/* Dirichlet Splatting project page.
   Colour roles follow the paper: Dirichlet = cool blue, Gaussian = warm
   orange (the kernel-comparison inset), heatmaps = Spectral colormap. */

:root {
  --bg: #fafbfc;
  --panel: #f0f4f7;
  --panel-edge: #dbe3ea;
  --ink: #17202c;
  --muted: #5b6675;
  --rule: #dfe5eb;
  --dir: #2b66a6;
  --gau: #d9772a;
  --amp-bg: #eef5fb;
  --ker-bg: #fdf3e9;

  --font-ui: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wide: 1100px;
  --measure: 42.5rem;   /* 680px, about 78 characters of the serif body */
  --gutter: 20px;
  --radius: 10px;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
canvas { display: block; }
a { color: var(--dir); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--dir); outline-offset: 2px; border-radius: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------------- Masthead ---------------- */

/* Layout follows the common graphics project-page header: one large
   centred title, blue author links to homepages, a venue
   line, then dark pill buttons. */
.masthead { text-align: center; padding: 64px 0 8px; }
.title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 auto 0.4em;
  max-width: 1100px;
  text-wrap: balance;
}
/* The subtitle runs a step smaller and in regular weight under the name. */
.title-main { display: block; letter-spacing: -0.03em; }
.title-sub { display: block; font-size: 0.8em; font-weight: 400; letter-spacing: -0.02em; margin-top: 0.1em; }
.authors {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.15em 0;
  font-family: var(--font-ui); font-size: 1.3rem; font-weight: 500;
}
.authors li:not(:last-child)::after { content: ","; margin-right: 0.55em; color: var(--ink); }
.authors a { color: var(--dir); text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.affiliation, .venue { font-family: var(--font-ui); margin: 0.4em 0 0; }
.affiliation { font-size: 1.05rem; color: var(--muted); }
.venue { font-size: 1.3rem; font-weight: 400; color: var(--ink); margin-top: 0.75em; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 0; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px 9px 14px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-family: var(--font-ui); font-weight: 600; font-size: 0.95rem;
  text-decoration: none;
}
.pill:hover { background: #2a3a4f; }
.pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill.is-pending { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--panel-edge); cursor: default; }
.pill.is-pending::after { content: "soon"; font-weight: 500; font-size: 0.75rem; color: var(--muted); margin-left: 2px; }

.noscript { font-family: var(--font-ui); color: var(--muted); }

/* ---------------- Teaser ---------------- */

.teaser { margin-top: 28px; }
.teaser figure { margin: 0; }
.teaser-frame { position: relative; }
.teaser-flow {
  position: absolute; left: 73.5%; top: 0; width: 17%;
  transform: translate(-50%, -8%);
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--font-ui); font-size: clamp(0.55rem, 1.1vw, 0.85rem); line-height: 1.1;
  pointer-events: none;
}
.teaser-flow svg { width: 100%; height: auto; overflow: visible; }
.teaser-flow path { fill: none; stroke-width: 3; stroke-linecap: round; }
.flow-fwd { color: #b8383a; }
.flow-bwd { color: #3c74a6; }
.teaser-labels { list-style: none; padding: 0; margin: 6px 0 0; position: relative; height: 1.6em; }
.teaser-labels li {
  position: absolute; left: var(--x); transform: translateX(-50%);
  font-family: var(--font-ui); font-weight: 600; white-space: nowrap;
  font-size: clamp(0.62rem, 1.45vw, 1rem);
}

/* ---------------- Sections and prose ---------------- */

/* Text runs in one centred column (--measure); demos and wide figures
   use the full container. Inside two-column .split rows the prose
   fills its grid cell instead. */
.block { margin-top: 88px; }
.block > h2, .block > h3, .block > .prose, .block > .table-wrap,
.block > .bib {
  max-width: var(--measure);
  margin-left: auto; margin-right: auto;
}
.block > h2 {
  font-family: var(--font-ui); font-weight: 700;
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  line-height: 1.15; letter-spacing: -0.02em;
  margin-top: 0; margin-bottom: 18px;
}
.block > h3 {
  font-family: var(--font-ui); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em;
  margin-top: 64px; margin-bottom: 14px;
  padding-top: 18px; border-top: 1px solid var(--rule);
}
.block > h2 + h3 { margin-top: 12px; }

.prose { max-width: var(--measure); }
.split .prose { max-width: none; }
.prose p { margin: 0 0 1em; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; }
.howto {
  font-family: var(--font-ui); font-size: 0.98rem; line-height: 1.55;
  color: var(--ink);
  padding-left: 14px; border-left: 3px solid var(--dir);
}

.eq { margin: 1.1em 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.eq-main { max-width: var(--wide); margin: 28px 0; text-align: center; font-size: 1.12rem; }
.eq-keys { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.key::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.key-amp::before { background: var(--amp-bg); box-shadow: inset 0 0 0 1px #7fb0d6; }
.key-ker::before { background: var(--ker-bg); box-shadow: inset 0 0 0 1px #e8a56a; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0 0 1.2em; }
.steps li { counter-increment: step; position: relative; padding-left: 2.3em; margin-bottom: 0.8em; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.12em;
  width: 1.6em; height: 1.6em; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--dir); color: #fff;
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 700;
}
.steps strong { font-family: var(--font-ui); font-weight: 600; }

/* ---------------- Interactive demos ---------------- */

.demo {
  margin: 26px 0 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  font-family: var(--font-ui);
}
.demo-bar {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  padding-bottom: 14px; margin-bottom: -6px;
  border-bottom: 1px solid var(--panel-edge);
}
.tool { display: flex; align-items: center; gap: 8px; }
.tool-label { color: var(--muted); font-size: 0.85rem; }
.bar-actions { display: flex; align-items: center; gap: 6px; padding-right: 16px; border-right: 1px solid var(--panel-edge); }
.bar-note { margin-left: auto; }
.hint { color: var(--muted); font-size: 0.82rem; margin-right: 6px; }

/* Icon buttons with a CSS tooltip from data-tip (shown on hover and on
   keyboard focus; aria-label carries the same text for screen readers). */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; cursor: pointer;
  background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--panel-edge);
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.icon-btn.is-primary { background: var(--dir); color: #fff; box-shadow: none; }
.icon-btn.is-primary:hover { background: #1f5590; }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5;
  padding: 4px 8px; border-radius: 5px;
  background: var(--ink); color: #fff;
  font-size: 0.78rem; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.icon-btn[data-tip]:hover::after, .icon-btn[data-tip]:focus-visible::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .icon-btn[data-tip]::after { transition: none; } }
/* Attention ring on a button the reader has not pressed yet (the optimizer's
   Run): a soft pulse spreading from its edge. page.js drops the class on
   the first click. ::after is taken by the tooltip, so the ring uses ::before. */
.icon-btn.is-attention::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  animation: attention-ring 1.6s ease-out infinite;
}
@keyframes attention-ring {
  0% { box-shadow: 0 0 0 0 rgba(43, 102, 166, 0.65); }
  70% { box-shadow: 0 0 0 9px rgba(43, 102, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 102, 166, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn.is-attention::before { animation: none; box-shadow: 0 0 0 3px rgba(43, 102, 166, 0.35); }
}

/* First-view gesture overlay on each editable canvas (DS.pointEditor):
   a dark veil that flashes twice to catch the eye, a hand that drags a
   dot with a small press-and-release bob, and the three gestures in white.
   pointer-events: none lets the first press reach the canvas. */
.hint-host { position: relative; }
.edit-hint {
  position: absolute; z-index: 6; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(23, 32, 44, 0.72); backdrop-filter: blur(1.5px);
  pointer-events: none;
  animation: edit-hint-in 0.25s ease, edit-hint-flash 0.9s ease-in-out 0.25s 2;
}
.edit-hint.is-row { flex-direction: row; gap: 32px; }
.edit-hint.is-leaving { opacity: 0; transition: opacity 0.3s; }
.edit-hint-demo { position: relative; width: 84px; height: 44px; flex: none; }
.edit-hint-dot {
  position: absolute; left: 18px; top: 20px; width: 12px; height: 12px; border-radius: 50%;
  background: #7fb6e8; box-shadow: 0 0 0 4px rgba(127, 182, 232, 0.3);
  animation: edit-hint-drag 1.8s ease-in-out infinite;
}
.edit-hint-hand-wrap { position: absolute; left: 18px; top: 23px; animation: edit-hint-drag 1.8s ease-in-out infinite; }
.edit-hint-hand {
  display: block; width: 30px; height: 30px;
  fill: #fff; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  animation: edit-hint-bob 0.6s ease-in-out infinite alternate;
}
.edit-hint-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--font-ui); font-size: 0.82rem; font-weight: 500; color: #fff; }
.edit-hint-list li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.edit-hint-list svg { width: 16px; height: 16px; flex: none; fill: none; stroke: #9cc8f0; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes edit-hint-in { from { opacity: 0; } to { opacity: 1; } }
/* Two flashes: the veil lightens and its edge glows, then settles. */
@keyframes edit-hint-flash {
  0%, 100% { background: rgba(23, 32, 44, 0.72); box-shadow: inset 0 0 0 0 rgba(127, 182, 232, 0); }
  50% { background: rgba(23, 32, 44, 0.5); box-shadow: inset 0 0 0 3px rgba(127, 182, 232, 0.85); }
}
@keyframes edit-hint-drag {
  0%, 15% { transform: translate(0, 0); }
  60%, 75% { transform: translate(34px, -12px); }
  100% { transform: translate(0, 0); }
}
@keyframes edit-hint-bob { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(1px, -3px) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .edit-hint, .edit-hint-dot, .edit-hint-hand-wrap, .edit-hint-hand { animation: none; }
}
.demo-stage { min-width: 0; }
.demo-view { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
.demo-side { display: flex; flex-direction: column; gap: 16px; font-size: 0.92rem; }

.plot { width: 100%; background: #fff; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--rule); touch-action: none; }
.plot-kernel { height: 340px; }
.plot-scene { aspect-ratio: 1 / 1; height: auto; }
.plot-scene[data-panel="scene"] { cursor: grab; }
.plot-race { height: 170px; }
.plot-race + .plot-race { margin-top: 10px; }
.plot-loss { height: 170px; }

/* The fan keeps its own aspect (its view box is about 560 x 336 mm), so
   it is never squeezed into the square scene's shape. */
.plot-fan { aspect-ratio: 5 / 3; height: auto; }
.plot-profile { height: 160px; }
.surfel-profile { margin-top: 14px; }
/* Surfel demo: a fixed-width fan and side column, centred in the panel, so
   the figure does not grow with the page width. */
#demo-surfel { grid-template-columns: 280px minmax(0, 560px); justify-content: center; column-gap: 32px; }
/* A flatter scene canvas keeps the whole demo within one screen height. */
#demo-surfel .plot-scene { aspect-ratio: 6 / 5; }
#demo-surfel .demo-side { gap: 12px; }
/* Material legend: the same colours the surfels use in every panel. */
.mat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7); }
#demo-surfel .bar-fill { background: var(--sel, #7fb0d6); opacity: 0.6; }
#demo-surfel .bar-total .bar-fill { background: var(--sel, var(--dir)); opacity: 1; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plot-fit { height: 190px; }
.plot-fit + .plot-fit { margin-top: 10px; }
.panel { margin: 0; }
.panel-box { position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; }
.panel-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel-overlay { cursor: crosshair; touch-action: none; }
.panel figcaption { margin-top: 8px; font-weight: 600; font-size: 0.92rem; }

.colorbar { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.8rem; color: var(--muted); }
.colorbar i {
  flex: 0 1 220px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #5e4fa2, #3288bd, #66c2a5, #abdda4, #e6f598, #ffffbf, #fee08b, #fdae61, #f46d43, #d53e4f, #9e0142);
}

.legend { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.85rem; color: var(--muted); }
.legend-tight { margin-top: 0; }
.swatch { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid; vertical-align: middle; margin-right: 7px; }
.sw-dir { border-color: var(--dir); }
.sw-gau { border-color: var(--gau); border-top-style: dashed; }
.sw-solid { border-top-style: solid; }
.sw-gt { height: 10px; border: 0; border-top: 1px solid rgba(23, 32, 44, 0.45); background: rgba(23, 32, 44, 0.08); }
.sw-ink { border-color: var(--ink); }
.sw-dash { border-color: var(--muted); border-top-style: dashed; border-top-width: 2px; }
.sw-phase {
  width: 18px; height: 8px; border: 0; border-radius: 4px;
  background: linear-gradient(90deg, hsl(0 62% 50%), hsl(90 62% 46%), hsl(180 62% 46%), hsl(270 62% 50%), hsl(360 62% 50%));
}
.panel .swatch { width: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.field-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.85rem; margin: 0; }
.field-label output { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.field-label.strong { color: var(--ink); font-weight: 700; font-size: 0.95rem; }

input[type="range"] { width: 100%; accent-color: var(--dir); margin: 0; }

.seg { font-family: var(--font-ui); display: inline-flex; flex-wrap: wrap; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px var(--panel-edge); padding: 2px; gap: 2px; }
.seg button {
  font: inherit; font-size: 0.85rem; font-weight: 500;
  border: 0; background: transparent; color: var(--ink);
  padding: 5px 10px; border-radius: 5px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
/* Sliding pill (page.js): with it, pressed buttons drop their own fill and
   the pill moves under them; without JS the plain fill above still works. */
.seg.has-pill { position: relative; }
.seg-pill {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 5px;
  background: var(--ink); pointer-events: none;
}
.seg.pill-ready .seg-pill { transition: transform 0.26s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.26s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.15s; }
.seg.has-pill button { position: relative; z-index: 1; transition: color 0.2s; }
.seg.has-pill button[aria-pressed="true"] { background: transparent; }

/* Switched-in views fade up; the run icon pops when it changes. */
.view-enter { animation: view-in 0.28s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.icon-btn.icon-swap svg { animation: icon-swap 0.24s ease; }
@keyframes icon-swap { from { transform: scale(0.55) rotate(-40deg); opacity: 0.3; } to { transform: none; opacity: 1; } }
.icon-btn { transition: transform 0.1s ease; }
.icon-btn:active:not(:disabled) { transform: scale(0.93); }
@media (prefers-reduced-motion: reduce) {
  .seg.pill-ready .seg-pill, .seg.has-pill button, .icon-btn { transition: none; }
  .view-enter, .icon-btn.icon-swap svg { animation: none; }
}
.seg button:disabled { opacity: 0.4; cursor: default; }

.btn {
  font: inherit; font-size: 0.88rem; font-weight: 600;
  border: 0; border-radius: 7px; cursor: pointer;
  padding: 7px 14px;
  background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--panel-edge);
  align-self: flex-start;
}
.btn:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.btn:disabled { opacity: 0.45; cursor: default; }

.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; cursor: pointer; }
.check input { accent-color: var(--dir); margin-top: 3px; }

.readout { margin: 0; display: grid; gap: 8px; }
.readout div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid var(--panel-edge); padding-top: 8px; }
.readout dt { color: var(--muted); font-size: 0.85rem; }
.readout dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }


.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 1fr 70px 44px; align-items: center; gap: 8px; font-size: 0.82rem; }
.bar-name { color: var(--muted); }
.bar-track { height: 8px; background: #fff; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--panel-edge); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: #7fb0d6; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-total { border-top: 1px solid var(--panel-edge); padding-top: 7px; }
.bar-total .bar-fill { background: var(--dir); }
.bar-total .bar-name { color: var(--ink); font-weight: 600; }

/* ---------------- Results ---------------- */

.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; margin: 18px 0; }
.split-even { grid-template-columns: 1fr 1fr; }
.fig { margin: 0; }
.fig-wide { margin: 18px 0 24px; }
.fig-wide img { width: 100%; border-radius: 4px; }
.fig figcaption { font-family: var(--font-ui); font-size: 0.88rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.pair-fig { display: grid; grid-template-columns: 1.33fr 1fr; gap: 10px; align-items: stretch; }
.pair-fig img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

/* Setup photos and our reconstruction at one shared height: each figure's
   flex-grow is its image's aspect ratio (set inline in index.html). */
.thz-row { display: flex; gap: 14px; margin: 18px 0 28px; align-items: flex-start; }
.thz-row .fig { flex-basis: 0; min-width: 0; }
.thz-row img { width: 100%; border-radius: 4px; }
/* Annotations redrawn from the paper's TikZ overlay: cyan boxes with a
   white halo, a dashed callout, and black-backed labels. */
.annot { position: relative; }
.annot svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.annot .halo { stroke: #fff; stroke-width: 4px; vector-effect: non-scaling-stroke; }
.annot .box { stroke: #00d9ff; stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.annot .inset { stroke: #000; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.annot .callout { stroke: #00d9ff; stroke-width: 1.6px; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.annot .tag rect { fill: #000; }
.annot .tag text { fill: #00d9ff; font-family: var(--font-ui); font-weight: 700; font-size: 30px; }


.compare { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.compare-box {
  position: relative; width: 100%; max-width: 420px; aspect-ratio: 538 / 600;
  border-radius: 6px; overflow: hidden; background: #e3e4e1; user-select: none;
}
.compare-box img { position: absolute; inset: 0; width: 100%; height: 100%; }
.compare-ours { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-box::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 0 1px rgba(23, 32, 44, 0.25); pointer-events: none;
}
.compare-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; z-index: 2;
}
.compare-range:focus-visible + * , .compare-box:focus-within { outline: 2px solid var(--dir); outline-offset: 2px; }
.compare-tag {
  position: absolute; top: 10px; z-index: 1;
  font-family: var(--font-ui); font-size: 0.78rem; font-weight: 600;
  background: rgba(23, 32, 44, 0.72); color: #fff; padding: 2px 8px; border-radius: 4px;
}
.tag-left { left: 10px; }
.tag-right { right: 10px; }

.table-wrap { overflow-x: auto; margin: 16px 0 0; }
table { border-collapse: collapse; font-family: var(--font-ui); font-size: 0.9rem; }
caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: 0.82rem; padding-top: 8px; }
th, td { padding: 7px 14px 7px 0; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
thead th { font-weight: 600; color: var(--muted); border-bottom-color: var(--ink); }
tbody th { font-weight: 500; }
tfoot th, tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 22px; }
.params td:nth-child(4), .params td:nth-child(5) { color: var(--dir); }

.bib { position: relative; max-width: 820px; }
.bib pre {
  margin: 0; padding: 18px 20px; overflow-x: auto;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.84rem; line-height: 1.55;
}
.bib-copy { position: absolute; top: 10px; right: 10px; }

.footer { margin-top: 96px; padding: 28px 0 48px; border-top: 1px solid var(--rule); font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); }
.footer p { margin: 0 auto; max-width: var(--measure); }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .demo { grid-template-columns: 1fr; }
  .demo-view { grid-template-columns: 1fr; }
  .split, .split-even { grid-template-columns: 1fr; }
  #demo-surfel { grid-template-columns: minmax(0, 560px); }
  #demo-surfel .plot-scene { max-width: 320px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  body { font-size: 1rem; }
  .masthead { padding-top: 40px; }
  .block { margin-top: 64px; }
  .demo { padding: 14px; margin-left: calc(-1 * var(--gutter) + 6px); margin-right: calc(-1 * var(--gutter) + 6px); }
  .pair { grid-template-columns: 1fr; }
  .trio { grid-template-columns: 1fr 1fr; }
  .authors, .venue { font-size: 1.1rem; }
  .eq-main { font-size: 0.74rem; }
  .plot-kernel { height: 260px; }
  .thz-row { flex-direction: column; }
  .teaser-flow { display: none; }
  .teaser-labels { display: none; }
}
