/* Inter Tight: a subset of the page's glyphs, self-hosted (vendor/fonts), declared with the headings rules below */

:root {
  /* ---- design tokens. Light (default): pure white, near-black text; colour only from the data.
     Dark (:root[data-theme="dark"]): a mid-dark neutral grey, re-tuned, the same page. */
  --page: #ffffff; --ink: #121418; --ink-2: #454b56; --ink-3: #7a808c; --line: #e6e8ec;
  --card: #ffffff; --tint: #f5f6f8; --accent: #2f5bd3; --obs: #d23a2e; --on-ink: #ffffff;
  --btn-bg: #ffffff; --glass: rgba(255, 255, 255, 0.9); --shadow-rgb: 20, 24, 33; --divider: #d5d8de;
  --tag-ink: #7a4f36; --tag-line: #e3cdbf; --err-ink: #9b2c2c; --err-bg: #fdf2f2; --err-line: #f3c9c9;
  --stripe-a: #f3f4f6; --stripe-b: #eceef1;
  /* read by the renderer */
  --stage-bg: #ffffff;
  --cell-bg: transparent;          /* 3D stages sit on the page itself */
  --stage-3d: transparent;
  --edge: #8d939e; --arrow: #ad7a5c; --arrow-tip: #e3cdbf; --hemi-ground: #9a9fa8;
  --light-sky: #ffffff; --light-hemi: 0.62; --light-key: 0.62;
  --mat-dim: 1; --mat-sat: 1;      /* material value / saturation scale */
  --obs-rgb: 0.824, 0.227, 0.180;  /* observed points */
  --grid-rgb: 0.07, 0.08, 0.10;    /* the floor grid: line colour and contrast */
  --grid-alpha: 0.07;
  --shadow-alpha: 0.2;
  --heat-0: #fbf7d4; --heat-1: #c7e9b4; --heat-2: #41b6c4; --heat-3: #225ea8; --heat-4: #0b1f5c;
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1120px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1c1e22; --ink: #e4e6ea; --ink-2: #b2b7c0; --ink-3: #868c97;
  --line: #30333a;                 /* hairlines at low contrast */
  --card: #24272c; --tint: #24272c; --accent: #8aa4f0; --obs: #dc6a5b; --on-ink: #1c1e22;
  --btn-bg: #24272c; --glass: rgba(36, 39, 44, 0.9); --shadow-rgb: 0, 0, 0; --divider: #3a3d45;
  --tag-ink: #e8c6ad; --tag-line: #5a4637; --err-ink: #f0a39a; --err-bg: #3a2524; --err-line: #5a3431;
  --stripe-a: #24272c; --stripe-b: #2a2d33;
  --stage-bg: #24272c;
  --cell-bg: #24272c;              /* slightly lighter behind 3D stages, so models do not look cut out */
  --stage-3d: #24272c;
  --edge: #737987; --arrow: #c99474; --arrow-tip: #ecd3c2; --hemi-ground: #4a4e57;
  --light-sky: #eef0f4; --light-hemi: 0.56;
  --light-key: 0.5;                /* a dimmer key */
  --mat-dim: 0.86;                 /* materials a touch darker ... */
  --mat-sat: 0.82;                 /* ... and less saturated */
  --obs-rgb: 0.863, 0.416, 0.357;  /* a slightly softer red */
  --grid-rgb: 0.92, 0.93, 0.95;
  --grid-alpha: 0.065;
  --shadow-alpha: 0.32;
  /* the heatmap for dark: low sits close to the stage colour (quiet), high a warm light yellow */
  --heat-0: #2d3440; --heat-1: #2c5566; --heat-2: #3a8d8a; --heat-3: #a3c46a; --heat-4: #f1d97a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }

/* One WebGL canvas for the whole page, drawn over the content with scissor viewports.
   It takes no pointer events: the .view elements underneath receive them. */
#stage {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: block;
}

main { padding: 0 var(--gutter) 64px; }
.sec { max-width: var(--maxw); margin: 0 auto; padding-top: 72px; }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.headline {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.04), 0 6px 24px rgba(var(--shadow-rgb), 0.05);
  padding: clamp(16px, 3vw, 28px);
  margin: 0 0 20px;
}

