/* LANDFALL — mission control in black and white, with liquid-glass panels and buttons.
   Colour is used only for the physics zones (trained / beyond training / impossible).
   html[data-fx="lite"] (phones, slower computers) swaps the real blur for tinted glass;
   html.reduce-motion turns off shake, drifting stars and other decorative motion. */

@font-face { font-family: "D-DIN"; src: url("fonts/D-DIN.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "D-DIN"; src: url("fonts/D-DIN-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "D-DIN Exp"; src: url("fonts/D-DINExp.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "D-DIN Exp"; src: url("fonts/D-DINExp-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --black: #000000;
  --white: #ffffff;
  --grey: #a3a3a3;          /* secondary text, 8.4:1 on black */
  --dim: #6b6b6b;           /* tertiary text and inactive marks */
  --line: rgba(255, 255, 255, 0.2);
  --line-strong: rgba(255, 255, 255, 0.5);
  --go: #29c7ac;            /* trained range */
  --caution: #f5b83d;       /* beyond training */
  --nogo: #ff5f57;          /* physically impossible */
  --wide: "D-DIN Exp", "D-DIN", "Helvetica Neue", Arial, sans-serif;
  --text: "D-DIN", "Helvetica Neue", Arial, sans-serif;
  --console-w: 360px;
  --console-gap: 20px;
  --console-space: calc(var(--console-w) + 2 * var(--console-gap));
  --gutter: clamp(16px, 4vw, 56px);
  --glass-fill: rgba(255, 255, 255, 0.05);
  --glass-blur: 22px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-fx="lite"] { --glass-fill: rgba(18, 18, 22, 0.8); }

* { box-sizing: border-box; }
html { background: var(--black); color: var(--white); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--black); font-family: var(--text); font-size: 17px; line-height: 1.6; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; }
:focus-visible { outline: 1px solid var(--white); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Liquid glass -------------------------------------------------------------- */
/* .glass blurs what is behind it; .glass-flat (buttons inside a glass panel) only looks like it,
   because the panel underneath is already blurred. --mx / --my follow the pointer (effects.js). */
.glass, .glass-flat {
  --mx: 25%; --my: -30%;
  position: relative; isolation: isolate; border-radius: 3px;
  background: var(--glass-fill);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 30px 60px -24px rgba(0, 0, 0, 0.75);
}
.glass {
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(170%);
  backdrop-filter: blur(var(--glass-blur)) saturate(170%);
}
html[data-fx="lite"] .glass { -webkit-backdrop-filter: none; backdrop-filter: none; }
.glass::before, .glass-flat::before {   /* the soft shine */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.085), transparent 45%);
}
.glass::after, .glass-flat::after {     /* the thin bright edge, brightest nearest the light */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.15) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* ---- Starfield (behind everything) ------------------------------------------------- */
.starfield { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.stars {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(100% + var(--tile));
  background-size: var(--tile) var(--tile); will-change: transform;
  animation: star-drift var(--dur) linear infinite;
}
@keyframes star-drift { to { transform: translate3d(0, calc(-1 * var(--tile)), 0); } }
html[data-fx="lite"] .stars.near { display: none; }
html.reduce-motion .stars { animation: none; }
main, .footer { position: relative; z-index: 1; }

/* ---- Loading screen ------------------------------------------------------------------ */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--black);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.loader.out { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo { width: 76px; height: 76px; opacity: 0; transform: translateY(10px); transition: opacity 0.7s ease, transform 0.9s var(--ease-out); }
.loader-kicker { margin: 0; font-family: var(--wide); font-size: 12px; font-weight: 700; letter-spacing: 0.5em; margin-right: -0.5em; text-transform: uppercase; color: var(--grey); opacity: 0; transition: opacity 0.7s ease 0.15s; }
.loader-title { margin: 6px 0 0; font-family: var(--wide); font-weight: 700; font-size: clamp(40px, 9vw, 108px); line-height: 1; text-transform: uppercase; letter-spacing: 0.8em; margin-right: -0.8em; opacity: 0; transition: opacity 1s ease, letter-spacing 1.4s var(--ease-out), margin 1.4s var(--ease-out); }
.loader-bar { width: 180px; height: 1px; margin-top: 22px; background: var(--line); overflow: hidden; }
.loader-bar span { display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; transition: transform 2s var(--ease-out); }
.loader.s1 .loader-logo { opacity: 1; transform: none; }
.loader.s1 .loader-kicker { opacity: 1; }
.loader.s1 .loader-bar span { transform: scaleX(1); }
.loader.s2 .loader-title { opacity: 1; letter-spacing: 0.32em; margin-right: -0.32em; }
html.reduce-motion .loader * { transition: opacity 0.3s ease !important; }

/* ---- Type ----------------------------------------------------------------- */
.wordmark { font-family: var(--wide); font-weight: 700; font-size: 14px; letter-spacing: 0.42em; text-transform: uppercase; text-decoration: none; }
.h2 { font-family: var(--wide); font-weight: 700; font-size: clamp(28px, 4.4vw, 52px); line-height: 1.05; letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 28px; }
.h3 { font-family: var(--wide); font-weight: 700; font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; margin: 0 0 10px; }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--grey); max-width: 46ch; margin: 0 0 64px; }
.group-label { display: block; font-family: var(--wide); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--grey); margin: 0 0 12px; padding: 0; }

