/* ============================================================
   project.css — project pages (RENI, RENI++, NeuSky)
   Same tokens and type as the homepage (home.css + home-grey.css).
   Wide page with section labels in a left gutter (.layout-b).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg:        #0c0c0c;
  --ink:       #e6e6e6;
  --ink-soft:  #9a9a9a;
  --ink-faint: #6a6a6a;
  --rule:      #232323;
  --surface:   #161616;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #4a4a4a;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: #fff; text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

img, video { display: block; max-width: 100%; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }

/* --- Header --- */
.crumb {
  font: 0.82rem/1.5 var(--mono);
  color: var(--ink-faint);
}
.crumb a { color: var(--ink-soft); text-decoration-color: #3a3a3a; }

.proj-head { padding: 2.5rem 0 2.25rem; }

.proj-head h1 {
  font: 600 clamp(1.7rem, 4vw, 2.3rem)/1.15 var(--sans);
  letter-spacing: -0.025em;
  max-width: 34ch;
  text-wrap: balance;
  margin: 3rem 0 1.1rem;
}

.authors { color: var(--ink-soft); }
.authors a { color: var(--ink-soft); text-decoration-color: #333; }
.authors a.me { color: var(--ink); }
.affil { color: var(--ink-faint); font-size: 0.9rem; margin: 0.1rem 0 1.1rem; }

.meta, .cite-copy {
  font: 0.82rem/1.5 var(--mono);
}
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.venue { color: var(--ink-soft); font-weight: 500; margin-right: 0.25rem; }
.meta a, .cite-copy { text-decoration: none; color: var(--ink); }
.meta a::before, .cite-copy::before { content: '['; color: var(--ink-faint); }
.meta a::after,  .cite-copy::after  { content: ']'; color: var(--ink-faint); }

/* --- Teaser: native aspect, never cropped --- */
.teaser { margin: 0 0 3rem; }
.teaser video { width: 100%; height: auto; outline: 1px solid var(--rule); }

/* --- Sections --- */
.block { border-top: 1px solid var(--rule); padding: 2.25rem 0; }

.block > h2 {
  font: 500 0.85rem/1.5 var(--mono);
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}

.body > p { max-width: 68ch; margin-bottom: 1rem; }
.body > p:last-child { margin-bottom: 0; }

.fig { margin: 1.75rem 0 0; }
.body > .fig:first-child { margin-top: 0; }
.fig img, .fig video { width: 100%; height: auto; background: #fff; outline: 1px solid var(--rule); }
.fig figcaption {
  font: 0.78rem/1.5 var(--mono);
  color: var(--ink-faint);
  margin-top: 0.6rem;
}

.samples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 1.5rem;
}
.samples img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }

/* Five 16:9 samples: two wide on top, three below */
.samples.five { grid-template-columns: repeat(6, 1fr); }
.samples.five img { aspect-ratio: 16 / 9; grid-column: span 2; }
.samples.five img:nth-child(-n+2) { grid-column: span 3; }

/* --- Citation --- */
.cite { position: relative; background: var(--surface); outline: 1px solid var(--rule); }
.cite pre {
  white-space: pre-wrap;
  padding-left: 1.25rem;
  font: 0.8rem/1.65 var(--mono);
  color: var(--ink-soft);
  padding: 1.25rem;
  overflow-x: auto;
}
.cite-copy {
  position: absolute; top: 0.75rem; right: 0.9rem;
  background: var(--surface); border: 0; cursor: pointer;
}
.cite-copy:hover { color: #fff; }

/* --- Footer --- */
.foot {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  font: 0.75rem/1.5 var(--mono);
  color: var(--ink-faint);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
}
.foot a { color: var(--ink-soft); text-decoration-color: #3a3a3a; }

/* ============================================================
   Layout B: gutter labels
   ============================================================ */
.layout-b .wrap { max-width: 1080px; }

@media (min-width: 900px) {
  .layout-b .proj-head,
  .layout-b .block {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 2.5rem;
  }
  .layout-b .crumb { padding-top: 0.55rem; }
  .layout-b .proj-head h1 { margin-top: 0; }
  .layout-b .teaser { margin-left: calc(190px + 2.5rem); }
  .layout-b .proj-head { padding-top: 5.5rem; }
  .layout-b .block > h2 {
    position: sticky; top: 1.5rem; align-self: start;
    margin-bottom: 0; padding-top: 0.1rem;
  }
}

/* --- Small screens --- */
@media (max-width: 640px) {
  .proj-head h1 { margin-top: 2rem; }
  .samples { grid-template-columns: repeat(2, 1fr); }
  .samples img:nth-child(9) { display: none; }
  .samples.five { grid-template-columns: 1fr 1fr; }
  .samples.five img, .samples.five img:nth-child(-n+2) { grid-column: auto; }
  .samples.five img:first-child { grid-column: span 2; }
}

.nobr { white-space: nowrap; }

/* Body text spans the full column, justified to the figure edges */
.body > p {
  max-width: none;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
}

/* Low-resolution media: show at native size, never upscaled */
.fig.native img, .fig.native video { width: auto; max-width: 100%; }

/* A paragraph after a figure starts the next figure's lead-in */
.body > .fig + p,
.body > .pair + p { margin-top: 2.5rem; }

/* Two images side by side, each with its own label */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 1.75rem;
}
.pair figure img { width: 100%; height: auto; outline: 1px solid var(--rule); }
.pair figcaption {
  font: 0.78rem/1.5 var(--mono);
  color: var(--ink-faint);
  margin-top: 0.5rem;
}

/* Header follow-up line (e.g. "Extended in RENI++") */
.followup { font-size: 0.9rem; color: var(--ink-soft); margin: -0.6rem 0 1.1rem; }

/* Ground-truth layer grid: column labels in HTML, one row per scene */
.layers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 1.75rem;
}
.layers span {
  font: 0.78rem/1.5 var(--mono);
  color: var(--ink-faint);
  padding-bottom: 0.35rem;
}
.layers img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.layers + figcaption, .layers-cap {
  font: 0.78rem/1.5 var(--mono);
  color: var(--ink-faint);
  margin-top: 0.6rem;
}

/* Downloads: repo name, then what it contains */
.downloads {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(13rem, auto) 1fr;
  gap: 0.6rem 1.5rem;
  margin-top: 1.25rem;
}
.downloads li { display: contents; }
.downloads > li > a { font: 0.82rem/1.65 var(--mono); }
.body > .downloads:first-child { margin-top: 0; }
.downloads span { color: var(--ink-soft); font-size: 0.94rem; }
@media (max-width: 640px) {
  .downloads { grid-template-columns: 1fr; gap: 0.15rem; }
  .downloads span { margin-bottom: 0.6rem; }
}

.body code, .downloads code { font: 0.85em var(--mono); color: var(--ink); }
.samples { margin-top: 1.75rem; }
