:root {
  --bg: #f5f8fc;
  --bg-rgb: 245 248 252;
  --surface: #ffffff;
  --ink: #1b2435;
  --ink-2: #3d495d;
  --mute: #6a778b;
  --line: #a9cbea;
  --line-soft: #dde7f2;
  --navy: #1e3f78;
  --blue: #3f7fd0;
  --red: #d63b2b;
  --arrow: #8d939c;
  --green: #79c983;
  --a: #1e3f78;
  --b: #8db5e3;
  --glow-a: #dde9f8;
  --glow-b: #e8e5f8;
  --shadow: 0 1px 0 rgba(255 255 255 / .9) inset, 0 14px 32px -18px rgba(29 53 87 / .32), 0 2px 6px -2px rgba(29 53 87 / .1);
  --shadow-lift: 0 1px 0 rgba(255 255 255 / .9) inset, 0 22px 40px -20px rgba(29 53 87 / .38), 0 3px 8px -2px rgba(29 53 87 / .12);
  --sans: Nunito, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --display: var(--sans);
  --serif: "Times New Roman", "STIX Two Text", Times, serif;
  --gut: clamp(20px, 4vw, 56px);
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --glide: cubic-bezier(.22, 1.12, .36, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-rgb: 11 18 32;
  --surface: #15223a;
  --ink: #e3ebf6;
  --ink-2: #b8c5d8;
  --mute: #8d9bb0;
  --line: #3f6797;
  --line-soft: #22324b;
  --navy: #a6c8ef;
  --blue: #6aa5ee;
  --red: #ff7a6b;
  --arrow: #6c7788;
  --green: #4f9f62;
  --a: #a6c8ef;
  --b: #4d78ac;
  --glow-a: #12233c;
  --glow-b: #191d3a;
  --shadow: 0 1px 0 rgba(255 255 255 / .05) inset, 0 16px 36px -18px rgba(0 0 0 / .6);
  --shadow-lift: 0 1px 0 rgba(255 255 255 / .06) inset, 0 22px 44px -20px rgba(0 0 0 / .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:root[data-motion="reduced"] { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }
.num { font-variant-numeric: tabular-nums; font-weight: 900; letter-spacing: -.02em; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gut); }
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.u { text-decoration: underline; text-decoration-thickness: .085em; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--blue); color: #fff; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 50; padding: 8px 12px; background: var(--navy); color: var(--bg); border-radius: 10px; }
.skip:focus { top: 12px; }

/* Navigation */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 68px; padding: 0 var(--gut);
  transition: background .4s, border-color .4s;
  border-bottom: 1.5px solid transparent;
}
.nav.is-solid { background: rgba(var(--bg-rgb) / .82); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-color: var(--line-soft); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 16px; letter-spacing: .01em; color: var(--navy); justify-self: start; }
.brand svg { width: 28px; height: 28px; }
.brand rect { fill: var(--navy); }
.brand path { fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nav-links { position: relative; display: flex; gap: 6px; font-size: 15px; font-weight: 800; }
.nav-links a { position: relative; z-index: 1; color: var(--mute); padding: 6px 14px; border-radius: 99px; transition: color .3s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.is-active { color: var(--navy); }
/* The current section's pill slides from link to link. */
.nav-ink { position: absolute; z-index: 0; left: 0; top: 0; height: 100%; width: 0; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); opacity: 0; transition: transform .6s var(--glide), width .6s var(--glide), opacity .3s; pointer-events: none; }
.nav-tools { display: flex; align-items: center; gap: 8px; justify-self: end; }
.tool { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-soft); transition: box-shadow .2s, color .2s, translate .5s var(--glide), scale .18s var(--ease); }
.tool:hover { color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tool-lang { font: 800 13px var(--sans); }
.pill { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; height: 38px; padding: 0 18px; border-radius: 99px; background: var(--navy); color: var(--bg); font-size: 14px; font-weight: 900; box-shadow: 0 8px 18px -10px rgba(30 63 120 / .7); transition: transform .35s var(--spring), translate .5s var(--glide), scale .18s var(--ease); }
.pill:hover { transform: translateY(-2px); }
/* The Demo button is wide, and its letters breathe in turn: a small rise and swell, then rest. */
.pill { min-width: 132px; justify-content: center; padding: 0 30px; letter-spacing: .03em; }
.breath b { display: inline-block; font-weight: inherit; transform-origin: 50% 80%; animation: letter-breathe 3.4s cubic-bezier(.45, 0, .3, 1) infinite; animation-delay: calc(var(--i) * .13s); }
@keyframes letter-breathe {
  0%, 58%, 100% { transform: none; }
  18% { transform: translateY(-2.5px) scale(1.14); }
  32% { transform: translateY(.5px) scale(.97); }
  42% { transform: translateY(-.5px) scale(1.02); }
}
:root[data-motion="reduced"] .breath b { animation: none; }

/* Scene */
.scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; display: block; }
.scene-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--bg-rgb) / .8) 0%, rgba(var(--bg-rgb) / .45) 22%, rgba(var(--bg-rgb) / 0) 36%);
}
.no-webgl .scene { display: none; }

main { position: relative; z-index: 2; }

/* Hero: the title column beside the assembled figure, which can be dragged. Its opaque ground sits right under the
   figure, so nothing of the tour scene behind it shows through. */