/* ---- Top bar ---------------------------------------------------------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 36px; padding: 0 var(--gutter);
  border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s;
}
.topbar.solid { background: var(--black); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-right: auto; }
.brand img { width: 32px; height: 32px; }
.brand-sep { width: 1px; height: 18px; background: var(--line-strong); }
.nav { display: flex; gap: 32px; }
.nav a { white-space: nowrap; font-family: var(--wide); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; color: var(--grey); transition: color 0.2s; }
.nav a:hover { color: var(--white); }
.sound-toggle {
  appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px;
  font-family: var(--wide); font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey);
}
.sound-toggle svg { width: 16px; height: 16px; }
.sound-toggle[aria-pressed="true"] { color: var(--white); }
.sound-toggle .wave { opacity: 0; transition: opacity 0.2s; }
.sound-toggle[aria-pressed="true"] .wave { opacity: 1; }
.sound-toggle[aria-pressed="true"] .mute { opacity: 0; }

/* ---- Launch film: the trailer, as wide as the screen allows with its control bar still in view ---- */
.film { --top-h: 64px; --bar-h: 72px; position: relative; padding-top: var(--top-h); }
.film-frame {
  position: relative; margin: 0 auto; aspect-ratio: 16 / 9;
  width: min(100%, max(60vw, (100vh - var(--top-h) - var(--bar-h)) * 16 / 9));
  width: min(100%, max(60vw, (100svh - var(--top-h) - var(--bar-h)) * 16 / 9));
}
.film-frame video {   /* the edges fade into the page, so a film narrower than the screen has no hard border */
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; background: var(--black);
  -webkit-mask: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
  mask: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
}
html[data-fx="lite"] .film-frame video { -webkit-mask: none; mask: none; }
.film-bar { position: relative; height: var(--bar-h); display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter); }
.film-progress { position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); overflow: hidden; }
.film-progress span { display: block; height: 100%; background: var(--white); transform: scaleX(0); transform-origin: left; }
.film-label { margin: 0 auto 0 0; display: flex; align-items: baseline; gap: 20px; white-space: nowrap; }
.film-kicker { font-family: var(--wide); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--grey); }
.film-clock { font-size: 15px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.film-btn {
  appearance: none; border: 0; cursor: pointer; height: 40px; min-width: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; color: var(--white);
  font-family: var(--wide); font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
}
.film-btn:hover { --glass-fill: rgba(255, 255, 255, 0.14); }
.film-btn svg { width: 16px; height: 16px; flex: none; }
.film:not(.paused) .i-play, .film.paused .i-pause { display: none; }
.film-sound .wave, .film-sound.on .mute { opacity: 0; }
.film-sound.on .wave { opacity: 1; }
.film-cta { margin-left: 14px; height: 40px; display: inline-flex; align-items: center; gap: 12px; padding: 0 18px; text-decoration: none; }
.film-cta svg { width: 14px; height: 14px; }

/* ---- Hero: live landing with mission control floating on the right ---------------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 680px; }
.stage { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr; }
.stage[data-panes="2"] { grid-template-columns: calc((100% - var(--console-space)) / 2) 1fr; }
.stage-actions { position: absolute; z-index: 8; left: 50%; top: 60%; transform: translateX(-50%); display: flex; gap: 12px; animation: rise-in 0.6s var(--ease-out); }
@keyframes rise-in { from { opacity: 0; transform: translate(-50%, 12px); } }

.pane { --safe-right: 0px; --usable: 1000px; position: relative; min-width: 0; overflow: hidden; animation: pane-in 0.6s var(--ease-out); }
@keyframes pane-in { from { opacity: 0; } }
.stage[data-panes="2"] .pane + .pane::before { content: ""; position: absolute; z-index: 2; left: 0; top: 80px; bottom: 16px; width: 1px; background: var(--line); }
.pane canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pane-head { position: absolute; z-index: 2; top: 92px; left: 24px; right: calc(var(--safe-right) + 24px); display: flex; justify-content: space-between; gap: 16px; pointer-events: none; transition: opacity 0.4s; }
.pane.ended .pane-head { opacity: 0; }
.pane-pilot { font-family: var(--wide); font-weight: 700; font-size: 13px; letter-spacing: 0.24em; text-transform: uppercase; }
.pane-live { display: block; margin-top: 4px; font-size: 12px; color: var(--grey); }
.pane-meta { font-size: 13px; color: var(--grey); text-align: right; }

/* Telemetry: a glass lower third, webcast style */
.telemetry {
  position: absolute; z-index: 3; left: 16px; right: calc(var(--safe-right) + 16px); bottom: 16px; padding: 14px 24px 16px;
  display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: end; gap: 26px; pointer-events: none;
}
.gauges { display: flex; gap: 16px; }
.gauge { position: relative; width: 90px; height: 90px; display: grid; place-items: center; text-align: center; }
.gauge svg { position: absolute; inset: 0; }
.gauge-track, .gauge-arc { fill: none; stroke-width: 2; }
.gauge-track { stroke: var(--line); }
.gauge-arc { stroke: var(--white); }
.gauge b { display: flex; justify-content: center; font-weight: 400; font-size: 23px; line-height: 1; margin-top: 4px; }
.gauge .unit { display: block; font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grey); margin-top: 4px; line-height: 1.2; }
.readouts { display: grid; grid-template-columns: repeat(2, minmax(84px, auto)); gap: 4px 22px; margin: 0; }
.readouts.right { grid-template-columns: repeat(3, minmax(70px, auto)); }
.readouts div { display: flex; flex-direction: column-reverse; }
.readouts dt { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grey); white-space: nowrap; }
.readouts dd { margin: 0; font-size: 22px; line-height: 1.15; white-space: nowrap; display: flex; align-items: baseline; }
.readouts dd small, .outcome-stats dd small { font-size: 12px; color: var(--grey); margin-left: 4px; }
.wind-arrow { display: inline-block; width: 24px; height: 12px; margin-right: 6px; align-self: center; transition: transform 0.25s var(--ease-out), opacity 0.25s; }
.clock { text-align: center; }
.tplus { display: block; white-space: nowrap; font-family: var(--wide); font-size: 34px; line-height: 1; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.phase { display: block; margin-top: 8px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--grey); }

