/* DensiTok project page
   Light and dark themes share one set of role tokens. The dark values are declared twice: once for the
   OS setting (unless the visitor picked light) and once for an explicit dark choice, which also follows
   the main site's theme toggle. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}

:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f4;
  --surface: #ffffff;
  --seg-on: #ffffff;
  --ink: #15171c;
  --ink-2: #3d4250;
  --muted: #6b7180;
  --faint: #9aa0ab;
  --line: #e6e7ea;
  --line-strong: #d3d6dc;
  --accent: #c0322b;
  --accent-hover: #a82a24;
  --accent-soft: #fbeceb;
  --stage: #0d0e11;
  --chart-base: #858b96;
  --chart-ours: #c0322b;
  --figure-bg: #ffffff;
  --shadow: 0 1px 2px rgba(16, 18, 24, 0.05), 0 10px 30px rgba(16, 18, 24, 0.06);
  --radius: 14px;
  --wrap: 1120px;
  --narrow: 760px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --bg-alt: #151820;
    --surface: #171a20;
    --seg-on: #2a2f39;
    --ink: #eceef2;
    --ink-2: #c4c8d0;
    --muted: #9098a6;
    --faint: #666d7a;
    --line: #262a32;
    --line-strong: #353a45;
    --accent: #ef5b4f;
    --accent-hover: #ff7a6f;
    --accent-soft: rgba(239, 91, 79, 0.14);
    --stage: #000000;
    --chart-base: #7f8694;
    --chart-ours: #ef5b4f;
    --figure-bg: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1014;
  --bg-alt: #151820;
  --surface: #171a20;
  --seg-on: #2a2f39;
  --ink: #eceef2;
  --ink-2: #c4c8d0;
  --muted: #9098a6;
  --faint: #666d7a;
  --line: #262a32;
  --line-strong: #353a45;
  --accent: #ef5b4f;
  --accent-hover: #ff7a6f;
  --accent-soft: rgba(239, 91, 79, 0.14);
  --stage: #000000;
  --chart-base: #7f8694;
  --chart-ours: #ef5b4f;
  --figure-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16.5px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 14px; }
b, strong { font-weight: 650; }
h1, h2, h3, h4 { color: var(--ink); }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-weight: 600;
}
.skip:focus { top: 10px; color: var(--bg); text-decoration: none; }

.wrap { max-width: calc(var(--wrap) + 48px); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: calc(var(--narrow) + 48px); }
.center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background-color 0.2s;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar {
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
  }
}
.topbar.is-stuck { border-bottom-color: var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand {
  flex: none; color: var(--ink); font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; pointer-events: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.topbar.show-brand .brand { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.toc {
  display: flex; gap: 2px; margin-left: auto; min-width: 0; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.toc::-webkit-scrollbar { display: none; }
.toc a {
  flex: none; padding: 6px 11px; border-radius: 999px; color: var(--muted);
  font-size: 14px; font-weight: 550; white-space: nowrap;
}
.toc a:hover { color: var(--ink); background: var(--bg-alt); text-decoration: none; }
.toc a.is-active { color: var(--ink); background: var(--bg-alt); }
.toc a:focus-visible, .video-frame video:focus-visible { outline-offset: -2px; }

.icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--bg-alt); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}
.play-toggle svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
.play-toggle .i-play { display: none; }
.play-toggle.is-paused .i-play { display: block; }
.play-toggle.is-paused .i-pause { display: none; }

@media (max-width: 640px) {
  .brand { display: none; }
  .toc { margin-left: -8px; }
  .toc a { padding: 6px 9px; font-size: 13.5px; }
}
@media (max-width: 400px) { .toc a { padding: 6px 7px; } }

/* ------------------------------------------------------------------ hero */
.hero { padding: 64px 0 20px; text-align: center; }
.title { margin: 0; font-weight: inherit; }
.wordmark {
  display: block; font-size: clamp(56px, 10vw, 104px); font-weight: 800;
  letter-spacing: -0.045em; line-height: 0.98; color: var(--ink);
}
.wordmark::after {
  content: ""; display: block; width: 76px; height: 4px; margin: 24px auto 0;
  border-radius: 2px; background: var(--accent);
}
/* Title intro (densitok.js). While .intro-on is set the static wordmark is hidden and an extruded copy is
   animated over it, letter by letter. The class is set in <head> and removed when the intro ends. */
