:root {
  --paper: #fbfbfb;
  --ink: #191b21;
  --muted: #626b7a;
  --faint: #939eaf;
  --line: #dfe3ea;
  --blue: #164be6;
  --serif: "EB Garamond", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "DM Mono", "Courier New", monospace;
  --article-width: 48rem;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--serif); font-size: 17.5px; line-height: 1.48; -webkit-font-smoothing: antialiased; }
::selection { background: #dbe5ff; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.25; }
strong { font-weight: 500; }
img, video { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 30; padding: 0.5rem 1rem; background: var(--paper); }
.skip-link:focus { top: 1rem; }

/* ── Header and reading layout ─────────────────────── */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(63.5rem, calc(100% - 4rem)); min-height: 5.5rem; margin-inline: auto; border-bottom: 1px solid var(--line); }
.site-header > a, .site-header > span { color: var(--muted); font: 0.63rem/1.7 var(--mono); }
.site-header > a:hover { color: var(--blue); }
.home-arrow { margin-left: 0.3rem; }
.paper-layout { display: block; width: min(var(--article-width), calc(100% - 3rem)); margin: 2.7rem auto 0; }
.paper-header { padding-top: 2.1rem; text-align: center; }
.paper-kicker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem 0.9rem; margin-bottom: 1.6rem; }
.venue-badge { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--blue); font: 500 0.74rem/1.6 var(--mono); }   /* as on the home page: a blue dot, no pill */
.venue-badge::before { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); content: ""; }
.venue-status { color: var(--muted); font: 0.65rem/1.6 var(--mono); }
h1 { font-size: clamp(2.5rem, 5.6vw, 4rem); letter-spacing: -0.045em; line-height: 1.04; text-wrap: balance; }
.paper-subtitle { max-width: 42rem; margin: 1rem auto 0; color: #424b5b; font-size: clamp(1.85rem, 3.8vw, 2.7rem); line-height: 1.16; letter-spacing: -0.025em; text-wrap: balance; }
/* Every author shares both affiliations, so they are listed once, without superscripts. */
.byline { margin-top: 2rem; }
.authors, .affiliations { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; }
.authors { gap: 0.45rem 1.6rem; }
.author { font-size: 1.18rem; white-space: nowrap; }
.affiliations { gap: 0.3rem 1.15rem; margin-top: 0.7rem; color: var(--muted); font-size: 1rem; }
.byline a { text-decoration: underline; text-decoration-color: #d2d4d8; text-decoration-thickness: 1px; }
.byline a:hover { text-decoration-color: currentColor; }
/* Paper and code links as on the home page: blue mono, a soft underline, an arrow that nudges on hover. */
.paper-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.8rem; margin-top: 1.45rem; }
.inline-link { display: inline-flex; align-items: baseline; gap: 0.45rem; color: var(--blue); font: 0.72rem/1.6 var(--mono); text-decoration: underline; text-decoration-color: #164be655; text-underline-offset: 5px; transition: color 180ms, text-decoration-color 180ms; }
.inline-link:hover { text-decoration-color: currentColor; }
.link-icon { flex: none; align-self: center; width: 1.15em; height: 1.15em; margin-right: -0.1rem; }   /* GitHub mark for the code; a 2-2-1 network for NeurIPS */
.inline-link > span { display: inline-block; transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.inline-link:hover > span { transform: translate(2px, -2px); }
@media (prefers-reduced-motion: reduce) { .inline-link > span { transition: none; } .inline-link:hover > span { transform: none; } }

/* ── Manuscript typography ───────────────────────── */
article p, article li, figcaption { text-align: justify; text-justify: inter-word; hyphens: auto; }
article p + p { margin-top: 1.5rem; }
/* Sections open with an accent number set inline with the display title; wrapped titles hang after it. */
.paper-section { margin-top: 6rem; }
.paper-section > h2 { display: flex; align-items: baseline; gap: 0.45em; margin-bottom: 2rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); font-size: 2.2rem; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; }
h3 { margin: 2.65rem 0 1.15rem; color: #292b31; font: 500 1.2rem/1.4 var(--serif); }
.section-number { margin-right: 0.4rem; font-variant-numeric: tabular-nums; }
h2 .section-number { flex: none; margin: 0; color: var(--blue); font-size: 0.68em; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
h3 .section-number { color: #70747b; font: 400 0.78rem/1.4 var(--mono); }
#introduction { margin-top: 5rem; }
article ol { margin-block: 0.9rem 1.25rem; padding-left: 1.5rem; }
article li { padding-left: 0.2rem; }
article li + li { margin-top: 0.45rem; }
.citation, .cross-reference { color: #596273; }
.citation { white-space: nowrap; font-size: 0.88em; }
.citation a:hover, .cross-reference:hover { color: var(--blue); text-decoration: underline; }

/* ── Figures share the text column ────────────────── */
.paper-figure, .paper-table { width: 100%; margin: 1.8rem 0; }
.paper-figure > a { display: block; }
.paper-figure img { width: 100%; }
/* White in the raster artwork takes on the paper tone; the animated SVGs already sit on it. */
.paper-figure img[src$=".webp"] { mix-blend-mode: multiply; }
figcaption { margin: 0.9rem 0 0; color: #555d6b; font-size: 0.95rem; line-height: 1.45; }
.caption-label { color: var(--ink); font-weight: 500; }

/* ── Static result tables ─────────────────────────── */
.paper-table figcaption { margin: 0 0 0.9rem; }
.table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
table { width: 100%; min-width: 40rem; table-layout: fixed; border-collapse: collapse; border-block: 1px solid #8a929f; font-family: var(--sans); font-size: 0.75rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
th, td { padding: 0.65rem 0.35rem; text-align: right; vertical-align: middle; }
th { hyphens: none; }
th:first-child { width: 23%; text-align: left; }
td { white-space: nowrap; }
thead { border-bottom: 1px solid #bac1cb; }
thead th { font-weight: 500; }
tbody th { font-weight: 400; }
thead th[colspan] { text-align: center; }
tbody tr.table-group { border-top: 1px solid var(--line); }
tbody tr { transition: background-color 0.15s; }
tbody tr:hover { background: #191b2108; }
table strong { font-weight: 600; }
.uncertainty { display: block; margin-top: 0.12rem; color: #717989; font-size: 0.88em; font-weight: 400; }
#tab-carracing th:first-child { width: 18%; }

/* ── Mathematics without scroll containers ────────── */
math { font-family: math; font-size: 0.9em; text-align: initial; text-indent: 0; }
.equation { display: flex; align-items: center; gap: 0.7rem; margin-block: 1.4rem; overflow: visible; }
.equation-parts { display: flex; flex: 1; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem 1.2rem; min-width: 0; }
.equation math { margin: 0; font-size: 1.02rem; overflow: visible; }
.equation-number { flex: 0 0 auto; color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.equation-system { display: grid; gap: 0.8rem; }
.equation-row { display: grid; grid-template-columns: 8.6rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; }
.equation-label { color: #596272; font-size: 0.95rem; }
.equation-row math { justify-self: start; }

/* ── Video panels ─────────────────────────────────── */
.video-panel-labels { display: grid; margin-bottom: 0.5rem; color: #596272; text-align: center; font: 0.63rem/1.6 var(--mono); }
.video-panel-labels.comparison-panels { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.0869565%; }
.video-panel-labels.prior-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4880952%; }
.video-surface { position: relative; background: var(--paper); }
video { width: 100%; background: var(--paper); }
.comparison-panels video { aspect-ratio: 1840 / 352; }
.prior-panels video { aspect-ratio: 1344 / 662; }
.video-gutters { position: absolute; inset: 0; display: none; pointer-events: none; }
.is-enhanced .video-gutters { display: block; }
/* Cover only the empty separators already present between source panels. */
.comparison-panels .video-gutters { background: linear-gradient(to right, transparent 19.1304348%, var(--paper) 19.1304348% 20.2173913%, transparent 20.2173913% 39.3478261%, var(--paper) 39.3478261% 40.4347826%, transparent 40.4347826% 59.5652174%, var(--paper) 59.5652174% 60.6521739%, transparent 60.6521739% 79.7826087%, var(--paper) 79.7826087% 80.8695652%, transparent 80.8695652%); }
.prior-panels .video-gutters { background: linear-gradient(to right, transparent 49.2559524%, var(--paper) 49.2559524% 50.7440476%, transparent 50.7440476%); }
/* Minimal controls: a black play/pause glyph, a thin black progress line with a black dot, the time in grey. */
.video-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; margin-top: 0.6rem; color: var(--muted); font: 0.6rem/1 var(--mono); }
.video-toggle { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-left: -0.45rem; padding: 0; border: 0; background: none; color: var(--ink); transition: opacity 150ms; }
.video-toggle:hover { opacity: 0.6; }
.video-toggle svg { width: 0.72rem; height: 0.72rem; fill: currentColor; }
.video-toggle .pause-glyph, .video-toggle.is-playing .play-glyph { display: none; }
.video-toggle.is-playing .pause-glyph { display: inline; }
.video-controls input { width: 100%; height: 12px; margin: 0; background: transparent; cursor: pointer; appearance: none; }
.video-controls input::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: linear-gradient(to right, var(--ink) 0 var(--video-progress, 0%), #d6dae1 var(--video-progress, 0%) 100%); }
.video-controls input::-webkit-slider-thumb { width: 10px; height: 10px; margin-top: -4px; border: 0; border-radius: 50%; background: var(--ink); appearance: none; }
.video-controls input::-moz-range-track { height: 2px; border-radius: 1px; background: #d6dae1; }
.video-controls input::-moz-range-progress { height: 2px; border-radius: 1px; background: var(--ink); }
.video-controls input::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--ink); }
.video-controls input:disabled { cursor: default; }
.video-controls output { font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-figure figcaption { margin-top: 0.65rem; }

/* ── References and footer ────────────────────────── */
.references ol { padding-left: 1.8rem; font-size: 1rem; line-height: 1.5; }
.references li { text-align: left; overflow-wrap: anywhere; }
.references li + li { margin-top: 0.8rem; }
.references li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.reference-authors { color: #626976; }
.references cite { font-style: normal; }
.site-footer { display: flex; justify-content: space-between; gap: 1.5rem; width: min(63.5rem, calc(100% - 4rem)); margin: 3rem auto 0; padding-block: 1.25rem 2rem; border-top: 1px solid var(--line); color: var(--muted); font: 0.6rem/1.8 var(--mono); }
.site-footer a { flex-shrink: 0; }
.footer-notes { display: grid; gap: 0.4rem; }
.footer-license a { text-decoration: underline; text-decoration-color: #626b7a50; text-underline-offset: 3px; }
.footer-license a:hover { text-decoration-color: currentColor; }

/* ── Descent rail: the home page's reading progress ── */
/* A dotted rail in the right margin, a blue trail down to a small dot, and a mono number at each section's place
   along the page. No box: it stays out of the reading. */
.descent-rail { --progress: 0; position: fixed; top: 50%; right: max(1.4rem, calc((100vw - 1180px) / 4)); z-index: 10; width: 9px; height: min(44vh, 24rem); font: 0.69rem/1.6 var(--mono); opacity: 0; visibility: hidden; transform: translateY(-50%); transition: opacity 400ms, visibility 400ms; }
.descent-rail.is-visible { opacity: 1; visibility: visible; }
.rail-track { position: absolute; inset: 0; }
.rail-track::before, .rail-trail { position: absolute; top: 0; bottom: 0; left: calc(50% - 1px); width: 2px; background-image: radial-gradient(circle, var(--faint) 0.7px, transparent 0.85px); background-size: 2px 5px; content: ""; }
.rail-trail { background-image: radial-gradient(circle, var(--blue) 0.9px, transparent 1.05px); clip-path: inset(0 0 calc(100% - var(--progress) * (100% - 9px)) 0); }
.rail-head { position: absolute; top: calc(var(--progress) * (100% - 9px) + 1.5px); left: 1.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--paper); }   /* the paper ring lifts the dot off the dotted track */
.rail-stop { position: absolute; top: calc(var(--at) * (100% - 9px) + 4.5px); left: 0; width: 9px; height: 1px; font-size: 0.6rem; line-height: 1; }   /* the stop is its tick: number to the left of the rail, name to the right */
.rail-stop::before { position: absolute; top: 0; right: calc(100% - 2px); width: 5px; height: 1px; background: var(--faint); content: ""; transition: background 180ms; }
.rail-number, .rail-name { position: absolute; top: 0; transform: translateY(-50%); white-space: nowrap; transition: color 180ms, opacity 180ms; }
.rail-number { right: calc(100% + 0.6rem); color: var(--faint); }
.rail-name { left: calc(100% + 0.6rem); color: var(--muted); opacity: 0; }
.rail-stop:hover .rail-number, .rail-stop[aria-current="location"] .rail-number { color: var(--blue); }
.rail-stop:hover .rail-name, .rail-stop[aria-current="location"] .rail-name { opacity: 1; }
.rail-stop[aria-current="location"]::before { background: var(--blue); }
@media (max-width: 1399px) { .rail-number, .rail-name { display: none; } }   /* narrow margins: only the ticks, so no label touches the content or the window edge */

/* ── Smaller screens ──────────────────────────────── */
@media (max-width: 1199px) {
  .site-header, .site-footer { width: min(var(--article-width), calc(100% - 3rem)); }
}
@media (max-width: 899px) { .descent-rail { display: none; } }   /* no margin left beside the column */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .site-header, .site-footer, .paper-layout { width: calc(100% - 2rem); }
  .site-header { min-height: 4.5rem; }
  .site-header > span { font-size: 0.57rem; }
  .paper-header { padding-top: 1.2rem; }
  .paper-subtitle { font-size: 1.8rem; }
  .byline { margin-top: 1.6rem; }
  .authors { gap: 0.4rem 1rem; }
  .author { font-size: 1.08rem; }
  .affiliations { gap: 0.3rem 0.8rem; font-size: 0.95rem; }
  .paper-section { margin-top: 4.5rem; }
  #introduction { margin-top: 3.5rem; }
  .paper-section > h2 { margin-bottom: 1.6rem; padding-bottom: 0.9rem; font-size: 1.8rem; }
  h3 { font-size: 1.12rem; margin-top: 2.3rem; }
  .paper-figure, .paper-table { margin-block: 1.5rem; }
  .equation { gap: 0.4rem; }
  .equation-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem; }
  .equation-label { grid-column: 1 / -1; }
  .equation math, .equation-number { font-size: 0.9rem; }
  .video-panel-labels { font-size: 0.49rem; }
  .video-controls { gap: 0.6rem; font-size: 0.56rem; }
  .site-footer { flex-direction: column; gap: 0.6rem; }
}
@media print {
  .site-header, .video-controls, .site-footer, .skip-link, .descent-rail { display: none !important; }
  body { font-size: 11pt; background: white; }
  .paper-layout { width: 100%; margin: 0; }
  .paper-header { padding: 0; }
  .paper-figure, .paper-table, .equation { break-inside: avoid; }
  .table-scroll { overflow: visible; }
  table { min-width: 0; font-size: 7pt; }
  figcaption { font-size: 9pt; }
  h2, h3, h4 { break-after: avoid; }
}
