:root {
  --bg: #030405;
  --ink: #eceef0;
  --muted: rgba(236, 238, 240, 0.58);
  --faint: rgba(236, 238, 240, 0.16);
  --line: rgba(236, 238, 240, 0.26);
  --accent: #c9d3df;
  --red: #d8222a;
  --gutter: 40px;
  --display: "Inter Tight", system-ui, -apple-system, Segoe UI, sans-serif;
  --wide: "Michroma", "Inter Tight", sans-serif;
  --ease: cubic-bezier(0.22, 0.7, 0.18, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;            /* clip, not hidden: hidden would make <body> a scroll container and break position: sticky */
  overscroll-behavior-y: none;
}
html { scroll-behavior: smooth; }
html.reduced { scroll-behavior: auto; }
body.loading, body.studio { overflow: hidden; }

/* The hero fills the first screen; it owns scroll gestures only while the page is at the top. */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.scrim {
  position: absolute;
  left: 0; bottom: 0;
  width: min(820px, 90vw);
  height: 70vh;
  background: radial-gradient(ellipse at 0% 100%, rgba(3, 4, 5, 0.78) 0%, rgba(3, 4, 5, 0.35) 40%, transparent 70%);
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--gutter);
  z-index: 30;
  transition: padding 0.5s var(--ease), background 0.5s, backdrop-filter 0.5s, border-color 0.5s;
  border-bottom: 1px solid transparent;
}
body.scrolled .nav {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: rgba(236, 238, 240, 0.07);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-logo { width: 40px; height: auto; display: block; filter: drop-shadow(0 0 14px rgba(216, 34, 42, 0.25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand-mark { font-weight: 600; font-size: 17px; letter-spacing: 0.2em; }
.brand-sub { font-size: 9px; font-weight: 500; letter-spacing: 0.42em; text-transform: uppercase; color: var(--muted); }
.links { display: flex; gap: 34px; }
.links a, .book {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.links a:hover, .book:hover { color: var(--ink); }
.controls { display: flex; align-items: center; gap: 10px; }
.ctl {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--faint); border-radius: 999px;
  background: rgba(10, 12, 14, 0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--muted);
  font: 500 11px/1 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.ctl:hover, .ctl[aria-pressed="true"] { color: var(--ink); border-color: var(--line); }
.ctl-label { opacity: 0.6; }
.sound { padding-left: 12px; }
.sound[aria-pressed="false"] { border-color: rgba(201, 211, 223, 0.45); color: var(--ink); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 2px; height: 3px; background: currentColor; border-radius: 1px; }
.sound[aria-pressed="true"] .bars i { animation: eq 1.1s var(--ease) infinite alternate; }
.sound[aria-pressed="true"] .bars i:nth-child(2) { animation-delay: -0.4s; }
.sound[aria-pressed="true"] .bars i:nth-child(3) { animation-delay: -0.8s; }
.sound[aria-pressed="true"] .bars i:nth-child(4) { animation-delay: -0.2s; }
@keyframes eq { from { height: 3px; } to { height: 12px; } }
.book {
  height: 34px; padding: 0 18px; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--ink); color: #08090a; font-weight: 500;
}
.book:hover { color: #08090a; background: #fff; }
.book-short { display: none; }
/* Only shown once the full menu is hidden, so phones still get a Map tab up top. */
.nav-map { display: none; text-decoration: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cta-row .btn { margin-top: 0; }

/* ---------- Copy panels ---------- */
.panel {
  position: absolute;
  left: var(--gutter);
  bottom: 72px;
  max-width: 500px;
  z-index: 4;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.panel[data-stage="0"] { max-width: 660px; }
.panel[data-stage="5"] { bottom: 40px; } /* sits low so the headlight stays visible */
.panel.show { opacity: 1; transform: none; pointer-events: auto; transition-delay: 0.08s; }
.eyebrow {
  font-family: var(--wide); font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--red); }
h1 {
  font-weight: 300; font-size: clamp(40px, 5vw, 72px); line-height: 1.0; letter-spacing: -0.025em;
  margin-bottom: 20px;
}
h2 {
  font-weight: 300; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.08; letter-spacing: -0.02em;
  margin-bottom: 14px; max-width: 440px;
}
.lede { font-size: 15px; line-height: 1.55; color: var(--muted); max-width: 400px; }
.panel .lede.long { max-width: 460px; font-size: 14px; }
.btn {
  margin-top: 28px;
  display: inline-flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(12, 14, 16, 0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); text-decoration: none;
  font: 500 12px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer;
  transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.btn:hover { background: var(--ink); color: #08090a; border-color: var(--ink); }
.btn.solid { background: var(--ink); color: #08090a; }
.btn.solid:hover { background: #fff; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* ---------- Progress ---------- */
/* A horizontal row of stop markers along the bottom, centred; the current stop's number sits above its bar. */
.progress {
  position: absolute;
  left: 50%; bottom: 30px;
  transform: translateX(-50%);
  list-style: none;
  display: flex; flex-direction: row; gap: 8px;
  z-index: 4;
}
.progress li { display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; }
.progress .num {
  font-family: var(--wide); font-size: 8px; letter-spacing: 0.2em; color: var(--muted);
  opacity: 0; transition: opacity 0.4s;
}
.progress li.current .num { opacity: 1; }
.progress .track { position: relative; width: 34px; height: 2px; background: var(--faint); overflow: hidden; border-radius: 2px; }
.progress .fill {
  position: absolute; inset: 0; background: var(--red);
  transform: scaleX(0); transform-origin: left;
}

/* ---------- Hint / toast ---------- */
.hint {
  position: absolute; left: 50%; bottom: 68px; transform: translateX(-50%);   /* above the stop markers */
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
  z-index: 3; transition: opacity 0.6s;
}
.hint i { width: 1px; height: 34px; background: linear-gradient(var(--muted), transparent); animation: drip 2.2s var(--ease) infinite; transform-origin: top; }
.hint.gone { opacity: 0; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.toast {
  position: absolute; right: var(--gutter); bottom: 28px; max-width: 340px;
  padding: 12px 16px; border-radius: 10px;
  background: rgba(12, 14, 16, 0.7); border: 1px solid var(--faint);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12px; line-height: 1.5; color: var(--muted); z-index: 6;
}
.toast code { color: var(--ink); font-size: 11px; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity 1.1s var(--ease), visibility 1.1s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.loader-logo { width: min(200px, 46vw); height: auto; animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.72; } }
.loader-bar { width: 180px; height: 1px; background: var(--faint); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease); }
.loader-pct { font-family: var(--wide); font-size: 9px; letter-spacing: 0.3em; color: var(--muted); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Responsive ---------- */
.links a, .book, .ctl { white-space: nowrap; }

/* Free-orbit stop */
body.orbit-ready #scene { cursor: grab; }
body.orbiting, body.orbiting * { cursor: grabbing !important; }
.orbit-hint {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  transition: opacity 0.6s;
}
.orbit-hint svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
body.orbit-used .orbit-hint { opacity: 0.35; }
@media (hover: none) { .orbit-hint::after { content: " — swipe sideways"; } }
/* Laptop widths: tighten the menu so every link and the Book button fit. */
@media (max-width: 1600px) {
  .links { gap: 22px; }
  .ctl-label { display: none; }
  .book-short { display: inline; }
  .book-long { display: none; }
}
@media (max-width: 1360px) {
  .links { gap: 16px; }
  .links a { font-size: 11px; letter-spacing: 0.12em; }
}
@media (max-width: 1240px) {
  .links { gap: 11px; }
  .links a { letter-spacing: 0.08em; }
}
@media (max-width: 1160px) { .links { display: none; } .nav-map { display: inline-flex; } }
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .nav { padding: 16px var(--gutter); }
  .ctl-label { display: none; }
  .book-short { display: inline; }
  .book-long { display: none; }
  .cta-row { margin-top: 22px; }
  .brand-logo { width: 32px; }
  .brand-mark { font-size: 14px; }
  .brand-sub { font-size: 8px; letter-spacing: 0.32em; }
  .controls { gap: 6px; }
  .ctl { padding: 0 11px; }
  .book { padding: 0 14px; }
  .panel { right: var(--gutter); bottom: 84px; }
  .panel[data-stage="5"] { bottom: 62px; }
  .panel[data-stage="5"] h2 { margin-bottom: 10px; }
  .lede { font-size: 14px; }
  .btn { margin-top: 22px; }
  .progress {
    top: auto; bottom: 34px; right: auto; left: 50%;
    transform: translateX(-50%); flex-direction: row; gap: 6px;
  }
  .progress .num { display: none; }
  .progress .track { width: 22px; height: 2px; }
  .progress .fill { transform: scaleX(0); transform-origin: left; }
  .hint { display: none; }
  .toast { left: var(--gutter); right: var(--gutter); bottom: auto; top: 64px; }
  .scrim { width: 100vw; height: 75vh; background: linear-gradient(to top, rgba(3,4,5,0.85), rgba(3,4,5,0.4) 45%, transparent 75%); }
}
/* Phones: make room for Map and Book. Sound keeps its bars; its label stays for screen readers. */
@media (max-width: 520px) {
  .sound .ctl-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (max-width: 430px) { #motionToggle { display: none; } }
@media (max-width: 360px) { .nav { gap: 8px; } .ctl { padding: 0 9px; } .book { padding: 0 11px; } }