.hero {
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; padding: 96px var(--gut) 0; position: relative;
  background:
    radial-gradient(40% 46% at 74% 16%, var(--glow-a), transparent 72%),
    radial-gradient(38% 40% at 52% 72%, var(--glow-b), transparent 72%),
    radial-gradient(34% 40% at 24% 50%, color-mix(in srgb, var(--glow-a) 55%, var(--bg)), transparent 75%),
    var(--bg);
}
.hero-copy { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 500px; padding: 24px 0 32px; }
.hero-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font: 800 12.5px/1.6 var(--sans); letter-spacing: .06em; color: var(--blue); }
.hero-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(63 127 208 / .16); }
.hero-title { margin: 0 0 32px -.03em; font: 900 clamp(60px, 6.6vw, 112px)/.95 var(--sans); letter-spacing: -.035em; color: var(--navy); }
.hero-title > span { display: block; white-space: nowrap; }
/* The three words breathe in turn: a slight rise, a small bounce, then rest. */
.hero-title .w { display: inline-block; transform-origin: 50% 85%; animation: breathe 5.2s cubic-bezier(.45, 0, .3, 1) infinite; }
.hero-title .w2 { animation-delay: .36s; }
.hero-title .w3 { animation-delay: .72s; }
@keyframes breathe {
  0%, 54%, 100% { transform: none; }
  15% { transform: translateY(-.05em) scale(1.022); }
  28% { transform: translateY(.012em) scale(.996); }
  38% { transform: translateY(-.012em) scale(1.004); }
}
:root[data-motion="reduced"] .hero-title .w { animation: none; }
.hero-title em { font-style: normal; color: var(--blue); }
.hero-title i { font-style: normal; font-weight: 400; color: var(--mute); }
.hero-title b { font-weight: inherit; color: var(--blue); }
.hero-intro { position: relative; isolation: isolate; max-width: 400px; }
.hero-intro::before {
  content: ""; position: absolute; z-index: -1; inset: -20px -110px -22px -26px; border-radius: 24px; pointer-events: none;
  background: linear-gradient(110deg, rgba(255 255 255 / .8), rgba(228 239 250 / .45) 62%, transparent);
  border-top: 1px solid rgba(255 255 255 / .9); box-shadow: 0 18px 48px rgba(80 116 147 / .07);
  -webkit-backdrop-filter: blur(22px) saturate(1.15); backdrop-filter: blur(22px) saturate(1.15);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 63%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 63%, transparent);
}
:root[data-theme="dark"] .hero-intro::before { background: linear-gradient(110deg, rgba(35 57 77 / .44), rgba(32 52 73 / .21) 62%, transparent); border-top-color: rgba(185 220 246 / .19); box-shadow: 0 20px 56px rgba(2 8 20 / .12); }
.hero-lede { margin: 0 0 12px; font: 800 clamp(20px, 1.7vw, 26px)/1.55 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.hero-desc { max-width: 340px; font-size: 15px; font-weight: 600; line-height: 1.8; color: var(--mute); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-steps { display: flex; align-items: center; gap: 12px; margin-top: 30px; font: 800 12.5px/1.6 var(--sans); letter-spacing: .04em; color: var(--mute); }
.hero-steps i { width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--line), var(--blue)); }
.hero-figure { position: absolute; z-index: 1; inset: 0; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.hero-figure.is-dragging .hero-canvas { cursor: grabbing; }
.hero-fallback { position: absolute; top: 92px; left: 42%; width: 52%; height: calc(100% - 212px); object-fit: contain; pointer-events: none; }
.hero-figure.is-webgl .hero-fallback { display: none; }
.hero-figure.is-static .hero-canvas { display: none; }
.hero-figure.is-static .hero-fallback { display: block; }
.hero-caption { position: absolute; z-index: 2; top: 84px; left: 68%; transform: translateX(-50%); display: flex; align-items: baseline; gap: 14px; white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--mute); pointer-events: none; }
.hero-caption .mono { color: var(--blue); font-weight: 500; letter-spacing: .14em; }
.hero-caption a { pointer-events: auto; color: var(--navy); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
.hero-hint { position: absolute; z-index: 2; bottom: 84px; left: 68%; transform: translateX(-50%); font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--mute); white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.is-lifted .hero-hint { opacity: 0; }
.hero-bottom { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; height: 62px; border-top: 1.5px solid var(--line-soft); font: 800 12.5px var(--sans); letter-spacing: .04em; color: var(--mute); }
.hero-bottom a:hover { color: var(--navy); }
.hero-scroll { display: flex; align-items: center; gap: 12px; }
.hero-scroll i { position: relative; width: 15px; height: 24px; border: 1.8px solid currentColor; border-radius: 9px; }
.hero-scroll i::after { content: ""; position: absolute; top: 4px; left: 50%; width: 2px; height: 5px; margin-left: -1px; border-radius: 1px; background: var(--blue); animation: cue 2s ease-in-out infinite; }
@keyframes cue { to { transform: translateY(8px); opacity: 0; } }
:root[data-motion="reduced"] .hero-scroll i::after { animation: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 24px; border-radius: 16px; font-size: 16px; font-weight: 900; transition: transform .4s var(--spring), box-shadow .3s, background .2s, color .2s, translate .5s var(--glide), scale .18s var(--ease); }
.btn i { font-style: normal; transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-3px); }
:is(.btn, .pill, .tool, .dock, .round:not(:disabled)):active { scale: .96; }
/* A soft sheen crosses the solid buttons on hover. */
.btn-solid, .pill { position: relative; }
:is(.btn-solid, .pill, .dock) { overflow: hidden; isolation: isolate; }
:is(.btn-solid, .pill, .dock)::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(105deg, transparent 32%, rgba(255 255 255 / .22) 50%, transparent 68%); transform: translateX(-110%); transition: transform .9s var(--ease); pointer-events: none; }
:is(.btn-solid, .pill, .dock):hover::after { transform: translateX(110%); }
.btn-solid:hover { box-shadow: 0 20px 32px -16px rgba(30 63 120 / .85); }
.btn-solid { background: var(--navy); color: var(--bg); box-shadow: 0 14px 26px -14px rgba(30 63 120 / .8); }
.btn-line { background: var(--surface); color: var(--navy); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.btn-line:hover { box-shadow: var(--shadow-lift); }
.btn-small { height: 40px; padding: 0 16px; gap: 8px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: .45; transform: none; cursor: default; }
.round { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--navy); font-weight: 900; box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); transition: transform .35s var(--spring), opacity .2s, translate .5s var(--glide), scale .18s var(--ease); }
.round:hover:not(:disabled) { transform: translateY(-2px); }
.round:disabled { opacity: .35; cursor: default; }
.tabs { position: relative; display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 99px; color: var(--mute); font-size: 14.5px; font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--line-soft); background: var(--surface); transition: color .2s, background .2s, box-shadow .2s; }
.tabs button span { font: 500 11px var(--mono); color: var(--blue); }
.tabs button:hover { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.tabs button[aria-selected="true"] { background: var(--navy); color: var(--bg); box-shadow: 0 10px 20px -12px rgba(30 63 120 / .7); }
/* With the sliding ink in place, the selected tab is drawn by the ink underneath it. */
.tabs button { position: relative; z-index: 1; transition: color .3s, box-shadow .3s, translate .5s var(--glide), scale .18s var(--ease); }
.tabs.has-ink button { background: none; }
.tabs.has-ink button[aria-selected="true"] { box-shadow: none; transition-delay: .08s; }
.tab-ink { position: absolute; z-index: 0; left: 0; top: 0; border-radius: 99px; background: var(--navy); box-shadow: 0 10px 20px -12px rgba(30 63 120 / .7); transition: transform .55s var(--glide), width .55s var(--glide), height .3s var(--ease); pointer-events: none; }
.tabs button:active { scale: .96; }
.tabs button[aria-selected="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.kicker { display: block; margin-bottom: 14px; color: var(--blue); letter-spacing: .14em; }
.lede { font-size: 18px; font-weight: 600; line-height: 1.75; color: var(--ink-2); }
.footnote { margin-top: 18px; font-size: 13.5px; font-weight: 600; color: var(--mute); }
.link { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; color: var(--navy); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1.5px; text-underline-offset: .3em; transition: text-decoration-color .2s; width: fit-content; }
.link:hover { text-decoration-color: var(--navy); }

/* Strip and overview */
.strip, .overview, .replay, .experiments, .airline, .resources { position: relative; background: var(--bg); }
/* Soft glows behind each section drift slower than the page, giving the sections some depth. */
.overview, .replay, .experiments, .airline, .resources { overflow: clip; }
:is(.overview, .replay, .experiments, .airline, .resources) > .wrap { position: relative; z-index: 1; }
.sec-glow { position: absolute; z-index: 0; width: min(56vw, 760px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--glow-a), transparent); pointer-events: none; }
.sec-glow.alt { width: min(44vw, 600px); background: radial-gradient(closest-side, var(--glow-b), transparent); }
.strip { padding: 34px 0; border-block: 1.5px solid var(--line-soft); }
.strip-inner { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: center; gap: 18px; }
.strip .kicker { margin: 0 12px 0 0; }
.stat { display: flex; align-items: baseline; gap: 14px; padding: 18px 24px; }
.stat b { font-size: clamp(34px, 3.4vw, 50px); line-height: 1; color: var(--navy); }
.stat span { font-size: 14px; font-weight: 800; color: var(--mute); }
.overview { padding: clamp(88px, 13vh, 150px) 0; }
.overview-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 90px); align-items: start; }
.overview .sec-head h2 { font-size: clamp(34px, 3.6vw, 56px); }
.ideas { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; }
.ideas li { display: flex; gap: 20px; padding: 20px 24px; transition: transform .4s var(--spring), box-shadow .3s; }
.ideas li:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.ideas .mono { color: var(--blue); padding-top: 4px; }
.ideas h3 { font-size: 19px; font-weight: 900; color: var(--navy); margin-bottom: 6px; }
.ideas p { font-size: 15px; font-weight: 600; line-height: 1.65; color: var(--mute); }

