/* XM4D project page (layout adapted from the BEACON page) */

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper: #f1efe9;
  --paper-deep: #e8e5dd;
  --paper-raise: #faf9f5;
  --ink: #1c1c20;
  --graphite: #5a5b63;
  --mist: #8e8f97;
  --accent: #1f4e8c;          /* xmblue, as in the paper */
  --accent-rgb: 31, 78, 140;
  --accent-hover: #183e70;
  --accent-2: #e6781e;        /* xmorange, the "4D" */
  --accent-2-rgb: 230, 120, 30;
  --accent-2-ink: #a8520f;    /* xmorange dark enough for text */
  --slate: #647892;
  --rule: #d8d4ca;
  --rule-soft: #e4e0d6;

  --col: 720px;
  --wide: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --topbar-h: 56px;

  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv05';
}

::selection { background: rgba(var(--accent-rgb), .16); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

img, video { display: block; max-width: 100%; height: auto; }
p, figcaption { text-wrap: pretty; }   /* avoid one- or two-word last lines */
sup { font-size: .62em; line-height: 0; vertical-align: .55em; }
em { font-style: italic; }
.math { font-style: italic; }

.skip-link {
  position: absolute; left: 12px; top: -60px; padding: 8px 12px;
  background: var(--ink); color: var(--paper); border-radius: 4px; z-index: 50;
}
.skip-link:focus { top: 10px; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  background: rgba(241, 239, 233, .86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.topbar-brand {
  color: var(--ink); font-weight: 700; letter-spacing: .04em; font-size: 15px;
  padding-bottom: 2px; border-bottom: 2px solid var(--accent);
}
.topbar-brand:hover { text-decoration: none; }
.topbar-links { display: flex; gap: 22px; margin-left: 8px; }
.topbar-links a { color: var(--graphite); font-size: 15px; font-weight: 500; }
.topbar-links a:hover { color: var(--ink); text-decoration: none; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1;
  background: transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-small { padding: 7px 13px; font-size: 14px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* ───────── Layout primitives ───────── */
main { display: block; }
section, .hero {
  padding: 0 var(--gutter);
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
}
section { padding-top: 80px; }
section h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
  margin-bottom: 16px;
}
section h3 { font-size: 19px; font-weight: 600; letter-spacing: -.012em; line-height: 1.25; }
.section-head { max-width: var(--col); margin-bottom: 28px; }
.section-head p, .method-head p { color: var(--graphite); }

/* ───────── Hero ───────── */
.hero { padding-top: 40px; }
.hero-lab { display: inline-block; margin-bottom: 28px; }
.hero-lab img { width: 230px; max-width: 60vw; }

/* award of the conference version (XM), shown above the title */
.award-banner {
  display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 18px;
  margin-bottom: 30px; padding: 16px 30px 16px 16px;
  background: rgba(var(--accent-2-rgb), .10);
  border: 1px solid rgba(var(--accent-2-rgb), .55);
  border-radius: 18px;
  color: var(--ink); line-height: 1.3;
  transition: background .15s ease, border-color .15s ease;
}
.award-banner:hover { background: rgba(var(--accent-2-rgb), .17); border-color: var(--accent-2); text-decoration: none; }
.award-icon {
  flex: none; display: grid; place-items: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent-2);
}
.award-icon svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.award-text { display: flex; flex-direction: column; gap: 4px; }
.award-text strong { font-size: clamp(21px, 2.5vw, 28px); font-weight: 700; letter-spacing: -.01em; color: var(--accent-2-ink); }
.award-text span { font-size: clamp(15px, 1.4vw, 17.5px); color: var(--graphite); }
.award-text b { color: var(--accent); font-weight: 700; }
.award-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 6px;
  padding: 2px 10px 2px 7px; border-radius: 999px;
  background: rgba(var(--accent-2-rgb), .13); color: var(--accent-2-ink);
}
.award-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-title {
  max-width: 900px;
  font-size: clamp(23px, 2.9vw, 34px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.012em;
  text-wrap: balance;
}
.hero-acronym {
  display: block;
  font-size: clamp(42px, 5.4vw, 66px);
  line-height: 1;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: .22em;
}
.acronym-4d { color: var(--accent-2); }
.hero-meta { margin-top: 22px; }
.authors { font-size: 17px; font-weight: 500; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.authors sup { color: var(--mist); font-weight: 500; margin-left: 2px; }
.authors a { color: inherit; border-bottom: 1px solid rgba(var(--accent-rgb), .35); }
.authors a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.affiliations { margin-top: 4px; color: var(--graphite); display: flex; flex-wrap: wrap; gap: 2px 20px; font-size: 15px; }
.affiliations sup { color: var(--mist); margin-right: 2px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.hero-video { margin-top: 36px; max-width: 880px; }
.hero-video video {
  width: 100%; aspect-ratio: 16 / 9;
  background: #0f0f12;
  border-radius: 8px;
  box-shadow: 0 20px 44px -28px rgba(28, 28, 32, .4), 0 1px 4px rgba(28, 28, 32, .08);
}
.figure.hero-figure { margin-top: 36px; max-width: 960px; }

/* pipeline walkthrough: a window onto the figure; each piece is one crop of it */
.teaser { position: relative; aspect-ratio: 2400 / 808; overflow: hidden; }
.teaser-piece { position: absolute; mix-blend-mode: multiply; }   /* white takes the page color, overlaps stay clean */
.figure .teaser-piece img {
  display: block; width: 100%; height: 100%; max-width: none;
  border: 0; border-radius: 0; background: none;
}
/* a stop's clip covers its panel inside its piece; visible only while it plays */
.figure .teaser-piece .teaser-clip {
  position: absolute; max-width: none; object-fit: fill;
  opacity: 0; transition: opacity .5s ease;
}
.figure .teaser-piece .teaser-clip.is-playing { opacity: 1; }
/* a jump (label click, keyboard, loop restart) eases instead of snapping */
.teaser.is-jump .teaser-piece { transition: left .5s ease, top .5s ease, width .5s ease, height .5s ease, opacity .5s ease; }

.pipe-scrub { display: none; align-items: flex-start; gap: 16px; max-width: 780px; margin-top: 22px; padding-right: 28px; }
.pipeline.is-live .pipe-scrub { display: flex; }
.pipe-toggle {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--paper-raise); color: var(--ink); cursor: pointer;
}
.pipe-toggle:hover { border-color: var(--ink); }
.pipe-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pipe-toggle .icon-play { fill: currentColor; stroke-width: 1.5; }
.pipe-toggle .icon-play, .pipeline.is-paused .pipe-toggle .icon-pause { display: none; }
.pipeline.is-paused .pipe-toggle .icon-play { display: block; }

/* the rail sits under a transparent range input; it spans the thumb centers (11px in from each end) */
.pipe-track { position: relative; flex: 1; min-width: 0; padding-top: 6px; }
.pipe-rail {
  position: absolute; left: 11px; right: 11px; top: 14px; height: 6px;
  border-radius: 3px; background: var(--paper-deep);
}
.pipe-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 0%); border-radius: inherit; background: var(--accent); }
.pipe-rail i {
  position: absolute; top: 50%; left: calc(var(--p) * 100%);
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--paper-raise); border: 2px solid var(--rule);
}
.pipe-rail i.is-done { background: var(--accent); border-color: var(--accent); }
.pipe-slider {
  position: relative; display: block; width: 100%; height: 22px; margin: 0;
  background: transparent; cursor: grab;
  -webkit-appearance: none; appearance: none;
}
.pipe-slider:active { cursor: grabbing; }
.pipe-slider::-webkit-slider-runnable-track { height: 22px; background: transparent; }
.pipe-slider::-moz-range-track { height: 22px; background: transparent; }
.pipe-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent-2); box-shadow: 0 1px 5px rgba(28, 28, 32, .28);
}
.pipe-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent-2); box-shadow: 0 1px 5px rgba(28, 28, 32, .28);
}
.pipe-slider:focus-visible { outline: none; }
.pipe-slider:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.pipe-ticks { position: relative; height: 24px; margin: 6px 11px 0; }
.pipe-ticks button {
  position: absolute; left: calc(var(--p) * 100%); transform: translateX(-50%);
  padding: 2px 4px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--mist); white-space: nowrap;
}
.pipe-ticks button:hover { color: var(--ink); }
.pipe-ticks button.is-done { color: var(--graphite); }
.pipe-ticks button[aria-current="step"] { color: var(--accent); font-weight: 700; }