.title {
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.byline { color: var(--ink-3); margin: 0 0 18px; font-size: 15px; }
.abstract { color: var(--ink-2); margin: 0; }
.label { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }

figure { margin: 0; }
figcaption { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 12px; }
figcaption .fignum { font-weight: 600; color: var(--ink); }
.sc { font-variant: small-caps; }
.math { font-family: "Times New Roman", "STIX Two Math", serif; font-style: italic; }
.math .up { font-style: normal; }

/* ---------- viewer cards ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.btn, .tab, .seg button {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  line-height: 1.3;
}
.tab[aria-selected="true"], .seg button[aria-pressed="true"], .btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--on-ink);
  border-color: var(--ink);
}
.btn:focus-visible, .tab:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg-label { font-size: 13px; color: var(--ink-3); }

.views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.views.one { grid-template-columns: minmax(0, 1fr); }
.vcell { min-width: 0; }
.vlabel { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.view {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  background: var(--tint);
  touch-action: none;
  cursor: grab;
}
.views.one .view { aspect-ratio: 16 / 9; }
.view.loading::after {
  content: "loading…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 13px;
}

.timeline { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; flex-wrap: wrap; }
.timeline input[type="range"] { flex: 1 1 160px; min-width: 120px; accent-color: var(--ink); }
.frame-readout { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-3); min-width: 72px; }
.info { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.scores { font-size: 14px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.scores b { font-weight: 600; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin: 8px 0 0; }
.legend .bar { width: 140px; height: 8px; border-radius: 4px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--ink); width: 16px; height: 16px; }
.slider-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.slider-row input[type="range"] { flex: 1 1 200px; accent-color: var(--ink); }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); flex: 1 1 200px; }

.apps { display: grid; gap: 20px; }

pre.bib {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--tint);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 0;
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .sec { padding-top: 48px; }
  .views { gap: 4px; }
  .vlabel { font-size: 11px; }
  .view { aspect-ratio: 3 / 5; }
  .views.one .view { aspect-ratio: 4 / 3; }
}

/* ======================================================================== v2 layout */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--gutter);
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.topbar-title { font-size: 13px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skip { font-size: 13px; font-weight: 600; color: var(--on-ink); background: var(--ink); border-radius: 999px; padding: 6px 12px; text-decoration: none; white-space: nowrap; }
.skip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- story: a tall section whose stage sticks while the step cards scroll past */
.scrolly { position: relative; }
.scrolly .sticky {
  position: sticky;
  top: 45px;
  height: calc(100vh - 45px);
  overflow: hidden;
  /* above the canvas (z 5) so labels, chips and legends read over the renders; the stage
     itself and its viewports are transparent, the canvas shows through them */
  z-index: 6;
}
.scrolly .view { background: transparent; }
/* above the WebGL canvas (z 5), so the text cards are never drawn over */
.steps { position: relative; z-index: 7; margin-top: calc(45px - 100vh); pointer-events: none; }
.step { min-height: 100vh; display: flex; align-items: flex-end; justify-content: flex-end; padding: 0 var(--gutter) 12vh; }
.step-hero { min-height: 100vh; }
.step-long { min-height: 160vh; }
.story-card { pointer-events: auto; max-width: 340px; margin: 0; font-size: 15px; color: var(--ink-2); }

/* wall: 5 family columns, a divider between the trained three and the held-out two */
.wall { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 10px var(--gutter) 8px; }
.wall-groups { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.grp-held { padding-left: 14px; }
.wall-grid { flex: 1 1 auto; min-height: 0; display: flex; gap: 8px; }
.wcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wcol-head { display: flex; gap: 6px; align-items: baseline; font-size: 13px; height: 18px; white-space: nowrap; overflow: hidden; }
.wcol-head b { font-weight: 650; color: var(--ink); }
.wcol-head span { color: var(--ink-3); }
.wcell { position: relative; flex: 1 1 0; min-height: 0; }
.wcell .view { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 8px; cursor: default; }
.cell-label { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: var(--ink-2); background: var(--glass); border-radius: 4px; padding: 0 4px; pointer-events: none; }
.wall-divider { flex: 0 0 1px; background: var(--divider); margin: 0 6px; }
.grp-inline { display: none; }
.wall-rule { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.wlabel { opacity: 0; transition: opacity 0.4s ease; }
.wall.labels-on .wlabel { opacity: 1; }

/* S3: the focus view grows out of the cloth cell; five family views side by side */
.view.focus { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; aspect-ratio: auto; cursor: default;
  transition: left 0.7s ease, top 0.7s ease, width 0.7s ease, height 0.7s ease; }
.view.focus.expanded { left: var(--gutter); top: 16px; width: calc(100% - 2 * var(--gutter)); height: calc(100% - 64px); opacity: 1; }
.scrolly[data-mode="wall"] .view.focus { opacity: 0; }
.scrolly[data-mode="five"] .view.focus { display: none; }
.scrolly:not([data-mode="wall"]) .wall { display: none; }
.five { position: absolute; inset: 8vh var(--gutter) 14vh; display: none; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scrolly[data-mode="five"] .five { display: grid; }
.fcell { display: flex; flex-direction: column; min-height: 0; }
.fcell .view { flex: 1 1 auto; aspect-ratio: auto; border-radius: 8px; cursor: default; }
.flabel { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 4px; }
.story-chip { position: absolute; left: var(--gutter); top: 24px; font-size: 13px; font-weight: 600; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.story-legend { position: absolute; left: var(--gutter); bottom: 12px; margin: 0; background: var(--glass); border-radius: 8px; padding: 4px 8px; }

/* one viewport at a time on phones: tabs pick it */
.view-tabs { display: none; }
.tap-to-rotate .view::before {
  content: "tap to rotate"; position: absolute; right: 6px; top: 6px; font-size: 11px; color: var(--ink-3);
  background: var(--glass); border-radius: 4px; padding: 1px 5px; pointer-events: none;
}
.tap-to-rotate.active .view::before { content: "rotating · tap outside to scroll"; }
.tap-to-rotate.active .view { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 767px) {
  .topbar-title { font-size: 11px; }
  .view-tabs { display: flex; }
  .views { grid-template-columns: minmax(0, 1fr); }
  .views .vcell { display: none; }
  .views[data-mobile-view="0"] .vcell[data-view="0"],
  .views[data-mobile-view="1"] .vcell[data-view="1"],
  .views[data-mobile-view="2"] .vcell[data-view="2"] { display: block; }
  .views .view { aspect-ratio: 4 / 5; }

  /* the wall: one row per family, two of its four clips */
  .wall-groups { display: none; }
  .wall-grid { flex-direction: column; gap: 4px; }
  .grp-inline { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); opacity: 0; transition: opacity 0.4s ease; }
  .wall.labels-on .grp-inline { opacity: 1; }
  .wall-divider { flex: 0 0 1px; margin: 2px 0; }
  .wcol { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .wcol-head { flex: 0 0 100%; height: 16px; font-size: 12px; }
  .wcell { flex: 1 1 calc(50% - 2px); height: calc((100vh - 45px - 190px) / 5); }
  .wcell[data-row="2"], .wcell[data-row="3"] { display: none; }
  .wall-rule { font-size: 11px; }
  .five { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; bottom: 56px; }
  .story-card { max-width: 100%; }
}

/* anchor jumps ("Skip to Explore") and scroll-into-view land below the sticky top bar */
.sec, .card, #family-card { scroll-margin-top: 60px; }

/* v3: the hero headline sits above the wall and is visible at scroll 0 */
.hero-head { margin: 0 0 8px; }
.hero-title { font-size: clamp(17px, 2.1vw, 26px); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.hero-line { font-size: clamp(14px, 1.4vw, 17px); color: var(--ink-2); margin: 2px 0 0; }
.wall-grid { min-height: 0; }
@media (max-width: 767px) {
  .hero-title { font-size: 16px; }
  .hero-line { font-size: 13px; }
  .wcell { height: calc((100vh - 45px - 250px) / 5); }
}

/* phones show two of each family's four wall clips, and the rule line says so */
.phone-only { display: none; }
@media (max-width: 767px) { .phone-only { display: inline; } }
@media (max-width: 767px) {
  /* on phones the rule line sits under the headline, clear of the story cards */
  .hero-head { order: -2; }
  .wall-rule { order: -1; margin: 0 0 4px; }
}

/* ======================================================================== v4 */
/* hero: loading bar (the reveal waits for the whole wall) and the scroll cue */
.wall-loading { position: absolute; left: var(--gutter); bottom: 14px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-3); transition: opacity 0.4s ease; z-index: 2; }
.wall-loading .bar { width: 90px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.wall-loading .bar span { display: block; height: 100%; width: 0; background: var(--ink-3); transition: width 0.2s ease; }
.wall-loading.done { opacity: 0; pointer-events: none; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); background: var(--glass); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px 4px; cursor: pointer; transition: opacity 0.35s ease;
}
.scroll-cue svg { animation: cue-bob 1.5s ease-in-out infinite; }
.scroll-cue.gone { opacity: 0; pointer-events: none; }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .scroll-cue svg { animation: none; } }

/* method story: sticky 3D on the left (~60%), step cards on the right */
.method { position: relative; display: grid; grid-template-columns: 60% 40%; padding: 0 var(--gutter); }
.method-stage { position: sticky; top: 45px; height: calc(100vh - 45px); z-index: 6; }
.method-stage .view.focus { position: absolute; inset: 44px 0 40px 0; width: auto; height: auto; opacity: 1;
  transition: none; aspect-ratio: auto; border-radius: 10px; }
.method[data-mode="five"] .view.focus { display: none; }
.method .five { position: absolute; inset: 44px 0 40px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (min-width: 768px) {
  /* five cells in one row, each 3:4, centred in the stage so every body gets a usable viewport */
  .method .five { top: 50%; bottom: auto; transform: translateY(-50%); align-items: start; }
  .method .fcell .view { flex: none; aspect-ratio: 3 / 4; }
}
/* the amplitude-recovery panel: a row above the five meshes (desktop), the free sixth slot (phones);
   it fades in when the morph starts and stays for the rest of the section */
.amp-panel { grid-column: 1 / -1; order: -1; justify-self: center; margin: 0 0 10px; padding: 8px 16px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 10px; text-align: center;
  opacity: 0; transform: translateY(6px); }
.amp-title { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.02em; }
.amp-eq { margin: 2px 0; font-size: 15px; color: var(--ink); }
.amp-eq .katex { font-size: 1.05em; }
/* the per-mesh tag: its opacity and emphasis follow that family's morph (set from scroll) */
.fcell { position: relative; }
.stag { position: absolute; top: 6px; right: 6px; z-index: 2; padding: 1px 6px; font-size: 12px; color: var(--tag-ink);
  background: var(--glass); border: 1px solid var(--tag-line); border-radius: 999px; pointer-events: none;
  opacity: 0; }
/* section length: the pinned range is ~165vh on desktop, so the holds (p 0-0.25, 0.75-1) are ~40vh */
.method .mstep[data-step="true"] { min-height: 95vh; }
.method .mstep[data-step="norm"] { min-height: 95vh; }
.method .scale-legend { grid-column: 1 / -1; order: 2; justify-self: center; margin: 6px 0 0; }
.method .story-chip { position: absolute; left: 0; top: 8px; }
.method .story-note { position: absolute; right: 0; top: 12px; font-size: 12px; color: var(--ink-3); }
.method .story-legend { position: absolute; left: 0; bottom: 8px; }
.method-steps { position: relative; z-index: 7; padding: 30vh 0 40vh 24px; }
.mstep { min-height: 65vh; display: flex; align-items: center; justify-content: flex-start; padding: 0; }
.mstep .story-card { max-width: 380px; opacity: calc(0.45 * var(--vis, 1)); transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.mstep.active .story-card { opacity: var(--vis, 1); border-color: var(--ink-3); box-shadow: 0 2px 4px rgba(var(--shadow-rgb), 0.06), 0 10px 30px rgba(var(--shadow-rgb), 0.08); }
.story-card h3 { font-size: 16px; line-height: 1.3; margin: 0 0 6px; color: var(--ink); }
.story-card p { margin: 0; }
@media (max-width: 767px) {
  .method { grid-template-columns: 100%; padding: 0 var(--gutter); }
  .method-stage { height: 50vh; }
  .method .five { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; top: 58px; }
  .method .story-note { top: 36px; left: 0; right: 0; text-align: left; }
  .amp-panel { grid-column: auto; order: 1; justify-self: stretch; align-self: center; margin: 0; padding: 6px 4px; }
  .amp-eq { font-size: 9px; white-space: nowrap; }
  .amp-title { font-size: 10px; }
  .method .five { top: 72px; }
  /* each card waits just below the 3D for its whole step, and fades if it rises into it */
  .mstep .story-card { position: sticky; top: calc(45px + 50vh + 8px); }
  .method-steps { padding: 4vh 0 30vh 0; }
  .mstep { min-height: 60vh; align-items: flex-start; }
  .mstep .story-card { max-width: 100%; }
}
/* the method stage sits above the canvas (for its labels); its viewports stay transparent */
.method .view { background: transparent; }
.method .focus { background: transparent; }

/* a wall cell that could not be loaded stays empty; the line under the wall says how many */
.wview.failed { background: repeating-linear-gradient(135deg, var(--stripe-a) 0 8px, var(--stripe-b) 8px 16px); }
.wall-error { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 44px; margin: 0; z-index: 8;
  font-size: 12px; color: var(--err-ink); text-align: center; }
/* a section that could not start says so in place */
.sec-error { margin: 8px var(--gutter); padding: 8px 12px; font-size: 13px; color: var(--err-ink);
  background: var(--err-bg); border: 1px solid var(--err-line); border-radius: 8px; position: relative; z-index: 8; }

/* the scale section's headline spans both columns, above the pinned stage */
.method .scale-headline { grid-column: 1 / -1; margin: 48px 0 8px; }
.hint { margin: -4px 0 12px; font-size: 13px; color: var(--ink-3); }

/* the scale scrubber: a free multiplier on the real residuals, one detent at amplitude recovery
   (alpha = 1 sits at 75% of the track: the range is -0.5 .. 1.5) */
.amp-scrub { grid-column: 1 / -1; order: 3; position: relative; width: min(420px, 90%); justify-self: center;
  margin: 14px 0 18px; pointer-events: auto; }
.amp-scrub input[type="range"] { width: 100%; accent-color: var(--arrow); margin: 0; }
.amp-scrub .detent { position: absolute; left: calc(75% - 1px); top: -4px; width: 2px; height: 14px;
  background: var(--ink-3); border-radius: 1px; pointer-events: none; }
.amp-scrub .detent-label { position: absolute; left: 75%; top: 22px; transform: translateX(-50%);
  font-size: 11px; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.amp-scrub.at-detent .detent-label { color: var(--ink); font-weight: 600; }

/* ---- Explore (v8): no card, the three models on one shared stage, controls floating below */
.compare { display: flex; flex-direction: column; background: none; border: 0; box-shadow: none; padding: 0; }
.compare > .row, .compare > .timeline, .compare > .legend, .compare > .info { order: 2; justify-content: center; }
.compare > .views { order: 1; gap: 0; margin: 0 0 6px; }
.compare > .view-tabs { order: 0; justify-content: center; }
.compare .view { background: transparent; border-radius: 0; }
.compare .vlabel { text-align: center; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.compare > .row, .compare > .timeline { margin: 4px auto; font-size: 13px; }
.compare .btn, .compare .seg button { font-size: 12px; padding: 4px 11px; }
.compare .seg-label { font-size: 12px; }
.compare > .timeline { width: min(640px, 100%); }
.compare > .info { text-align: center; }
/* the callout: above the canvas, never takes the pointer */
.callout { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.callout svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.callout line { stroke: var(--ink-3); stroke-width: 1; }
.callout span { position: absolute; width: 118px; height: 22px; line-height: 20px; text-align: center; font-size: 11px;
  font-weight: 600; color: var(--ink-2); background: var(--glass); border: 1px solid var(--line); border-radius: 999px; }


/* ---- the horse film strip: a pinned stage; the strip slides, the centre frame is shown large */
.film { position: relative; min-height: 320vh; }
.film-stage { position: sticky; top: 45px; height: calc(100vh - 45px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 12px var(--gutter); overflow: hidden; }
.film-main { position: relative; width: min(1100px, 100%); aspect-ratio: 16 / 9; max-height: 62vh;
  border-radius: 10px; overflow: hidden; }
.film-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.film-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--ink-2); }
.film-legend .dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; display: inline-block; margin-left: 10px; }
.film-legend .dot.trk { background: #c0392b; }
.film-legend .dot.far { background: #1a4f9c; }
.film-legend .dot.rob { background: #e8342f; border-color: #14181d; }
.film-legend .dot.pay { background: #9c6b3f; }
.film-strip { position: relative; width: 100%; overflow: hidden; padding: 14px 0;
  background:
    radial-gradient(circle, var(--page) 2.2px, transparent 2.6px) 0 4px / 16px 8px repeat-x,
    radial-gradient(circle, var(--page) 2.2px, transparent 2.6px) 0 calc(100% - 4px) / 16px 8px repeat-x,
    var(--ink); opacity: 0.94; }
.film-track { display: flex; gap: 6px; will-change: transform; }
.film-track img { flex: 0 0 auto; width: 132px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px;
  opacity: 0.55; transition: opacity 0.2s ease, outline-color 0.2s ease; outline: 2px solid transparent; outline-offset: 1px; }
.film-track img.on { opacity: 1; outline-color: var(--page); }
.film-caption { margin: 0; font-size: 14px; color: var(--ink-2); text-align: center; max-width: 720px; }
@media (max-width: 767px) {
  .film-main { max-height: 44vh; }
  .film-track img { width: 92px; }
}

/* ---- hero: the two groups, prominent */
.wall-groups { font-size: clamp(13px, 1.25vw, 17px); font-weight: 650; letter-spacing: 0.02em; text-transform: none;
  color: var(--ink); margin: 0 0 8px; }
.wall-groups .grp { padding-bottom: 6px; border-bottom: 2px solid var(--ink-3); }
.wall-groups .grp-held { padding-left: 0; border-bottom-color: var(--accent); color: var(--accent); }
.wall-divider { flex: 0 0 2px; background: var(--ink-3); opacity: 0.6; margin: 0 8px; }
.grp-inline { opacity: 1 !important; font-size: 13px !important; color: var(--ink) !important; }

/* ---- three contributions: one small real-data visual each */
.contrib { position: relative; z-index: 6; max-width: 1240px; margin: 0 auto; padding: 96px var(--gutter) 40px; }
.contrib-grid { display: grid; grid-template-columns: 1fr 1.3fr 1.6fr; gap: 28px; }
.contrib-card { display: flex; flex-direction: column; gap: 10px; }
.contrib-title { margin: 0; font-size: 18px; font-weight: 650; color: var(--ink); }
.contrib-views { display: flex; gap: 6px; }
.cview { flex: 1 1 0; margin: 0; min-width: 0; }
.cview .view { aspect-ratio: auto; height: clamp(200px, 22vw, 300px); background: transparent; border-radius: 0; cursor: default; }
.cview figcaption { text-align: center; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.contrib-text { margin: 0; font-size: 14px; color: var(--ink-2); }
.contrib-legend { justify-content: center; margin-top: 18px; }
@media (max-width: 900px) { .contrib-grid { grid-template-columns: 1fr; gap: 36px; } }

/* Explore: the "largest harmonic error" callout, and a plain ring at the same vertex in Ours */
.callout.ring span { display: none; }
.callout .ring-dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 1.5px solid var(--ink); box-shadow: 0 0 0 2px rgba(0,0,0,0.25); }
.callout.err span { width: 150px; }

/* the theme toggle (header) */
.topbar-actions { display: inline-flex; align-items: center; gap: 8px; }
.theme-toggle { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 999px;
  border: 1px solid var(--line); background: var(--btn-bg); color: var(--ink-2); cursor: pointer; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar { background: var(--glass); }

/* hero v11: 5 columns x 2 rows on desktop (rows 0-1 of the seeded draw), 2 x 5 on phones */
.wcell[data-row="2"], .wcell[data-row="3"] { display: none; }
.wall-grid { gap: 12px; }
.wcol { gap: 10px; }

.film-head { margin: 0; font-size: clamp(22px, 3vw, 32px); align-self: flex-start; }

/* the error callout: an anchor dot on the vertex, a short leader to the label; dimmed (not hidden)
   when the vertex faces away from the camera */
.callout .anchor-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--ink); box-shadow: 0 0 0 2px var(--page); transition: opacity 0.15s ease; }
.callout.hidden-anchor .anchor-dot, .callout.hidden-anchor .ring-dot { opacity: 0.3; }
.callout.hidden-anchor line { stroke-dasharray: 3 3; }

/* v13: the title band above the hero; the abstract after it */
.title-band { max-width: var(--maxw); margin: 0 auto; padding: 72px var(--gutter) 8px; text-align: center; }
.title-band .title { font-size: clamp(26px, 4vw, 42px); margin: 0 0 10px; text-wrap: balance; }
.title-band .byline { margin: 0; }
.abstract-sec { padding: 72px var(--gutter) 24px; max-width: 820px; }
.abstract-sec .abstract { font-size: 16px; line-height: 1.65; }

/* v13 applications: one film at a time, a left/right switcher above it */
.film-top { width: min(1100px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.film-switch { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.film-prev, .film-next { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.film-prev:hover, .film-next:hover { border-color: var(--ink-3); }
.film-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 2px; }
.film-tabs::-webkit-scrollbar { display: none; }
.ftab { flex: 0 0 auto; font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink-3); white-space: nowrap; }
.ftab:hover { color: var(--ink); }
.ftab[aria-selected="true"] { color: var(--ink); background: var(--card); border-color: var(--line); font-weight: 600; }
.film-main { aspect-ratio: 16 / 9; background: #ffffff; touch-action: pan-y; }
.film-track img { aspect-ratio: auto; width: auto; height: 74px; }
.film-main { max-height: 56vh; }
@media (max-width: 767px) {
  .film-top { justify-content: center; }
  .film-head { align-self: center; text-align: center; }
  .film-switch { width: 100%; }
  .film-tabs { flex: 1 1 auto; }
  .film-track img { height: 52px; }
  .film-main { max-height: 42vh; }
}

/* v13b: applications as two stacked blocks, Video then Robot */
.film-titles { display: flex; flex-direction: column; gap: 2px; }
.film-block { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.film-robot { min-height: 240vh; }
@media (max-width: 767px) { .film-titles { align-items: center; } }

/* the method figure: sharp SVG, rounded, a subtle shadow; click opens a lightbox */
.overview-sec { padding: 56px var(--gutter) 24px; max-width: 1320px; }
.overview-sec figure { margin: 0; }
.overview-sec img { display: block; width: 100%; height: auto; }
img.paper-fig { border-radius: 8px; box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.06), 0 6px 20px rgba(var(--shadow-rgb), 0.08);
  cursor: zoom-in; background: #ffffff; }
.lightbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(var(--shadow-rgb), 0.72); cursor: zoom-out; }
.lightbox img { max-width: none; max-height: none; border-radius: 8px;
  background: #ffffff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }

/* ===== Explore: five synchronised views, thumbnail row ===== */
.x5-thumbs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 0 0 12px; }
.x5-thumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; overflow: hidden;
  width: 116px; height: 81px; opacity: 0.72; transition: opacity 0.15s ease, border-color 0.15s ease; }
.x5-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.x5-thumb:hover { opacity: 1; }
.x5-thumb[aria-pressed="true"] { opacity: 1; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.compare.x5 > .x5-thumbs { order: 0; }
.x5-views { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.x5-views .vcell { display: block !important; }
.x5-views .view { aspect-ratio: 3 / 4; }
.x5-dots { display: none; }
@media (max-width: 767px) {
  .x5-thumb { width: 64px; height: 45px; border-radius: 6px; }
  .x5-thumbs { gap: 6px; flex-wrap: nowrap; }
  .x5-views { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0 !important; scrollbar-width: none; }
  .x5-views::-webkit-scrollbar { display: none; }
  .x5-views .vcell { flex: 0 0 100%; scroll-snap-align: start; }
  .x5-views .view { aspect-ratio: 4 / 5; }
  .x5-views .vcell[data-method="ours"] { order: 1; }
  .x5-views .vcell[data-method="harmonic"] { order: 2; }
  .x5-views .vcell[data-method="nsdp"] { order: 3; }
  .x5-views .vcell[data-method="doma"] { order: 4; }
  .x5-views .vcell[data-method="gt"] { order: 5; }
  .compare.x5 > .x5-dots { order: 1; display: flex; justify-content: center; gap: 6px; margin: 0 0 6px; }
  .x5-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
  .x5-dots span.on { background: var(--ink-2); }
}

/* ===== Explore: two rows (shape above error), ground truth's error cell = colour bar ===== */
.x5-two .x5-cell { display: flex !important; flex-direction: column; }
.x5-two .view { aspect-ratio: 5 / 6; }
.x5-legendcell { aspect-ratio: 5 / 6; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--ink-3); }
.x5-legendcell .bar { display: inline-block; width: 46%; height: 8px; border-radius: 4px; }
@media (max-width: 767px) {
  .x5-two .view, .x5-two .x5-legendcell { aspect-ratio: 5 / 4; }
}
.tap-to-rotate .x5-error::before { content: none !important; }

/* ===== Explore: the whole block in one viewport, full content width, figures fill their cells ===== */
#explore.sec { max-width: none; padding-top: 10px; margin-top: 62px; scroll-margin-top: 56px; }
#explore .eyebrow { margin: 0 0 2px; }
#explore .headline { margin: 0 0 2px; }
#explore .hint { margin: 0 0 8px; }
#explore .tabs { margin: 0 0 8px; }
.compare.x5 > .x5-thumbs { margin: 0 0 12px; }
.compare.x5 > .views { margin: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.compare.x5 .vlabel { font-size: 14px; font-weight: 650; letter-spacing: 0.06em; color: var(--ink); margin: 0 0 4px; }
.x5-legendcell { flex-direction: column; gap: 6px; }
.x5-legendlabel { font-size: 13px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.x5-scale { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.x5-legendcell .bar { width: 52%; }
.compare.x5 > .timeline { width: min(860px, 100%); margin: 6px auto 0; }
.compare.x5 > .timeline .toggle { margin-left: 8px; white-space: nowrap; }
.x5-waiting .view { cursor: progress; }
@media (min-width: 768px) {
  .x5 { --x5row: clamp(190px, calc((100vh - 368px) / 2), 30vw); }
  .x5-two .view, .x5-two .x5-legendcell { aspect-ratio: auto; height: var(--x5row); }
}

/* ===== Explore: a column that fails or stalls shows Retry instead of "loading…" ===== */
.x5-two .x5-cell { position: relative; }
.x5-retry { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; font: inherit; font-size: 13px;
  font-weight: 600; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--page, #fff); color: var(--ink); cursor: pointer; }
.x5-retry[hidden] { display: none; }
.x5-retry:hover { border-color: var(--ink); }

/* ==========================================================================================
   DESIGN v21 -- "sparse to dense", in Tidewater: cool slate, one deep sea-teal accent; the data keeps
   its own colours (observed-point red, the error ramp). A dot motif -- a few points filling into a
   line -- marks every section, the way the method fills a mesh from a few points.
   ========================================================================================== */
:root {
  --page: #f6f9f9; --ink: #0c1b1e; --ink-2: #344a4f; --ink-3: #587075; --line: #dbe4e5; --divider: #c5d3d5;
  --card: #ffffff; --tint: #ebf1f2; --accent: #0a6873; --accent-2: #07525a; --accent-soft: #dfeff1;
  --on-ink: #ffffff; --btn-bg: #ffffff; --glass: rgba(246, 249, 249, 0.88); --shadow-rgb: 8, 28, 32;
  --band: #0a2a2f; --band-ink: #e6f1f2; --band-ink-2: #a6c2c5; --band-accent: #7fd6dd; --band-line: #154047;
  --tag-ink: #0a6873; --tag-line: #b9dade; --tag-rgb: 223, 239, 241;
  --rail: #0a2a2f; --rail-ink: #ffffff; --skip-ink: #ffffff;
  --radius: 16px; --radius-s: 10px;
  --maxw: 1180px;
  --nav-h: 54px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] {
  --page: #071315; --ink: #e2eeef; --ink-2: #b1c6c8; --ink-3: #85a0a3; --line: #15292c; --divider: #22393d;
  --card: #0c1c1f; --tint: #0c1c1f; --accent: #5ccbd4; --accent-2: #8adde3; --accent-soft: #10292d;
  --on-ink: #071315; --btn-bg: #0c1c1f; --glass: rgba(7, 19, 21, 0.86); --shadow-rgb: 0, 0, 0;
  --band: #030a0b; --band-ink: #e0eced; --band-ink-2: #a0b9bc; --band-accent: #7fd6dd; --band-line: #102326;
  --tag-ink: #8adde3; --tag-line: #1f4146; --tag-rgb: 16, 41, 45;
  --rail: #030a0b; --rail-ink: #e2eeef; --skip-ink: #071315;
  --stage-bg: #071315; --cell-bg: #071315; --stage-3d: #071315;
  --edge: #6f7a8f; --hemi-ground: #3d4658; --light-sky: #eef1f7;
  --grid-rgb: 0.86, 0.89, 0.96; --grid-alpha: 0.06;
  --heat-0: #1b2638; --heat-1: #24506a; --heat-2: #33908c; --heat-3: #a6c86a; --heat-4: #f3db7a;
}

body { font-size: 17px; line-height: 1.65; letter-spacing: -0.003em; font-feature-settings: "ss01", "cv11"; text-rendering: optimizeLegibility; }
::selection { background: var(--accent-soft); color: var(--ink); }
a { color: var(--accent); }

/* ---- the dot motif: three points filling into a line (sparse -> dense) ---- */
.dots, .eyebrow::before, .label::before, .film-block::before {
  content: ""; display: inline-block; vertical-align: middle; width: 30px; height: 6px; margin: -2px 10px 0 0;
  background:
    radial-gradient(circle, currentColor 1.6px, transparent 2px) 0 50% / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 1.6px, transparent 2px) 8px 50% / 6px 6px no-repeat,
    radial-gradient(circle, currentColor 1.6px, transparent 2px) 14px 50% / 6px 6px no-repeat,
    linear-gradient(currentColor, currentColor) 20px 50% / 10px 2px no-repeat;
}
.eyebrow, .label, .film-block {
  font-size: 12px; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.headline { font-size: clamp(28px, 3.3vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -0.028em; color: var(--ink); text-wrap: balance; }

/* ---- nav: wordmark, section links, a progress hairline ---- */
.topbar { height: var(--nav-h); padding: 0 var(--gutter); background: var(--glass); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.topbar-title { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 750; letter-spacing: -0.01em; color: var(--ink); }
.topbar-title .mark { width: 18px; height: 18px; flex: 0 0 auto; }
.topnav { display: flex; gap: 2px; margin: 0 auto; }
.topnav a { font-size: 13.5px; font-weight: 550; color: var(--ink-3); text-decoration: none; padding: 6px 12px; border-radius: 999px;
  transition: color .2s var(--ease), background-color .2s var(--ease); }
.topnav a:hover { color: var(--ink); background: var(--tint); }
.topnav a.on { color: var(--ink); }
.skip { background: var(--accent); color: var(--skip-ink); font-weight: 650; padding: 8px 16px; transition: background-color .2s var(--ease), transform .2s var(--ease); }
.skip:hover { background: var(--accent-2); }
.theme-toggle { width: 34px; height: 34px; }
.navprog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: var(--accent); pointer-events: none; }
@media (max-width: 900px) { .topnav { display: none; } }

/* ---- title: a lock-up over a field of points ---- */
.title-band { position: relative; max-width: none; padding: clamp(56px, 10vh, 112px) var(--gutter) clamp(32px, 6vh, 64px); text-align: left;
  overflow: hidden; isolation: isolate; }
.title-band::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle, var(--divider) 1.1px, transparent 1.6px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 90% at 85% 0%, #000 0%, transparent 62%); mask-image: radial-gradient(120% 90% at 85% 0%, #000 0%, transparent 62%); }
.title-inner { max-width: none; margin: 0; }
.title-band .title { font-size: clamp(36px, 5.6vw, 76px); line-height: 1.0; font-weight: 760; letter-spacing: -0.04em; margin: 0; max-width: 15ch; text-wrap: balance; }
.title-band .title .wm { color: var(--accent); }
.title-band .title .rest { display: block; margin-top: 0.12em; font-size: 0.56em; line-height: 1.12; font-weight: 640; letter-spacing: -0.025em; color: var(--ink); max-width: 24ch; }
.title-band .byline { margin: 22px 0 0; font-size: 15px; color: var(--ink-3); }
.quicklinks { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }
.quicklinks a { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 16px; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.quicklinks a:hover { border-color: var(--ink); transform: translateY(-1px); }
.quicklinks a.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.quicklinks a svg { width: 14px; height: 14px; }

/* ---- hero wall: headline + group rules ---- */
.hero-title { font-size: clamp(18px, 1.9vw, 26px); font-weight: 720; letter-spacing: -0.02em; }
.hero-line { font-size: clamp(14px, 1.15vw, 16px); color: var(--ink-3); }
.wall-groups { font-size: 12px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.wall-groups .grp { border-bottom-width: 2px; border-bottom-color: var(--ink); }
.wall-groups .grp-held { color: var(--accent); border-bottom-color: var(--accent); }
.wall-divider { background: var(--divider); opacity: 1; flex-basis: 1px; }
.scroll-cue { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 6px 20px rgba(var(--shadow-rgb), 0.08); }

/* ---- abstract: an ink band, two columns ---- */
.abstract-sec { max-width: none; margin: 0; padding: clamp(64px, 11vh, 120px) var(--gutter); background: var(--band); color: var(--band-ink);
  position: relative; z-index: 6; }
.abstract-sec > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.abstract-sec .label { color: var(--band-accent); margin-bottom: 18px; }
.abstract-sec .abstract { color: var(--band-ink); font-size: clamp(17px, 1.45vw, 21px); line-height: 1.62; letter-spacing: -0.006em; max-width: 62ch;
  margin-left: max(0px, calc((100% - var(--maxw)) / 2)); }
@media (min-width: 1000px) {
  .abstract-sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); column-gap: 48px; }
  .abstract-sec > * { max-width: none; margin: 0; }
  .abstract-sec .label { justify-self: end; margin-top: 6px; }
  .abstract-sec { padding-left: max(var(--gutter), calc((100vw - var(--maxw)) / 2)); padding-right: max(var(--gutter), calc((100vw - var(--maxw)) / 2)); }
  .abstract-sec .abstract { margin: 0; }
}

/* ---- applications: segmented clip picker, a framed frame, a film rail ---- */
.film-head { font-size: clamp(26px, 3vw, 40px); font-weight: 700; letter-spacing: -0.028em; }
.film-block { font-size: 12px; }
.film-switch { background: var(--tint); border-radius: 999px; padding: 4px; gap: 2px; }
.film-prev, .film-next { width: 30px; height: 30px; border: 0; background: var(--card); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.12); }
.film-prev:hover, .film-next:hover { color: var(--accent); }
.ftab { font-size: 12.5px; font-weight: 550; color: var(--ink-3); padding: 6px 12px; border: 0; }
.ftab[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 650; box-shadow: 0 1px 3px rgba(var(--shadow-rgb), 0.14); border: 0; }
.film-main { border-radius: var(--radius); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.06), 0 18px 48px -18px rgba(var(--shadow-rgb), 0.28);
  transition: opacity .25s var(--ease); }
.film-main.switching img { opacity: 0.45; transition: opacity .2s var(--ease); }
.film-legend { font-size: 12.5px; color: var(--ink-2); gap: 6px 4px; }
.film-strip { width: 100%; max-width: 100%; border-radius: 12px; padding: 14px 0; opacity: 1;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 1.6px, transparent 2px) 6px 4px / 14px 7px repeat-x,
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 1.6px, transparent 2px) 6px calc(100% - 3px) / 14px 7px repeat-x,
    var(--rail); }
.film-track img { border-radius: 3px; opacity: 0.5; }
.film-track img.on { opacity: 1; outline: 2px solid var(--rail-ink); outline-offset: 2px; }
.film-caption { font-size: 14px; color: var(--ink-2); max-width: 760px; }

/* ---- method figure: a quiet frame ---- */
.overview-sec { max-width: none; padding-top: clamp(48px, 9vh, 96px); }
.overview-sec figure { max-width: 1280px; margin: 0 auto; }
img.paper-fig { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 18px 48px -24px rgba(var(--shadow-rgb), 0.25); }

/* ---- the scale story: full-width stage, a caption band instead of scrolling cards (desktop) ---- */
.method .scale-headline { margin: clamp(40px, 7vh, 72px) 0 0; }
.amp-panel { background: var(--card); border-color: var(--line); border-radius: var(--radius-s); }
.amp-title { color: var(--accent); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; }
.stag { color: var(--tag-ink); border-color: var(--tag-line); }
.amp-scrub input[type="range"] { accent-color: var(--accent); }
.story-chip { background: var(--card); border-color: var(--line); font-weight: 650; }
.flabel { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
@media (min-width: 768px) {
  .method.banded { grid-template-columns: 100%; }
  .method.banded .method-stage { top: var(--nav-h); height: calc(100vh - var(--nav-h)); }
  .method.banded .five { position: absolute; left: 0; right: 0; top: 52px; bottom: auto; transform: none; display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
  .method.banded .fcell .view { aspect-ratio: auto; height: clamp(190px, calc(100vh - var(--nav-h) - 52px - 92px - 100px - 214px), 450px); }
  .method.banded .amp-panel { margin: 0 0 6px; }
  .method.banded .amp-scrub { margin: 8px 0 0; }
  .method.banded .method-steps { padding: 0; }
  .method.banded .mstep { min-height: 62vh; }
  .method.banded .mstep .story-card { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
  .mband { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(980px, 100%); display: grid;
    grid-template-columns: 1fr 1fr; gap: 14px; z-index: 7; }
  .mband-card { font-size: 14.5px; line-height: 1.55; color: var(--ink-3); padding: 14px 18px; border-radius: var(--radius-s);
    border: 1px solid var(--line); background: var(--glass); transition: color .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease); }
  .mband-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink-3); transition: color .3s var(--ease); }
  .mband-card p { margin: 0; }
  .mband-card.on { color: var(--ink-2); border-color: var(--ink); background: var(--card); box-shadow: 0 12px 32px -18px rgba(var(--shadow-rgb), 0.35); }
  .mband-card.on h3 { color: var(--ink); }
  .mband-card.on h3::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin: 0 8px 2px 0; }
  .method.banded .story-chip { display: none; }
  .method.banded .story-note { left: 0; right: 0; top: 14px; text-align: center; }
}
@media (max-width: 767px) {
  .method-steps { padding: 2vh 0 6vh 0; }
  .mstep { min-height: 46vh; }
}

/* ---- contributions: three cards, ordered by one, two, three points ---- */
.contrib { padding: clamp(40px, 7vh, 72px) var(--gutter) 24px; max-width: none; }
.contrib-grid { gap: 20px; }
.contrib-card { padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; gap: 12px; }
.contrib-card::before { content: ""; display: block; height: 6px; width: 30px; color: var(--accent);
  background: radial-gradient(circle, currentColor 2px, transparent 2.5px) 0 50% / 8px 6px no-repeat; }
.contrib-card.c-s::before { background:
  radial-gradient(circle, currentColor 2px, transparent 2.5px) 0 50% / 8px 6px no-repeat,
  radial-gradient(circle, currentColor 2px, transparent 2.5px) 10px 50% / 8px 6px no-repeat; }
.contrib-card.c-f::before { background:
  radial-gradient(circle, currentColor 2px, transparent 2.5px) 0 50% / 8px 6px no-repeat,
  radial-gradient(circle, currentColor 2px, transparent 2.5px) 10px 50% / 8px 6px no-repeat,
  radial-gradient(circle, currentColor 2px, transparent 2.5px) 20px 50% / 8px 6px no-repeat; }
.contrib-title { font-size: 19px; font-weight: 700; letter-spacing: -0.018em; }
.contrib-text { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.cview figcaption { color: var(--ink-3); }

/* ---- Explore and the controls everywhere: segmented, quiet, one accent ---- */
.tabs { background: var(--tint); border-radius: 999px; padding: 4px; display: inline-flex; gap: 2px; }
.tab { border: 0; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13.5px; padding: 6px 16px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); border: 0; box-shadow: 0 1px 3px rgba(var(--shadow-rgb), 0.16); }
.btn, .seg button { border-color: var(--line); font-weight: 550; }
.seg button[aria-pressed="true"], .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.timeline input[type="range"], .slider-row input[type="range"], .toggle input { accent-color: var(--accent); }
.x5-thumb { border-radius: 10px; background: var(--card); transition: opacity .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease); }
.x5-thumb:hover { transform: translateY(-1px); }
.x5-thumb[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.compare.x5 .vlabel { font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--ink); }
.x5-legendlabel { font-size: 12px; letter-spacing: 0.14em; color: var(--ink-2); }
#explore .hint { color: var(--ink-3); }
#explore .tabs { margin: 0 0 8px; }
#explore .headline { font-size: clamp(26px, 2.6vw, 38px); }

/* ---- BibTeX ---- */
#bibtex .card { position: relative; border-radius: var(--radius); }
pre.bib { background: var(--tint); border-radius: var(--radius-s); font-size: 13px; }
.copy-bib { position: absolute; right: 18px; top: 18px; font: inherit; font-size: 12.5px; font-weight: 650; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.copy-bib:hover { border-color: var(--ink); }
.endmark { display: flex; justify-content: center; padding: 40px 0 8px; color: var(--divider); }
.endmark .dots { margin: 0; width: 30px; }

/* ---- section reveal: content rises in once (off for reduced motion) ---- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } .quicklinks a, .x5-thumb { transition: none; } }

/* ---- phone ---- */
@media (max-width: 767px) {
  body { font-size: 16px; }
  .title-band { padding: 44px var(--gutter) 28px; }
  .title-band .title { font-size: 40px; }
  .title-band .title .rest { font-size: 0.5em; }
  .quicklinks { gap: 8px; }
  .quicklinks a { padding: 8px 13px; font-size: 13px; }
  .abstract-sec .abstract { font-size: 17px; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 6px 13px; }
  .contrib-card { padding: 18px; }
  .copy-bib { top: 12px; right: 12px; }
}

/* v21 fixes: the film frame is exactly the clip's shape (no pillarbox), headers share one left edge */
.film-top { width: 100%; }
.film-main { background: transparent; width: min(1100px, 100%, calc(56vh * var(--ar, 1.7778))); max-height: none; }
@media (max-width: 767px) { .film-main { width: min(100%, calc(42vh * var(--ar, 1.7778))); } }
.film-main img { opacity: 0; }
.film-main img.front { opacity: 1; }
.film-main.switching img.front { opacity: 0.45; transition: opacity .2s var(--ease); }

/* ==========================================================================================
   DESIGN v21 r2 -- one centred column. Figures and sections: --col (1180 px); running text:
   --measure (about 70 characters); Explore: --col-x (1560 px). Margins grow on wide screens;
   full-bleed bands keep their content inside the column.
   ========================================================================================== */
:root { --col: 1180px; --col-x: 1560px; --measure: 68ch;
  --side: max(var(--gutter), calc((100vw - var(--col)) / 2)); }
.topbar { padding-left: var(--side); padding-right: var(--side); }

/* title: two lines as the paper sets them; the author block, then one row of buttons, under it; the wall right under that */
.title-band { padding: clamp(22px, 3.4vh, 44px) var(--side) clamp(14px, 2.2vh, 26px); }
.title-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 40px; }
.title-band .title { max-width: none; font-size: clamp(30px, 3.5vw, 54px); line-height: 1.06; font-weight: 740; letter-spacing: -0.032em; }
.title-band .title .l1, .title-band .title .l2 { white-space: nowrap; }
.title-band .title .l2 { color: var(--ink-2); font-weight: 650; }
.title-side { text-align: right; padding-bottom: 6px; }
.title-band .byline { margin: 0 0 12px; }
.quicklinks { margin: 0; justify-content: flex-start; }
.title-band::before { -webkit-mask-image: radial-gradient(90% 120% at 100% 0%, #000 0%, transparent 60%); mask-image: radial-gradient(90% 120% at 100% 0%, #000 0%, transparent 60%); }

/* hero wall: inside the column */
.scrolly .sticky .wall { left: var(--side); right: var(--side); padding-left: 0; padding-right: 0; }
.wall-loading { left: var(--side); }

/* abstract band: edge to edge, text at the reading measure inside the column */
.abstract-sec { padding-left: var(--side) !important; padding-right: var(--side) !important; }
.abstract-sec .abstract { max-width: var(--measure); }

/* applications */
.film-stage { padding-left: var(--side); padding-right: var(--side); }
.film-top, .film-strip { max-width: var(--col); }
.film-main { width: min(var(--col), 100%, calc(56vh * var(--ar, 1.7778))); }
.film-caption { max-width: var(--measure); }

/* method figure, amplitude recovery, contributions, BibTeX */
.overview-sec { padding-left: var(--side); padding-right: var(--side); }
.overview-sec figure { max-width: var(--col); }
.method { padding-left: var(--side); padding-right: var(--side); }
.contrib { padding-left: var(--side); padding-right: var(--side); }
.contrib-text { max-width: var(--measure); }
main { padding-left: 0; padding-right: 0; }
#bibtex.sec { max-width: none; padding-left: var(--side); padding-right: var(--side); }
#bibtex .card { max-width: var(--col); margin-left: auto; margin-right: auto; }
/* Explore: wider than the text column so the five columns stay large; title, tabs and controls on its width */
#explore.sec { max-width: none; padding-left: max(var(--gutter), calc((100vw - var(--col-x)) / 2)); padding-right: max(var(--gutter), calc((100vw - var(--col-x)) / 2)); }

@media (max-width: 767px) {
  .title-inner { grid-template-columns: minmax(0, 1fr); }
  .title-band .title { font-size: 31px; line-height: 1.1; }
  .title-band .title .l1 { white-space: normal; }
  .title-band .title .l2 { white-space: normal; }
  .br-d { display: none; }
  .title-side { text-align: left; padding-top: 16px; }
  .quicklinks { justify-content: flex-start; }
  /* amplitude recovery: the five meshes take the stage rows, legend and scrubber only their own height */
  .method .five { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto auto; grid-auto-rows: auto; bottom: 8px; }
  .method-stage { height: 56vh; }
  .method .amp-scrub { margin: 6px auto 20px; }
  .mstep { min-height: 34vh; }
  .mstep .story-card { top: calc(var(--nav-h) + 56vh + 6px); }
}
/* r2 fixes: the reading measure in em of the text's own size (about 70 characters of Inter Tight);
   Explore rows no taller than a column is wide, so very tall screens do not shrink the figures */
:root { --measure: 31em; }
@media (min-width: 768px) {
  .x5 { --x5row: clamp(190px, min(calc((100vh - 368px) / 2), calc(min(100vw - 2 * var(--gutter), var(--col-x)) / 5 * 1.05)), 30vw); }
}
/* r2: on very tall screens the wall cells keep their shape (about 1 : 1.3) instead of stretching */
@media (min-width: 768px) {
  .scrolly .wall-grid { flex: 0 1 auto; height: min(100%, calc((min(100vw - 2 * var(--gutter), var(--col)) - 48px) / 5 * 1.3 * 2 + 10px)); }
}

/* ==========================================================================================
   DESIGN v21 r3 -- the title area, with room for the final author block
   ========================================================================================== */
/* title area: the title alone on its two lines; the author block (authors, affiliations, venue) under it;
   one row of buttons under that, left-aligned with the title (the row for Paper / Code / Video / BibTeX) */
.title-inner { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "meta" "links"; align-items: start; }
.title-band .title { grid-area: title; }
.title-links { grid-area: links; margin-top: 16px; }
.authorblock { grid-area: meta; margin-top: 12px; }
.authorblock p { margin: 0; }
.authors { font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.authors .au { white-space: nowrap; margin-right: 1.1em; color: var(--ink); font-weight: 560; }
.authors sup, .affils sup { font-size: 0.68em; color: var(--accent); margin-left: 1px; }
.affils { margin-top: 3px !important; font-size: 13.5px; color: var(--ink-3); }
.affils .af { white-space: nowrap; margin-right: 1.2em; }
.venue { margin-top: 3px !important; font-size: 13.5px; font-weight: 650; color: var(--accent); letter-spacing: 0.02em; }
.title-band .byline.authors { margin: 0; font-size: 15px; color: var(--ink-3); }
@media (max-width: 767px) { .title-links { margin-top: 14px; } }

/* ==========================================================================================
   DESIGN v21 r4 -- scroll cue, Figure-1 brackets, headings face, wall spacing
   ========================================================================================== */
/* the scroll cue: pinned to the bottom of the first screen (the title band pushed the hero's own
   bottom edge below the fold); it fades as soon as the reader scrolls */
.scroll-cue { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 9;
  flex-direction: row; gap: 8px; padding: 9px 18px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.12em;
  color: var(--on-ink); background: var(--ink); border: 0; box-shadow: 0 10px 28px -8px rgba(var(--shadow-rgb), 0.45); }
.scroll-cue svg { width: 14px; height: 14px; }
.scroll-cue.gone { opacity: 0; transform: translate(-50%, 8px); transition: opacity .35s var(--ease), transform .35s var(--ease); }

/* group headers in the form of the paper's Figure 1: one over-bar per group with turned-down ends,
   spanning exactly its columns (placed by js/design.js), the label centred above the bar */
@media (min-width: 768px) {
  .wall-groups { position: relative; display: block; height: 34px; margin: 0 0 4px; }
  .wall-groups .grp { position: absolute; top: 0; height: 34px; padding: 0; margin: 0; border: 0; background: none;
    border-radius: 0; display: block; text-align: center; font-size: 13px; font-weight: 650; letter-spacing: 0.06em; text-transform: none;
    color: var(--ink); width: auto; }
  .wall-groups .grp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 9px; margin: 0;
    border: 2px solid var(--ink); border-bottom: 0; background: none; }
  .wall-groups .grp-held { color: var(--accent); }
  .wall-groups .grp-held::after { border-color: var(--accent); }
  .wall-divider { flex: 0 0 1px; background: var(--divider); opacity: 1; margin: 0 9px; }
  /* family names under the brackets, centred over their columns, always shown (as in the figure) */
  .wcol-head { opacity: 1 !important; justify-content: center; font-size: 13px; height: 18px; }
  .wcol.held .wcol-head b { color: var(--accent); }
  .wall-grid { gap: 10px; }
  .wcol { gap: 6px; }
}

/* headings: Inter Tight, tracking 0 (no negative letter-spacing on display sizes); the subset keeps the page's glyphs */
@font-face { font-family: "Inter Tight"; src: url("../vendor/fonts/inter-tight-sub.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root { --font-head: var(--font); --head-ls: 0; }
.title-band .title, .headline, .film-head, .hero-title, .contrib-title, #explore .headline { font-family: var(--font-head); letter-spacing: var(--head-ls); }

/* r4: wall cells close to the figures' own shape (landscape-ish), so the figures fill them and the
   band between the brackets and the first row closes */
@media (min-width: 768px) {
  .scrolly .wall-grid { flex: 0 1 auto; height: min(100%, calc((min(100vw - 2 * var(--gutter), var(--col)) - 48px) / 5 * 0.92 * 2 + 46px)); }
}

/* ===== Explore: the largest-harmonic-error marker, and the enlarged view ===== */
.x5 .callout.x5-mark span { width: 196px; }
.x5 .callout.ring .ring-dot { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.x5-enlarge { position: absolute; left: 6px; top: 6px; z-index: 6; width: 26px; height: 26px; display: grid; place-items: center;
  padding: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--glass); color: var(--ink-2); cursor: zoom-in;
  opacity: 0; transition: opacity 0.15s ease; }
.x5-cell:hover .x5-enlarge, .x5-enlarge:focus-visible { opacity: 1; }
.view.loading .x5-enlarge { display: none; }
.x5-bigopen > .x5-views, .x5-bigopen > .x5-dots { display: none !important; }
.x5-big { order: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.x5-big[hidden] { display: none; }
.x5-bighead { position: relative; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.x5-bighead .btn { font-size: 13px; padding: 5px 12px; }
.x5-bigtitle { font-size: 14px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); min-width: 220px; text-align: center; }
.x5-bigclose { margin-left: 18px; }
.x5-bigpanels { display: flex; gap: 12px; justify-content: center; align-items: flex-start; }
.x5-bigcell .vlabel { text-align: center; font-size: 14px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin: 0 0 4px; }
.x5-bigcell .view { aspect-ratio: auto; background: transparent; border-radius: 0; }
@media (max-width: 767px) {
  .x5-enlarge { opacity: 1; }
  .x5-bigpanels { flex-direction: column; width: 100%; }
  .x5-bighead { gap: 6px; }
  .x5-bigtitle { order: -1; width: 100%; min-width: 0; }
  .x5-bigclose { margin-left: 0; }
}

/* fix_v22 M: the pinned wall uses the stage height (was: rows sized to a 0.92 cell shape, leaving the bottom
   quarter empty at 1440x900). Column widths unchanged; the rows take the height left above the scroll cue,
   up to a 1 : 1.5 cell shape on very tall screens. */
@media (min-width: 768px) {
  .scrolly .wall { padding-bottom: 54px; }
  .scrolly .wall-grid { flex: 1 1 auto; height: auto;
    max-height: calc((min(100vw - 2 * var(--gutter), var(--col)) - 48px) / 5 * 1.5 * 2 + 46px); }
}

/* fix_v22 M: the low/high bar sits in the two cards that use colour (each says what the colour is) */
.contrib-card .contrib-legend { justify-content: center; margin: -4px 0 0; }
.contrib-card .contrib-legend .bar { width: 96px; }

/* fix_v22 M: the Explore marker legible at 1440 -- a dark ring with a white halo (reads on light and dark
   meshes), a larger label, the ring kept visible (not faint) when the vertex is behind the surface, and a key
   under the colour bar saying what it marks */
.x5 .callout.ring .ring-dot { width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2.5px solid #1b2129;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 3.5px rgba(0,0,0,0.28); }
.x5 .callout .anchor-dot { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: #1b2129;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 3.5px rgba(0,0,0,0.28); }
.x5 .callout line { stroke: #1b2129; stroke-width: 1.5; }
.x5 .callout.x5-mark span { width: 232px; height: 24px; line-height: 22px; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.x5 .callout.hidden-anchor .anchor-dot, .x5 .callout.hidden-anchor .ring-dot { opacity: 0.6; }
.x5-markkey { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.x5-markring { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #1b2129;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.95); }

/* fix_v22 A2: Explore close-up row (one camera on the ringed vertex, ground-truth outline drawn in every column) */
.x5-zoom { border-top: 1px dashed var(--line); }
.x5-zoomtag { position: absolute; right: 6px; top: 4px; z-index: 5; font-size: 11px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.x5-zoomline { flex: 0 0 auto; width: 16px; height: 0; border-top: 1.5px solid var(--ink); }

/* fix_v22 B: wall cells at 4 : 3 (were about 1 : 1.42), each subject fitted to the same share of the cell's
   shorter side (js/story.js SUBJECT_FILL). The rows are not stretched to fill the stage. */
@media (min-width: 768px) {
  .scrolly .wall-grid { flex: 0 0 auto; height: auto; max-height: none; }
  .scrolly .wcell { flex: 0 0 auto; aspect-ratio: 4 / 3; }
}

/* fix_v22 r3: the wall shows three or four of each family's four drawn clips (js/story.js Hero.fitRows), cells 4:3 */
@media (min-width: 768px) {
  .scrolly .wcell[data-row="2"] { display: block; }
  .scrolly .wall[data-rows="4"] .wcell[data-row="3"] { display: block; }
}

/* fix_v22 r3: Explore -- the timeline's peak mark, and the five-panel close-up behind the enlarge buttons */
.x5-scrubwrap { position: relative; flex: 1 1 160px; min-width: 120px; display: flex; align-items: center; }
.x5-scrubwrap input[type="range"] { flex: 1 1 auto; width: 100%; margin: 0; }
.x5-peak { position: absolute; top: -9px; left: calc(8px + (100% - 16px) * var(--f, 0)); width: 0; height: 0; margin-left: -5px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--ink); pointer-events: none; }
.x5-peak[hidden] { display: none; }
.x5-bigpanels { gap: 10px; }
.x5-bigcell .view.x5-zoom { border-radius: 6px; border-top: 0; }
.x5-bigkey { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.x5-bigkey .bar { display: inline-block; width: 140px; height: 8px; border-radius: 4px; }
.x5-bigkey .x5-markkey { margin: 0 0 0 18px; }
.x5-zoomline { flex: 0 0 auto; width: 16px; height: 0; border-top: 1.5px solid var(--ink); }

/* fix_v22 r4: hero -- whole rows only (js/story.js Hero.updateRows hides the rows that do not fit), the caption
   always shown under the last row */
@media (min-width: 768px) {
  .scrolly .wcell.row-off { display: none !important; }
}
.scrolly .wall-rule { opacity: 1; }

/* fix_v22 r5: Explore close-up -- each column is a visible viewport (rule-colour border, rounded, its own tint);
   the 3D view fills the inner box and is cut only by it (js/explore5.js cornerMask rounds the corners) */
.x5-vp { position: relative; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); overflow: hidden; }
.x5-vp > .view.x5-zoom { position: absolute; inset: 0; width: auto; height: auto; aspect-ratio: auto; border: 0; border-radius: 0; background: transparent; }

/* fix_v22 r7b (Fix 4): the Abstract body about 1.2x larger (was clamp(17px, 1.45vw, 21px), line height 1.62; phones 17px).
   The column stays 31em of the text's own size (var(--measure)), so the characters per line hold. Only the Abstract body changes. */
.abstract-sec .abstract { font-size: clamp(20.4px, 1.74vw, 25.2px); line-height: 1.58; }
@media (max-width: 767px) {
  .abstract-sec .abstract { font-size: 20.4px; }
}

/* davis9: per-clip placement credit under the Video caption, and the page-footer credits line */
.film-place { margin: -4px 0 0; font-size: 11.5px; color: var(--ink-2); text-align: center; }
.film-place a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.credits { max-width: 820px; margin: 0 auto; padding: 4px 24px 28px; text-align: center; font-size: 11.5px; color: var(--ink-2); }
.credits p { margin: 0; }
.credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* 5c: the Video block's clip switcher always sits under the title (one position, whatever the number of clips) */
.film-video .film-top { flex-direction: column; align-items: flex-start; }
@media (max-width: 767px) { .film-video .film-top { align-items: center; } }
/* rr: one player height for every DAVIS clip: 252 px (frames are 504 px high, 2x), width = 252 px x the clip's aspect; the widest
   clip (rhino, 2349x504) needs 1174.5 px, within the 1180-px column at 1440 and 1920. Narrower windows: the 100% / 56vh caps shrink it. */
.film-video .film-main { width: min(var(--col), 100%, calc(252px * var(--ar, 1.7778)), calc(56vh * var(--ar, 1.7778))); }
/* fw: every DAVIS frame is 2360x504; the player takes the full column (1180 px at 1440 and 1920, so 252 px high) and scales
   proportionally on narrower windows (overrides the rr rule above) */
.film-video .film-main { width: min(var(--col), 100%); }
.film-caption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* bib: on phones the BibTeX wraps instead of clipping, and its first line starts below the Copy button (Copy copies pre.textContent, unchanged) */
@media (max-width: 767px) {
  #bibtex pre.bib { white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 38px; }
}

/* mob (fix_v22 mobile round): phones and touch screens only; desktop (>= 768 px with a mouse) is untouched.
   Fix 1: on touch screens a vertical swipe passes through every panel that is not an active 3D viewer. Explore's
   viewers keep 3D control after a tap: js/viewer.js touchGuard marks the wrapper .active, and its .view then keeps
   touch-action: none from the base .view rule. */
@media (pointer: coarse) {
  .scrolly .view, #method .view, #contrib .view, .tap-to-rotate:not(.active) .view { touch-action: pan-y; }
}
/* Option 0: the designed phone wall, five rows (families) x two cells, all on screen while pinned. The hero v11 global
   gaps (.wall-grid 12 px, .wcol 10 px) made the two cells wrap to full width; the original 4 px gaps are restored and the
   cells are shortened so the bottom row clears the scroll cue.
   Fix 2: shorter pinned ranges on phones: hero 360 -> 240 vh, DAVIS (.film) 320 -> 200 vh, Isaac (.film-robot) 240 -> 160 vh. */
@media (max-width: 767px) {
  .wall-grid { gap: 4px; }
  .wcol { gap: 4px; }
  .scrolly .wcol { flex: 0 0 auto; }   /* rows packed from the top, not stretched over the stage */
  .wcell { height: calc((100vh - 45px - 400px) / 5); }
  .scrolly .step-hero { min-height: 66.667vh; }
  .scrolly .step-long { min-height: 106.667vh; }
  .scrolly .step[data-step="labels"] { min-height: 66.667vh; }
  .film { min-height: 200vh; }
  .film-robot { min-height: 160vh; }
}