/* Architecture journey */
.journey { position: relative; }
.journey-head { position: relative; z-index: 2; padding: clamp(96px, 14vh, 150px) var(--gut) 0; max-width: 760px; }
.journey-head h2 { font-size: clamp(34px, 3.8vw, 56px); font-weight: 900; line-height: 1.08; letter-spacing: -.02em; color: var(--navy); }
.stage { min-height: 120vh; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gut); }
.stage > * { will-change: opacity, transform; }
.stage-card { max-width: 430px; padding: 26px 30px 30px; background: rgba(var(--bg-rgb) / .72); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage-no { color: var(--blue); font-weight: 500; margin-bottom: 12px; }
.stage h2 { font-size: clamp(28px, 2.7vw, 38px); font-weight: 900; line-height: 1.15; letter-spacing: -.015em; color: var(--navy); text-decoration: underline; text-decoration-thickness: .075em; text-underline-offset: .22em; }
.stage-card > p:not(.stage-no) { margin-top: 16px; font-size: 16.5px; line-height: 1.7; color: var(--ink-2); }
.stage-card > p.stage-note:not(.stage-no) { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--line-soft); font-size: 13.5px; line-height: 1.65; color: var(--mute); }
.stage-end { min-height: 150vh; }
.stage-end .stage-card { max-width: 540px; }
.stage-end h2 { font-size: clamp(28px, 2.7vw, 40px); text-decoration: none; }
.stage-end .link { margin-top: 22px; }
.rail { position: fixed; left: var(--gut); bottom: 30px; z-index: 3; list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; opacity: 0; transition: opacity .4s; pointer-events: none; }
.rail.is-on { opacity: 1; }
.rail li { width: 9px; height: 9px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: width .45s var(--spring), background .3s; }
.rail li.is-on { width: 28px; border-radius: 9px; background: var(--navy); box-shadow: none; }

/* Section shells */
.replay { padding: clamp(96px, 14vh, 160px) 0 clamp(72px, 11vh, 128px); box-shadow: 0 -120px 120px -40px var(--bg); }
.experiments, .airline, .resources { padding: clamp(72px, 11vh, 128px) 0; }
.sec-head { margin-bottom: clamp(32px, 5vh, 56px); }
.sec-head h2 { font-size: clamp(38px, 4.8vw, 72px); font-weight: 900; line-height: 1.06; letter-spacing: -.025em; color: var(--navy); }
.sec-split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 18px 48px; }
.sec-split > p { max-width: 420px; font-size: 15.5px; font-weight: 600; line-height: 1.7; color: var(--mute); }
.card h3 { font-size: 20px; font-weight: 900; color: var(--navy); margin-bottom: 14px; }

