/* X-Splat project page.
   One committed palette rather than a light/dark pair: the renderings are all on black,
   and a light theme would put a white page around black images. Everything is defined
   on bare :root so no colour depends on a media query -- a viewer in light mode gets
   this page, not a flash of white. */

:root {
  --bg:        #0a0b0f;
  --bg-alt:    #101219;
  --surface:   #171a23;
  --line:      #262b38;
  --text:      #e9ecf4;
  --muted:     #99a1b5;
  --rgb:       #ff9a62;   /* the reflective modality */
  --xray:      #6fd2ff;   /* the absorptive one */
  --link:      #8fd8ff;
  --radius:    14px;
  /* One column for everything but the hero. Figures used to sit in a wider container
     than their captions and the body text, and a 350px step between the two read as a
     mistake rather than a layout. Detail that a shared width costs is on the other end
     of a click: each figure links to its full-resolution file. */
  --wrap:      52rem;
  --wrap-wide: 68rem;   /* hero only */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.7 "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgba(143, 216, 255, .3); }
a:hover { border-bottom-color: var(--link); }

h1, h2 { line-height: 1.22; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
h2 { font-size: 1.7rem; margin-bottom: .35em; }
p { margin: 0 0 1.1em; }
sup { font-size: .72em; }

.wrap      { max-width: var(--wrap);      margin: 0 auto; padding: 0 1.5rem; }
.wrap-wide { max-width: var(--wrap-wide); margin: 0 auto; padding: 0 1.5rem; }

/* ---------------------------------------------------------------- masthead */

.masthead { padding: 4.5rem 0 2.5rem; text-align: center; }

.venue {
  margin: 0 0 1.6rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--xray);
}

.masthead h1 { font-size: clamp(1.85rem, 4.2vw, 3rem); margin-bottom: 1.6rem; }

.authors  { font-size: 1.05rem; margin-bottom: .4rem; }
.authors a, .authors span { white-space: nowrap; }
.authors a { border-bottom-color: transparent; }
.authors a:hover { border-bottom-color: var(--link); }
.affils { color: var(--muted); font-size: .95rem; margin-bottom: 1.8rem; }

.badges { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

.badge {
  display: inline-block;
  padding: .5rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .93rem;
  font-weight: 500;
}
a.badge:hover { border-color: var(--xray); color: var(--xray); }
.badge-off { color: var(--muted); cursor: default; }

/* ------------------------------------------------------------------ layout */

.hero { padding: 1rem 0 3.5rem; }
.section { padding: 3.75rem 0; }
.section-alt { background: var(--bg-alt); }

.lede { font-size: 1.09rem; }
.sub  { color: var(--muted); }
h2 + .sub { margin-top: -.2em; }

ul { margin: 0 0 1.1em; padding-left: 1.2em; }
li { margin-bottom: .5em; }

/* ------------------------------------------------------- figures and video */

figure { margin: 0 0 2.5rem; }
figure:last-child { margin-bottom: 0; }

figcaption {
  margin-top: .85rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}
figcaption strong { color: var(--text); font-weight: 600; }

.video-figure video,
.fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #000;
}

/* The paper's figures are drawn on white. Reversing them would misrepresent them, so
   they sit on their own light card with a little breathing room instead. */
.fig img {
  background: #fff;
  padding: .55rem;
}

/* Wrapping the image in a link is the whole "view full size" affordance -- the file it
   points at is the same one, at its own resolution. */
.fig a { display: block; border: 0; }
.fig a:hover img { outline: 2px solid var(--xray); outline-offset: -2px; }

/* The pipeline figure is about five times as wide as it is tall; below ~700px it
   becomes unreadable when scaled to fit, so it scrolls at a legible size instead. */
.fig-wide img { min-width: 42rem; }
.fig-wide { overflow-x: auto; }

.video-figure { position: relative; }

.video-figure .play-again {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  background: rgba(6, 7, 10, .55);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.video-figure .play-again::before {
  content: "";
  width: 0; height: 0;
  margin-right: .6rem;
  border-left: 1.15rem solid currentColor;
  border-top: .72rem solid transparent;
  border-bottom: .72rem solid transparent;
}

/* -------------------------------------------------------- compare (slider) */

.compare { max-width: 32rem; margin: 0 auto; }

.tag {
  color: var(--muted);
  font-size: .78em;
  font-weight: 400;
}

.compare-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

/* Hidden, but still laid out and still painted: display:none stops Safari decoding,
   which would leave the canvas empty. */
#compare-src {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

#compare-canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  cursor: ew-resize;
  touch-action: none;   /* the drag is ours, not the browser's scroll */
}
#compare-canvas:focus-visible { outline: 2px solid var(--xray); outline-offset: 2px; }

.corner {
  position: absolute;
  top: .7rem;
  padding: .18rem .55rem;
  border-radius: 6px;
  background: rgba(8, 9, 13, .62);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  pointer-events: none;
}
.corner-l { left: .7rem;  color: var(--rgb); }
.corner-r { right: .7rem; color: var(--xray); }

/* The fallback when there is no canvas: show the packed clip as it is, both
   modalities side by side. It still makes the point. */
.compare.no-canvas #compare-src { position: static; opacity: 1; width: 100%; height: auto; }
.compare.no-canvas #compare-canvas,
.compare.no-canvas .corner { display: none; }
.compare.no-canvas .compare-stage { aspect-ratio: auto; }

/* ----------------------------------------------------------------- gallery */

.gallery-stage {
  max-width: 32rem;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
 /* Every scene clip is square, and the src changes at runtime; pinning the ratio
    keeps the switch from resizing the page under the reader. */
.gallery-stage video { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }

.stage-label {
  margin: .9rem 0 1.1rem;
  text-align: center;
  font-weight: 600;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: .5rem;
}
.thumbs button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
}
.thumbs img { display: block; width: 100%; height: auto; opacity: .55; }
.thumbs button:hover img { opacity: .85; }
.thumbs button[aria-selected="true"] { border-color: var(--xray); }
.thumbs button[aria-selected="true"] img { opacity: 1; }

/* ------------------------------------------------------------------ bibtex */

pre {
  margin: 0 0 1.1em;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}
code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.65;
  color: #cfd6e6;
}

/* ------------------------------------------------------------------ footer */

footer {
  padding: 2.75rem 0 3.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .88rem;
}
footer p { margin: 0; }

/* ------------------------------------------------------------------ narrow */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead { padding-top: 3rem; }
  .authors { font-size: .98rem; }
  .thumbs { grid-template-columns: repeat(5, 1fr); }
  .fig-wide img { min-width: 30rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
