:root {
  --bg: #0e1b2a;
  --ink: #eaf1f7;
  --muted: #8ba0b4;
  --accent: #2f7ff0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: radial-gradient(1200px 700px at 50% -10%, #1b3450 0%, var(--bg) 60%);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: rgba(10, 18, 28, 0.6);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 5;
}

.bar-left { display: flex; gap: 0.5rem; }
.bar-title { font-weight: 600; letter-spacing: 0.01em; }
.muted { color: var(--muted); font-size: 0.85rem; }

.chip {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.chip:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.chip:disabled { opacity: 0.35; cursor: default; }

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

/* iPhone frame: a fixed 393x852 logical canvas, scaled to fit by JS. */
.phone-scale { transform-origin: center center; }

.phone {
  width: 393px;
  height: 852px;
  background: linear-gradient(160deg, #3a3d42, #17181b 40%);
  border-radius: 55px;
  padding: 10px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(255, 255, 255, 0.10),
    inset 0 0 0 2px #000;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 45px;
  overflow: hidden;
  background: #fff;
}

/* Dynamic Island */
.island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 122px;
  height: 35px;
  border-radius: 999px;
  background: #000;
  z-index: 3;
  pointer-events: none;
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 5px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.9);
  z-index: 3;
  pointer-events: none;
}
.bar-right { display: flex; align-items: center; gap: 0.75rem; }
a.chip { text-decoration: none; display: inline-block; }

.layer { position: absolute; inset: 0; transition: opacity 0.26s ease; }
.layer.fading { opacity: 0; }
#layer-top { pointer-events: none; }
#layer-top > * { pointer-events: auto; }

/* attention pulse on navigable controls when viewer clicks dead space */
[data-goto].pulse {
  animation: pulse 0.9s ease;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 3px rgba(47, 127, 240, 0.85); }
  70% { box-shadow: 0 0 0 10px rgba(47, 127, 240, 0); }
  100% { box-shadow: 0 0 0 3px rgba(47, 127, 240, 0); }
}
