/* ==========================================================================
   ORA — Orbital Roof Assessment
   Layout model: one fixed stage (the flight) + ten fixed scenes. Only the
   active scene is visible. Chrome lives in reserved bands so it can never
   collide with copy: nav (top), telemetry (bottom), chapter rail (right).
   ========================================================================== */

:root {
  --bg: #030305;
  --ink: #f2f2f0;
  --ink-2: rgba(242, 242, 240, 0.72);
  --ink-3: rgba(242, 242, 240, 0.5);
  --body: #c5c9cf;
  --line: rgba(255, 255, 255, 0.1);
  --good: #8fd3ff;
  --wear: #f0c45c;
  --damage: #ff5a4e;
  --sans: 'Geist', 'Inter', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', monospace;
  --ease: cubic-bezier(0.16, 0.84, 0.24, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.18, 1);
  --pad: clamp(20px, 2.8vw, 40px);
  --gutter: clamp(28px, 6.4vw, 120px);
  --rail-w: 0px;
  --safe-top: 112px;
  --safe-bottom: 104px;
}
html.wide { --rail-w: 224px; }
@media (max-height: 780px) { :root { --safe-top: 96px; --safe-bottom: 88px; } }

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--ink); color: #0a0a0b; }
:focus-visible { outline: 2px solid var(--good); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: 16px; top: -64px; z-index: 200;
  padding: 11px 16px; border-radius: 999px;
  background: var(--ink); color: #0a0a0b;
  font: 500 13px/1 var(--sans); text-decoration: none;
  transition: top 0.3s var(--ease);
}
.skip:focus { top: 16px; }

/* ==========================================================================
   Stage
   ========================================================================== */

.stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.frame {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  will-change: transform;
  transition: opacity 0.4s ease;
}
html.is-cut .frame { opacity: 0; }
#bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* The frame the flight rests on, copied off the video (see "The still" in main.js). */
#still { position: absolute; inset: 0; width: 100%; height: 100%; display: block; visibility: hidden; }
html.has-still #still { visibility: visible; }
/* Out of the render tree while hidden, so moving the frame never repaints it. */
#roof { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; transition: opacity 0.9s ease, visibility 0s linear 0.9s; }
html.show-roof #roof { opacity: 1; visibility: visible; transition: opacity 0.9s ease, visibility 0s; }
html.show-roof.roof-soft #roof { opacity: 0.82; }
.plane .pf { stroke-width: 3; stroke-linejoin: round; }
.plane .pd { opacity: 0.5; mix-blend-mode: screen; }
.plane--good .pf { fill: rgba(143, 211, 255, 0.13); stroke: rgba(143, 211, 255, 0.9); }
.plane--wear .pf { fill: rgba(240, 190, 70, 0.3); stroke: rgba(240, 196, 92, 0.95); }
.plane--damage .pf { fill: rgba(255, 90, 78, 0.24); stroke: rgba(255, 90, 78, 0.95); }
#scanline { stroke: #d9f1ff; stroke-width: 3; opacity: 0; }
#scanband { opacity: 0; }