.intro-on .hero { position: relative; }
.intro-on .wordmark { position: relative; color: transparent; }
.intro-on .wordmark::after { transform: scaleX(var(--wm-bar, 0)); }
.wm-stage {
  position: absolute; left: 0; top: 0; width: 100%;
  transform-style: preserve-3d; pointer-events: none; user-select: none; -webkit-user-select: none;
}
/* One letter block: the front face is in flow and sizes the box, the side slices are stacked behind it.
   No opacity or filter on .wm-letter itself, either would flatten the extrusion. */
.wm-letter { position: absolute; top: 0; white-space: pre; transform-style: preserve-3d; }
.wm-face { display: block; color: var(--ink); opacity: 0; }
.wm-side { position: absolute; left: 0; top: 0; opacity: 0; }
.wm-canvas { position: absolute; z-index: 60; max-width: none; pointer-events: none; }
.subtitle {
  display: block; margin: 22px auto 0; max-width: 820px; text-wrap: balance;
  font-size: clamp(20px, 2.7vw, 29px); font-weight: 600; letter-spacing: -0.018em; line-height: 1.28;
}
@media (max-width: 720px) { .br-wide { display: none; } }
.authors {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px;
  margin: 30px auto 0; padding: 0; max-width: 1000px; font-size: 18px; font-weight: 550;
}
.authors a { color: var(--ink); background-image: linear-gradient(var(--line-strong), var(--line-strong)); background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; }
.authors a:hover { color: var(--accent); text-decoration: none; }
.authors sup, .affils sup { margin-left: 1px; font-size: 0.66em; font-weight: 600; color: var(--muted); }
.affils {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px;
  margin: 10px 0 0; padding: 0; color: var(--muted); font-size: 15.5px;
}
.affils sup { margin: 0 3px 0 0; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: #c0322b; border-color: #c0322b; color: #fff; text-decoration: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg .fill { fill: currentColor; stroke: none; }
.btn.is-disabled { background: var(--bg-alt); border-color: var(--line); color: var(--faint); cursor: default; }
.btn.is-disabled:hover { background: var(--bg-alt); border-color: var(--line); color: var(--faint); }
.soon {
  margin-left: 2px; padding: 3px 7px; border-radius: 999px; background: var(--line);
  color: var(--ink-2); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ------------------------------------------------------------------ sections */
.section { padding-top: 88px; }
.section-first { padding-top: 48px; }
h2 { margin: 0 0 24px; font-size: clamp(27px, 3.4vw, 36px); font-weight: 750; letter-spacing: -0.028em; line-height: 1.18; text-wrap: balance; }
.section h2 { text-align: center; }
h3 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.018em; line-height: 1.3; text-wrap: balance; }
h4 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.caption { color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.caption.center { margin: 12px auto 0; max-width: 760px; }
.abstract p { color: var(--ink-2); font-size: 17px; line-height: 1.72; }
.abstract em, .abstract b { color: var(--ink); }

.video-frame { overflow: hidden; border-radius: var(--radius); background: #000; box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.video-frame video { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ figures */
.figure { margin: 0; }
.figure + .figure { margin-top: 24px; }
.figure img { display: block; width: 100%; height: auto; }
.paper-fig { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--figure-bg); }
.paper-fig img { border-radius: 4px; }
.paper-fig figcaption { margin-top: 14px; color: #5f6573; font-size: 14.5px; line-height: 1.55; }
.paper-fig figcaption b { color: #262a33; }
@media (max-width: 640px) { .paper-fig { padding: 10px; border-radius: 10px; } }

/* ------------------------------------------------------------------ paper summary: TL;DR, cards, note */
.wrap.sub { margin-top: 72px; }
.lead { max-width: 780px; margin: -10px auto 28px; color: var(--ink-2); font-size: 17px; text-align: center; text-wrap: pretty; }
.tldr { padding: 22px 26px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); }
.section .tldr h2 {
  margin: 0 0 12px; color: var(--accent); font-size: 13px; font-weight: 750; letter-spacing: 0.09em; line-height: 1.4;
  text-align: left; text-transform: uppercase;
}
.tldr ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 17px; line-height: 1.62; }
.tldr li + li { margin-top: 9px; }
.tldr b { color: var(--ink); }
.cards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0 0; padding: 0; }
.card { padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.card-tag {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; margin-bottom: 12px; padding: 0 8px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
}
.card h3 { margin-bottom: 8px; font-size: 18px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.note {
  margin: 16px 0 0; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  background: var(--accent-soft); color: var(--ink-2); font-size: 15.5px; line-height: 1.6;
}
.note b { color: var(--ink); }
@media (max-width: 860px) { .cards { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .wrap.sub { margin-top: 56px; }
  .tldr { padding: 18px 18px 20px; }
  .tldr ul, .lead { font-size: 16px; }
}

/* ------------------------------------------------------------------ demos */
.demo { margin-top: 8px; }
.demo + .demo { margin-top: 64px; padding-top: 48px; border-top: 1px solid var(--line); }
.demo-head { max-width: 820px; }
.demo-head p { margin: 0; color: var(--ink-2); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 20px 0 16px; }
.ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.ctl-end { margin-left: auto; }
.ctl-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.seg {
  display: inline-flex; max-width: 100%; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg-alt);
}
.seg button {
  flex: none; height: 32px; min-width: 38px; margin: 0; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: color 0.12s, background-color 0.12s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line); }
.lbl-short { display: none; }
@media (max-width: 400px) { .lbl-long { display: none; } .lbl-short { display: inline; } }
@media (max-width: 760px) { .ctl-end { margin-left: 0; } }

.scene-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.scene-picker button {
  width: 50px; height: 50px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 9px;
  background: var(--bg-alt); cursor: pointer; opacity: 0.62; transition: opacity 0.15s, border-color 0.15s;
}
.scene-picker button:hover { opacity: 0.9; }
.scene-picker button[aria-pressed="true"] { border-color: var(--accent); opacity: 1; }
.scene-picker button:focus-visible { opacity: 1; outline-color: var(--ink); }
.scene-picker img { display: block; width: 100%; height: 100%; object-fit: cover; }

.inputs-row { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; min-height: 46px; }
.inputs-row .strip { flex-wrap: wrap; }
.strip { display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0; }
.strip img {
  display: block; flex: 0 1 auto; width: calc((100% - 24px) / 7); max-width: 84px; height: auto;
  aspect-ratio: 220 / 125; object-fit: cover; border-radius: 4px; background: var(--bg-alt);
}
.strip.square img { aspect-ratio: 1 / 1; width: 46px; max-width: none; flex: none; }

/* ------------------------------------------------------------------ results table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.results-table { width: 100%; min-width: 780px; border-collapse: collapse; color: var(--ink-2); font-size: 14.5px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 8px 12px; font-weight: 400; text-align: right; white-space: nowrap; }
.results-table thead th { padding-top: 10px; color: var(--muted); font-size: 12.5px; font-weight: 650; vertical-align: bottom; }
.results-table .grp { padding-bottom: 2px; color: var(--ink-2); text-align: center; }
.results-table .v, .results-table .m { text-align: left; }
.results-table .g { border-left: 1px solid var(--line); }
.results-table tbody tr:first-child > * { border-top: 1px solid var(--line-strong); }
.results-table tbody .pair > * { border-top: 1px solid var(--line); }
.results-table tbody .v { color: var(--ink); font-weight: 650; }
.results-table tbody .t { color: var(--muted); }
.results-table .ref td { color: var(--muted); }
.results-table .ours td { background: var(--accent-soft); }
.results-table .ours .m { color: var(--accent); font-weight: 700; }
.results-table b { color: var(--ink); font-weight: 700; }
.table-scroll + .caption { margin: 12px 0 0; max-width: 920px; }
@media (max-width: 640px) {
  .results-table { min-width: 660px; font-size: 13.5px; }
  .results-table th, .results-table td { padding: 7px 9px; }
}

/* ------------------------------------------------------------------ 1. before/after wipe player */
.cmp { margin: 0; min-width: 0; --pos: 50%; --p: 0.5; }
.cmp .strip { margin-top: 7px; }
.pane {
  position: relative; overflow: hidden; aspect-ratio: 518 / 272; border-radius: 10px;
  background: var(--stage); cursor: ew-resize; touch-action: pan-y pinch-zoom;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.pane video, .pane canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; display: block;
}
.pane video { object-fit: cover; }
.pane canvas { background: var(--stage); }
.pane.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px;
  border: 2.5px solid rgba(255, 255, 255, 0.25); border-top-color: rgba(255, 255, 255, 0.85); border-radius: 50%;
  animation: spin 0.9s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pane.is-error::after {
  content: "Video failed to load"; position: absolute; top: 12px; left: 50%; z-index: 2; transform: translateX(-50%);
  padding: 3px 9px; border-radius: 5px; background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.wipe {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2); pointer-events: none;
}
.knob {
  position: absolute; top: 50%; left: clamp(17px, var(--pos), calc(100% - 17px)); display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: #fff; color: #15171c; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); pointer-events: auto; cursor: ew-resize;
}
.knob svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.knob:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent); }
.chip {
  position: absolute; bottom: 9px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 8px; border-radius: 5px; background: rgba(0, 0, 0, 0.66); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1.3; pointer-events: none; transition: opacity 0.15s;
}
.chip-l { left: 9px; opacity: clamp(0, calc((var(--p) - 0.16) * 12), 1); }
.chip-r { right: 9px; background: #c0322b; opacity: clamp(0, calc((0.84 - var(--p)) * 12), 1); }

.cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
.cmp-grid[data-view="split"] { grid-template-columns: minmax(0, 1fr); }
.cmp-grid[data-view="split"] .pane { aspect-ratio: 1036 / 272; cursor: pointer; }
.cmp-grid[data-view="split"] canvas, .cmp-grid[data-view="split"] .wipe, .cmp-grid[data-view="split"] .knob { display: none; }
.cmp-grid[data-view="split"] .pane video { object-fit: fill; }
.cmp-grid[data-view="split"] .chip { max-width: calc(50% - 18px); }
.cmp-grid[data-view="split"] .chip-l, .cmp-grid[data-view="split"] .chip-r { opacity: 1; }
.cmp-grid[data-view="split"] .chip-r { right: auto; left: calc(50% + 9px); }
.cmp-grid[data-view="split"] .pane::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; z-index: 1; width: 2px; margin-left: -1px;
  background: rgba(255, 255, 255, 0.9); pointer-events: none;
}
@media (max-width: 760px) { .cmp-grid { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ 2. sparse-view mosaic */
.mosaic { display: grid; gap: 20px; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 9px; }
.group-head h4 { margin: 0 4px 0 0; font-size: 15.5px; }
.need-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: 999px; color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.need-chip.none { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; overflow: hidden; aspect-ratio: 256 / 234; border-radius: 8px; background: var(--stage); cursor: pointer; }
.tile canvas, .tile video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; display: block; }
.tile video { object-fit: fill; }
.tile .chip { left: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: 12.5px; }
.tile.ours { box-shadow: 0 0 0 2px var(--accent); }
.tile.ours .chip { background: #c0322b; }
.tile .na {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center; padding: 12px;
  border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--bg-alt); color: var(--muted);
  font-size: 13px; font-weight: 600; text-align: center;
}
.tile.is-na { cursor: default; }
.tile.is-na canvas { visibility: hidden; }
.tile.is-na .na { display: flex; }
.tile.is-na .chip { background: #6b7180; }
@media (max-width: 480px) { .chip { white-space: normal; } }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ 3. diffusion-based NVS */
.nvs-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.nvs-grid { display: grid; grid-template-columns: repeat(5, minmax(128px, 1fr)); gap: 0 10px; min-width: 680px; }
.nvs-col { position: relative; min-width: 0; }
.nvs-col-head { display: flex; align-items: flex-end; min-height: calc(2.6em + 8px); padding: 0 2px 8px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.nvs-col.ours .nvs-col-head { color: var(--accent); }
.nvs-col.gt .nvs-col-head { color: var(--muted); }
.nvs-col.gt::after { content: ""; position: absolute; top: 0; bottom: 0; right: -6px; width: 1px; background: var(--line); }
.nvs-stack { position: relative; display: grid; gap: 14px; }
.nvs-pair { display: grid; gap: 6px; }
.shot { position: relative; }
@media (hover: hover) { .shot { cursor: crosshair; } }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; background: var(--bg-alt); }
.box { position: absolute; border: 2px solid #ffc400; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); pointer-events: none; }
.zoom { aspect-ratio: 1 / 1; border-radius: 6px; background-color: var(--bg-alt); background-repeat: no-repeat; box-shadow: inset 0 0 0 2px #ffc400; }
.nvs-col.ours .shot img, .nvs-col.ours .zoom { box-shadow: 0 0 0 2px var(--accent); }
.nvs-col .na {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center; padding: 10px;
  border: 1px dashed var(--line-strong); border-radius: 6px; background: var(--bg-alt); color: var(--muted);
  font-size: 13px; font-weight: 600; text-align: center;
}
.nvs-col.is-na .nvs-pair { visibility: hidden; }
.nvs-col.is-na .na { display: flex; }
.nvs-col.is-na .nvs-col-head { color: var(--muted); }

/* runtime graph */
.chart-card { margin: 0; padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.runtime-card { max-width: 680px; margin-top: 24px; }
.chart-head { display: flex; flex-direction: column; gap: 2px; }
.chart-title { margin: 0; color: var(--ink); font-size: 15.5px; font-weight: 700; }
.chart-sub { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; min-height: 1.5em; }
.bars { display: grid; gap: 9px; margin-top: 14px; }
.bar-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; gap: 10px; }
.bar-label { overflow: hidden; color: var(--ink-2); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.bar-row.ours .bar-label { color: var(--ink); }
.bar-track { position: relative; display: block; min-width: 0; height: 22px; margin-right: 58px; }
.bar {
  position: absolute; left: 0; top: 4px; height: 14px; min-width: 3px; border-radius: 0 4px 4px 0;
  background: var(--chart-base); transition: width 0.35s ease;
}
.bar-row.ours .bar { background: var(--chart-ours); }
.bar-value {
  position: absolute; top: 50%; transform: translateY(-50%); transition: left 0.35s ease;
  color: var(--ink-2); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bar-row.na .bar-value { color: var(--muted); font-weight: 500; }
.runtime-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }
.runtime-note b { color: var(--accent); }
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 104px minmax(0, 1fr); }
  .bar-label { white-space: normal; line-height: 1.25; }
}

/* ------------------------------------------------------------------ interactive Gaussian viewer */
/* One canvas, two halves (gaussian-viewer.mjs): side by side when the stage is wide, stacked when it is tall.
   The divider and the tags follow the same breakpoint that switches the aspect ratio. */
.splat-stage {
  position: relative; overflow: hidden; aspect-ratio: 3.2 / 1; border-radius: var(--radius); background: var(--stage);
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.splat-stage[data-state="ready"] { cursor: grab; }
.splat-stage.is-dragging { cursor: grabbing; }
.splat-stage:focus-visible { outline-offset: 3px; }
.splat-stage canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; max-width: none; display: block; }
.splat-stage::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; z-index: 1; width: 2px; margin-left: -1px;
  background: rgba(255, 255, 255, 0.9); pointer-events: none;
}
.splat-tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 3px 8px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.66); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap; pointer-events: none;
}
.splat-tag-b { left: calc(50% + 10px); background: #c0322b; }
.splat-overlay {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 20px; color: #fff; text-align: center;
}
.splat-stage[data-state="ready"] .splat-overlay, .splat-stage:not([data-state="loading"]) .splat-meter,
.splat-stage[data-state="loading"] .splat-overlay .btn, .splat-status:empty { display: none; }
.splat-status { max-width: 420px; margin: 0; padding: 4px 10px; border-radius: 6px; background: var(--stage); font-size: 14.5px; font-weight: 600; }
.splat-meter { overflow: hidden; width: min(240px, 60%); height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.splat-meter span { display: block; width: 0; height: 100%; border-radius: 2px; background: #fff; transition: width 0.2s; }
.splat-overlay .btn { border-color: #fff; background: #fff; color: #15171c; cursor: pointer; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5); }
.splat-overlay .btn:hover { border-color: #c0322b; background: #c0322b; color: #fff; }
.splat-overlay .soon { background: rgba(21, 23, 28, 0.1); color: inherit; }
.seg button:disabled { opacity: 0.5; cursor: default; }
.seg button:disabled:hover { color: var(--muted); }
.splat-stage + .caption { margin: 12px 0 0; max-width: 920px; }
@media (max-width: 760px) {
  .splat-stage { aspect-ratio: 4 / 5; }
  .splat-stage::before { top: 50%; right: 0; bottom: auto; left: 0; width: auto; height: 2px; margin: -1px 0 0; }
  .splat-tag-a { bottom: calc(50% + 10px); }
  .splat-tag-b { left: 10px; }
}

/* ------------------------------------------------------------------ citation + footer */
.bibtex { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); }
.bibtex pre { margin: 0; padding: 20px 22px; overflow-x: auto; color: var(--ink-2); font: 13.5px/1.65 var(--mono); }
.bibtex code { font: inherit; }
.copy-btn {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.copy-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy-btn.is-done { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.footer { margin-top: 104px; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }
.footer p { margin: 0; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .links { gap: 8px; }
  .btn { height: 38px; padding: 0 13px; gap: 6px; font-size: 14px; }
  .btn svg { width: 16px; height: 16px; }
  .soon { padding: 2px 5px; font-size: 9.5px; }
  .wrap { padding: 0 16px; }
  .hero { padding-top: 40px; }
  .authors { font-size: 16.5px; gap: 2px 16px; }
  .affils { font-size: 14.5px; }
  .section { padding-top: 64px; }
  .section-first { padding-top: 40px; }
  .demo + .demo { margin-top: 48px; padding-top: 36px; }
}
