/* ════════════════════════════════════════════════════════════════
   Paddock Pixel — coming-soon site
   Brand: Carbon charcoal / cyan #46d0e2 / PG511 pink #ff1493
   Fonts: Archivo (display, wdth axis) · Hanken Grotesk (UI) ·
          JetBrains Mono (telemetry / numerics) — same files as app
   ════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/Archivo-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('fonts/HankenGrotesk-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/JetBrainsMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Carbon palette — mirrors the app's frontend/src/theme.ts
     (see DESIGN-PARITY.md / tokens.css --pp-*). */
  --bg0:      #08090c;                  /* deepest recess: scrollbar track, lap gradient */
  --bg:       #0c0e12;                  /* app `bg` — page background */
  --surface:  #0f1218;                  /* app `surface` — panels, inputs, cards */
  --border:   rgba(255,255,255,.11);    /* app `border2` — visible edges */
  --border-soft: rgba(255,255,255,.07); /* app `border` — hairline dividers */
  --text:     #e9edf2;                  /* app `text` */
  --subtext:  #99a2b1;                  /* app `subtext` */
  --accent:   #46d0e2;                  /* app `accent` */
  --accent-bright: #5fdcec;             /* app `accentHov` */
  --brand:    #ff1493;                  /* PG511 pink — unchanged */

  --font-display: 'Archivo', 'Hanken Grotesk', system-ui, sans-serif;
  --font-ui:      'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  --ease-kinetic: cubic-bezier(0.23, 1, 0.32, 1);
  --pad-x: clamp(20px, 5vw, 56px);
  --content-max: 1320px;   /* capped sections are centered at this width */
}

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

/* overflow-x: clip on the root kills the horizontal scroll that the
   decorative bleeds (ghost track, glows) would otherwise create — it
   clips WITHOUT making a scroll container, so the sticky lap section
   still works (unlike overflow:hidden, which forces overflow-y:auto). */
html { color-scheme: dark; scroll-behavior: smooth; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: rgba(75, 210, 228, 0.35); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.11);
  border-radius: 5px;
  border: 2px solid var(--bg0);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── HUD ─────────────────────────────────────────────────────── */

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px var(--pad-x);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--subtext);
  animation: hud-in 600ms var(--ease-kinetic) both;
}
@keyframes hud-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 118%;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.px {
  /* separator dot, vertically centred on the caps; nudged left to offset the
     optical whitespace the K's open leg leaves on its right */
  width: 0.62cap; height: 0.62cap;
  background: var(--brand);
  display: inline-block;
  flex: none;
  align-self: center;
  transform: translate(-1px, -0.04em);
}
.wordmark .by {
  font-family: var(--font-ui);
  font-weight: 500;
  font-stretch: normal;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--subtext);
  margin: 0 6px 0 8px;
}
/* PG511 brand mark — black-art logo recoloured to brand magenta via mask */
.pg-logo {
  display: inline-block;
  height: 1.05em;
  aspect-ratio: 2.043;
  vertical-align: -0.16em;
  background: var(--brand);
  -webkit-mask: url(media/pg511.png) center / contain no-repeat;
  mask: url(media/pg511.png) center / contain no-repeat;
  flex: none;
}
.wordmark .pg-logo { height: 32px; vertical-align: middle; }
.foot-right .pg-logo { height: 32px; vertical-align: middle; }

.hud-live {
  display: inline-flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
  white-space: nowrap;
}
.rec { color: var(--brand); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.rec-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand);
  animation: rec-pulse 1.3s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