/* Rolling digits, like a flight computer */
.roll { display: inline-flex; font-variant-numeric: tabular-nums; }
.rd { display: inline-block; height: 1.1em; overflow: hidden; }
.rs { display: flex; flex-direction: column; transition: transform 0.16s cubic-bezier(0.3, 0.8, 0.3, 1); }
.rs > span, .rc { display: block; height: 1.1em; line-height: 1.1em; }
html.reduce-motion .rs { transition: none; }

/* Countdown */
.countdown {
  position: absolute; z-index: 7; top: 0; bottom: 0; left: 0; right: var(--console-space);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
}
.cd-text { font-family: var(--wide); font-weight: 700; font-size: clamp(64px, 11vw, 156px); line-height: 1; letter-spacing: 0.1em; margin-right: -0.1em; text-transform: uppercase; }
.cd-text.tick { animation: cd-tick 0.8s var(--ease-out) both; }
.cd-text.go { font-size: clamp(40px, 7vw, 100px); letter-spacing: 0.4em; margin-right: -0.4em; animation: cd-go 0.6s var(--ease-out) both; }
@keyframes cd-tick { 0% { opacity: 0; transform: scale(1.35); } 22% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(0.94); } }
@keyframes cd-go { 0% { opacity: 0; letter-spacing: 0.9em; } 30% { opacity: 1; } 100% { opacity: 0; letter-spacing: 0.4em; } }
html.reduce-motion .cd-text { animation: none !important; }
.cd-hint { margin-top: 18px; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); }