.pipe-text { margin-top: 14px; max-width: var(--col); min-height: 8.6em; }
.pipe-panel + .pipe-panel { margin-top: 14px; }   /* without JS all steps are listed */
.pipe-panel[hidden] { display: none; }
.pipe-kicker { font-size: 13.5px; font-weight: 600; color: var(--accent-2-ink); letter-spacing: .02em; }
.pipe-panel h3 { font-size: 20px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; margin: 2px 0 6px; }
.pipe-panel p:last-child { color: var(--graphite); font-size: 15.5px; }
.pipeline.is-live .pipe-panel + .pipe-panel { margin-top: 0; }
@media (max-width: 600px) {   /* narrow: only the current step keeps its label */
  .pipe-scrub { gap: 12px; padding-right: 0; }
  .pipe-ticks button:not([aria-current]) { font-size: 0; padding: 0; width: 22px; height: 22px; }
  .pipe-ticks button[aria-current="step"]:first-child { transform: translateX(-11px); }
  .pipe-ticks button[aria-current="step"]:last-child { transform: translateX(calc(-100% + 11px)); }
}
}
.figure figcaption { margin-top: 10px; font-size: 14.5px; color: var(--graphite); max-width: var(--col); }

.hero-lede {
  max-width: 600px;
  margin-top: 36px;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.45;
  letter-spacing: -.01em;
  font-weight: 500;
}
.hero-lede em { color: var(--accent); font-style: italic; }

