/* Page structure: header, hero, journey (scenes + road + stations), finish, FAQ, footer. */

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

/* Header ------------------------------------------------------------------ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(7, 9, 10, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1240px, calc(100% - 96px));
  height: 100%;
  margin: 0 auto;
}

.brand {
  font: 700 14px/1.2 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav { display: flex; gap: 26px; margin-left: 12px; }
.main-nav a {
  white-space: nowrap;
  font: 600 12px/1 var(--font-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #cdd3d2;
  text-decoration: none;
  transition: color 0.2s;
}
.main-nav a:hover { color: var(--lime); }

.header-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}
.progress-label { font: 600 13px/1 var(--font-body); white-space: nowrap; }

.meter { display: flex; gap: 6px; }
.meter i {
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background: var(--idle);
  transition: background-color 0.4s, box-shadow 0.4s;
}
.meter i.done { background: var(--lime); box-shadow: 0 0 10px rgba(181, 245, 52, 0.5); }

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(7, 9, 10, 0.5);
  font: 600 10px/1 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #cdd3d2;
}
.motion-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(181, 245, 52, 0.7);
}
.motion-toggle[aria-pressed="false"] .motion-dot { background: #697373; box-shadow: none; }

.menu-button {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: transparent;
}
.menu-button span,
.menu-button span::before,
.menu-button span::after {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
  content: "";
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}
.menu-button span { top: 18px; }
.menu-button span::before { top: -5px; left: 0; }
.menu-button span::after { top: 5px; left: 0; }
.site-header.menu-open .menu-button span { background: transparent; }
.site-header.menu-open .menu-button span::before { transform: translateY(5px) rotate(45deg); }
.site-header.menu-open .menu-button span::after { transform: translateY(-5px) rotate(-45deg); }

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: var(--header-h);
}

.hero-media {
  position: absolute;
  inset: -4% 0;
  z-index: -2;
}
.hero-img,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 16%;
}
.hero-video { opacity: 0; transition: opacity 0.9s ease; }
.hero-video.is-playing { opacity: 1; }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 9, 10, 0.9) 0%, rgba(7, 9, 10, 0.58) 38%, rgba(7, 9, 10, 0.04) 74%),
    linear-gradient(180deg, rgba(7, 9, 10, 0.4) 0, transparent 28%, transparent 52%, var(--bg) 100%);
}

.hero-copy {
  position: relative;
  width: min(1240px, calc(100% - 96px));
  margin: 0 auto;
  padding: clamp(32px, 6vh, 64px) 0 150px;
}
.hero h1 {
  font: 800 clamp(38px, 5vw, 72px)/1 var(--font-body);
  letter-spacing: -0.025em;
}
.hero-line { color: var(--text); }
.hero-sub {
  margin-top: 14px;
  max-width: 52ch;
  font-size: clamp(16px, 1.5vw, 21px);
  color: #e4e9e5;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 26px;
  font: 600 12px/1 var(--font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; }
.legend-dot { width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; }
.legend-dot.is-done { background: var(--lime); box-shadow: 0 0 8px rgba(181, 245, 52, 0.6); }
.legend-dot.is-next { background: var(--cyan); box-shadow: 0 0 8px rgba(0, 221, 254, 0.6); }
.legend-dot.is-idle { background: var(--idle); }

/* Featured next-stage card (phone only) ---------------------------------- */
.featured { display: none; }

/* Journey ----------------------------------------------------------------- */
.journey {
  position: relative;
  z-index: 2;
  isolation: isolate;
  margin-top: -150px;
  overflow-x: clip;
}
.journey::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(rgba(7, 9, 10, 0.84), rgba(7, 9, 10, 0.92)),
    url("../assets/img/ground.webp") 0 0 / 300px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 260px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 260px);
}

.journey-inner {
  --card-w: 45%;
  --node: 64px;
  --node-offset: 46px;
  --gap: 130px;
  position: relative;
  width: min(1240px, calc(100% - 96px));
  margin: 0 auto;
  padding: 48px 0 190px;
}

