/* Reach to Push: project page styles. Dark "studio night" theme to match the rendered films. */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --bg: #0a0b0d;
  --bg-2: #0f1114;
  --surface: #16181c;
  --surface-2: #1d2025;
  --ink: #f2f1ec;
  --ink-2: #b9bab4;
  --ink-3: #8b8d89;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);
  --goal: #7fd6a2;
  --goal-ink: #9be3b8;
  --goal-wash: rgba(127, 214, 162, .13);
  --spot: #f2c230;
  --box: #d08a3c;
  --cyl: #4096d8;
  --reach: #43ad7a;
  --done: #ab7ad1;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 16px;
  --r-lg: 22px;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  --wrap: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* a faint field of registration crosses, like the floor in the films */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: radial-gradient(ellipse at 50% -10%, rgba(127, 214, 162, .07), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cpath d='M28 32h8M32 28v8' stroke='%23ffffff' stroke-opacity='.07' stroke-width='1.2'/%3E%3C/svg%3E"); }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
sub, sup { line-height: 0; }
:focus-visible { outline: 2px solid var(--goal); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
@media (max-width: 560px) { .wrap { width: calc(100% - 32px); } }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn { --h: 44px; display: inline-flex; align-items: center; gap: 8px; height: var(--h); padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s, border-color .2s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .07); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--ink:hover { background: #fff; border-color: #fff; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 14px; }

/* ---------- type helpers ---------- */
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font: 400 clamp(2.1rem, 4.2vw, 3.4rem)/1.02 var(--serif); letter-spacing: -.01em; }
h2 em, h1 em { font-style: italic; color: var(--goal); }
.head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); column-gap: 40px; align-items: end; margin-bottom: 34px; }
.head__note { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
@media (max-width: 820px) { .head { grid-template-columns: 1fr; row-gap: 14px; } }
.section { padding: clamp(72px, 10vw, 124px) 0; }
.section.wrap { padding-inline: 0; }
.section--tint { background: var(--bg-2); border-block: 1px solid var(--line); }
.card { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.footnote { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-3); }

/* ---------- hero ---------- */
.hero { padding-top: clamp(56px, 9vw, 112px); text-align: center; }
.hero__title { margin-inline: auto; font: 400 clamp(1.75rem, 4.25vw, 3.5rem)/1.03 var(--serif); letter-spacing: -.016em; text-wrap: balance; }
@media (min-width: 680px) { .hero__title span { display: block; } }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 24px 0 0; padding: 0; list-style: none; font-size: clamp(15px, 1.7vw, 17px); font-weight: 500; }
.authors li:not(:last-child)::after { content: ","; margin-right: .42em; }
.authors a { text-decoration: underline; text-decoration-color: rgba(127, 214, 162, .45); text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: color .2s, text-decoration-color .2s; }
.authors a:hover { color: var(--goal-ink); text-decoration-color: var(--goal); }
.affil { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.hero__links { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.hero__links .btn { --h: 42px; padding: 0 20px; }
.hero__media { width: min(100%, 1000px); margin: clamp(24px, 4vw, 40px) auto 0; }
.hero__frame { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; box-shadow: var(--shadow), 0 0 0 1px var(--line); aspect-ratio: 16 / 9; }
.hero__video { width: 100%; height: 100%; object-fit: cover; }
.hero__media figcaption { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
.hero__toggle { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(10, 11, 13, .72); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.hero__toggle:hover { background: var(--bg); }
.hero__toggle svg { width: 16px; height: 16px; }
.hero__toggle .i-play, .is-paused .i-pause { display: none; }
.is-paused .i-play { display: block; }

.section--abstract { padding-block: clamp(52px, 7vw, 90px); }
.abstract { max-width: 82ch; margin-inline: auto; }
.abstract p { margin: 20px 0 0; color: var(--ink-2); line-height: 1.75; }

/* ---------- where it touches ---------- */
:root { --arm: #62b0ff; --body: #ff7d63; }
.touch { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); grid-template-areas: "rail rail" "video chair" "trace share"; gap: 16px 18px; }
.rail { grid-area: rail; position: relative; display: flex; align-items: flex-start; gap: 0; padding: 24px 4px 0; }
.rail::before { content: ""; position: absolute; left: 28px; right: 28px; top: 39px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--line-2), rgba(127, 214, 162, .55)); }
.rail button { position: relative; flex: 1; display: grid; justify-items: center; gap: 4px; padding: 0 2px 4px; border: 0; background: none; cursor: pointer; color: var(--ink-3); }
.rail button::before { content: ""; width: 14px; height: 14px; margin-top: 9px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--ink-3); transition: transform .25s var(--ease), background .2s, border-color .2s; }
.rail button b { font: 600 14px/1 var(--mono); color: var(--ink-2); margin-top: 4px; }
.rail button span { font-size: 12.5px; line-height: 1.2; white-space: nowrap; }
.rail button:hover b, .rail button:hover span { color: var(--ink); }
.rail button[aria-checked="true"]::before { background: var(--ink); border-color: var(--ink); transform: scale(1.25); box-shadow: 0 0 0 5px rgba(242, 241, 236, .12); }
.rail button[aria-checked="true"] b { color: var(--ink); }
.rail button[aria-checked="true"] span { color: var(--ink-2); }
.rail button[data-win]::before { border-color: var(--goal); }
.rail button[data-win][aria-checked="true"]::before { background: var(--goal); border-color: var(--goal); box-shadow: 0 0 0 5px var(--goal-wash); }
.rail button[data-win] span { color: var(--goal-ink); }
.rail__mark { position: relative; z-index: 1; flex: 0 0 0; width: 0; align-self: stretch; }
.rail__mark i { position: absolute; left: -1px; top: 7px; width: 2px; height: 18px; border-radius: 1px; background: var(--reach); }
.rail__mark em { position: absolute; left: 0; top: -20px; transform: translateX(-50%); font: 400 11px/1 var(--mono); font-style: normal; color: var(--reach); white-space: nowrap; }
.rail__axis { position: absolute; left: 6px; top: 0; font: 500 11px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }

.touch__video { grid-area: video; position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; aspect-ratio: 16 / 9; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.touch__video video, .fx__video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chip { position: absolute; left: 12px; top: 12px; padding: 6px 10px; border-radius: 999px; background: rgba(10, 11, 13, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 500 12px/1 var(--mono); color: var(--ink-2); pointer-events: none; }
.chip[hidden] { display: none; }
.touch__pp { position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(10, 11, 13, .72); color: var(--ink); cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s; }
.touch__pp:hover { background: rgba(10, 11, 13, .9); }
.touch__pp svg { width: 16px; height: 16px; }
.touch__pp .i-play, .touch__pp.is-paused .i-pause { display: none; }
.touch__pp.is-paused .i-play { display: block; }

.touch__chair { grid-area: chair; position: relative; min-height: 300px; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #20232a, #0a0b0d 72%); box-shadow: var(--shadow), 0 0 0 1px var(--line); cursor: grab; }
.touch__chair:active { cursor: grabbing; }
.touch__chair canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.touch__fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .5s; pointer-events: none; }
.touch__chair.is-live .touch__fallback { opacity: 0; }
.touch__legend { position: absolute; left: 14px; top: 14px; display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; font: 400 12px var(--mono); color: var(--ink-2); pointer-events: none; }
.touch__legend li { display: flex; align-items: center; gap: 7px; }
.touch__legend i { width: 9px; height: 9px; border-radius: 50%; }
.touch__legend .k-arm { background: var(--arm); box-shadow: 0 0 8px var(--arm); }
.touch__legend .k-body { background: var(--body); box-shadow: 0 0 8px var(--body); }
.touch__legend .k-goal { width: 14px; height: 3px; border-radius: 2px; background: var(--goal); }
.touch__note { position: absolute; left: 14px; bottom: 12px; margin: 0; font: 400 12px var(--mono); color: var(--ink-3); pointer-events: none; font-variant-numeric: tabular-nums; }
.drag-hint { position: absolute; right: 12px; top: 12px; display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(242, 241, 236, .9); color: var(--bg); font-size: 12.5px; pointer-events: none; transition: opacity .5s; }
.drag-hint svg { width: 16px; height: 16px; }
.touch__chair:not(.is-live) .drag-hint, .touch__chair.was-dragged .drag-hint { opacity: 0; }

.touch__trace { grid-area: trace; min-width: 0; }
.touch__cap { margin: 2px 0 10px; font: 400 1.45rem/1.2 var(--serif); min-height: 2.4em; text-wrap: pretty; }
.touch__cap.is-win { color: var(--goal); }
.trace { position: relative; }
.trace svg { width: 100%; height: auto; overflow: visible; }
.tr-line { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tr-ref { stroke: var(--goal); stroke-width: 1.2; stroke-dasharray: 4 4; }
.tr-ref--warn { stroke: #e8705c; }
.tr-note { font: 400 11.5px var(--mono); fill: var(--ink-3); }
.tr-note--goal { fill: var(--goal-ink); }
.tr-note--warn { fill: #f09a88; }
.tr-note--strong { fill: var(--ink); font-weight: 500; }
.tr-note--bg { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.touch .tr-note--bg { stroke: var(--bg-2); }
.tr-topple { fill: rgba(232, 112, 92, .12); }
.tr-in { fill: rgba(127, 214, 162, .12); }
.tr-lane { fill: rgba(255, 255, 255, .04); }
.tr-head { stroke: var(--ink); stroke-opacity: .55; stroke-width: 1; }
.tr-dot { fill: var(--ink); stroke: var(--bg-2); stroke-width: 2; }
.tr-hit { fill: transparent; cursor: ew-resize; touch-action: none; }
svg .tick--sm { font-size: 10.5px; }
svg .tick--axis { font-size: 11.5px; fill: var(--ink-2); }

.touch__share { grid-area: share; margin: 0; align-self: start; }
.touch__share figcaption { font-size: 13.5px; color: var(--ink-3); margin: 6px 0 10px; }
.share { display: grid; gap: 6px; }
.share__row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 62px; align-items: center; gap: 10px; width: 100%; padding: 3px 4px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; opacity: .5; transition: opacity .2s, background .2s; }
.share__row:hover { opacity: .85; }
.share__row.is-on { opacity: 1; background: rgba(255, 255, 255, .04); }
.share__k { font: 500 12px var(--mono); color: var(--ink-2); }
.share__bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.share__bar i { display: block; height: 100%; }
.share__v { font: 500 12.5px var(--mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.share__v small { color: var(--ink-3); font-size: 11px; }

@media (max-width: 980px) {
  .touch { grid-template-columns: 1fr; grid-template-areas: "rail" "video" "chair" "trace" "share"; }
  .touch__chair { aspect-ratio: 4 / 3; min-height: 0; }
}
@media (max-width: 640px) {
  .rail button span { display: none; }
  .rail__mark { display: none; }
  .rail__axis { display: none; }
  .touch__cap { font-size: 1.25rem; }
}

/* ---------- 3D replay ---------- */
.replay { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "view panel" "transport panel"; gap: 14px 18px; }
.replay__view { grid-area: view; position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #1b1d22, #070809 70%); box-shadow: var(--shadow), 0 0 0 1px var(--line); cursor: grab; }
.replay__view:active { cursor: grabbing; }
.replay__view canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; transition: opacity .35s; }
.replay__fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s; pointer-events: none; }
.replay.is-live .replay__fallback { opacity: 0; }
.replay__loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(22, 24, 28, .92); font-size: 14px; color: var(--ink-2); }
.replay.is-live .replay__loading { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--goal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.replay__hud { position: absolute; left: 14px; top: 14px; pointer-events: none; }
.hud-phase { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(10, 11, 13, .75); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.hud-phase::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ph, #6b6d6a); }
.hud-phase[data-state="push"] { --ph: var(--spot); }
.hud-phase[data-state="placed"] { --ph: var(--goal); color: var(--goal-ink); }
.replay:not(.is-live) .replay__hud { display: none; }
.replay__hint { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(242, 241, 236, .9); color: var(--bg); font-size: 13px; pointer-events: none; transition: opacity .5s; }
.replay__hint svg { width: 16px; height: 16px; }
.replay:not(.is-live) .replay__hint, .replay.was-dragged .replay__hint { opacity: 0; }

.replay__panel { grid-area: panel; display: flex; flex-direction: column; gap: 16px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); align-self: stretch; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--bg); gap: 2px; border: 1px solid var(--line); }
.seg button { flex: 1; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--surface-2); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2); }
.seg--sm button { min-height: 30px; font-size: 13px; padding: 4px 8px; }
.seg--stack { flex-direction: column; }
.seg--stack button { text-align: left; padding: 8px 12px; }
.seg--stack button small { display: block; font: 400 11.5px var(--mono); color: var(--ink-3); margin-top: 1px; }
.readout { margin: 0; font: 400 13px/1.5 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.readout b { color: var(--ink); font-weight: 500; }
.spark { margin: 0; position: relative; }
.spark svg { width: 100%; height: 84px; overflow: visible; }
.spark figcaption { display: flex; justify-content: space-between; margin-top: 6px; font: 400 12px var(--mono); color: var(--ink-3); }
.spark__ref { display: inline-flex; align-items: center; gap: 6px; }
.spark__ref i { width: 14px; height: 0; border-top: 1.5px solid var(--goal); }
.verdict { display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); transition: background .3s, color .3s; }
.verdict__icon { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; position: relative; transition: background .3s, border-color .3s; }
.verdict.is-ok { background: var(--goal-wash); color: var(--goal-ink); font-weight: 500; border-color: rgba(127, 214, 162, .3); }
.verdict.is-ok .verdict__icon { background: var(--goal); border-color: var(--goal); }
.verdict.is-ok .verdict__icon::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-row .seg { flex: 0 1 190px; }
.panel-label { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__ui { width: 36px; height: 21px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle__ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--ink-2); transition: transform .2s var(--ease), background .2s; }
.toggle input:checked + .toggle__ui { background: var(--goal); border-color: var(--goal); }
.toggle input:checked + .toggle__ui::after { transform: translateX(15px); background: var(--bg); }
.toggle input:focus-visible + .toggle__ui { outline: 2px solid var(--goal); outline-offset: 2px; }

.transport { grid-area: transport; display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.transport__play, .transport__restart { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.transport__play { background: var(--ink); color: var(--bg); }
.transport__restart { background: transparent; color: var(--ink-2); }
.transport__restart:hover { background: var(--surface-2); }
.transport svg { width: 18px; height: 18px; }
.transport__play .i-play, .transport__play.is-paused .i-pause { display: none; }
.transport__play.is-paused .i-play { display: block; }
.transport__time { font: 500 13px var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.scrub { flex: 1; min-width: 0; padding-top: 14px; }
.scrub__legend { display: flex; gap: 14px; margin-top: 6px; font: 400 11px var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.scrub__legend span { display: inline-flex; align-items: center; gap: 5px; }
.scrub__legend i { width: 10px; height: 4px; border-radius: 2px; }
.k-approach { background: #4a4c50; } .k-push { background: var(--spot); } .k-placed { background: var(--goal); }
input[type="range"][data-scrub] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; }
input[data-scrub]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--track, var(--surface-2)); }
input[data-scrub]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--track, var(--surface-2)); }
input[data-scrub]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
input[data-scrub]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
@media (max-width: 980px) {
  .replay { grid-template-columns: 1fr; grid-template-areas: "view" "transport" "panel"; }
  .replay__view { aspect-ratio: 4 / 3; }
  .replay__panel { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .replay__panel > .seg--robots, .replay__panel > .verdict, .replay__panel > .readout { grid-column: 1 / -1; }
}
@media (max-width: 620px) { .replay__panel { grid-template-columns: 1fr; } .scrub__legend { display: none; } .scrub { padding-top: 0; } .transport { gap: 8px; } }

/* ---------- method ---------- */
.fig2-card { margin: 0; }
.fig2-scroll { overflow-x: auto; border-radius: var(--r); }
.fig2-host { min-width: 690px; padding: clamp(8px, 2vw, 24px); background: #fff; }
.fig2-host.is-live { padding-inline: 0; background: none; }
.fig2-host > img, .fig2-frame > svg { display: block; width: 100%; height: auto; }
.fig2-frame { position: relative; }
.fig2 [data-hit] { cursor: pointer; transition: fill .25s, stroke .25s; }
.fig2 [data-hit]:focus-visible { outline: none; }
.fig2 [data-hit].is-active, .fig2 [data-hit]:focus-visible { fill: rgba(127, 214, 162, .06); stroke: var(--goal); stroke-width: 1.6px; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(127, 214, 162, .55)); }
.fig2 .f2-dim { fill: rgba(15, 17, 20, .66); pointer-events: none; opacity: 0; transition: opacity .3s; }
.fig2-frame.is-exploring .f2-dim { opacity: 1; }
.fig2 .f2-flow { fill: none !important; stroke: #fff !important; stroke-opacity: .55; stroke-width: 2.4px !important; stroke-linecap: round !important; stroke-dasharray: 2 16; animation: f2-flow 1.5s linear infinite; pointer-events: none; }
@keyframes f2-flow { from { stroke-dashoffset: 18; } to { stroke-dashoffset: 0; } }
.f2-sim { position: absolute; pointer-events: none; transition: opacity .35s; }
.f2-sim canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity 1s;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 96%, transparent), linear-gradient(180deg, #000 78%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 96%, transparent), linear-gradient(180deg, #000 78%, transparent);
  mask-composite: intersect; }
.f2-sim.is-live canvas { opacity: 1; }
.f2-sim.is-dim { opacity: .28; }
.f2-cutout { width: 100%; height: 100%; object-fit: contain; }
.f2-goal { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; gap: 1px; font: 700 clamp(9px, 1.05vw, 13px)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #e5bd3c; text-shadow: 0 0 10px rgba(0, 0, 0, .9); opacity: 0; transition: opacity .8s .4s; }
.f2-goal i { width: 2px; height: clamp(8px, 1.1vw, 14px); background: currentColor; position: relative; }
.f2-goal i::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.f2-sim.is-live .f2-goal { opacity: 1; }
.f2-tip { position: absolute; z-index: 3; width: max-content; max-width: min(300px, 46%); transform: translate(-50%, calc(-100% - 8px)); padding: 10px 13px 11px; border-radius: 12px; background: rgba(22, 24, 28, .96); border: 1px solid rgba(127, 214, 162, .35); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); pointer-events: none; }
.f2-tip.is-below { transform: translate(-50%, 8px); }
.f2-tip strong { display: block; margin-bottom: 2px; color: var(--goal-ink); font-weight: 600; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .fig2 .f2-flow { display: none; } }
.fig2-hint { display: none; margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }
.fig2-caption { margin: 14px 0 0; min-height: 3.2em; color: var(--ink-2); font-size: 15px; }
.fig2-caption b, .fig2-caption strong { color: var(--ink); }
@media (max-width: 738px) { .fig2-hint { display: block; } }
.caption-k { margin-right: 8px; color: var(--ink-3); font: 500 11.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend i.line { height: 3px; border-radius: 2px; width: 16px; }

/* ---------- charts (shared) ---------- */
.chart { position: relative; height: 340px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
svg .grid line { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
svg .base { stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
svg .tick { font: 400 12px var(--mono); fill: var(--ink-3); font-variant-numeric: tabular-nums; }
svg .cat { font: 500 13.5px var(--sans); fill: var(--ink); }
svg .val { font: 500 12px var(--mono); fill: var(--ink-2); text-anchor: middle; font-variant-numeric: tabular-nums; }
svg .unit { font: 500 12px var(--mono); fill: var(--ink-3); }
svg .ph-label { font: 500 11px var(--mono); fill: var(--ink-3); letter-spacing: .04em; }
.chart .bar { cursor: pointer; transition: opacity .2s; }
.chart.is-hover .bar:not(.is-hot) { opacity: .35; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart__tip { position: absolute; z-index: 2; pointer-events: none; padding: 8px 11px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .8); }
.chart__tip b { font: 600 15px var(--sans); display: block; }

/* ---------- results ---------- */
.results { display: block; }
.chart-card { padding: 20px 20px 14px; }
.chart-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 8px; }
.seg--metric { flex-wrap: wrap; }
.seg--metric button { flex: 0 1 auto; }
.chart-table { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.chart-table summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.chart-table summary::-webkit-details-marker { display: none; }
.chart-table summary::before { content: "+"; font: 500 15px var(--mono); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--ink); }
.chart-table[open] summary::before { content: "−"; }
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
caption { text-align: left; font-size: 13px; color: var(--ink-3); padding-bottom: 8px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
td { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.5px; }
thead th { font-size: 12px; font-weight: 500; color: var(--ink-3); }
tbody th { font-weight: 500; }


/* ---------- failure analysis ---------- */
.fx { --fx: #e8705c; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "modes modes" "clip stats"; gap: 16px 18px; }
.fx__modes { grid-area: modes; padding: 4px; border-radius: 16px; }
.fx__modes button { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 9px; padding: 9px 14px; border-radius: 12px; text-align: left; font-size: 15px; }
.fx__modes button i { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.fx__modes button small { grid-column: 2; font: 400 11.5px var(--mono); color: var(--ink-3); font-weight: 400; }
.fx__modes button[aria-checked="true"] { box-shadow: 0 0 0 1px color-mix(in srgb, var(--fx) 60%, transparent); }
.fx__clip { grid-area: clip; min-width: 0; display: grid; gap: 14px; align-content: start; }
.fx__video { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; aspect-ratio: 16 / 9; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.fx__ep p { margin: 0 0 8px; font-size: 14.5px; color: var(--ink-2); }
.fx__ep p b { color: var(--ink); font-weight: 500; }
.fx__stats { grid-area: stats; min-width: 0; padding: 18px 18px 16px; display: grid; gap: 10px; align-content: start; }
.fx__curve-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fx__curve-head h3 { font: 400 1.55rem/1.1 var(--serif); }
.legend--sm { gap: 12px; font-size: 12px; color: var(--ink-3); }
.legend--sm i { width: 10px; height: 10px; }
.legend--sm i.line { width: 14px; height: 2.5px; }
.legend i.hatch { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .25) 0 2px, transparent 2px 5px); border: 1px solid var(--line-2); }
.fx__curve { position: relative; height: 230px; }
.fx__curve svg { width: 100%; height: 100%; overflow: visible; }
.fx__curve .chart__tip { white-space: normal; width: max-content; max-width: 260px; }
.fx-clipline { stroke: var(--ink); stroke-opacity: .5; stroke-width: 1; stroke-dasharray: 3 3; }
.fx-clipdot { stroke: var(--ink); stroke-width: 2; }
.fx__why { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); min-height: 6.2em; }
.fx__inout { border-top: 1px solid var(--line); padding-top: 12px; }
.fx__inout-k { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 12.5px; color: var(--ink-3); }
/* Fig. 7: a pair of columns per mode, inside (grey) and outside (the mode's colour) the training range */
.iob { --ph: 132px; position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-left: 30px; }
.iob__grid { position: absolute; left: 30px; right: 0; top: 18px; height: var(--ph); pointer-events: none; }
.iob__grid span { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(255, 255, 255, .07); }
.iob__grid span:last-child { border-top-color: rgba(255, 255, 255, .22); }
.iob__grid i { position: absolute; right: calc(100% + 8px); top: -7px; font: 400 10.5px var(--mono); font-style: normal; color: var(--ink-3); }
.iob__g { position: relative; display: grid; justify-items: center; gap: 2px; padding: 18px 2px 8px; border: 0; border-radius: 12px; background: none; cursor: pointer; opacity: .5; transition: opacity .2s, background .2s; }
.iob__g:hover { opacity: .85; }
.iob__g.is-on { opacity: 1; background: rgba(255, 255, 255, .035); }
.iob__cols { display: flex; align-items: flex-end; justify-content: center; gap: 5px; height: var(--ph); width: 100%; margin-bottom: 6px; }
.iob__slot { position: relative; height: 100%; width: min(24px, 36%); }
.iob__bar { position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); min-height: 2px; border-radius: 4px 4px 1px 1px; transform-origin: bottom; transition: transform .9s var(--ease); }
.iob__slot--in .iob__bar { background: rgba(185, 186, 180, .3); box-shadow: inset 0 0 0 1px rgba(185, 186, 180, .55); }
.iob__slot--out .iob__bar { background: var(--fx); box-shadow: 0 0 18px -6px var(--fx); }
.iob__ci { position: absolute; left: 50%; bottom: var(--lo); height: calc(var(--hi) - var(--lo)); width: 1px; margin-left: -.5px; background: rgba(242, 241, 236, .75); }
.iob__ci::before, .iob__ci::after { content: ""; position: absolute; left: -3px; width: 7px; height: 1px; background: inherit; }
.iob__ci::before { top: 0; } .iob__ci::after { bottom: 0; }
.iob__slot b { position: absolute; left: 50%; bottom: calc(max(var(--h), var(--hi)) + 4px); transform: translateX(-50%); font: 500 11px var(--mono); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.iob__slot--out b { color: var(--ink); }
.iob__name { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.2; text-align: center; }
.iob__cond { font: 400 10.5px var(--mono); color: var(--ink-3); text-align: center; line-height: 1.25; }
.iob__x { margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--fx) 18%, transparent); color: var(--ink); font: 600 11.5px var(--mono); }
.iob__x.is-flat { background: rgba(255, 255, 255, .06); color: var(--ink-2); font-weight: 500; }
.iob__key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.iob__key span { display: inline-flex; align-items: center; gap: 6px; }
.iob__sw { width: 10px; height: 10px; border-radius: 2px; }
.iob__sw--in { background: rgba(185, 186, 180, .32); box-shadow: inset 0 0 0 1px rgba(185, 186, 180, .55); }
.iob__sw--out { background: var(--fx); }
.js .fx:not(.is-in) .iob__bar { transform: scaleY(0); }
/* the 3D replay in place of the film */
.fx__video canvas, .touch__video canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; }
.fx__video canvas:active, .touch__video canvas:active { cursor: grabbing; }
.is-3d .fx__video video, .is-3d .touch__video video { opacity: 0; pointer-events: none; transition: opacity .5s; }
.fx__video .drag-hint, .touch__video .drag-hint { right: 12px; top: 12px; }
.fx:not(.is-3d) .fx__video .drag-hint, .fx__video.was-dragged .drag-hint, .touch:not(.is-3d) .touch__video .drag-hint, .touch__video.was-dragged .drag-hint { opacity: 0; }
@media (max-width: 1080px) { .fx { grid-template-columns: minmax(0, 1fr); grid-template-areas: "modes" "clip" "stats"; } }
@media (max-width: 720px) {
  .fx__modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx__modes button { min-width: 0; padding-inline: 10px; white-space: normal; }
  .iob { --ph: 112px; gap: 2px; }
}

/* ---------- cite ---------- */
.cite { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.cite__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; }
.tabs button { padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 14px; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.cite__actions { display: flex; gap: 8px; }
.cite .btn--ink.is-done { background: var(--goal); border-color: var(--goal); color: var(--bg); }
.cite__code { margin: 0; padding: 22px 24px 26px; overflow-x: auto; font: 400 14px/1.7 var(--mono); color: var(--ink); white-space: pre; tab-size: 2; }
.cite__code--txt { white-space: normal; font-family: var(--sans); font-size: 16px; line-height: 1.6; max-width: 80ch; }
.cite__code .k { color: var(--goal); } .cite__code .f { color: #9fb6ff; }
.cite__status { margin: 0; height: 0; overflow: hidden; }

/* ---------- related + footer ---------- */
.related { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: center; padding-bottom: clamp(64px, 8vw, 104px); }
.related__label { font: 400 2rem/1.1 var(--serif); }
.related__card { position: relative; display: grid; gap: 4px; padding: 20px 64px 20px 22px; border-radius: var(--r); border: 1px solid var(--line-2); text-decoration: none; transition: border-color .2s, background .2s; }
.related__card:hover { border-color: rgba(255, 255, 255, .45); background: var(--surface); }
.related__card strong { font: 400 1.6rem/1.1 var(--serif); }
.related__card > span:not(.related__go) { font-size: 15px; color: var(--ink-2); }
.related__go { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 22px; transition: transform .25s var(--ease); }
.related__card:hover .related__go { transform: translate(4px, -50%); }
@media (max-width: 700px) { .related { grid-template-columns: 1fr; gap: 10px; } }
.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; }
.foot p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media print { .hero__media, video { display: none !important; } body { background: #fff; color: #000; } }