/* Case replay */
.replay-deck { position: relative; }
.replay-card { position: relative; padding: 18px; }
/* While the steps are dealt, the cards still to come peek out above the card as a short stack. */
.deck-sheet { position: absolute; inset: 0; border-radius: var(--radius); background: var(--surface); border: 1.5px solid var(--line); box-shadow: var(--shadow); opacity: 0; transition: opacity .45s var(--ease), transform .6s var(--spring); pointer-events: none; }
.replay-deck:is([data-left="1"], [data-left="2"]) .deck-a { opacity: .85; transform: translateY(-12px) scale(.975); }
.replay-deck[data-left="2"] .deck-b { opacity: .55; transform: translateY(-24px) scale(.95); }
.step-in.is-dealt { animation: dealt .5s var(--ease) both; }
@keyframes dealt { from { opacity: 0; transform: translateX(56px) rotate(1.2deg); } }
.replay-card > .tabs { padding: 4px 4px 18px; border-bottom: 1.5px dashed var(--line-soft); }
.replay-content { padding: 30px 14px 22px; }
.replay-content .step-in { height: 100%; }
.replay-content.is-measuring .step-in { animation: none; }
/* The cases sit in a list beside the replay. */
.replay-card.has-cases { display: grid; grid-template-columns: 228px minmax(0, 1fr); column-gap: 20px; }
.case-main { min-width: 0; display: flex; flex-direction: column; }
.case-main > .replay-content { flex: 1 0 auto; }
.case-list { display: flex; flex-direction: column; gap: 4px; padding: 2px 18px 2px 0; border-right: 1.5px dashed var(--line-soft); }
.case-item { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 11px 10px; border-radius: 14px; text-align: left; transition: background .35s var(--ease), box-shadow .35s, translate .5s var(--glide), scale .18s var(--ease); }
.case-item:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.case-item:active { scale: .97; }
.case-item .case-tag { display: grid; place-items: center; height: 30px; border-radius: 9px; font-size: 10.5px; letter-spacing: .02em; color: var(--blue); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); transition: background .35s, color .35s; }
.case-item b { font-size: 14px; font-weight: 900; line-height: 1.3; color: var(--navy); transition: color .35s; }
.case-item[aria-current="true"] { background: var(--navy); box-shadow: 0 12px 22px -14px rgba(30 63 120 / .8); }
.case-item[aria-current="true"] b { color: var(--bg); }
.case-item[aria-current="true"] .case-tag { color: var(--bg); background: color-mix(in srgb, var(--bg) 14%, transparent); box-shadow: none; }
.case-pd { position: relative; padding: 22px 22px 20px; }
.case-query { max-height: 200px; overflow: auto; font: 400 13px/1.75 var(--mono); color: var(--ink-2); }
.case-query p { white-space: pre-line; }
.case-query p + p { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--line-soft); }
.case-query b { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 8px; font: 800 11.5px var(--sans); color: var(--bg); background: var(--blue); }
.case-demo { margin-top: 22px; }
.case-file { color: var(--mute); }
.case-doc { max-height: 330px; overflow: auto; padding: 18px 24px; border-radius: 20px; background: var(--bg); border: 1.5px solid var(--line-soft); font-size: 14.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; }
.case-doc .markdown { white-space: normal; }
.case-doc :is(h1, h2, h3, h4, h5, h6) { margin: 16px 0 6px; font-size: 15.5px; font-weight: 900; color: var(--navy); }
.case-doc .markdown > :first-child { margin-top: 0; }
.case-doc :is(p, ul, ol) { margin: 6px 0; }
.case-doc :is(ul, ol) { padding-left: 1.3em; }
.case-doc code { font: 500 12.5px var(--mono); }
.case-doc .katex-display { margin: 8px 0; overflow-x: auto; overflow-y: hidden; }
.solution-blocks.is-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.solution-blocks.is-pair .solution-value { font-size: clamp(26px, 2.4vw, 34px); }
.solution-block .case-description { margin-top: 4px; font-size: 14px; }
.var-chart { display: flex; flex-direction: column; padding: 18px 20px; border-radius: 22px; background: var(--bg); border: 1.5px solid var(--line-soft); }
.var-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 14px; color: var(--mute); }
.var-head > .mono:first-child { color: var(--blue); }
.var-list { max-height: 300px; overflow: auto; display: grid; align-content: start; gap: 9px; }
.var-row { display: grid; grid-template-columns: minmax(0, 52%) minmax(0, 1fr); align-items: center; gap: 12px; }
.var-name { overflow: hidden; font: 500 12px var(--mono); color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; }
.var-bars { display: grid; gap: 4px; }
.var-bar { display: grid; grid-template-columns: minmax(0, 1fr) 70px; align-items: center; gap: 10px; }
.var-bar .track { height: 10px; }
.var-bar b { font: 800 12.5px var(--sans); text-align: right; font-variant-numeric: tabular-nums; color: var(--navy); }
.var-bar.b .fill { background: var(--b); }
.replay-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 6px 4px; border-top: 1.5px dashed var(--line-soft); }
.replay-bar p { display: flex; gap: 14px; color: var(--mute); }
.replay-bar p span:last-child { font-family: var(--sans); font-weight: 800; color: var(--navy); letter-spacing: 0; }
.replay-buttons { display: flex; align-items: center; gap: 10px; }
.step-in { animation: step-in .6s var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(14px); } }
:root[data-motion="reduced"] .step-in { animation: none; }
/* The card has one height for all six steps; the right-hand panel of each step fills it. */
.case-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); height: 100%; }
.case-grid > :first-child { align-self: start; }
.case-grid > :last-child { min-height: 0; }
.case-eyebrow { display: block; margin-bottom: 10px; color: var(--blue); letter-spacing: .14em; }
.card .case-title { margin: 0; font-size: clamp(26px, 2.6vw, 38px); font-weight: 900; line-height: 1.18; letter-spacing: -.015em; color: var(--navy); text-decoration: underline; text-decoration-thickness: .075em; text-underline-offset: .22em; }
.case-description { margin-top: 16px; font-size: 15.5px; font-weight: 600; line-height: 1.75; color: var(--ink-2); }
.case-mechanism { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 8%, transparent); font-size: 14px; font-weight: 700; color: var(--navy); }
.case-stats { display: flex; gap: 34px; margin-top: 22px; }
.case-stats b { display: block; font-size: 36px; line-height: 1; color: var(--navy); }
.case-stats small { font-size: 13px; font-weight: 800; color: var(--mute); }
.upload { position: relative; display: grid; align-content: center; gap: 12px; padding: 40px 18px 18px; border: 2px dashed var(--green); border-radius: 26px; }
.upload-tag { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); font-size: 19px; font-weight: 900; color: var(--navy); white-space: nowrap; }
.upload-tag svg { width: 34px; height: 24px; fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; }
.files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.files .file { position: relative; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 14px 13px; border-radius: 16px; background: var(--bg); border: 1.5px solid var(--line-soft); transition: border-color .2s, transform .35s var(--spring); }
.files .tag { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font: 600 10.5px var(--mono); color: var(--blue); }
.files b { display: block; font: 600 12.5px/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.files small { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; line-height: 1.45; color: var(--mute); }
.qa { position: absolute; top: -24px; right: 18px; width: 58px; height: 50px; filter: drop-shadow(0 6px 8px rgba(29 53 87 / .2)); }
.qa-q { fill: #d9503f; }
.qa-a { fill: #6d93bc; }
.qa text { fill: #fff; font: 900 17px var(--sans); text-anchor: middle; }
.type-board { position: relative; display: grid; place-items: center; align-content: center; gap: 22px; padding: 34px 24px; border-radius: 24px; background: var(--bg); border: 1.5px solid var(--line-soft); }
.type-result { display: grid; justify-items: center; gap: 6px; padding: 20px 34px; border-radius: 22px; background: var(--navy); color: var(--bg); box-shadow: 0 16px 30px -16px rgba(30 63 120 / .8); }
.type-result b { font-size: 52px; line-height: 1; font-weight: 900; }
.type-result small { font: 500 11px var(--mono); letter-spacing: .14em; opacity: .8; }
.tokens { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tokens span { padding: 7px 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-soft), 0 4px 10px -6px rgba(29 53 87 / .3); font-size: 14px; font-weight: 900; color: var(--mute); }
.tokens .is-on { color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.data-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.select { height: 40px; padding: 0 38px 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233f7fd0' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center; color: var(--ink); font: 500 13px var(--mono); appearance: none; }
.case-data, .case-data > #case-table { display: flex; flex-direction: column; }
.case-data > #case-table { flex: 1 1 0; min-height: 0; }
.table-scroll { max-height: 300px; overflow: auto; border-radius: 16px; border: 1.5px solid var(--line-soft); background: var(--bg); }
.data-table { width: 100%; border-collapse: collapse; font: 500 12.5px var(--mono); }
.data-table th, .data-table td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.data-table thead th { position: sticky; top: 0; background: var(--surface); color: var(--navy); font: 900 12.5px var(--sans); }
.data-table tbody th { text-align: left; color: var(--navy); font-weight: 600; }
.code-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.code-toolbar .switch button { white-space: nowrap; }
.code-toolbar .mono { color: var(--blue); }
.code-step { display: flex; flex-direction: column; height: 100%; }
.code-step .footnote { margin-top: 12px; }
.code { max-height: 330px; overflow: auto; margin: 0; padding: 20px 22px; border-radius: 20px; background: #1b2331; color: #e6edf6; font: 400 13px/1.7 var(--mono); box-shadow: var(--shadow); }
.code .ln { display: inline-block; width: 2.6em; color: #5f6d82; user-select: none; }
.code .kw { color: #8fb8ff; }
.code .str { color: #ffd479; }
.code .com { color: #7fe0a8; }
.solution-value { margin-top: 8px; font-size: clamp(36px, 3.6vw, 52px); line-height: 1.05; font-weight: 900; color: var(--red); font-variant-numeric: tabular-nums; }
.solution-label { margin-top: 18px; font: 500 11.5px var(--mono); letter-spacing: .1em; color: var(--mute); }
.checks { display: grid; gap: 8px; margin-top: 18px; }
.checks span { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.checks span::before { content: "✓"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); font-size: 12px; font-weight: 900; }
/* Once the card has its height, the long panels grow into the room left in it. */
.replay-content:not(.is-measuring) .case-data .table-scroll, .replay-content:not(.is-measuring) .code-step :is(.code, .case-doc), .replay-content:not(.is-measuring) .var-list { flex: 1 1 0; min-height: 0; max-height: none; }

/* Experiments */
.study-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.study-card { padding: clamp(22px, 3vw, 36px); }
.study-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 14px 40px; }
.study-head h3 { font-size: clamp(22px, 2.2vw, 30px); margin-bottom: 8px; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .22em; }
.study-head p { max-width: 640px; font-size: 15px; font-weight: 600; line-height: 1.7; color: var(--mute); }
.legend { display: flex; gap: 18px; font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 10px; border-radius: 5px; background: var(--a); }
.sw-b { background: var(--b); }
.study-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 0 18px; }
.study-toolbar .mono { color: var(--mute); }
.switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line-soft); }
.switch button { height: 32px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 800; color: var(--mute); }
.switch button[aria-pressed="true"] { background: var(--navy); color: var(--bg); }
.big-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.big-score { padding: 24px 26px; border-radius: 22px; background: var(--bg); border: 1.5px solid var(--line-soft); }
.big-score .mono { color: var(--mute); }
.big-score strong { display: block; margin-top: 10px; font-size: clamp(56px, 7vw, 110px); line-height: .92; font-weight: 900; letter-spacing: -.04em; color: var(--a); font-variant-numeric: tabular-nums; }
.count { display: inline-block; }
.big-score strong small { font-size: .32em; letter-spacing: 0; color: var(--mute); margin-left: .06em; }
.big-score > span { display: block; margin-top: 6px; font: 500 13px var(--mono); color: var(--mute); }
.big-score.oss strong { color: var(--b); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11px, 1fr)); gap: 4px; margin-top: 18px; }
.tiles i { aspect-ratio: 1; border-radius: 3px; background: var(--a); opacity: 0; transform: scale(.4); transition: opacity .4s var(--ease), transform .5s var(--spring); transition-delay: calc(var(--i) * 6ms); }
.oss .tiles i { background: var(--b); }
.tiles i.miss { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.is-in .tiles i, :root[data-motion="reduced"] .tiles i { opacity: 1; transform: none; }
.tile-key { margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--mute); }
.bar-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.bar-group { padding: 18px 20px 20px; border-radius: 20px; background: var(--bg); border: 1.5px solid var(--line-soft); }
.bar-group h4 { margin: 0 0 12px; font-size: 15.5px; font-weight: 900; color: var(--navy); }
.bar { display: grid; grid-template-columns: 92px 1fr 74px; align-items: center; gap: 10px; margin-top: 8px; }
.bar .who { font-size: 12.5px; font-weight: 800; color: var(--mute); }
.track { position: relative; height: 12px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: var(--a); transition: width 1.2s var(--ease); }
.fill.ext { background: transparent; border: 1.5px solid var(--a); border-left: 0; border-radius: 0 6px 6px 0; }
.bar.b .fill { background: var(--b); }
.bar.b .fill.ext { background: transparent; border-color: var(--b); }
.val { font: 900 14px var(--sans); text-align: right; font-variant-numeric: tabular-nums; color: var(--a); }
.val small { display: block; font: 500 10.5px var(--mono); color: var(--mute); }
.bar.b .val { color: var(--mute); }
.repair { padding: 22px 24px; border-radius: 22px; background: var(--bg); border: 1.5px solid var(--line-soft); }
.repair-score { display: flex; align-items: baseline; gap: 14px; margin: 8px 0 14px; font-weight: 900; color: var(--navy); }
.repair-score .before { font-size: 40px; color: var(--mute); }
.repair-score .after { font-size: 56px; line-height: 1; }
.repair-score small { font-size: 18px; color: var(--mute); }
.repair.b .repair-score .after { color: var(--b); }
.repair .track { height: 14px; }
.study-foot { margin-top: 24px; padding-top: 18px; border-top: 1.5px dashed var(--line-soft); display: grid; gap: 12px; }
.study-foot > p { font-size: 13.5px; font-weight: 600; line-height: 1.7; color: var(--mute); }
.sources { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.sources a { font-size: 13px; font-weight: 800; color: var(--navy); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .25em; }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.values summary { width: fit-content; padding: 8px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 800; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.values[open] summary { margin-bottom: 12px; }
.metric-details { margin-top: 16px; padding: 0 22px; }
.metric-details summary { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; font-size: 15.5px; font-weight: 900; color: var(--navy); }
.metric-details summary i { font-style: normal; font-size: 20px; color: var(--blue); transition: transform .3s; }
.metric-details[open] summary i { transform: rotate(45deg); }
.metric-details p { padding-bottom: 16px; font-size: 14px; font-weight: 600; line-height: 1.75; color: var(--ink-2); }

/* Airline */
.airline-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: stretch; }
.air-map { position: relative; margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 42% 62%, color-mix(in srgb, var(--blue) 9%, var(--surface)) 0%, var(--surface) 62%); }
#air-map { display: block; width: 100%; height: auto; flex: 1; }
#air-map .grat { fill: none; stroke: var(--line-soft); stroke-width: 1; }
#air-map .land { fill: color-mix(in srgb, var(--blue) 17%, var(--surface)); stroke: color-mix(in srgb, var(--blue) 42%, var(--surface)); stroke-width: 1.1; stroke-linejoin: round; }
#air-map .land-dots circle { fill: color-mix(in srgb, var(--blue) 30%, var(--surface)); }
#air-map .net { fill: none; stroke: var(--blue); stroke-width: 1.4; stroke-linecap: round; opacity: .32; stroke-dasharray: 3 7; animation: air-dash 2.8s linear infinite; }
#air-map .end { fill: var(--surface); stroke: var(--blue); stroke-width: 1.6; opacity: .55; }
#air-map .route { fill: none; stroke: var(--navy); stroke-width: 3.2; stroke-linecap: round; }
#air-map .route-glow { fill: none; stroke: var(--blue); stroke-width: 10; stroke-linecap: round; opacity: .12; }
#air-map .plane { fill: var(--navy); }
#air-map .city circle { fill: var(--surface); stroke: var(--navy); stroke-width: 3; }
#air-map .city text { fill: var(--ink); font: 900 19px var(--sans); }
#air-map .city .sub { fill: var(--mute); font: 700 13px var(--sans); }
#air-map .city text, #air-map .hub text { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
#air-map .hub circle.core { fill: var(--red); stroke: var(--surface); stroke-width: 3; }
#air-map .hub circle.ring { fill: none; stroke: var(--red); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: air-ring 2.6s ease-out infinite; }
#air-map .hub circle.ring + circle.ring { animation-delay: 1.3s; }
#air-map .hub text { fill: var(--red); font: 900 22px var(--sans); }
#air-map .hub .sub { fill: var(--ink-2); font: 800 13px var(--sans); }
.air-tag { position: absolute; top: 16px; left: 16px; z-index: 1; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: inset 0 0 0 1.5px var(--line-soft); color: var(--mute); font-size: 11px; letter-spacing: .12em; }
@keyframes air-dash { to { stroke-dashoffset: -40; } }
@keyframes air-ring { from { transform: scale(.4); opacity: .8; } to { transform: scale(2.4); opacity: 0; } }
:root[data-motion="reduced"] #air-map .net, :root[data-motion="reduced"] #air-map .ring { animation: none; }
.air-scales { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 18px 18px; }
.air-scale { padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1.5px var(--line-soft); }
.air-scale.is-medium { box-shadow: inset 0 0 0 1.5px var(--line); }
.air-scale .mono { color: var(--blue); letter-spacing: .14em; font-size: 11px; }
.air-scale b { display: block; margin-top: 4px; font-size: 16px; font-weight: 900; color: var(--navy); }
.air-scale span { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--mute); }
.air-side { display: grid; gap: 14px; align-content: start; }
.air-model { padding: 22px 24px 20px; }
.air-model h3 { margin-bottom: 6px; }
.air-model-sub { font-size: 14px; font-weight: 600; line-height: 1.6; color: var(--mute); }
.air-formula { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--bg); border: 1.5px solid var(--line-soft); font-family: var(--serif); font-size: 17.5px; line-height: 1.9; }
.air-formula p { display: grid; grid-template-columns: 2.6em 1fr auto; align-items: baseline; gap: .5em; }
.air-formula em { color: var(--mute); font: 800 13px var(--sans); font-style: normal; }
.air-formula span { font-style: italic; white-space: nowrap; overflow-x: auto; }
.air-formula sub { font-size: .62em; }
.air-formula small { font: 800 12px var(--sans); color: var(--blue); }
.air-model-note { margin-top: 10px; font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--mute); }
.air-model-note sub { font-size: .7em; }
.air-metrics { display: grid; gap: 12px; margin-top: 8px; }
.air-label { font-size: 13.5px; font-weight: 800; color: var(--mute); }
.air-metric { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 22px; padding: 16px 20px; }
.air-metric > span { font-size: 15px; font-weight: 800; color: var(--ink-2); }
.air-metric strong { display: grid; justify-items: end; font-size: 26px; font-weight: 900; color: var(--a); font-variant-numeric: tabular-nums; }
.air-metric strong + strong { color: var(--b); }
.air-metric strong small { font: 500 10.5px var(--mono); color: var(--mute); }

/* Resources */
.paper-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.paper-links a { position: relative; display: grid; gap: 6px; padding: 24px 26px 26px; transition: transform .4s var(--spring), box-shadow .3s; }
.paper-links a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.paper-links span { font-size: 22px; font-weight: 900; color: var(--navy); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: .08em; text-underline-offset: .22em; }
.paper-links small { font: 500 12px var(--mono); color: var(--mute); }
.paper-links small.mono { color: var(--blue); }
.paper-card { margin-top: 18px; padding: clamp(22px, 3vw, 34px); }
.authors-row { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; justify-content: space-between; }
.authors-row .kicker { margin: 0; }
.citation { margin-top: 14px; font-size: 15px; font-weight: 600; line-height: 1.75; color: var(--ink-2); }

/* Footer, dock, toast */
.foot { position: relative; z-index: 2; background: var(--bg); font-size: 13.5px; font-weight: 700; color: var(--mute); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; padding-top: 26px; padding-bottom: 40px; border-top: 1.5px solid var(--line-soft); }
.foot-brand { color: var(--navy); font-weight: 900; font-size: 16px; }
.foot p { margin-right: auto; display: flex; gap: 18px; }
.foot a:hover { color: var(--navy); }
.dock { position: fixed; right: 22px; bottom: 22px; z-index: 15; display: grid; grid-template-columns: auto; column-gap: 12px; align-items: center; padding: 9px 14px 9px 18px; border-radius: 18px; background: var(--navy); color: var(--bg); box-shadow: 0 18px 34px -16px rgba(30 63 120 / .8); transform: translateY(140%); opacity: 0; transition: transform .6s var(--spring), opacity .3s, translate .5s var(--glide), scale .18s var(--ease); }
.dock.is-on { transform: none; opacity: 1; }
.dock:hover { transform: translateY(-3px); }
.dock span { font-size: 14px; font-weight: 900; }
.dock small { grid-row: 2; font-size: 11.5px; font-weight: 700; opacity: .75; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 30; max-width: min(90vw, 640px); transform: translate(-50%, 20px); opacity: 0; padding: 11px 18px; border-radius: 16px; background: var(--navy); color: var(--bg); font-size: 13.5px; font-weight: 700; transition: .4s var(--spring); pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Reveal */
.rv { opacity: 0; transform: translateY(34px) scale(.98); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.15s var(--glide), filter .9s var(--ease); }
.rv.is-in { opacity: 1; transform: none; filter: none; }
:root[data-motion="reduced"] .rv { opacity: 1; transform: none; filter: none; transition: none; }
:root[data-motion="reduced"] .fill { transition: none; }

@media (max-height: 820px) and (min-aspect-ratio: 4/5) {
  .hero-eyebrow { margin-bottom: 16px; }
  .hero-title { font-size: clamp(52px, min(6.6vw, 10.5vh), 112px); margin-bottom: 22px; }
  .hero-actions { margin-top: 26px; }
  .hero-steps { margin-top: 18px; }
}
@media (max-width: 1080px) {
  .case-grid, .overview-grid, .airline-grid { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .replay-card.has-cases { grid-template-columns: minmax(0, 1fr); }
  .case-list { flex-direction: row; overflow-x: auto; gap: 8px; margin-bottom: 14px; padding: 2px 2px 14px; border-right: 0; border-bottom: 1.5px dashed var(--line-soft); scroll-snap-type: x proximity; }
  .case-item { flex: 1 0 auto; min-width: 176px; scroll-snap-align: start; }
  .air-scales { grid-template-columns: 1fr; }
  .strip-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .strip .kicker { grid-column: 1 / -1; }
  }
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav { grid-template-columns: 1fr auto; }
  .paper-links { grid-template-columns: 1fr; }
  .big-scores { grid-template-columns: 1fr; }
}
@media (max-width: 720px), (max-aspect-ratio: 4/5) {
  .scene-scrim { background: linear-gradient(0deg, rgba(var(--bg-rgb) / .9) 0%, rgba(var(--bg-rgb) / .55) 26%, rgba(var(--bg-rgb) / 0) 42%); }
  .hero-copy { justify-content: flex-end; padding-bottom: 20px; }
  .hero-caption, .hero-hint { display: none; }
  .hero-title { font-size: min(15vw, 8.4vh); margin-bottom: 24px; }
  .hero-intro::before { inset: -14px -35px -16px -20px; border-radius: 18px; }
  .stage { justify-content: flex-end; padding-bottom: 12vh; min-height: 110vh; }
  .rail { display: none; }
  .hero-fallback { top: 70px; left: 4%; width: 92%; height: 42%; }
}
@media (max-width: 720px) {
  .hero-eyebrow { margin-bottom: 16px; font-size: 11.5px; }
  .hero-lede { font-size: 19px; }
  .hero-desc { font-size: 14px; }
  .hero-actions { margin-top: 24px; gap: 10px; }
  .hero-actions .btn { height: 48px; padding: 0 18px; font-size: 15px; }
  .hero-steps { margin-top: 20px; font-size: 11.5px; }
  .hero-bottom { height: 54px; font-size: 11.5px; }
  .hero-scroll span { display: none; }
  .strip-inner { grid-template-columns: 1fr; gap: 10px; }
  .stat { padding: 14px 18px; }
  .stage-card { padding: 20px 22px 22px; }
  .stage h2 { font-size: 26px; }
  .stage-card > p:not(.stage-no) { font-size: 15px; }
  .replay-card { padding: 12px; }
  .replay-content { padding: 22px 6px 16px; }
  .replay-bar p span:last-child { display: none; }
  .replay-bar p, .replay-bar .btn { white-space: nowrap; }
  /* On a phone the three files read better as a compact list. */
  .files { grid-template-columns: 1fr; gap: 8px; }
  .files .file { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; }
  .files .tag { flex: none; width: 32px; height: 32px; }
  .files b { overflow-wrap: normal; }
  .tabs button { height: 36px; padding: 0 12px; font-size: 13.5px; }
  .case-stats { gap: 22px; }
  .bar { grid-template-columns: 74px 1fr 64px; }
  .air-metric { grid-template-columns: 1fr auto; }
  .air-metric > span { grid-column: 1 / -1; }
  .pill { min-width: 92px; padding: 0 18px; }
  .tool { width: 34px; height: 34px; }
  .dock { display: none; }
  .journey-head h2 { display: inline; padding: 2px 8px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 82%, transparent); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
  #air-map .city text { font-size: 34px; }
  #air-map .city .sub, #air-map .hub .sub { font-size: 24px; }
  #air-map .hub text { font-size: 38px; }
  #air-map .route { stroke-width: 5; }
}

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: cubic-bezier(.2, .7, .1, 1); }

/* Demo video: a dark panel over the Figure 3 model seen from several angles (assets/film-scene.js) */
.hero-links { display: flex; gap: 26px; }
.film { position: relative; background: var(--bg); padding: clamp(28px, 5vh, 64px) var(--gut) clamp(12px, 2vh, 28px); }
.film-panel {
  --ink: #e3ebf6; --ink-2: #b8c5d8; --mute: #8d9bb0; --line: #3f6797; --line-soft: #22324b; --navy: #a6c8ef; --blue: #6aa5ee; --surface: #15223a;
  position: relative; isolation: isolate; overflow: clip; max-width: 1480px; margin: 0 auto; border-radius: 36px; color: var(--ink);
  background: radial-gradient(90% 70% at 16% 0%, #15305a 0%, rgba(21 48 90 / 0) 62%), radial-gradient(80% 70% at 100% 100%, #13264b 0%, rgba(19 38 75 / 0) 60%), #081120;
  box-shadow: 0 0 0 1.5px rgba(166 200 239 / .12) inset, 0 44px 90px -54px rgba(8 17 32 / .8);
}
:root[data-theme="dark"] .film-panel { box-shadow: 0 0 0 1.5px #22324b inset, 0 44px 90px -54px rgba(0 0 0 / .9); }
/* The stage stays on screen while the panel passes and takes no room of its own. */
.film-stage { position: sticky; top: 0; z-index: 0; height: 100vh; margin-bottom: -100vh; pointer-events: none; }
.film-stage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 46% 40% at 32% 22%, rgba(8 17 32 / .55), rgba(8 17 32 / 0) 80%), linear-gradient(180deg, rgba(8 17 32 / .3), rgba(8 17 32 / 0) 22%, rgba(8 17 32 / 0) 78%, rgba(8 17 32 / .45)); }
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; animation: film-in 1.8s var(--ease) both; transition: opacity .8s var(--ease); }
@keyframes film-in { from { opacity: 0; } }
.film.is-playing .film-canvas { opacity: .5; }
.film-fallback { position: absolute; inset: 0; display: none; }
.film-stage.is-static .film-fallback { display: block; }
.film-stage.is-static .film-canvas { display: none; }
.film-fallback img { position: absolute; width: min(46%, 640px); height: auto; opacity: .2; filter: saturate(.7) brightness(.75); }
.film-fallback img:first-child { left: -8%; top: 4%; transform: perspective(1400px) rotateY(26deg) rotateX(16deg) rotate(-5deg); }
.film-fallback img:last-child { right: -9%; top: 34%; transform: perspective(1400px) rotateY(-30deg) rotateX(10deg) rotate(4deg); }
.film-inner { position: relative; z-index: 1; padding: clamp(72px, 13vh, 150px) clamp(20px, 5vw, 80px) clamp(64px, 12vh, 130px); }
.film-head { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; max-width: 1040px; margin: 0 auto clamp(32px, 6vh, 64px); }
/* A soft dark halo keeps the copy legible when a lit part of the model passes behind it. */
.film-head { text-shadow: 0 1px 2px rgba(8 17 32 / .9), 0 0 22px rgba(8 17 32 / .85); }
.film-head h2 { font-size: clamp(32px, 3.7vw, 56px); font-weight: 900; line-height: 1.08; letter-spacing: -.025em; color: #f2f6fc; }
.film-copy > p:first-child { font-size: 17px; font-weight: 600; line-height: 1.75; color: var(--ink-2); }
.film-note { margin-top: 14px; color: var(--mute); }
.film-frame { position: relative; max-width: 1040px; aspect-ratio: 16 / 9; margin: 0 auto; overflow: hidden; border-radius: 24px; background: #050a14; border: 1.5px solid rgba(166 200 239 / .3); box-shadow: 0 0 0 10px rgba(106 165 238 / .06), 0 50px 100px -50px rgba(0 0 0 / .9); transform-origin: 50% 20%; }
.film-frame video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; }
/* The poster is the dark title card, so the play control is light and sits in its lower left, clear of the title. */
.film-play { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; gap: 18px; padding: clamp(16px, 3.6%, 40px); background: linear-gradient(200deg, rgba(8 17 32 / 0) 55%, rgba(8 17 32 / .5)); transition: opacity .45s var(--ease), visibility .45s; }
.film-play i { position: relative; display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: #eef4ff; color: #1e3f78; box-shadow: 0 0 0 8px rgba(166 200 239 / .16), 0 18px 36px -14px rgba(0 0 0 / .7); transition: transform .45s var(--spring), box-shadow .3s; }
.film-play i::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(166 200 239 / .55); animation: film-ring 2.6s var(--ease) infinite; }
@keyframes film-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.45); opacity: 0; } }
.film-play svg { width: 30px; height: 30px; margin-left: 4px; fill: currentColor; }
.film-play:hover i { transform: scale(1.07); box-shadow: 0 0 0 13px rgba(166 200 239 / .14), 0 22px 42px -14px rgba(0 0 0 / .75); }
.film-play > span { display: grid; gap: 2px; padding-bottom: 6px; text-align: left; color: #eef4ff; font-size: 20px; font-weight: 900; line-height: 1.2; text-shadow: 0 1px 10px rgba(8 17 32 / .8); }
.film-play small { color: #b8c5d8; }
.film.is-started .film-play { opacity: 0; visibility: hidden; }
.film-chapters { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-width: 1040px; margin: clamp(18px, 3vh, 28px) auto 0; padding: 0; }
.film-chapters button { position: relative; overflow: hidden; display: grid; gap: 3px; width: 100%; padding: 12px 14px 13px; border-radius: 14px; text-align: left; color: #d6e1ef; font-size: 14.5px; font-weight: 800; line-height: 1.3; background: rgba(21 34 58 / .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1.5px solid rgba(166 200 239 / .26); transition: border-color .3s, background .3s, color .3s, transform .4s var(--spring); }
.film-chapters button .mono { color: var(--mute); }
.film-chapters button:hover { transform: translateY(-2px); color: #fff; border-color: rgba(166 200 239 / .45); }
.film-chapters button.is-on { color: #fff; background: rgba(30 63 120 / .6); border-color: var(--blue); }
.film-chapters button i { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--blue); }
:root[data-motion="reduced"] .film-play i::after, :root[data-motion="reduced"] .film-canvas { animation: none; }
@media (max-width: 1080px) {
  .film-head { grid-template-columns: 1fr; align-items: start; }
  .film-chapters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .film { padding: 18px 12px 8px; }
  .film-panel { border-radius: 26px; }
  .film-inner { padding: 40px 16px 24px; }
  .film-head h2 { font-size: 28px; }
  .film-copy > p:first-child { font-size: 15px; }
  .film-frame { border-radius: 16px; box-shadow: 0 0 0 6px rgba(106 165 238 / .06), 0 30px 60px -30px rgba(0 0 0 / .9); }
  .film-play { padding: 10px; }
  .film-play i { width: 42px; height: 42px; box-shadow: 0 0 0 5px rgba(166 200 239 / .16), 0 12px 24px -10px rgba(0 0 0 / .7); }
  .film-play i::after { inset: -5px; }
  .film-play svg { width: 18px; height: 18px; margin-left: 3px; }
  /* The poster is small here; the button alone keeps its subtitle clear, and the chapters below give the length. */
  .film-play > span { display: none; }
  .film-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .film-chapters button { padding: 10px 12px 11px; font-size: 13.5px; }
  .hero-links { gap: 16px; }
}