/* Result screen: a glass card */
.outcome {
  position: absolute; z-index: 4; top: 0; bottom: 0; left: 0; right: var(--safe-right);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 96px 20px calc(var(--tele-h, 130px) + 120px); background: rgba(0, 0, 0, 0.3);
  opacity: 0; transition: opacity 0.5s ease;
}
.outcome.show { opacity: 1; }
.outcome-card { padding: 30px 44px 26px; transform: translateY(20px) scale(0.98); transition: transform 0.7s var(--ease-out); }
.outcome.show .outcome-card { transform: none; }
html.reduce-motion .outcome-card { transform: none; transition: none; }
.outcome-title { font-family: var(--wide); font-weight: 700; font-size: clamp(24px, calc(var(--usable) * 0.042), 50px); line-height: 1.1; letter-spacing: 0.2em; margin: 0 -0.2em 0 0; text-transform: uppercase; }
.outcome-sub { color: var(--grey); margin: 12px auto 26px; font-size: 16px; max-width: 42ch; }
.outcome-stats { display: flex; justify-content: center; gap: clamp(20px, calc(var(--usable) * 0.05), 64px); margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line-strong); }
.outcome-stats div { display: flex; flex-direction: column-reverse; min-width: 90px; }
.outcome-stats dt { font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey); }
.outcome-stats dd { margin: 0; font-size: clamp(26px, calc(var(--usable) * 0.036), 40px); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Crash flash */
.pane .flash { position: absolute; inset: 0; z-index: 3; background: #fff; opacity: 0; pointer-events: none; }
.pane .flash.on { animation: flash 0.5s ease-out; }
@keyframes flash { from { opacity: 0.32; } to { opacity: 0; } }

/* Compact telemetry: compare mode and phones (app.js sets .compact when the visible pane is narrow) */
.pane.compact .pane-head { top: 76px; left: 16px; right: calc(var(--safe-right) + 16px); }
.pane.compact .pane-live { display: none; }
.pane.compact .telemetry { left: 10px; right: calc(var(--safe-right) + 10px); bottom: 10px; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; padding: 11px 16px 13px; }
.pane.compact .gauges { display: none; }
.pane.compact .clock { grid-column: 1 / -1; grid-row: 1; text-align: left; display: flex; align-items: baseline; justify-content: space-between; }
.pane.compact .tplus { font-size: 22px; }
.pane.compact .phase { margin: 0; }
.pane.compact .readouts, .pane.compact .readouts.right { display: contents; }
.pane.compact .readouts dd { font-size: 17px; }
.pane.compact .outcome { padding: 56px 12px calc(var(--tele-h, 110px) + 16px); }
.pane.compact .outcome-card { padding: 18px 18px 16px; }
html[data-fx="lite"] .outcome-card { --glass-fill: rgba(14, 14, 18, 0.93); }
.pane.compact .outcome-title { font-size: clamp(18px, calc(var(--usable) * 0.058), 30px); }
.pane.compact .outcome-sub { font-size: 13px; margin: 6px 0 12px; }
.pane.compact .outcome-stats { gap: 16px; padding-top: 12px; }
.pane.compact .outcome-stats div { min-width: 0; }
.pane.compact .outcome-stats dd { font-size: clamp(20px, calc(var(--usable) * 0.054), 28px); }
.readouts .compact-only { display: none; }
.pane.compact .readouts .compact-only { display: flex; }

/* ---- Mission control console (floating glass) -------------------------------------- */
.console {
  position: absolute; z-index: 6; top: 80px; right: var(--console-gap); bottom: var(--console-gap); width: var(--console-w);
  padding: 24px 24px 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 26px; scrollbar-width: thin; scrollbar-color: var(--dim) transparent;
}
.console-title { font-family: var(--wide); font-weight: 700; font-size: 16px; letter-spacing: 0.26em; text-transform: uppercase; margin: 0; }
.group { border: 0; margin: 0; padding: 0; min-width: 0; }

.pilots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pilot {
  appearance: none; border: 0; cursor: pointer; padding: 13px 12px; text-align: left; color: var(--grey);
  font-family: var(--wide); font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  transition: color 0.2s, background-color 0.25s;
}
.pilot:hover { color: var(--white); }
.pilot[aria-checked="true"] { color: var(--white); --glass-fill: rgba(255, 255, 255, 0.17); }
.pilot[aria-checked="true"]::after { background: rgba(255, 255, 255, 0.85); }
.pilot-about { font-size: 14px; line-height: 1.5; color: var(--grey); margin: 12px 0 14px; min-height: 3em; }

.compare { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check-label { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-label .box { width: 14px; height: 14px; border: 1px solid var(--line-strong); display: inline-block; }
.check-label input:checked + .box { background: var(--white); box-shadow: inset 0 0 0 3px var(--black); }
.check-label input:focus-visible + .box { outline: 1px solid var(--white); outline-offset: 3px; }
select {
  appearance: none; background: transparent; border: 1px solid var(--line-strong); border-radius: 2px; padding: 6px 30px 6px 10px; font-size: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23fff'/%3E%3C/svg%3E");
  background-position: right 10px center; background-repeat: no-repeat;
}
select option { background: #111; }
select:disabled { opacity: 0.35; }

/* Sliders with physics zones */
.ctl { margin-bottom: 20px; }
.ctl-head { display: flex; justify-content: space-between; align-items: baseline; }
.ctl-head label { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.ctl-head output { font-size: 22px; font-variant-numeric: tabular-nums; }
.ctl-head output small { font-size: 12px; color: var(--grey); margin-left: 3px; }
.ctl-track { position: relative; height: 26px; }
.zones { position: absolute; left: 7px; right: 7px; top: 50%; height: 0; }
.zones span { position: absolute; top: 0; height: 0; }
.zones .z-trained { border-top: 3px solid var(--go); margin-top: -1.5px; }
.zones .z-beyond { border-top: 1.5px solid var(--caution); margin-top: -0.75px; }
.zones .z-impossible { border-top: 3px dotted var(--nogo); margin-top: -1.5px; }
.ctl input[type="range"] { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; }
.ctl input[type="range"]::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.ctl input[type="range"]::-moz-range-track { height: 26px; background: transparent; }
.ctl input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: 6px; background: var(--white); border: 0; border-radius: 0; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 255, 255, 0.35); }
.ctl input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; background: var(--white); border: 0; border-radius: 0; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.9); }
.ctl input[type="range"]:focus-visible { outline: none; }
.ctl input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 1px solid var(--white); outline-offset: 4px; }
.ctl-zone { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--grey); margin-top: 2px; }
.zone-glyph { display: inline-block; width: 18px; height: 0; flex: none; }
.zone-trained { border-top: 3px solid var(--go); }
.zone-beyond { border-top: 1.5px solid var(--caution); }
.zone-impossible { border-top: 3px dotted var(--nogo); }
.zone-key { list-style: none; margin: 2px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--grey); }
.zone-key li { display: flex; align-items: center; gap: 8px; }

