/* LightGenBench project page. Dark, one centered column, after bmild.github.io/rawnerf:
   a title, the link buttons, one hero image, then blocks of a heading, a sentence and one visual. */

:root {
  --bg: #000;
  --ink: #f2f1ef;
  --ink-soft: #a8a6a1;
  --line: #2a2927;
  --panel: #111110;
  --accent: #f59e0b;
  --accent-ink: #fbbf24;
  --radius: 10px;
  --w: 900px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }

/* hero */
.hero { text-align: center; padding-top: 72px; padding-bottom: 36px; }
.hero h1 { margin: 0; font-size: clamp(40px, 7vw, 60px); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
.hero__claim { margin: 10px 0 18px; font-size: clamp(18px, 2.6vw, 23px); color: var(--ink-soft); letter-spacing: -.01em; }
.authors { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 24px; font-size: 18px; }
.affil { margin: 4px 0 28px; color: var(--ink-soft); font-size: 15px; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; padding: 9px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border: 1px solid var(--line);
}
.btn:hover { text-decoration: none; }
.btn--off { color: #6f6d69; cursor: default; }
.btn--on { color: #111; background: var(--accent); border-color: var(--accent); }
.btn--on:hover { background: var(--accent-ink); }
.hero__img { width: 100%; border-radius: var(--radius); }
/* the task sentence, under the hero */
.lead { margin: 28px auto 0; max-width: 720px; text-align: center; font-size: 19px; color: var(--ink); }

/* blocks: a heading, a sentence, one visual */
.block { padding-top: 72px; }
.block h2 { margin: 0 0 8px; font-size: 25px; font-weight: 600; letter-spacing: -.015em; }
.block > p { margin: 0 0 20px; color: var(--ink-soft); }
.block > p b { color: var(--ink); font-weight: 600; }
/* a block with no sentence: keep the visual off the heading */
.block > h2 + .video { margin-top: 16px; }
.fig { width: 100%; border-radius: var(--radius); cursor: zoom-in; }
/* white paper diagrams stay white, framed as a card on the black page */
.fig--card { background: #fff; padding: 14px; }

.video { border-radius: var(--radius); overflow: hidden; background: var(--panel); line-height: 0; }
.video video { width: 100%; height: auto; display: block; }

/* emission off/on comparison: the "on" image underneath, the "off" image on top, clipped at --x */
.cmp {
  --x: 50%;
  position: relative; overflow: hidden; border-radius: var(--radius); background: var(--panel);
  cursor: ew-resize; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none;
}
.cmp img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp .cmp__top { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
/* the divider is the slider control; the images stay plain images with their alt text */
.cmp__bar {
  position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px;
  background: var(--accent); box-shadow: 0 0 12px 2px rgba(245,158,11,.6);
}
.cmp__bar:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
/* the handle and the two labels ride on the divider near its top, centered on one line */
.cmp__knob, .cmp__lab {
  position: absolute; top: 28px; transform: translateY(-50%); pointer-events: none;
  background: rgba(0,0,0,.6); color: var(--ink); font-weight: 600; white-space: nowrap;
}
.cmp__knob {
  left: 50%; width: 32px; height: 32px; margin-left: -16px; border-radius: 50%;
  border: 2px solid var(--accent); box-shadow: 0 0 12px 2px rgba(245,158,11,.5);
  display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
}
.cmp__lab { padding: 3px 10px; border-radius: 999px; font-size: 13px; letter-spacing: .02em; }
.cmp__lab--off { right: 26px; }
.cmp__lab--on { left: 26px; }

/* Results: one divider shared by every render of the grid; inputs take 16:9 cells,
   renders square ones, so 16fr + 5 x 9fr gives every row one height */
.qgrid { display: grid; grid-template-columns: minmax(0, 16fr) repeat(5, minmax(0, 9fr)); gap: 6px; }
.cmp.qgrid { overflow: visible; border-radius: 0; background: none; cursor: default; touch-action: auto; }
.qgrid__head { align-self: end; padding-bottom: 2px; font-size: 13px; line-height: 1.3; color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; }
.qcell { position: relative; overflow: hidden; border-radius: 6px; background: var(--panel); }
.qcell--input { aspect-ratio: 16 / 9; }
.qgrid .cmp__pane { aspect-ratio: 1; cursor: ew-resize; touch-action: pan-y pinch-zoom; }
/* the handle only: a ~120 px render has no room for the Off / On labels once the line moves */
.qgrid .cmp__knob { top: 16px; width: 24px; height: 24px; margin-left: -12px; font-size: 14px; }
.qgrid .cmp__lab { display: none; }

/* the 3D viewer (site/viewer/, a build_model_gallery.py page in embed mode) */
/* one row of six roughly square panels under a picker line and two-line headings: width / 6 + 72 px */
.viewer { position: relative; height: 0; padding-top: calc(16.667% + 72px); }
.viewer iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; }

.code {
  position: relative; background: var(--panel); color: #e7e5e4; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 88px 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 14px;
}
/* wrap instead of scrolling, so the Copy button never covers part of the command on a phone */
.code pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
.copy {
  position: absolute; top: 12px; right: 12px; background: #292524; color: #d6d3d1;
  border: 1px solid #44403c; border-radius: 8px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.copy:hover { background: #44403c; color: #fff; }

/* footer.wrap, not footer: .wrap's margin shorthand would otherwise zero the top margin */
footer.wrap { margin-top: 88px; padding-top: 24px; padding-bottom: 56px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 14px; }
footer code { font-family: var(--mono); font-size: 13px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(0,0,0,.95); padding: 24px; cursor: zoom-out; }
.lb.on { display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 100%; max-height: 100%; border-radius: 8px; }

@media (max-width: 640px) {
  .block { padding-top: 56px; }
  .block h2 { font-size: 22px; }
  .fig--card { padding: 6px; }
  .lead { font-size: 17px; }
  .cmp__knob, .cmp__lab { top: 22px; }
  .cmp__knob { width: 28px; height: 28px; margin-left: -14px; font-size: 16px; }
  .cmp__lab { font-size: 12px; padding: 2px 8px; }
  .cmp__lab--off { right: 22px; }
  .cmp__lab--on { left: 22px; }
  /* the results grid drops the input column */
  .qgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
  .qgrid__head--input, .qcell--input { display: none; }
  .qgrid__head { font-size: 10px; }
  .qgrid .cmp__knob { width: 20px; height: 20px; margin-left: -10px; font-size: 12px; }
  /* the viewer stacks its panels 3 x 2 at this width, so it needs a taller frame */
  .viewer { padding-top: calc(66.667% + 120px); }
}