/* Scene photos: full-bleed collage bands behind the road. */
.scenes {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 0;
  width: 100vw;
  margin-left: -50vw;
  overflow: hidden;
}
.scene {
  position: absolute;
  width: 72%;
  height: 440px;
  overflow: hidden;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
}
.scene--left { left: 0; clip-path: polygon(0 7%, 100% 0, 91% 100%, 0 93%); }
.scene--right { right: 0; clip-path: polygon(9% 0, 100% 7%, 100% 93%, 0 100%); }
.scene--bridge { top: 6%; }
.scene--visor { top: 28%; }
.scene--pitlane { top: 51%; }
.scene--garage { top: 73%; }
.scene-photo {
  position: absolute;
  inset: -8% 0;
  background-size: cover;
  background-position: center;
  background-color: #0b0f10;
}
.scene--bridge .scene-photo { background-image: url("../assets/img/scene-bridge.webp"); }
.scene--visor .scene-photo { background-image: url("../assets/img/scene-visor.webp"); background-position: 30% center; }
.scene--pitlane .scene-photo { background-image: url("../assets/img/scene-pitlane.webp"); }
.scene--garage .scene-photo { background-image: url("../assets/img/scene-garage.webp"); }

/* Road: the box reaches 180px above the journey so the lead-in can fade out inside the hero. */
.road {
  position: absolute;
  inset: -180px 0 0;
  z-index: 1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 110px, #000 175px);
  mask-image: linear-gradient(to bottom, transparent 0, transparent 110px, #000 175px);
}
.road-svg {
  position: absolute;
  top: 180px;
  left: 0;
  width: 100%;
  height: calc(100% - 180px);
  overflow: visible;
}
.road-static { will-change: transform; }

.road-shoulder { fill: none; stroke: rgba(0, 0, 0, 0.5); stroke-linejoin: round; }
.road-edge { fill: none; stroke: rgba(236, 240, 235, 0.6); stroke-linejoin: round; }
.road-asphalt { fill: none; stroke: url(#asphalt-pattern); stroke-linejoin: round; }
.road-center {
  fill: none;
  stroke: rgba(255, 255, 255, 0.26);
  stroke-width: 3;
  stroke-dasharray: 18 22;
}
.road-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.road-finish { fill: url(#checker-pattern); stroke: rgba(255, 255, 255, 0.55); stroke-width: 2; }
.road-dashes {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 3;
  stroke-dasharray: 0 99999;
}

/* Stations ---------------------------------------------------------------- */
.stations { position: relative; z-index: 2; }
.station { position: relative; }
.station + .station { margin-top: var(--gap); }

.station:nth-child(1) { --x: 0%; }
.station:nth-child(2) { --x: 24%; }
.station:nth-child(3) { --x: 0%; }
.station:nth-child(4) { --x: 19%; }
.station:nth-child(5) { --x: 7%; }

.station-card {
  position: relative;
  width: var(--card-w);
  margin-left: var(--x);
}

.station-node {
  position: absolute;
  top: 50%;
  left: calc(var(--x) + var(--card-w) + var(--node-offset));
  width: var(--node);
  height: var(--node);
  margin: calc(var(--node) / -2) 0 0 calc(var(--node) / -2);
}

/* Finish, FAQ, footer ------------------------------------------------------ */
.finish {
  position: relative;
  z-index: 2;
  padding: 24px 0 90px;
  background: var(--bg);
}
.finish-inner {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  text-align: center;
}
.finish h2 {
  font: 800 clamp(40px, 5.6vw, 76px)/1 var(--font-body);
  letter-spacing: -0.02em;
}
.finish h2 span { color: var(--lime); }
.finish p:not(.finish-status):not(.tagline) {
  max-width: 46ch;
  margin: 18px auto 28px;
  color: #bcc5c2;
  font-size: 17px;
}
.finish-status {
  margin-top: 22px;
  font: 600 11px/1.4 var(--font-label);
  letter-spacing: 0.16em;
  color: var(--lime);
}
.tagline {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(1240px, calc(100% - 96px));
  margin: 72px auto 0;
  font: 600 12px/1.2 var(--font-label);
  letter-spacing: 0.22em;
  color: #cdd3d2;
  text-align: left;
}
.tagline i { flex: none; width: 2px; height: 34px; background: var(--lime); }

.faq { padding: 20px 0 80px; background: var(--bg); position: relative; z-index: 2; }
.faq-inner { width: min(820px, calc(100% - 48px)); margin: 0 auto; }
.faq h2 { margin-bottom: 18px; font: 700 28px/1.2 var(--font-body); }
.faq details {
  margin-top: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass);
}
.faq summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { float: right; content: "+"; color: var(--lime); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 20px 18px; color: #bcc5c2; }

.site-footer {
  position: relative;
  z-index: 2;
  padding: 28px 0 110px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg);
  color: #728177;
  font-size: 12px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: min(1240px, calc(100% - 96px));
  margin: 0 auto;
}
.footer-reset {
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: transparent;
  font: 600 10px/1 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cdd3d2;
}
.footer-reset:hover { border-color: var(--lime); color: var(--lime); }

/* Header budget ----------------------------------------------------------- */
/* The full bar needs ~1090px of inner width (brand 236 + nav 309 + progress 286 + labelled toggle 161 + gaps),
   so the toggle goes icon-only up to 1200px and the nav collapses into a drawer up to 1100px. */
@media (max-width: 1200px) {
  .motion-toggle { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .motion-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (max-width: 1100px) {
  .header-inner { gap: 18px; }
  .brand { letter-spacing: 0.1em; }
  .menu-button { display: block; }
  .meter { gap: 5px; }
  .meter i { width: 22px; }

  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 6px 36px 14px;
    background: rgba(7, 9, 10, 0.995);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s 0.25s;
  }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 13px; }
  .site-header.menu-open .main-nav {
    transform: none;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
}

/* Tablet ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .header-inner,
  .hero-copy,
  .journey-inner,
  .tagline,
  .footer-inner { width: calc(100% - 72px); }
  .journey-inner {
    --card-w: clamp(380px, 52%, 520px);
    --node: 56px;
    --node-offset: 40px;
    --gap: 80px;
  }
  .station:nth-child(2) { --x: 15%; }
  .station:nth-child(4) { --x: 10%; }
  .station:nth-child(5) { --x: 4%; }
}

/* Phone ------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --header-h: 96px; }

  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "brand toggle menu" "progress progress progress";
    align-content: center;
    gap: 6px 10px;
    width: calc(100% - 40px);
  }
  .brand { grid-area: brand; font-size: 13px; }
  .motion-toggle { grid-area: toggle; padding: 0; width: 40px; height: 40px; justify-content: center; }
  .motion-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .menu-button { grid-area: menu; }
  .header-progress { grid-area: progress; margin: 0; gap: 12px; }
  .meter { flex: 1; gap: 5px; }
  .meter i { flex: 1; width: auto; }

  .main-nav { padding-left: 20px; padding-right: 20px; }

  .hero-img,
  .hero-video { object-position: 66% center; }
  .hero-copy { padding: 20px 0 74px; }
  .hero h1,
  .hero-sub,
  .legend {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .featured {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr;
    margin: -74px 20px 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: rgba(10, 14, 16, 0.88);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  }

  .journey { margin-top: -30px; }
  .journey-inner {
    --card-w: auto;
    --node: 44px;
    width: calc(100% - 40px);
    padding: 56px 0 150px;
    --gap: 28px;
  }
  .station-card { width: auto; margin-left: 64px; }
  .station:nth-child(n) { --x: 0px; }
  .station-node { top: 36px; left: 26px; }

  .scene { width: 100%; height: 320px; }

  .finish { padding-bottom: 60px; }
  .tagline { width: calc(100% - 40px); margin-top: 48px; }
  .footer-inner { flex-direction: column; align-items: flex-start; width: calc(100% - 40px); }
  .site-footer { padding-bottom: 120px; }
}

@media (max-width: 340px) {
  .brand { font-size: 11px; letter-spacing: 0.06em; }
  .header-inner { width: calc(100% - 28px); }
}
