/* Tev project page. Red theme shared with main_red.pdf and the poster. */
:root {
  color-scheme: light;
  --crimson: #c8102e;
  --oxblood: #991b1b;
  --red-light: #fee2e2;
  --red-card: #fef2f2;
  --red-line: #fecaca;
  --green-light: #d4f2d7;
  --green-ink: #1e6b35;
  --ink: #2a2020;
  --ink-2: #4a3d3d;
  --gray: #6b5b5b;
  --line: #eadede;
  --bg: #ffffff;
  --bg-soft: #faf7f7;
  --ucla: #2774ae;
  --radius: 12px;
  --maxw: 1080px;
  --sans: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--oxblood); text-decoration-color: rgba(153, 27, 27, .35); text-underline-offset: 2px; }
a:hover { color: var(--crimson); text-decoration-color: currentColor; }
b, strong { font-weight: 700; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.sc { font-variant: small-caps; letter-spacing: .02em; }
.katex { font-size: 1.08em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }

/* ---------- top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.nav .brand { font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; }
.nav .brand .dot { color: var(--crimson); }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav li a {
  display: block; padding: 6px 12px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--gray); text-decoration: none; white-space: nowrap;
}
.nav li a:hover { color: var(--ink); background: var(--bg-soft); }
.nav li a.active { color: var(--crimson); background: var(--red-card); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 56px 0 28px; }
.hero h1 {
  margin: 0 auto; max-width: 940px;
  font-size: clamp(30px, 4.6vw, 50px); line-height: 1.12; font-weight: 700; letter-spacing: -.01em;
  text-wrap: balance;
}
.hero h1 .name { color: var(--crimson); }
.authors { margin: 26px auto 0; max-width: 820px; font-size: 20px; line-height: 1.8; }
.authors a { color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.authors a:hover { color: var(--crimson); }
.authors sup, .affils sup { color: var(--crimson); font-weight: 700; font-size: .68em; margin-left: 1px; }
.authors .sep { display: inline-block; width: 18px; }
.affils {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 36px;
  margin-top: 16px; color: var(--ink-2); font-size: 18px;
}
.affil { display: inline-flex; align-items: center; gap: 10px; }
.affil img { height: 24px; width: auto; }
.affil img.ucla { height: 20px; }

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 16px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--ink); transition: background .15s, transform .15s;
}
.btn:hover { background: var(--crimson); border-color: var(--crimson); color: #fff; transform: translateY(-1px); }
.btn svg, .btn img { width: 18px; height: 18px; flex: none; }
.btn.soon { background: #fff; color: var(--gray); border-color: var(--line); cursor: default; }
.btn.soon:hover { transform: none; background: #fff; border-color: var(--line); color: var(--gray); }
.btn.soon img { filter: grayscale(1); opacity: .6; }
.btn svg.x-logo { width: 15px; height: 15px; }
.btn .tag {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 999px; background: var(--bg-soft); color: var(--gray); border: 1px solid var(--line);
}

/* ---------- figures ---------- */
figure { margin: 0; }
.figure { margin: 28px 0 0; }
.figure .frame { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.figure .frame img { width: 100%; height: auto; }
.figure a.frame { cursor: zoom-in; }
.figure figcaption { margin: 12px auto 0; max-width: 900px; font-size: 15.5px; line-height: 1.55; color: var(--gray); }
.figure figcaption b:first-child { color: var(--ink); }
.figure.pad .frame { padding: 18px 20px; }
.figure.ranking { margin-bottom: 34px; }

/* videos: 16:9 boxes reserved before the poster loads */
.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: inherit; }
.video.launch { margin-top: 8px; }
.video.launch .frame { background: #0b0909; border-color: #0b0909; }
.video.launch + .figure { margin-top: 36px; }

/* ---------- sections ---------- */
section { padding: 60px 0 8px; }
.eyebrow {
  display: block; text-align: center; margin-bottom: 6px;
  color: var(--crimson); font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
h2 { margin: 0 0 22px; text-align: center; font-size: clamp(26px, 3.2vw, 34px); line-height: 1.2; font-weight: 700; text-wrap: balance; }
h3 { margin: 34px 0 10px; font-size: 22px; line-height: 1.3; font-weight: 700; }
h3 .num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 50%;
  background: var(--crimson); color: #fff; font-size: 16px; vertical-align: 2px;
}
p { margin: 0 0 14px; }
.lede { font-size: 19.5px; color: var(--ink-2); }
.muted { color: var(--gray); }

.tldr {
  margin: 36px auto 0; max-width: 900px; padding: 18px 24px; border-radius: var(--radius);
  background: var(--red-card); border: 1px solid var(--red-line); font-size: 19px; line-height: 1.6;
}
.tldr b.label { color: var(--crimson); margin-right: 6px; }

.abstract { text-align: justify; hyphens: auto; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.stat {
  padding: 18px 18px 16px; border-radius: var(--radius); background: var(--red-light);
  display: flex; flex-direction: column; gap: 4px;
}
.stat .big { font-size: 38px; line-height: 1.05; font-weight: 700; color: var(--crimson); font-variant-numeric: tabular-nums; }
.stat .big small { font-size: 20px; font-weight: 700; }
.stat .what { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.stat .ctx { font-size: 14.5px; color: var(--ink-2); line-height: 1.4; }

/* two-up challenge cards */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
.card { padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card.soft { background: var(--bg-soft); border-color: transparent; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.chips li {
  padding: 4px 12px; border-radius: 999px; background: var(--red-card); border: 1px solid var(--red-line);
  font-size: 15px; font-weight: 600; color: var(--oxblood);
}

/* pipeline stages */
.stages { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.stages li { position: relative; padding: 2px 0 2px 46px; font-size: 16.5px; line-height: 1.55; }
.stages li::before {
  content: attr(data-n);
  position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
}
.stages li b { display: block; font-size: 17.5px; }

.eqbox {
  margin: 26px auto 0; max-width: 860px; padding: 16px 22px; border-radius: var(--radius);
  background: var(--bg-soft); border-left: 4px solid var(--crimson); font-size: 17px;
}
.eqbox .katex-display { margin: .5em 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

.props { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.prop { padding: 16px 18px; border-radius: var(--radius); background: var(--red-card); }
.prop b { display: block; color: var(--oxblood); font-size: 17px; margin-bottom: 2px; }
.prop > span { font-size: 15.5px; color: var(--ink-2); line-height: 1.45; display: block; }

/* starvation widget */
.starve { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: center; margin-top: 18px; }
.starve .controls label { display: flex; justify-content: space-between; font-size: 15.5px; font-weight: 600; margin-top: 12px; }
.starve .controls label .val { font-family: var(--mono); color: var(--crimson); font-weight: 600; }
.starve input[type=range] { width: 100%; accent-color: var(--crimson); }
.starve .readout { font-size: 15.5px; color: var(--ink-2); margin-top: 12px; line-height: 1.5; }
.starve .readout .pct { font-size: 40px; font-weight: 700; color: var(--crimson); line-height: 1; display: block; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; }
.dots i { aspect-ratio: 1; border-radius: 3px; background: var(--crimson); transition: background .2s; }
.dots i.waste { background: #ddd3d3; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--gray); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--crimson); }
.legend i.waste { background: #ddd3d3; }

/* ---------- tables ---------- */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 16px; }
.tabs button {
  font: 600 15.5px var(--sans); padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--gray);
}
.tabs button:hover { color: var(--ink); border-color: #d9caca; }
.tabs button[aria-selected=true] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.panel[hidden] { display: none; }
.panel > p { max-width: 900px; margin-left: auto; margin-right: auto; }

.tbl.wide { position: relative; left: 50%; transform: translateX(-50%); width: max(100%, min(1240px, calc(100vw - 48px))); }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.35; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 9px; text-align: center; white-space: nowrap; }
thead th { font-weight: 700; color: var(--ink); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
thead tr.top th { border-bottom: 0; padding-bottom: 2px; }
thead tr.top th.grp { border-bottom: 2px solid var(--red-line); }
thead tr.sub th { font-weight: 600; color: var(--gray); font-size: 13.5px; }
tbody th { text-align: left; font-weight: 600; padding-left: 14px; }
tbody td:first-of-type.l, td.l { text-align: left; }
tbody tr { border-bottom: 1px solid #f4eeee; }
tbody tr:last-child { border-bottom: 0; }
tbody tr.sep { border-top: 1px solid #d9caca; }
tbody tr.group td {
  text-align: center; font-size: 13.5px; color: var(--gray); background: #fff;
  padding: 9px; border-top: 1px solid #d9caca; letter-spacing: .02em;
}
tbody tr.ours { background: var(--red-light); }
tbody tr.ours th { color: var(--oxblood); }
tbody tr.delta th, tbody tr.delta td { font-size: 13.5px; color: var(--gray); }
tbody tr.delta th { color: var(--crimson); font-weight: 700; }
.up { color: var(--crimson); font-weight: 700; }
.down { color: var(--gray); }
.yes { color: #1f8a3c; font-weight: 700; }
.no { color: #b8a9a9; }
table .vr { border-left: 1px solid var(--line); }
.tbl-cap { margin: 10px auto 0; max-width: 900px; font-size: 15px; color: var(--gray); line-height: 1.5; text-align: center; }
.sticky-col tbody th { position: sticky; left: 0; z-index: 1; background: inherit; }
.sticky-col thead tr:first-child > th:first-child { position: sticky; left: 0; z-index: 2; background: var(--bg-soft); }
.sticky-col tbody tr { background: #fff; }
.sticky-col tbody tr.ours { background: var(--red-light); }
.sticky-col tbody tr.group td { position: static; }

/* ---------- qualitative ---------- */
.qual { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.qcol { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; background: #fff; font-size: 14.5px; line-height: 1.45; }
.qcol.ours { border-color: var(--red-line); background: var(--red-card); }
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.qhead b { font-size: 16px; }
.qhead .score { font-family: var(--mono); font-size: 14px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }
.qhead .score.hi { background: var(--green-light); color: var(--green-ink); }
.qhead .score.lo { background: var(--red-light); color: var(--oxblood); }
.qstep { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 6px; margin: 0 0 7px; }
.qstep .t { white-space: nowrap; font-family: var(--mono); font-size: 12px; color: #a39595; padding-top: 2px; }
.qstep.good, .qstep.bad { border-radius: 6px; padding: 6px 7px 6px 0; }
.qstep.good { background: var(--green-light); }
.qstep.bad { background: #f9d4da; }
.qstep.good .t, .qstep.bad .t { padding-left: 7px; color: var(--gray); }
.qstep code { font-size: 12.5px; word-break: break-word; }
.qkey { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 12px; font-size: 14.5px; color: var(--gray); }
.qkey i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 20px 22px; overflow-x: auto; border-radius: var(--radius);
  background: #231b1b; color: #f6eaea; font: 14px/1.6 var(--mono);
}
.copy {
  position: absolute; top: 10px; right: 10px; font: 600 13.5px var(--sans); padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
}
.copy:hover { background: var(--crimson); border-color: var(--crimson); }

footer { margin-top: 72px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--gray); font-size: 15px; text-align: center; }
footer a { color: var(--gray); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .stats, .qual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  .nav .brand { display: none; }
  .nav ul { margin-left: 0; }
  .hero { padding-top: 36px; }
  .authors { font-size: 18px; }
  .grid2, .stages, .props, .starve { grid-template-columns: minmax(0, 1fr); }
  .abstract { text-align: left; }
  section { padding-top: 48px; }
  .figure.pad .frame { padding: 10px; }
  .card { padding: 18px 16px; }
  .katex-display > .katex { font-size: 1.05em; }
  .qual { grid-template-columns: minmax(0, 1fr); }
  tbody tr.group td { text-align: left; padding-left: 14px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat .big { font-size: 34px; }
  .dots { grid-template-columns: repeat(10, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