/* Phones/portrait: the flight sits in a window that melts into black */
.feather { position: absolute; inset: 0; pointer-events: none; display: none; }
html.compact .feather {
  display: block;
  background: linear-gradient(180deg,
    #030305 0px, #030305 var(--wt, 0px),
    rgba(3, 3, 5, 0) calc(var(--wt, 0px) + var(--ft, 64px)),
    rgba(3, 3, 5, 0) calc(var(--wb, 100vh) - var(--fb, 132px)),
    rgba(3, 3, 5, 0.86) calc(var(--wb, 100vh) - var(--fb, 132px) * 0.18),
    #030305 var(--wb, 100vh), #030305 100%);
}

.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 3, 5, 0.84) 0%, rgba(3, 3, 5, 0.62) 24%, rgba(3, 3, 5, 0.2) 46%, rgba(3, 3, 5, 0) 62%),
    linear-gradient(180deg, rgba(3, 3, 5, 0.66) 0%, rgba(3, 3, 5, 0) 17%, rgba(3, 3, 5, 0) 78%, rgba(3, 3, 5, 0.72) 100%);
  transition: opacity 1s ease;
}
html.compact .scrim { background: linear-gradient(180deg, rgba(3, 3, 5, 0.5) 0%, rgba(3, 3, 5, 0) 22%); }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 125% 95% at 55% 50%, transparent 52%, rgba(0, 0, 0, 0.55) 100%); }
.dim { position: absolute; inset: 0; pointer-events: none; background: #030305; opacity: 0; transition: opacity 1.2s ease; }
html.is-dim .dim { opacity: 0.78; }

/* Film grain. A new pattern every 50 ms rather than one pattern sliding about: each frame is the
   texture mirrored another way (no two frames in a row alike), so the eye sees a fine shimmer and no
   movement to follow. Only the transform changes: the compositor does it all. */
.grain {
  position: absolute; inset: -120px; pointer-events: none;
  background-image: var(--grain, none);
  background-size: 160px 160px;
  opacity: 0.065;
  animation: grain 0.3s infinite;
  animation-timing-function: steps(1, end);
}
@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  16.666% { transform: translate3d(-37px, 23px, 0) scale(-1, 1); }
  33.333% { transform: translate3d(29px, -41px, 0) scale(1, -1); }
  50% { transform: translate3d(-13px, -27px, 0) scale(-1, -1); }
  66.666% { transform: translate3d(43px, 11px, 0); }
  83.333% { transform: translate3d(-21px, 37px, 0) scale(-1, 1); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ==========================================================================
   Preloader
   ========================================================================== */

#loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.3s var(--ease-io) 0.2s;
}
#loader.is-done { clip-path: inset(0 0 100% 0); pointer-events: none; }
#loader.is-gone { display: none; }
.loader__center { display: flex; flex-direction: column; align-items: center; gap: 30px; transition: opacity 0.6s ease, transform 1s var(--ease-io); }
#loader.is-done .loader__center { opacity: 0; transform: translateY(-40px) scale(0.96); }
.loader__mark { width: clamp(150px, 17vw, 220px); height: auto; overflow: visible; }
.loader__mark circle {
  fill: var(--ink); opacity: 0;
  transform-box: fill-box; transform-origin: center; transform: scale(0.2);
  animation: dot-in 0.7s var(--ease) forwards;
  animation-delay: calc(var(--i) * 55ms + 150ms);
}
.loader__mark .ld circle { fill: rgba(242, 242, 240, 0.4); }
.loader__mark .ls { animation: dot-in 0.7s var(--ease) forwards, pulse-dot 1.6s ease-in-out 1.6s infinite; animation-delay: calc(var(--i) * 55ms + 150ms), 1.6s; }
@keyframes dot-in { to { opacity: 1; transform: none; } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.loader__count { display: flex; align-items: flex-start; gap: 4px; font: 300 clamp(44px, 6vw, 72px)/1 var(--sans); letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.loader__unit { font: 500 12px/1 var(--mono); letter-spacing: 0.1em; color: var(--ink-3); margin-top: 8px; }
.loader__bar { position: absolute; left: var(--pad); right: var(--pad); bottom: 64px; height: 1px; background: var(--line); }
.loader__bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.loader__foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 30px; display: flex; justify-content: space-between; gap: 16px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }

/* ==========================================================================
   Navigation, buttons, links
   ========================================================================== */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: 84px; padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  opacity: 0; transition: opacity 1s ease 0.5s;
}
html.is-ready .nav { opacity: 1; }
.nav__logo { display: inline-flex; color: var(--ink); }
.nav__logo svg { height: 24px; width: auto; display: block; }
.nav__links { display: flex; align-items: center; gap: 34px; font-size: 14px; }
.btn .short { display: none; }

.link {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 0; border: 0; background: none;
  color: var(--ink-2); text-decoration: none; cursor: pointer;
  font: 400 15px/1 var(--sans); letter-spacing: -0.005em;
  transition: color 0.3s ease;
}
.nav .link { font-size: 14px; }
.link span { position: relative; display: inline-block; padding: 5px 0; }
.link span::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.link:hover { color: var(--ink); }
.link:hover span::after { transform: scaleX(1); transform-origin: left; }
.link--down::after { content: '↓'; font-size: 14px; transition: transform 0.45s var(--ease); }
.link--down:hover::after { transform: translateY(3px); }

.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 28px;
  border: 0; border-radius: 999px;
  font: 500 15px/1 var(--sans); letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color 0.45s var(--ease), transform 0.6s var(--ease), border-color 0.3s ease;
}
.btn::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; transform: translateY(102%); transition: transform 0.55s var(--ease); }
.btn:hover::before { transform: none; }
.btn--sm { height: 42px; padding: 0 20px; font-size: 14px; }
.btn--solid { background: var(--ink); color: #0a0a0b; }
.btn--solid::before { background: #ffffff; }
.btn--ghost { border: 1px solid rgba(255, 255, 255, 0.26); color: var(--ink); background: rgba(3, 3, 5, 0.32); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn--ghost::before { background: var(--ink); }
.btn--ghost:hover { color: #0a0a0b; border-color: var(--ink); }
.btn__arrow { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.45s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn__spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
.btn.is-loading .btn__spin { display: inline-block; }
.btn.is-loading .btn__arrow { display: none; }
.btn:disabled { cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Telemetry (bottom band + flight-only extras)
   ========================================================================== */

.hud {
  position: fixed; inset: 0; z-index: 15; pointer-events: none;
  font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(242, 242, 240, 0.72);
  opacity: 0; transition: opacity 1s ease 0.6s;
}
html.is-ready .hud { opacity: 1; }
html.is-final .hud { opacity: 0; transition-delay: 0s; }
.hud__corner { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(242, 242, 240, 0.38); transition: opacity 0.8s ease; }
.hud__corner--tl { top: 92px; left: var(--pad); border-top-width: 1px; border-left-width: 1px; }
.hud__corner--tr { top: 92px; right: var(--pad); border-top-width: 1px; border-right-width: 1px; }
.hud__corner--bl { bottom: 60px; left: var(--pad); border-bottom-width: 1px; border-left-width: 1px; }
.hud__corner--br { bottom: 60px; right: var(--pad); border-bottom-width: 1px; border-right-width: 1px; }
.hud__top { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; white-space: nowrap; transition: opacity 0.8s ease; }
.hud__sep { width: 18px; height: 1px; background: rgba(242, 242, 240, 0.35); }
.hud__bl, .hud__br { position: absolute; bottom: 28px; display: flex; align-items: center; gap: 22px; white-space: nowrap; }
.hud__bl { left: var(--pad); }
.hud__br { right: var(--pad); }
#hud-phase { color: var(--ink); }
.hud__rec { display: inline-flex; align-items: center; gap: 8px; }
.hud__rec i { width: 6px; height: 6px; border-radius: 50%; background: var(--damage); animation: blink 1.6s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }
html.is-late .hud__top, html.is-late .hud__corner { opacity: 0; }

/* ==========================================================================
   Chapter rail (wide screens only, in its own column)
   ========================================================================== */

.rail { display: none; }
html.wide .rail {
  display: block; position: fixed; z-index: 16;
  right: var(--pad); top: 50%; width: 170px; transform: translateY(-50%);
  opacity: 0; transition: opacity 1s ease 0.8s;
}
html.wide.is-ready .rail { opacity: 1; }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail button {
  width: 100%; height: 24px; padding: 0; border: 0; background: none;
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  color: rgba(242, 242, 240, 0.36);
  font: 500 10px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; transition: color 0.3s ease;
}
.rail button::after { content: ''; flex: 0 0 auto; width: 14px; height: 1px; background: currentColor; transition: width 0.5s var(--ease); }
.rail button span { opacity: 0; transform: translateX(6px); white-space: nowrap; transition: opacity 0.35s ease, transform 0.45s var(--ease); }
.rail button:hover, .rail button:focus-visible, .rail button.is-active { color: var(--ink); }
.rail button:hover span, .rail button:focus-visible span, .rail button.is-active span { opacity: 1; transform: none; }
.rail button.is-active::after { width: 34px; }

/* ==========================================================================
   Cursor (mouse only)
   ========================================================================== */

.cursor { display: none; }
html.has-cursor .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity 0.3s ease; }
html.has-cursor .cursor.is-on { opacity: 1; }
html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }
html.has-cursor input { cursor: text; }
html.has-cursor select { cursor: pointer; }
.cursor__dot, .cursor__ring { position: absolute; left: 0; top: 0; will-change: transform; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; }
.cursor__ring i { display: block; width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid #fff; border-radius: 50%; transition: transform 0.45s var(--ease), background 0.3s ease; }
.cursor.is-hover .cursor__ring i { transform: scale(1.75); background: rgba(255, 255, 255, 0.1); }
.cursor.is-down .cursor__ring i { transform: scale(0.8); }

/* ==========================================================================
   Roof findings
   ========================================================================== */

#tags { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; opacity: 0; transition: opacity 0.5s ease; will-change: transform; }
.tag.is-on { opacity: 1; }
.tag.is-left { flex-direction: row-reverse; }
.tag__dot {
  flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; background: rgba(3, 3, 5, 0.55);
  box-shadow: 0 0 0 5px rgba(3, 3, 5, 0.3), 0 0 22px currentColor;
  display: grid; place-items: center;
  font: 600 0px/1 var(--mono); color: #fff; font-style: normal;
}
.tag__line { flex-shrink: 0; width: 0; height: 1px; background: currentColor; transition: width 0.6s var(--ease) 0.12s; }
.tag.is-on .tag__line { width: 28px; }
.tag__box {
  display: flex; flex-direction: column; gap: 4px;
  padding: 9px 13px; border-radius: 6px;
  background: rgba(6, 7, 9, 0.86); border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0; transform: translateX(-8px); transition: opacity 0.5s ease 0.3s, transform 0.6s var(--ease) 0.3s;
}
.tag.is-left .tag__box { transform: translateX(8px); }
.tag.is-on .tag__box { opacity: 1; transform: none; }
.tag b { font: 500 13px/1.2 var(--sans); color: var(--ink); white-space: nowrap; }
.tag em { font: 500 10px/1.2 var(--mono); font-style: normal; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; white-space: nowrap; }
.tag--damage { color: var(--damage); }
.tag--wear { color: var(--wear); }
.tag--good { color: var(--good); }

/* ==========================================================================
   Scenes
   ========================================================================== */

#main { position: relative; z-index: 5; }
.scene { position: fixed; inset: 0; visibility: hidden; pointer-events: none; }
.scene.is-active { visibility: visible; pointer-events: auto; }
.scene.is-leaving { visibility: visible; }
.scene__inner {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: var(--safe-top) max(var(--gutter), var(--rail-w)) var(--safe-bottom) var(--gutter);
}
.content { width: 100%; max-width: 600px; }
.scene--hero .content { max-width: 900px; }

/* Word-by-word titles */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.04em 0.14em; margin: 0 -0.04em -0.14em; }
.w > span { display: inline-block; transform: translate3d(0, 118%, 0); transition: transform 0.4s ease; }
.scene.is-active .w > span { transform: none; transition: transform 1.15s var(--ease) calc(var(--i) * 55ms + 300ms); }
.scene.is-leaving .w > span { transform: translate3d(0, -118%, 0); transition: transform 0.6s cubic-bezier(0.7, 0, 0.84, 0) calc(var(--i) * 18ms); }

/* Supporting elements */
.fx { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity 0.3s ease, transform 0.4s ease; }
.scene.is-active .fx { opacity: 1; transform: none; transition: opacity 0.9s ease var(--d, 300ms), transform 1.15s var(--ease) var(--d, 300ms); }
.scene.is-leaving .fx { opacity: 0; transform: translate3d(0, -14px, 0); transition: opacity 0.35s ease, transform 0.45s ease; }

.kicker {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 26px;
  font: 500 11.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(242, 242, 240, 0.62);
  opacity: 0; transition: opacity 0.3s ease;
}
.scene.is-active .kicker { opacity: 1; transition: opacity 0.8s ease 0.2s; }
.kicker__n { color: var(--ink); }
.kicker__line { width: 32px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease; }
.scene.is-active .kicker__line { transform: none; transition: transform 1s var(--ease) 0.3s; }

.title { margin: 0; font-weight: 500; color: var(--ink); }
h1.title { font-size: clamp(54px, min(7vw, 12.5vh), 128px); letter-spacing: -0.052em; line-height: 0.9; }
h2.title { max-width: 12.5ch; font-size: clamp(40px, min(4.4vw, 8vh), 76px); letter-spacing: -0.046em; line-height: 0.96; }
.soft { color: rgba(242, 242, 240, 0.42); }

.lead { margin: 32px 0 0; max-width: 33ch; font-size: clamp(17px, 1.3vw, 21px); line-height: 1.5; color: #d3d6db; letter-spacing: -0.01em; }
.body { margin: 26px 0 0; max-width: 38ch; font-size: clamp(16px, 1.1vw, 18px); line-height: 1.62; color: var(--body); }

.cta { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 34px; margin-top: 42px; }

.hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px;
  font: 500 10px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3);
}
.scene.is-active .hint.fx { transform: translateX(-50%); }
.hint.fx { transform: translate(-50%, 22px); }
.hint i { position: relative; width: 1px; height: 40px; overflow: hidden; background: rgba(242, 242, 240, 0.18); }
.hint i::after { content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 40%; background: var(--ink); transform: translateY(-100%); animation: cue 2.2s var(--ease-io) infinite; }
.hint__touch { display: none; }
@keyframes cue { to { transform: translateY(250%); } }

.legend { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 26px; font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--body); }
.legend li { display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot--good { background: var(--good); }
.dot--wear { background: var(--wear); }
.dot--damage { background: var(--damage); }

.card {
  background: rgba(8, 9, 12, 0.66);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}

/* Report */
.scene--report .scene__inner { justify-content: space-between; gap: 56px; }
.scene--report .content { max-width: 520px; }
.report { flex: 0 0 auto; width: 400px; padding: 24px 26px 22px; }
.report__head { display: flex; justify-content: space-between; align-items: center; font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.pill { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; }
.report__top { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.gauge { width: 92px; height: 92px; flex-shrink: 0; }
.gauge circle { fill: rgba(242, 242, 240, 0.14); transition: fill 0.3s ease; }
.scene.is-active .gauge circle.on { fill: var(--wear); transition: fill 0.5s ease calc(var(--k) * 30ms + 500ms); }
.report__num { margin: 0; display: flex; align-items: baseline; gap: 6px; font-size: 64px; font-weight: 400; letter-spacing: -0.06em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.report__num small { font: 500 13px/1 var(--mono); letter-spacing: 0.04em; color: var(--ink-3); }
.report__label { margin: 10px 0 0; font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--wear); }
.report__bar { display: flex; gap: 3px; height: 5px; margin-top: 22px; }
.seg { width: var(--w); height: 100%; border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.scene.is-active .seg { transform: none; transition: transform 1.2s var(--ease) calc(0.6s + var(--j) * 0.15s); }
.seg--damage { background: var(--damage); }
.seg--wear { background: var(--wear); }
.seg--good { background: var(--good); }
.report__split { display: flex; justify-content: space-between; margin: 10px 0 0; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.report__list { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--line); }
.report__list li {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
  opacity: 0; transform: translateX(12px); transition: opacity 0.3s ease, transform 0.3s ease;
}
.scene.is-active .report__list li { opacity: 1; transform: none; transition: opacity 0.7s ease calc(0.75s + var(--i) * 0.08s), transform 0.9s var(--ease) calc(0.75s + var(--i) * 0.08s); }
.report__list span { flex-grow: 1; color: var(--ink); }
.report__list em { font: 500 10px/1 var(--mono); font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.report__next { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 0; font-size: 14px; }
.report__next span { font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.report__next b { font-weight: 500; }

/* Platform */
.scene--platform .scene__inner { justify-content: center; }
.scene--platform .content { max-width: 1040px; }
.scene--platform .title { max-width: 18ch; }
.steps { list-style: none; margin: 46px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps li {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px 24px 28px; border-radius: 14px;
  background: rgba(10, 11, 14, 0.62); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition-property: opacity, transform, border-color, background;
}
.steps li::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: var(--good); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease); }
.steps li:hover { border-color: rgba(255, 255, 255, 0.18); background: rgba(14, 16, 20, 0.72); }
.steps li:hover::before { transform: none; }
.steps__n { font: 500 11px/1 var(--mono); letter-spacing: 0.16em; color: var(--ink-3); }
.steps b { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.steps p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--body); }
.for { margin: 28px 0 0; font: 500 11px/1.5 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }

/* Access */
.scene--access .scene__inner { display: grid; grid-template-columns: minmax(0, 580px) minmax(0, 520px); justify-content: space-between; align-content: center; column-gap: 56px; padding-bottom: 128px; }
.scene--access .content { max-width: 580px; }
.scene--access .title { max-width: 16ch; }
.perks { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; font-size: 15px; color: var(--ink-2); }
.perks li { display: flex; align-items: center; gap: 12px; }
.perks li::before { content: ''; flex-shrink: 0; width: 14px; height: 1px; background: rgba(242, 242, 240, 0.4); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; padding: 30px 30px 28px; }
.field { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
.field:focus-within::after { transform: none; }
.field--full { grid-column: 1 / -1; }
label { font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
input, select {
  width: 100%; height: 46px; padding: 0; border: 0; border-radius: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent; color: var(--ink);
  font: 400 16px/1 var(--sans); outline: none;
}
input::placeholder { color: rgba(242, 242, 240, 0.32); }
select { appearance: none; -webkit-appearance: none; padding-right: 22px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 10px) 21px, calc(100% - 5px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
select:invalid { color: rgba(242, 242, 240, 0.4); }
select option { background: #0a0a0b; color: var(--ink); }
[aria-invalid="true"] { border-bottom-color: var(--damage); }
.form__foot { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 16px 22px; margin-top: 4px; }
.form__msg { margin: 0; min-height: 20px; font-size: 14px; color: var(--body); }
.form__msg.is-ok { color: var(--good); }
.form__msg.is-err { color: var(--damage); }
.foot {
  position: absolute; left: var(--gutter); right: max(var(--gutter), var(--rail-w)); bottom: 30px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 24px;
  font: 500 10.5px/1.5 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.foot .link { font: inherit; letter-spacing: inherit; color: var(--ink-2); }
.bigmark { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 64px; width: calc(100% - 2 * var(--gutter)); height: auto; overflow: visible; pointer-events: none; }
.bigmark * { fill: none; stroke: rgba(242, 242, 240, 0.07); stroke-width: 0.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.4s ease; }
.scene.is-active .bigmark * { stroke-dashoffset: 0; transition: stroke-dashoffset 2.6s var(--ease-io) 0.3s; }
.scene.is-active .bigmark :nth-child(2) { transition-delay: 0.55s; }
.scene.is-active .bigmark :nth-child(3) { transition-delay: 0.8s; }

/* ==========================================================================
   Compact layout — phones and portrait screens
   The flight plays in a window at the top; copy sits on black below it.
   ========================================================================== */

html.compact { --gutter: 20px; --pad: 18px; }
html.compact .nav { height: 60px; }
html.compact .nav__logo svg { height: 20px; }
html.compact .nav__links .link { display: none; }
html.compact .nav__links .link--keep { display: inline-flex; font-size: 13px; }
html.compact .nav__links { gap: 18px; }
html.compact .nav .btn .long { display: none; }
html.compact .nav .btn .short { display: inline; }
html.compact .nav .btn--sm { height: 38px; padding: 0 16px; font-size: 13px; }

/* Each chapter's copy sits at the foot of the screen, below the nav. Should a small phone not hold it
   all, the chapter scrolls in its own pane (leaving past either end), never running under the nav or
   the telemetry line. */
html.compact .scene__inner {
  top: 60px; flex-direction: column; align-items: stretch; justify-content: flex-start;
  padding: 16px 20px 50px;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px); mask-image: linear-gradient(180deg, transparent 0, #000 16px);
}
html.compact .scene__inner::-webkit-scrollbar { display: none; }
html.compact .scene__inner > :first-child { margin-top: auto; }
html.compact .kicker { margin-bottom: 14px; font-size: 10.5px; }
html.compact h1.title { font-size: clamp(38px, min(11vw, 6.6vh), 54px); }
html.compact h2.title { max-width: 15ch; font-size: clamp(27px, min(7.6vw, 4.6vh), 36px); line-height: 1; }
html.compact .lead { margin-top: 16px; font-size: 15.5px; line-height: 1.5; }
html.compact .body { margin-top: 14px; font-size: 15px; line-height: 1.55; }
html.compact .cta { margin-top: 22px; gap: 14px 24px; }
html.compact .cta .btn { height: 50px; padding: 0 22px; }
html.compact .hint { display: none; }
html.compact .legend { margin-top: 16px; gap: 10px 20px; font-size: 10px; }

/* Analysis on a phone: the markers' findings, spelled out under the roof; each lights up as the scan
   reaches its marker. They stand in for the paragraph and the legend. */
.finds { display: none; }
html.compact #analysis .body, html.compact #analysis .legend { display: none; }
html.compact .finds { display: block; list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
html.compact .finds li {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
  opacity: 0.22; transition: opacity 0.5s ease;
}
html.compact .finds li.is-on { opacity: 1; }
html.compact .finds b {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--c); background: rgba(3, 3, 5, 0.55); box-shadow: 0 0 12px -2px var(--c);
  font: 600 10px/1 var(--mono); color: var(--ink);
}
html.compact .finds span { flex-grow: 1; color: var(--ink); }
html.compact .finds em { font: 500 10px/1 var(--mono); font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.finds--damage { --c: var(--damage); }
.finds--wear { --c: var(--wear); }
.finds--good { --c: var(--good); }

html.compact .scene--report .scene__inner { gap: 14px; }
html.compact .scene--report .body { display: none; }
html.compact .report { width: 100%; padding: 16px 16px 14px; border-radius: 14px; }
html.compact .report__list { display: none; } /* the findings were listed under the roof a chapter earlier */
html.compact .report__top { margin-top: 12px; gap: 14px; }
html.compact .gauge { width: 68px; height: 68px; }
html.compact .report__num { font-size: 48px; }
html.compact .report__bar { margin-top: 14px; }
html.compact .report__list { margin-top: 12px; }
html.compact .report__list li { padding: 8px 0; font-size: 13px; }
html.compact .report__next { margin-top: 12px; font-size: 13px; }

html.compact .scene--platform .scene__inner > :first-child { margin-bottom: auto; } /* centred */
html.compact .steps { grid-template-columns: 1fr; gap: 10px; margin-top: 22px; }
html.compact .steps li { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 6px 12px; padding: 15px 18px 16px; }
html.compact .steps p { grid-column: 1 / -1; }
html.compact .steps b { font-size: 18px; }
html.compact .steps p { font-size: 14px; }
html.compact .for { margin-top: 18px; font-size: 10px; }

/* The form scrolls in its own pane below the nav: copy dissolves at the pane's top edge instead of
   sliding under the logo and buttons. */
html.compact .scene--access .scene__inner { display: block; padding: 26px 20px 36px; }
html.compact .scene--access .content { max-width: none; }
html.compact .perks { margin-top: 20px; font-size: 14px; }
html.compact .form { grid-template-columns: 1fr; gap: 16px; margin-top: 26px; padding: 20px 18px 20px; }
html.compact .foot { position: static; margin-top: 30px; flex-direction: column; align-items: flex-start; gap: 8px; }
html.compact .bigmark { bottom: auto; top: 50%; opacity: 0.6; }

html.compact .hud__top, html.compact .hud__br, html.compact .hud__corner { display: none; }
html.compact .hud__bl { bottom: 16px; gap: 14px; font-size: 9.5px; }

html.compact .tag__line, html.compact .tag__box { display: none; }
html.compact .tag__dot { width: 22px; height: 22px; font-size: 10px; box-shadow: 0 0 0 4px rgba(3, 3, 5, 0.35), 0 0 16px currentColor; }

/* Short phones (Safari's toolbar takes ~150px of the screen): tighter type and spacing, so each
   chapter's copy and the picture above it still fit without anything overlapping. */
@media (max-height: 640px) {
  html.compact .kicker { margin-bottom: 10px; }
  html.compact h1.title { font-size: clamp(34px, 10vw, 44px); }
  html.compact h2.title { font-size: clamp(25px, 7vw, 30px); }
  html.compact .lead { margin-top: 12px; font-size: 14.5px; line-height: 1.45; }
  html.compact .body { margin-top: 10px; font-size: 14px; line-height: 1.5; }
  html.compact .cta { margin-top: 16px; }
  html.compact .cta .btn { height: 46px; }
  html.compact .finds { margin-top: 12px; }
  html.compact .finds li { padding: 6px 0; font-size: 13.5px; }
  html.compact .finds b { width: 20px; height: 20px; font-size: 9.5px; }
  html.compact .report { padding: 13px 14px 12px; }
  html.compact .report__top { margin-top: 10px; gap: 12px; }
  html.compact .gauge { width: 56px; height: 56px; }
  html.compact .report__num { font-size: 42px; }
  html.compact .report__bar { margin-top: 12px; }
  html.compact .report__next { margin-top: 10px; }
  html.compact .steps { margin-top: 14px; gap: 8px; }
  html.compact .steps li { padding: 11px 14px 12px; gap: 4px 10px; }
  html.compact .steps b { font-size: 16px; }
  html.compact .steps p { font-size: 13px; line-height: 1.45; }
  html.compact .for { margin-top: 12px; line-height: 1.4; }
}
@media (max-height: 580px) {
  html.compact .scene__inner { padding-bottom: 44px; }
  html.compact .hud__bl { bottom: 14px; }
  html.compact .steps li { padding: 10px 14px 11px; }
  html.compact .steps p { font-size: 12.5px; }
}

/* Touch devices: swap the hint wording */
html.touch .hint__desk { display: none; }
html.touch .hint__touch { display: inline; }

/* Low-power devices: no blur, no grain */
html.lite .card, html.lite .steps li, html.lite .btn--ghost { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.lite .card, html.lite .steps li { background: rgba(10, 11, 14, 0.92); }
html.lite .grain { display: none; }
html.lite .plane .pd { mix-blend-mode: normal; }

/* Reduced motion: keep it readable, drop the movement */
html.calm .grain, html.calm .hint i::after { animation: none; }
html.calm .w > span, html.calm .fx, html.calm .kicker__line, html.calm .seg, html.calm .report__list li { transition: opacity 0.3s ease !important; transform: none !important; }
html.calm .loader__mark circle { animation: none; opacity: 1; transform: none; }