/* example runs below the teaser: a picker grouped by dataset; the run's three columns are labelled above its clip */
.runs { margin-top: 44px; }
.runs .segmented { border-radius: 18px; align-items: center; }
.seg-label {
  padding: 0 4px 0 12px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--mist);
}
.run-cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--graphite);
}
.run { margin: 0; }
.run video { width: 100%; border-radius: 6px; background: var(--paper-deep); }
.run figcaption { margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.run figcaption span { display: block; color: var(--mist); font-weight: 400; }

/* ───────── Method: scrollytelling ───────── */
.method-head { max-width: var(--col); margin-bottom: 16px; }
.method-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 44%);
  gap: 0 clamp(24px, 5vw, 72px);
  align-items: start;
}
.method-steps { max-width: 520px; padding-bottom: 12vh; }
.step {
  min-height: 56vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7vh 0;
  border-top: 1px solid var(--rule-soft);
  transition: opacity .35s ease;
  opacity: .4;
}
.step.is-active { opacity: 1; }
.step:first-child { border-top: 0; min-height: 0; padding-top: 2vh; }
.step h3 { margin-bottom: 10px; max-width: 26ch; }
.step p { color: var(--graphite); }
.step-cta { margin-top: 14px; font-weight: 500; }

.method-stage { position: relative; height: 100%; }
.stage-sticky {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  height: min(calc(100vh - var(--topbar-h) - 48px), 520px);
  min-height: 320px;
  justify-content: center;
  display: flex; flex-direction: column;
}
#stage-img {
  width: 100%; height: auto; max-height: 100%; flex: 0 1 auto; min-height: 0;
  object-fit: contain;
  mix-blend-mode: multiply;   /* white figure background takes the page color */
  transition: opacity .25s ease;
}
#stage-img.is-swapping { opacity: 0; }
.stage-hud {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 6px;
  font-size: 14px; font-weight: 500; color: var(--graphite);
}
.hud-task { min-width: 12ch; }

@media (max-width: 900px) {
  .method-body { display: flex; flex-direction: column; }
  .method-stage { order: -1; position: sticky; top: var(--topbar-h); z-index: 5; background: var(--paper); height: auto; }
  .stage-sticky { position: static; height: auto; min-height: 0; padding-top: 8px; }
  .stage-hud { position: static; padding: 6px 0 10px; }
  .method-steps { max-width: none; padding-top: 12px; }
  .step { min-height: 0; padding: 36px 0; opacity: 1; }
  .step.is-active h3 { color: var(--accent); }
}

/* ───────── From XM to XM4D ───────── */
.lineage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 960px; }
.lineage-card {
  padding: 22px 24px;
  background: var(--paper-raise);
  border: 1px solid var(--rule-soft);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
}
.lineage-card-new { border-top-color: var(--accent-2); }
.lineage-venue { display: flex; flex-wrap: wrap; align-items: center; min-height: 26px; font-size: 13.5px; font-weight: 600; color: var(--accent); letter-spacing: .02em; margin-bottom: 6px; }
.lineage-card-new .lineage-venue { color: var(--accent-2); }
.lineage-card h3 { margin-bottom: 12px; }
.lineage-card ul { padding-left: 1.15em; color: var(--graphite); font-size: 15.5px; }
.lineage-card li + li { margin-top: 6px; }
.lineage-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@media (max-width: 760px) {
  .lineage-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ───────── Abstract ───────── */
.abstract p { max-width: var(--col); font-size: 16.5px; line-height: 1.65; color: var(--ink); }
.abstract h2 { margin-bottom: 14px; }

/* ───────── Figures ───────── */
.figure { margin: 0; }
.figure img {
  width: 100%;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--rule-soft);
}
.figure-wide { margin-top: 44px; }