/* Landing check */
.check { border-top: 1px solid var(--line); padding-top: 18px; }
.check-row { display: flex; justify-content: space-between; align-items: baseline; }
.check-key { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.check-val { font-size: 22px; font-variant-numeric: tabular-nums; }
.check-verdict { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-size: 14px; }
.check-verdict b { font-family: var(--wide); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; }
.expect { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.expect-rate { font-family: var(--wide); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.expect-rate.untested { color: var(--dim); }
.expect-who { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.expect-note { grid-column: 1 / -1; font-size: 13px; line-height: 1.45; color: var(--grey); margin-top: 6px; }

/* Launch */
.launch-group { display: flex; flex-direction: column; gap: 12px; }
.landing-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.landing-field .group-label { margin: 0; }
.landing-field input { width: 120px; background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; padding: 4px 0; text-align: right; font-size: 18px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.landing-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.hint { font-size: 12.5px; line-height: 1.5; color: var(--dim); margin: 2px 0 0; }
.launch-row {
  position: sticky; bottom: 0; z-index: 3; margin: auto -24px 0; padding: 16px 24px 22px;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px;
  border-top: 1px solid var(--line); background: rgba(12, 12, 15, 0.94);
}
html[data-fx="lite"] .launch-row { background: rgba(16, 16, 20, 0.98); }

.btn {
  appearance: none; border: 0; color: var(--white); cursor: pointer; padding: 14px 20px;
  font-family: var(--wide); font-size: 12px; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; white-space: nowrap;
  transition: background-color 0.2s, transform 0.12s;
}
.btn:hover { --glass-fill: rgba(255, 255, 255, 0.14); }
.btn:active { transform: scale(0.985); }
.btn-launch { --glass-fill: rgba(255, 255, 255, 0.16); padding: 20px 10px; font-size: 16px; letter-spacing: 0.42em; }
.btn-launch:hover { --glass-fill: rgba(255, 255, 255, 0.26); }
.btn-launch::after { background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.35) 60%); }
.launch-row #surprise { letter-spacing: 0.14em; padding-left: 8px; padding-right: 8px; }
.btn[disabled] { opacity: 0.45; cursor: progress; }

/* ---- Sections ---------------------------------------------------------------- */
.section { padding: clamp(96px, 14vw, 180px) var(--gutter) 0; max-width: 1360px; margin: 0 auto; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }
html.reduce-motion .reveal { transform: none; transition: opacity 0.4s ease; }

.story { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.story li { padding: 28px 32px 0 0; }
.story li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.story-no { display: block; font-family: var(--wide); font-size: 13px; letter-spacing: 0.2em; color: var(--grey); margin-bottom: 40px; }
.story p { color: var(--grey); margin: 0; max-width: 40ch; }

.bignums { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.bignum { padding: 28px 24px 8px 0; }
.bignum + .bignum { padding-left: 24px; border-left: 1px solid var(--line); }
.bignum-value { display: block; font-family: var(--wide); font-weight: 400; font-size: clamp(56px, 7.2vw, 112px); line-height: 0.9; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.bignum-value small { font-size: 0.38em; letter-spacing: 0.06em; margin-left: 4px; }
.bignum-label { display: block; margin-top: 22px; font-family: var(--wide); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.bignum-vs { display: block; margin-top: 6px; font-size: 15px; color: var(--grey); }
.tradeoff { margin-top: 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.tradeoff p { margin: 0; color: var(--grey); max-width: 62ch; }
.tradeoff table { border-collapse: collapse; margin-top: 22px; font-variant-numeric: tabular-nums; }
.tradeoff th, .tradeoff td { text-align: left; padding: 8px 28px 8px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.tradeoff th { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grey); }

/* Charts */
.chart { margin: 0 0 120px; }
.chart figcaption { max-width: 70ch; margin-bottom: 28px; }
.chart figcaption p { margin: 0; color: var(--grey); }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 760px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.heat col.rowhead { width: 220px; }
.heat th { font-weight: 400; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); text-align: center; padding: 0 4px 10px; vertical-align: bottom; line-height: 1.3; }
.heat th[scope="row"] { vertical-align: middle; text-align: left; text-transform: none; letter-spacing: 0.02em; font-size: 14px; color: var(--white); padding: 0 16px 0 0; white-space: nowrap; position: sticky; left: 0; background: var(--black); }
.heat tr.final th[scope="row"] { font-weight: 700; }
.heat td { text-align: center; height: 44px; font-size: 15px; }
.heat td.limit-start, .heat th.limit-start { border-left: 1px solid var(--white); }
.heat tr.final td { font-weight: 700; }

.curves { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 28px; }
.curve h4 { font-size: 13px; font-weight: 400; letter-spacing: 0.04em; margin: 0 0 8px; color: var(--grey); }
.curve.final h4 { color: var(--white); font-weight: 700; }
.curve svg { width: 100%; height: auto; display: block; overflow: visible; }
.curve .readout { font-size: 12px; fill: var(--white); font-variant-numeric: tabular-nums; }
.axis text { font-size: 11px; fill: var(--dim); font-family: var(--text); }

.pairs { display: grid; gap: 30px; }
.pairs-legend { display: flex; gap: 8px 28px; flex-wrap: wrap; font-size: 14px; color: var(--grey); margin-bottom: 8px; }
.pairs-legend span { display: inline-flex; align-items: center; gap: 10px; }
.swatch { width: 22px; height: 10px; display: inline-block; }
.pair-row { display: grid; grid-template-columns: 180px 1fr 120px; gap: 6px 24px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.pair-name { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
.pair-bars { display: grid; gap: 6px; padding-right: 60px; }
.bar { position: relative; height: 22px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; transform-origin: left; transition: transform 1.1s var(--ease-out); }
.reveal:not(.in) .bar-fill { transform: scaleX(0); }
html.reduce-motion .bar-fill { transition: none; transform: none !important; }
.bar-ci { position: absolute; top: 50%; height: 1px; background: var(--white); }
.bar-label { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; font-variant-numeric: tabular-nums; padding-left: 8px; white-space: nowrap; }
.pair-p { font-size: 13px; color: var(--grey); text-align: right; font-variant-numeric: tabular-nums; }

/* Flight records */
.clips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.clip { margin: 0; }
.clip.wide { grid-column: 1 / -1; }
.clip video { width: 100%; height: auto; display: block; background: var(--black); border: 1px solid var(--line); filter: grayscale(1) contrast(1.05); }
.clip figcaption { margin-top: 12px; font-size: 14px; color: var(--grey); max-width: 70ch; }
.clip figcaption b { display: block; color: var(--white); font-family: var(--wide); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 4px; }

/* Footer */
.footer { margin-top: 160px; padding: 40px var(--gutter) 48px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 18px 40px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { width: 44px; height: 44px; }
.nowrap { white-space: nowrap; }
.footer-sign { font-family: var(--wide); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.footer-links { display: flex; gap: 10px; justify-self: end; }
.footer-links a { text-decoration: none; padding: 10px 16px; font-family: var(--wide); font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; }
.footer-credits { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--dim); max-width: 90ch; }

/* ---- Phones and narrow screens ------------------------------------------------- */
@media (max-width: 1080px) {
  :root { --console-space: 0px; }
  .hero { height: auto; min-height: 0; }
  .nav-live { display: none; }   /* the live landing sits right under the film here */
  .stage { position: relative; height: calc(78svh + 72px); min-height: 592px; padding-bottom: 72px; }
  .stage[data-panes="2"] { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; height: calc(100svh + 72px); min-height: 820px; }
  .stage[data-panes="2"] .pane + .pane::before { left: 16px; right: 16px; top: 0; bottom: auto; width: auto; height: 1px; }
  .stage[data-panes="2"] .telemetry { padding: 10px 14px 12px; gap: 6px 10px; }
  .stage[data-panes="2"] .readouts dd { font-size: 15px; }
  .stage[data-panes="2"] .tplus { font-size: 19px; }
  .stage-actions { top: auto !important; bottom: 12px; left: 16px !important; right: 16px; transform: none; animation: none; }
  .stage-actions .btn { flex: 1; padding: 13px 10px; }
  .stage-actions[hidden] { display: flex !important; visibility: hidden; }
  .console { position: relative; top: auto; right: auto; bottom: auto; width: auto; margin: 0 16px; padding: 28px 20px 0; overflow: visible; }
  .console-title { display: none; }
  .launch-row { position: static; margin: 0 -20px; padding: 16px 20px 20px; }
  .story, .bignums { grid-template-columns: 1fr 1fr; }
  .story li:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); margin-top: 28px; }
  .bignum:nth-child(3) { padding-left: 0; border-left: 0; }
  .bignum:nth-child(n+3) { border-top: 1px solid var(--line); }
  .curves { grid-template-columns: repeat(2, 1fr); }
  .tradeoff { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .topbar { height: 56px; gap: 16px; }
  .brand img { width: 28px; height: 28px; }
  .sound-toggle .label { display: none; }
  .film { --top-h: 56px; --bar-h: 64px; }
  .film-cta { display: none; }   /* on phones the live landing is right below the film anyway */
  .film-label { gap: 14px; }
  .stage { height: calc(70svh + 72px); min-height: 552px; }
  .pane-head { top: 66px; }
  .story, .bignums { grid-template-columns: 1fr; }
  .story li, .story li + li { padding: 24px 0 0; border-left: 0; }
  .story li + li { border-top: 1px solid var(--line); margin-top: 28px; }
  .story-no { margin-bottom: 16px; }
  .bignum, .bignum + .bignum { padding: 24px 0 8px; border-left: 0; }
  .bignum + .bignum { border-top: 1px solid var(--line); }
  .clips { grid-template-columns: 1fr; }
  .pair-row { grid-template-columns: 1fr auto; }
  .pair-bars { grid-column: 1 / -1; grid-row: 2; }
  .heat { min-width: 640px; }
  .heat col.rowhead { width: 128px; }
  .heat th[scope="row"] { white-space: normal; font-size: 13px; line-height: 1.25; padding-right: 10px; }
  .heat td { font-size: 14px; }
  .curves { gap: 28px 16px; }
  .axis text { font-size: 19px; }
  .curve .readout { font-size: 20px; }
  .footer { grid-template-columns: 1fr; margin-top: 110px; }
  .footer-links { justify-self: start; }
}