.session b {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.phase { color: var(--accent); }

@media (max-width: 640px) {
  .phase { display: none; }
}

/* ── HERO ────────────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 72px);
  align-items: start;
  padding: clamp(56px, 11vh, 130px) var(--pad-x) 0;
  max-width: var(--content-max);
  margin-inline: auto;
}

/* ghosted real-track outline, bleeding off the VIEWPORT's right
   edge — the calc undoes the hero's centering margin so the void
   right of the content column gets texture on wide screens (path
   baked in by main.js; z-index -1 keeps it behind content but
   above the page background) */
.hero-track {
  position: absolute;
  z-index: -1;
  top: -24px;
  right: calc((min(100vw, var(--content-max)) - 100vw) / 2 - 48px);
  width: min(60vw, 1000px);
  height: auto;
  transform: rotate(-6deg);
  pointer-events: none;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: clamp(18px, 3vh, 30px);
}

h1 {
  font-family: var(--font-display);
  font-weight: 840;
  font-stretch: 121%;
  font-size: clamp(2.35rem, 6.4vw, 4.9rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 15ch;
  color: #e9edf2;
}
h1 .line { display: block; }
h1 em {
  font-style: normal;
  color: var(--brand);   /* PG511 pink — ties the headline to the logo */
  position: relative;
}

.sub {
  margin-top: clamp(20px, 3.5vh, 32px);
  font-size: clamp(15px, 1.6vw, 17.5px);
  color: var(--subtext);
  max-width: 54ch;
}

/* ── HERO VISUAL: the desktop app, playing a vertical render ───
   A mini replica of the editor window. App-exact chrome values:
   title bar #13161c (--pp-bar), viewport #050608 (--pp-video),
   dock #0f1218 (surface) — see tokens.css / DESIGN-PARITY.md.    */

.hero-visual {
  position: relative;
  width: clamp(360px, 34vw, 500px);
  margin-top: 6px;
}

.appwin { position: relative; }

/* ambient glow — the render lights the room */
.appwin::before {
  content: '';
  position: absolute;
  inset: -48px;
  z-index: -1;
  background:
    radial-gradient(42% 34% at 28% 18%, rgba(75, 210, 228, 0.13), transparent 70%),
    radial-gradient(40% 32% at 76% 82%, rgba(255, 20, 147, 0.10), transparent 70%);
  pointer-events: none;
}

.aw-frame {
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Windows-style title bar: app icon + document title on the left,
   min / max / close controls on the right (the app is Windows-first;
   the Mac build lands later) */
.aw-bar {
  display: flex;
  align-items: center;
  height: 32px;
  padding-left: 10px;
  background: #13161c;
  border-bottom: 1px solid var(--border-soft);
}
.aw-app { display: inline-flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.aw-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--subtext);
}
.aw-winctl { flex: none; display: inline-flex; align-self: stretch; }
.wc {
  width: 30px; align-self: stretch;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.wc-close { position: relative; }
.wc-min::before  { content: ''; width: 9px; height: 1px; background: #b9bfc7; }
.wc-max::before  { content: ''; width: 8px; height: 8px; border: 1px solid #b9bfc7; border-radius: 1px; }
.wc-close::before, .wc-close::after {
  content: ''; position: absolute; width: 11px; height: 1px; background: #b9bfc7;
}
.wc-close::before { transform: rotate(45deg); }
.wc-close::after  { transform: rotate(-45deg); }
.wc-close { background: rgba(232, 17, 35, 0.16); }   /* the app's close, tinted */

/* app toolbar — the real control strip: Import · Play · sync · Render…
   (Render is the app's accent action button; it lives HERE, not up in
   the title bar) */
.aw-toolbar {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 8px;
  background: #0f1218;
  border-bottom: 1px solid var(--border-soft);
}
.awb {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 5px;
  background: #171b22; border: 1px solid rgba(255, 255, 255, 0.09);
  font-family: var(--font-ui); font-size: 10.5px; font-weight: 500;
  color: var(--text); white-space: nowrap;
}
.awb-sp { flex: 1 1 auto; }
.awb.ok { color: #5fd08a; border-color: rgba(95, 208, 138, 0.32); }
.awb.go {                        /* Render… — accent, like the app */
  background: var(--accent); color: #04161a;
  border-color: transparent; font-weight: 700;
}
.awb-ic.play {
  width: 0; height: 0;
  border-style: solid; border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent var(--accent);
}

/* the 9:16 render sits letterboxed in the viewport, like the app */
.aw-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 11;
  background: #050608;
}
.aw-viewport video {
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
}

/* mini dock: lap rows + the real speed trace (filled by main.js) */
.aw-dock {
  display: flex;
  align-items: stretch;
  height: 64px;
  background: #0f1218;
  border-top: 1px solid var(--border-soft);
}
.aw-laps {
  flex: none;
  width: 128px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 9px;
}
.aw-lap {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border-radius: 4px;
}
.aw-lap.active {
  background: rgba(75, 210, 228, 0.16);
  box-shadow: inset 0 0 0 1px rgba(75, 210, 228, 0.3);
}
.aw-swatch {
  flex: none;
  width: 14px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.aw-swatch.blank { background: transparent; border-color: transparent; }
.aw-lapno { font-weight: 600; }
.aw-time {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.aw-fast {
  color: #5fd08a;
  font-family: var(--font-mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.aw-tl {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: #0c0e12;
  border-left: 1px solid var(--border-soft);
  overflow: hidden;
}
.aw-tl canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.aw-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: #fff;
  opacity: 0.9;
  will-change: transform;
}

.aw-tag {
  position: absolute;
  top: 10px;
  right: -26px;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: #5b6472;
}

/* ── SESSION CARD (decorative, hangs off the app window's
      bottom-right corner on desktop) ─────────────────────────── */

.session-card {
  position: absolute;
  bottom: -150px;   /* clears the app toolbar; peeks over the dock corner */
  right: -44px;
  width: clamp(230px, 20vw, 264px);
  background: rgba(15, 18, 24, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 14px 16px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  user-select: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.session-card header {
  color: var(--subtext);
  font-size: 10px;
  letter-spacing: 0.16em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}
.session-card dl div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
}
.session-card dl div + div { border-top: 1px dotted rgba(255, 255, 255, 0.09); }
.session-card dt { color: #5b6472; font-size: 10px; letter-spacing: 0.14em; }
.session-card dd { color: #79828f; font-variant-numeric: tabular-nums; }
.session-card dd.best  { color: var(--text); }
.session-card dd.delta { color: var(--accent); }
.session-card dd.rendering {
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.caret {
  width: 6px; height: 11px;
  background: var(--brand);
  animation: caret-blink 1.1s steps(2, start) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* the card pokes past the hero's right edge, which only has
   guaranteed room once the hero hits its max-width cap */
@media (max-width: 1199px) {
  .session-card { display: none; }
}
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { margin: clamp(36px, 6vh, 56px) auto 0; width: min(460px, 92vw); }
  .hero-track { width: 74vw; top: 0; }
}

/* ── FORM ────────────────────────────────────────────────────── */

.grid-form {
  margin-top: clamp(26px, 4.5vh, 44px);
  display: flex;
  flex-wrap: wrap;          /* so the Turnstile widget drops below the row */
  gap: 10px;
  max-width: 520px;
}

.grid-form input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.grid-form input[type="email"]::placeholder { color: #5b6472; }
.grid-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(75, 210, 228, 0.16);
}

.grid-form button {
  flex: none;
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #04161a;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 150ms ease, transform 160ms var(--ease-kinetic), box-shadow 160ms ease;
}
.grid-form button:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(75, 210, 228, 0.22);
}
.grid-form button:active { transform: scale(0.97); box-shadow: none; }
.grid-form button:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
  background: var(--accent);
}

/* Turnstile: own row, full width. The min-height reserves the widget's space
   so the fine print doesn't jump when it finishes loading. */
.grid-form .cf-turnstile {
  flex: 1 0 100%;
  min-height: 65px;
}

.fine {
  margin-top: 12px;
  font-size: 12px;
  color: var(--subtext);
}

/* success state (injected by main.js) */
.grid-success {
  margin-top: clamp(26px, 4.5vh, 44px);
  max-width: 520px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  animation: success-in 400ms var(--ease-kinetic) both;
}
@keyframes success-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.grid-success b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.grid-success span { color: var(--subtext); font-size: 13.5px; }

.grid-form input.shake { animation: shake 300ms ease; border-color: var(--brand); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ── START LIGHTS (launch choreography) ──────────────────────────
   index.html's head script adds html.pre-launch, which holds every
   entry animation at frame 0. main.js builds the gantry, runs the
   sequence, then drops the class — lights out, page launches.      */

html.pre-launch .hud,
html.pre-launch .reveal,
html.pre-launch .flicker { animation-play-state: paused; }

.lights {
  position: fixed;
  top: clamp(96px, 22vh, 220px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 60;
  pointer-events: none;
}
.lt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 34px;
  padding: 9px 0;
  background: #0b0d11;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.lt i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #1a1216;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.lt.on i {
  background: var(--brand);
  box-shadow:
    0 0 3px rgba(255, 20, 147, 0.8),
    0 0 16px rgba(255, 20, 147, 0.55);
}
.lights.out {
  opacity: 0;
  transform: translate(-50%, -16px);
  transition: opacity 700ms var(--ease-kinetic), transform 700ms var(--ease-kinetic);
}
.lights.out .lt i {           /* lamps snap dark the instant it's GO */
  background: #1a1216;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ── ENTRY ORCHESTRATION ─────────────────────────────────────── */

.reveal {
  animation: rise 700ms var(--ease-kinetic) both;
}
.r0 { animation-delay: 120ms; }
.r1 { animation-delay: 220ms; }
.r2 { animation-delay: 330ms; }
.r3 { animation-delay: 470ms; }
.r4 { animation-delay: 590ms; }
.r5 { animation-delay: 680ms; }
.r6 { animation-delay: 800ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* one-time render-in flicker on the word "subtitles" */
.flicker { animation: flick 480ms steps(1) 1s both; }
@keyframes flick {
  0%   { opacity: 0; }
  18%  { opacity: 1; }
  32%  { opacity: 0.25; }
  46%  { opacity: 1; }
  62%  { opacity: 0.5; }
  100% { opacity: 1; }
}

/* below-the-fold sections fade in on scroll */
.io-reveal { opacity: 0; transform: translateY(18px); }
.io-reveal.in {
  opacity: 1; transform: translateY(0);
  transition: opacity 650ms var(--ease-kinetic), transform 650ms var(--ease-kinetic);
}

/* ── DRIVE THE LAP (scroll-scrubbed, pinned) ─────────────────────
   The tall section provides scroll runway; the inner wrapper sticks
   for one viewport while scroll position drives lap progress.      */

.lap-section {
  /* extra runway so the segment-marker choreography (A drop → zoom →
     B drop → zoom out) has room to breathe mid-lap */
  height: 320vh;
  margin-top: clamp(48px, 9vh, 100px);
}

.lap-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg0) 14%, var(--bg0) 86%, var(--bg) 100%);
}

.lap-grid {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 96px);
  padding: 8px var(--pad-x);
}

/* ── stage dressing ──────────────────────────────────────────────
   The air around the map + readout, kept instrument-grade: a faint
   engineering grid (plot dots every third intersection) that fades
   away UNDER the content so the data stays the star, viewfinder
   corner brackets (this is a video product, after all), and a
   geo-ref caption. All static, all whisper-quiet. */
.lap-grid::before {   /* engineering grid, masked out of the middle */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;   /* above the sticky gradient, below all content */
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(233, 237, 242, 0.09) 1px, transparent 1.5px),
    linear-gradient(rgba(233, 237, 242, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 237, 242, 0.045) 1px, transparent 1px);
  background-size: 156px 156px, 52px 52px, 52px 52px;
  /* -26px lands the dot tile's centre on a gridline intersection */
  background-position: -26px -26px, 0 0, 0 0;
  -webkit-mask-image: radial-gradient(115% 100% at 50% 46%, transparent 28%, #000 72%);
  mask-image: radial-gradient(115% 100% at 50% 46%, transparent 28%, #000 72%);
}
.lap-grid::after {   /* viewfinder corner brackets */
  content: '';
  position: absolute;
  inset: 18px 22px;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff),
    linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size:
    20px 1px, 1px 20px,   /* top left */
    20px 1px, 1px 20px,   /* top right */
    20px 1px, 1px 20px,   /* bottom left */
    20px 1px, 1px 20px;   /* bottom right */
  background-position:
    0 0, 0 0,
    100% 0, 100% 0,
    0 100%, 0 100%,
    100% 100%, 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.1;
}
.lap-georef {
  position: absolute;
  left: 30px;
  bottom: 26px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(153, 162, 177, 0.55);
  pointer-events: none;
}

.lap-map {
  position: relative;
  height: 100%;
  max-height: min(52vh, 470px);
  aspect-ratio: 1.31;   /* real Gingerman bounds: 100 x 76.4 */
  min-height: 0;
}
.lap-map svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* apex quip — a motorsport jab that fades in as the dot drives through
   each corner (JS sets left/top + opacity; anchored via translate) */
.lap-quip {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: min(230px, 64%);
  padding: 9px 13px;
  border-radius: 9px;
  background: rgba(8, 9, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  color: #eef1f5;
  font-family: var(--font-ui);
  font-style: italic;
  font-size: clamp(11px, 1.45vw, 14px);
  line-height: 1.34;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
}
.lap-quip::before {   /* an opening quote mark, in accent */
  content: "\201C";
  color: var(--accent);
  font-style: normal;
  margin-right: 1px;
}
.lap-quip::after { content: "\201D"; color: var(--accent); font-style: normal; }

/* segment delta pill — the app's map callout for the A→B measurement
   (App.tsx map segment highlight: black 0.75 pill, bold 12px
   system-ui, green/red by time gained/lost; border recoloured to the
   site accent — the app's is orange). JS sets left/top + colour +
   opacity; anchored via translate like the quip. */
.seg-pill {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  padding: 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(70, 208, 226, 0.5);
  font: 700 12px system-ui, sans-serif;
  line-height: 16px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.lap-readout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--font-mono);
}
.lr-speed { display: flex; align-items: baseline; gap: 10px; }
.lr-speed b {
  font-family: var(--font-display);
  font-weight: 840;
  font-stretch: 121%;
  font-size: clamp(56px, 11vh, 96px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: #e9edf2;
  font-variant-numeric: tabular-nums;
  min-width: 2.1ch;
}
.lr-speed span { font-size: 11px; letter-spacing: 0.18em; color: var(--subtext); }
#lapState {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-soft);
  min-width: 5ch;
  text-align: center;
}
#lapState.thr  { color: var(--accent-bright); border-color: rgba(75, 210, 228, 0.35); }
#lapState.brk  { color: var(--brand); border-color: rgba(255, 20, 147, 0.35); }
#lapState.hold { color: var(--subtext); }
.lr-rows { width: 100%; min-width: 190px; font-size: 12px; letter-spacing: 0.06em; }
.lr-rows div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 7px 0;
}
.lr-rows div + div { border-top: 1px dotted rgba(255, 255, 255, 0.09); }
.lr-rows dt { color: #5b6472; font-size: 10px; letter-spacing: 0.14em; }
.lr-rows dd { color: var(--text); font-variant-numeric: tabular-nums; }
#lapDelta.ahead  { color: #3ddc7e; }   /* ghost gaining on the fastest lap */
#lapDelta.behind { color: #ff5f5f; }   /* ghost behind the fastest lap */
#lapElev .clm { font-size: 10px; margin-left: 6px; font-style: normal; }
#lapElev .clm.up   { color: #3ddc7e; }   /* climbing */
#lapElev .clm.down { color: #ff5f5f; }   /* descending */

.trace-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--pad-x) 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--subtext);
}
.tm-left { display: inline-flex; align-items: center; gap: 10px; }
.chip {
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}
.chip-lap   { color: #04161a; background: var(--accent); }
.tm-hint { color: var(--accent); opacity: 0.85; transition: opacity 400ms ease; }
.tm-hint.off { opacity: 0; }

/* ── TIMELINE PANEL — replica of the app's timeline UI ─────────
   Colors/paddings mirror the app (frontend/src/App.tsx
   TimelineGraph + theme.ts): #0c0e12 plot, #46d0e2 trace,
   #0f1218 controls bar, ghost pill buttons.                      */

.tl-panel {
  flex: none;
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
/* min-height (not height) so the row stretches it to match the
   lap panel — whichever is taller sets the height of both */
.tl-graph {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: clamp(150px, 24vh, 260px);
  background: #0c0e12;
  cursor: crosshair;
  touch-action: pan-y;
}
/* absolute: the canvas backing store must not feed back into row height */
.tl-graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── LAP DATA PANEL — replica of the app's lap list ──────────── */

.lp-resizer { flex: none; width: 8px; background: #0c0e12; cursor: col-resize; }

.lap-panel {
  flex: none;
  width: clamp(180px, 16vw, 236px);
  display: flex;
  flex-direction: column;
  background: #0f1218;
  font-family: var(--font-ui);
  min-height: 0;
}
.lp-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
}
.lp-list::-webkit-scrollbar { width: 6px; }
.lp-list::-webkit-scrollbar-track { background: #0c0e12; }
.lp-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.11); border-radius: 3px; border: none; }
.lp-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

.lp-session {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  cursor: pointer;
}
.lp-session:hover { background: rgba(255, 255, 255, 0.06); }
.lp-session .lp-disc { color: #99a2b1; font-size: 10px; width: 10px; flex: none; }
.lp-session .lp-file {
  flex: 1 1 auto;
  color: #e9edf2;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.lp-session .lp-primary { color: #46d0e2; font-size: 11px; font-weight: 600; flex: none; }
.lp-session .lp-del {
  flex: none;
  background: rgba(255, 255, 255, 0.06);
  color: #99a2b1;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  padding: 1px 4px;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}
.lp-session .lp-del:hover { color: #e5604f; border-color: #e5604f; }

.lap-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 22px;
  font-size: 11px;
  border-radius: 8px;
  opacity: 0;
}
.lp-in .lap-row { animation: lapRowIn 250ms cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes lapRowIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lap-row.lp-active {
  background: rgba(75, 210, 228, 0.16);
  box-shadow: inset 0 0 0 1px rgba(75, 210, 228, 0.3);
}
.lp-swatch {
  flex: none;
  width: 26px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.lp-swatch.blank { background: transparent; border-color: transparent; }
.lp-ref {
  flex: none;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 4px;
  border-radius: 4px;
  background: transparent;
  color: #5b6472;
  border: 1px solid rgba(255, 255, 255, 0.11);
}
.lp-ref.set { background: #46d0e2; color: #04161a; border-color: #46d0e2; }
.lp-cbox {
  flex: none;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  border: 1.5px solid rgba(255, 255, 255, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lp-cbox.checked { border-color: #46d0e2; }
.lp-cbox svg { width: 9px; height: 9px; display: block; }
.lp-lap { font-weight: 600; }
.lp-spacer { flex: 1 1 auto; }
.lp-time { color: #e9edf2; font-family: var(--font-mono); font-size: 12px; }
.lp-fast {
  color: #5fd08a;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

@media (max-width: 780px) {
  .lap-panel, .lp-resizer { display: none; }
}

/* ── BELOW: pitch + channel checklist ────────────────────────── */

.below {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(56px, 10vh, 110px) var(--pad-x);
  max-width: var(--content-max);
  margin-inline: auto;
}

.pitch h2 {
  font-family: var(--font-display);
  font-weight: 780;
  font-stretch: 114%;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  max-width: 20ch;
}
.pitch p {
  margin-top: 16px;
  color: var(--subtext);
  max-width: 46ch;
}
.pitch-tease { font-size: 13.5px; }
.pitch-tease::before {
  content: '»';
  color: var(--brand);
  margin-right: 8px;
}

.channels h3 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--subtext);
  margin-bottom: 14px;
}

.ch-list {
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  border-top: 1px solid var(--border-soft);
}
.ch-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 150ms ease;
}
.ch-list li:hover { background: rgba(255, 255, 255, 0.02); }
.ch-no { color: #5b6472; font-size: 11px; }
.ch-name { color: var(--text); letter-spacing: 0.06em; }
.ch-name.classified { color: #4a5260; cursor: help; }
.ch-rule {
  flex: 1 1 auto;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
}
.ch-status { font-size: 10px; letter-spacing: 0.14em; }
.ch-status.torqued { color: var(--accent); }
.ch-status.torqued::before { content: '✓ '; }
.ch-status.locked { color: var(--brand); opacity: 0.75; }
.ch-status.locked::before { content: '▒ '; }

/* ── FOOTER ──────────────────────────────────────────────────── */

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px var(--pad-x) 28px;
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--subtext);
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */

@media (max-width: 780px) {
  .below { grid-template-columns: 1fr; }
  .grid-form { flex-direction: column; }
  .grid-form button { width: 100%; }
  h1 { max-width: none; }
  .lap-grid { gap: 16px; }
  .lap-map { height: auto; max-height: none; width: min(56vw, 300px); aspect-ratio: 1.15; }
  .lr-speed b { font-size: clamp(40px, 12vw, 64px); }
  .lr-rows { min-width: 0; }
}

/* ── 404 (public/404.html) ───────────────────────────────────────
   Served by Cloudflare Pages for any unmatched path. Deliberately
   static: no JS, so nothing here depends on main.js running (which
   is also why it avoids .reveal — those start hidden and are only
   un-hidden by the entry choreography). */

.nf-body { min-height: 100vh; display: flex; flex-direction: column; }

/* the wordmark is a <span> on the homepage but a link back here */
.nf-body .wordmark { text-decoration: none; color: inherit; }

.nf {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(40px, 10vh, 96px) var(--pad-x);
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

.nf-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.nf-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 118px);
  font-weight: 800;
  font-stretch: 108%;
  line-height: 0.94;
  letter-spacing: -0.02em;
}
/* the one highlighted word in an .nf-title (404 + confirmed) */
.nf-hl { color: var(--brand); }

.nf-copy {
  max-width: 46ch;
  color: var(--subtext);
  font-size: clamp(15px, 1.4vw, 17px);
}

.nf-back {
  margin-top: 10px;
  display: inline-block;
  padding: 13px 24px;
  border-radius: 8px;
  background: var(--accent);
  color: #04161a;
  font-weight: 650;
  text-decoration: none;
  transition: background 160ms var(--ease-kinetic),
              transform 160ms var(--ease-kinetic),
              box-shadow 160ms var(--ease-kinetic);
}
.nf-back:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(75, 210, 228, 0.22);
}
.nf-back:active { transform: scale(0.97); box-shadow: none; }

/* ── REDUCED MOTION ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .hud, .flicker { animation: none; }
  .nf-back:hover { transform: none; }
  .aw-playhead { display: none; }   /* reel is paused — no playback to track */
  .io-reveal { opacity: 1; transform: none; transition: none; }
  .rec-dot { animation: none; }
  .caret { animation: none; }
  .grid-form button:hover { transform: none; }
  .lap-row, .lp-in .lap-row { animation: none; opacity: 1; }
}