/* ───────── Galleries ───────── */
.gallery { margin-top: 40px; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; margin-bottom: 16px; }
.gallery-head h3 { font-size: 20px; }
.gallery-head .gallery-note { max-width: var(--col); margin: 0; }
.gallery-note { color: var(--graphite); font-size: 15.5px; margin: 0 0 18px; max-width: var(--col); }
.gallery-group[hidden] { display: none; }

.segmented {
  display: inline-flex; flex-wrap: wrap; max-width: 100%; min-width: 0;
  border: 1px solid var(--rule); border-radius: 22px; padding: 3px;
  background: var(--paper-raise);
}
.segmented button {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--graphite); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

/* ───────── Gallery: 3D viewer (viewer.js) ───────── */
.viewer {
  display: grid; grid-template-columns: minmax(0, 1fr) 256px;
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--paper-raise);
}
.viewer-stage { position: relative; min-width: 0; background: #18181b; }   /* dark: unreconstructed edges read as dark, not fog */
.viewer-canvas { display: block; width: 100%; aspect-ratio: 16 / 10; touch-action: none; cursor: grab; }
.viewer-canvas:active { cursor: grabbing; }
.viewer-status {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center;
  font-family: var(--mono); font-size: 13px; color: #c9c9cf; pointer-events: none;
}
.viewer-status[hidden] { display: none; }
.viewer-hint {
  position: absolute; left: 10px; bottom: 10px; padding: 2px 9px; border-radius: 999px;
  background: rgba(250, 249, 245, .85); font-size: 12.5px; color: var(--graphite); pointer-events: none;
}
.viewer-panel {
  display: flex; flex-direction: column; gap: 20px; padding: 18px 18px 16px;
  border-left: 1px solid var(--rule); font-size: 14.5px;
}
.viewer-panel fieldset { border: 0; min-width: 0; }
.viewer-label {
  display: block; margin-bottom: 7px; padding: 0;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--mist);
}
.viewer-scene {
  width: 100%; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 14.5px;
}
.viewer-layers label { display: flex; align-items: center; gap: 9px; padding: 3px 0; cursor: pointer; }
.viewer-layers input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.key { margin-left: auto; width: 26px; height: 10px; border-radius: 5px; }
.key-graph { background: linear-gradient(90deg, #4fc74f 0 60%, #e63d3d 60%); }
.key-cameras { background: var(--accent); }
.key-tracks { background: linear-gradient(90deg, #e6394f, #e6b422, #3cc45a, #2f8fe0, #a446d8); }
.viewer-views .segmented { display: flex; }
.viewer-views .segmented button { flex: 1; padding: 6px 8px; font-size: 13.5px; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.viewer-time { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.viewer-play {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer;
}
.viewer-play:hover { border-color: var(--ink); }
.viewer-play svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-play .icon-play { fill: currentColor; stroke-width: 1.5; }
.viewer-play .icon-play, .viewer.is-paused .viewer-play .icon-pause { display: none; }
.viewer.is-paused .viewer-play .icon-play { display: block; }
.viewer-slider { flex: 1; min-width: 0; accent-color: var(--ink); }
.viewer-frame { flex: none; font-family: var(--mono); font-size: 11.5px; color: var(--mist); }
@media (max-width: 860px) {
  .viewer { grid-template-columns: minmax(0, 1fr); }
  .viewer-panel { border-left: 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
  .viewer-field, .viewer-time { grid-column: 1 / -1; }
  .viewer-hint { display: none; }
}
@media (max-width: 520px) {
  .viewer-canvas { aspect-ratio: 4 / 3; }
  .viewer-panel { grid-template-columns: minmax(0, 1fr); }
}

/* ───────── Solver iterations ───────── */
.solver-runs { margin-top: 8px; }
.section-head p + p { margin-top: 10px; }
.solver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.solver-fig { margin: 0; }
.solver-fig video { width: 100%; aspect-ratio: 16 / 10.4; object-fit: contain; border-radius: 8px; border: 1px solid var(--rule-soft); background: #fff; }
.solver-fig figcaption { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.solver-fig figcaption span { display: block; margin-top: 3px; font-size: 14.5px; font-weight: 400; color: var(--graphite); line-height: 1.5; }
@media (max-width: 860px) { .solver-grid { grid-template-columns: minmax(0, 1fr); } }

/* ───────── Applications ───────── */
.app { margin-top: 48px; }
.app-text { max-width: var(--col); }
.app-text h3 { font-size: 20px; margin-bottom: 6px; }
.app-text p { color: var(--graphite); font-size: 15.5px; }
#app-articulate .app-text { margin-bottom: 16px; }
.app.gallery .gallery-head { align-items: flex-end; }
.app-cols { display: grid; margin-bottom: 6px; font-size: 13.5px; font-weight: 500; color: var(--graphite); }
.app-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.app-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-clip { margin: 0; }
.app-clip-single { max-width: 860px; }
.app-clip video { width: 100%; border-radius: 6px; background: var(--paper-deep); }
.app-clip figcaption { margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.app-clip figcaption span { display: block; color: var(--mist); font-weight: 400; }
.app-table { margin-top: 24px; max-width: 860px; overflow-x: auto; }
.app-table table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.app-table caption { caption-side: top; text-align: left; padding-bottom: 8px; font-size: 13.5px; font-weight: 500; color: var(--graphite); }
.app-table th, .app-table td { padding: 6px 12px 6px 0; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--rule-soft); }
.app-table thead th { font-weight: 500; color: var(--mist); border-bottom-color: var(--rule); }
.app-table tbody th { font-weight: 500; }
.app-table td { color: var(--graphite); }
.app-table .num { text-align: right; padding-right: 0; padding-left: 16px; }
.app-table tr.ours th, .app-table tr.ours td { color: var(--accent); }
.app-table tr.ours + tr:not(.ours) th, .app-table tr.ours + tr:not(.ours) td { border-top: 1px solid var(--rule); }
.app-note { margin-top: 10px; font-size: 13.5px; color: var(--mist); line-height: 1.45; }
@media (max-width: 640px) {
  .app-table table { font-size: 13px; }
  .app-table th, .app-table td { white-space: normal; padding-right: 8px; vertical-align: top; }
  .app-table .num { padding-left: 8px; }
}
.viewer-parts { display: grid; gap: 6px; }
.viewer-part { display: grid; grid-template-columns: minmax(56px, max-content) minmax(60px, 1fr) 40px; align-items: center; gap: 8px; font-size: 14px; line-height: 1.25; }
.viewer-part input { width: 100%; accent-color: var(--ink); }
.viewer-part output { font-family: var(--mono); font-size: 12px; color: var(--graphite); text-align: right; }
.viewer-demo-label { display: none; font-size: 13.5px; color: var(--graphite); }
.viewer.is-articulated .viewer-slider, .viewer.is-articulated .viewer-frame { display: none; }
.viewer.is-articulated .viewer-demo-label { display: inline; }

/* ───────── Citation ───────── */
.citation-venue { color: var(--graphite); margin: -4px 0 18px; }
.bibtex-wrap { position: relative; max-width: 820px; }
.bibtex {
  background: var(--paper-raise);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: 18px 20px 18px;
  padding-right: 140px;
  font-family: var(--mono);
  font-size: 13.5px; line-height: 1.6; color: var(--graphite);
  overflow-x: auto; white-space: pre;
}
.bibtex code { font: inherit; }
.citation-note { color: var(--graphite); margin: 22px 0 10px; }
.bibtex-copy {
  position: absolute; top: 12px; right: 12px;
  font: inherit; font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink); cursor: pointer;
}
.bibtex-copy:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 560px) {
  .bibtex { padding-right: 20px; padding-top: 52px; }
}

/* ───────── Footer ───────── */
.site-footer { margin-top: 90px; border-top: 1px solid var(--rule-soft); }
.footer-inner {
  max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto;
  padding: 36px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px;
}
.site-footer p { font-size: 13.5px; color: var(--mist); max-width: 520px; line-height: 1.55; }
.site-footer a { color: var(--graphite); }

/* ───────── Toast ───────── */
#toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 11px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-size: 14.5px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .25s ease;
  z-index: 100; max-width: calc(100vw - 32px); text-align: center;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ───────── Responsive ───────── */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar-links { display: none; }
  .hero { padding-top: 36px; }
  section { padding-top: 64px; }
  .authors { font-size: 16px; gap: 2px 16px; }
  .hero-video, .figure.hero-figure { margin-top: 28px; }
  .hero-lede { margin-top: 28px; }
  .gallery-head h3 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .step, .btn, .segmented button, #stage-img, #toast, .award-banner { transition: none; }
  .teaser.is-jump .teaser-piece { transition: none; }
}
