/* NeDM project page — no external assets, light/dark aware. */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f6f7f9;
  --bg-sunken: #eef0f4;
  --fg:        #1a1d21;
  --fg-muted:  #5c6572;
  --line:      #dfe3e9;
  --accent:    #1f6fb2;
  --accent-sf: #e8f1f9;
  --gen:       #1f77b4;
  --rig:       #ff7f0e;
  --crm:       #2ca02c;
  --radius:    10px;
  --maxw:      1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14171b;
    --bg-soft:   #1b1f25;
    --bg-sunken: #22272e;
    --fg:        #e6e9ee;
    --fg-muted:  #9aa4b2;
    --line:      #2c333c;
    --accent:    #5aa9e6;
    --accent-sf: #16232f;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}
h3 { font-size: 1.02rem; margin: 0 0 .4rem; }

section { margin: 4.5rem 0; }

.lede { color: var(--fg-muted); max-width: 74ch; margin: 0 0 1.6rem; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 4rem 0 3rem;
  text-align: center;
}

.venue {
  margin: 0 0 1.1rem;
  font-size: .8rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.subtitle {
  margin: .55rem 0 1.8rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--fg-muted);
  font-weight: 400;
}

.authors { margin: 0 0 .3rem; font-size: 1.08rem; }
.affil   { margin: 0 0 1.9rem; font-size: .93rem; color: var(--fg-muted); }

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

.btn {
  display: inline-block;
  padding: .5rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-size: .93rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-sf); }
.btn-sm { padding: .35rem .8rem; font-size: .87rem; }
.btn-disabled { opacity: .55; cursor: default; }
.btn-disabled:hover { border-color: var(--line); background: var(--bg); }
.soon {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-muted);
  margin-left: .2rem;
}

/* ── TL;DR + stat strip ─────────────────────────────────────────────── */

.tldr { margin: 3.2rem 0 2.2rem; }
.tldr p { font-size: 1.1rem; max-width: 74ch; margin: 0 auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 3rem;
}
.stat { background: var(--bg); padding: 1.1rem 1rem; text-align: center; }
.stat b { display: block; font-size: 1.22rem; letter-spacing: -.01em; }
.stat span { display: block; font-size: .82rem; color: var(--fg-muted); line-height: 1.4; margin-top: .2rem; }

/* ── Figures ────────────────────────────────────────────────────────── */

.fig { margin: 0; }
.fig img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.fig figcaption,
.tbl caption {
  font-size: .87rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-top: .7rem;
  text-align: left;
}
.fig-wide { margin: 2rem 0; }

.split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* ── Video comparison ───────────────────────────────────────────────── */

.ref { color: var(--crm); font-weight: 600; }
.act { color: #e8483a; font-weight: 600; }

/* The nine-clip matrix earns more width than the prose column. */
.wide {
  width: min(1440px, calc(100vw - 44px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.vrow { margin-bottom: 2.2rem; }
.vrow-head {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.vrow-head h3 { margin: 0; font-size: 1.12rem; }
.vrow-head p  { margin: 0; font-size: .88rem; color: var(--fg-muted); flex: 1 1 20rem; }

.ood {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 5px;
  background: var(--accent-sf);
  color: var(--accent);
  border: 1px solid currentColor;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  vertical-align: 2px;
}

.vrow-clips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.vcard { margin: 0; }
.vcard video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
}
.vcard figcaption { margin-top: .55rem; font-size: .87rem; }

.chip {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 5px;
  font-size: .78rem;
  font-weight: 600;
  color: #fff;
  vertical-align: 1px;
}
.c-gen { background: var(--gen); }
.c-rig { background: var(--rig); }
.c-crm { background: var(--crm); }

.vname   { color: var(--fg-muted); margin-left: .35rem; }
.vmetric { display: block; color: var(--fg-muted); font-size: .84rem; margin-top: .15rem; }
.vmetric b { color: var(--fg); }

.replay { flex: 0 0 auto; }

/* ── Tables ─────────────────────────────────────────────────────────── */

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.tbl caption { caption-side: bottom; margin-top: .8rem; }
.tbl th, .tbl td { padding: .42rem .6rem; text-align: right; }
.tbl th:first-child, .tbl td:first-child,
.tbl th:nth-child(2), .tbl td:nth-child(2) { text-align: left; }
.tbl thead th {
  border-bottom: 1.5px solid var(--fg);
  font-weight: 600;
  font-size: .84rem;
}
.tbl tbody tr:last-child td { border-bottom: 1.5px solid var(--fg); }
.tbl .sep td { border-top: 1px solid var(--line); }
.tbl .best td:nth-child(3), .tbl .best td:nth-child(4) { font-weight: 700; color: var(--accent); }
.tbl .rom td { color: var(--accent); font-weight: 600; }
.tbl-full td:first-child { width: 50%; }

.foot { font-size: .82rem; color: var(--fg-muted); max-width: 78ch; }

/* Two throughput tables side by side, each with its own short caption. */
.split-tables { grid-template-columns: 1fr 1fr; gap: 2.4rem; align-items: start; }
.split-tables .tbl { font-size: .84rem; }
.split-tables .tbl th, .split-tables .tbl td { padding: .38rem .45rem; }
/* Configuration reads left, every measured column reads right (as in the paper). */
.split-tables .tbl th:nth-child(2), .split-tables .tbl td:nth-child(2) { text-align: right; }
.tcap { font-size: .82rem; color: var(--fg-muted); line-height: 1.5; margin: .8rem 0 0; }

/* ── Data release ───────────────────────────────────────────────────── */

/* Snippet on the left, the link and its note on the right. */
.split-data { grid-template-columns: 1fr 1fr; gap: 2rem; }
.split-data pre { margin: 0; }
.datalinks .foot { margin: 1rem 0 0; }

/* ── Callout, cards, result list ────────────────────────────────────── */

.callout {
  margin-top: 2.2rem;
  padding: 1.2rem 1.4rem;
  background: var(--accent-sf);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p { margin: 0; font-size: .96rem; }
.callout p + p { margin-top: .9rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.card p { margin: 0; font-size: .92rem; color: var(--fg-muted); }

.resultlist {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .8rem;
  margin-top: 2rem;
}
.res {
  padding: .9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.res b { display: block; font-size: 1.35rem; letter-spacing: -.01em; }
.res span { font-size: .87rem; color: var(--fg-muted); }

/* ── BibTeX + footer ────────────────────────────────────────────────── */

pre {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: .85rem;
  line-height: 1.5;
}

footer {
  border-top: 1px solid var(--line);
  padding: 1.8rem 0 2.4rem;
  margin-top: 4rem;
  font-size: .87rem;
  color: var(--fg-muted);
  text-align: center;
}
footer p { margin: 0; }

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .resultlist { grid-template-columns: repeat(2, 1fr); }
  .split-tables { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 900px) {
  .split, .cards { grid-template-columns: 1fr; }
  .vrow-clips { grid-template-columns: 1fr; }
  .wide { width: auto; margin-left: 0; transform: none; }

  /* Multi-panel figures are unreadable when squeezed; let them scroll instead. */
  .fig-wide { overflow-x: auto; }
  .fig-wide img { min-width: 680px; }
  .fig-wide figcaption { min-width: 0; position: sticky; left: 0; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .vcard video { max-width: 100%; }
  section { margin: 3.2rem 0; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .stats { grid-template-columns: 1fr; }
  .hero { padding: 2.8rem 0 2.2rem; }
}
