/* Project page styles. Plain CSS, no build step, no external resources. */
:root {
  --ink: #1b1d21;
  --muted: #5f6570;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --rule: #e4e5e8;
  --accent: #0f766e;
  --accent-soft: #e6f4f2;
  --serif: Charter, "Bitstream Charter", "Source Serif Pro", "Iowan Old Style", Cambria, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --col: 860px;
  --wide: 1200px;
  --toc: 200px;
  --bar: 54px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
figure img { width: 100%; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--bar);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: var(--wide); height: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--sans); font-size: 14px;
}
.topbar-title { font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; }

/* Buttons (announced, not linked) */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  border: 1px solid var(--rule); background: var(--bg-soft); color: var(--muted);
  cursor: default; user-select: none; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; }

/* Layout: table of contents + main column */
.layout {
  max-width: var(--wide); margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: var(--toc) minmax(0, 1fr); column-gap: 40px;
}
.toc {
  position: sticky; top: var(--bar); align-self: start;
  padding: 48px 0 24px; font-family: var(--sans); font-size: 13.5px;
}
.toc-label {
  margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; padding: 4px 10px; color: var(--muted); text-decoration: none;
  border-left: 2px solid transparent; line-height: 1.4;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.toc ul ul a { padding-left: 22px; font-size: 12.5px; }

main { width: 100%; max-width: var(--col); justify-self: center; padding: 40px 0 80px; min-width: 0; }

/* Hero */
.hero { text-align: center; padding: 16px 0 8px; }
.hero h1 {
  font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.25;
  letter-spacing: -0.01em; margin: 0 0 18px;
}
.hero .authors { font-family: var(--sans); font-size: 17px; margin: 0 0 4px; }
.hero .venue { font-family: var(--sans); font-size: 15px; color: var(--muted); margin: 0 0 22px; }
.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

figure { margin: 0; }
.teaser { margin: 36px 0 0; }
.teaser img { width: 100%; height: auto; border-radius: 6px; }

/* Sections */
section { margin: 72px 0; }
h2 {
  font-family: var(--sans); font-weight: 600; font-size: 24px; letter-spacing: -0.01em;
  margin: 0 0 22px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
h3 { font-family: var(--sans); font-weight: 600; font-size: 19px; margin: 56px 0 12px; }
h2 + h3 { margin-top: 0; }
p { margin: 0 0 14px; }
.abstract p { text-align: justify; hyphens: auto; }

.tldr {
  margin: 0; padding: 18px 22px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: 18px;
}

/* Result figures */
.fig { margin: 18px 0 8px; }
.fig img { width: 100%; height: auto; }
.fig-grid { display: grid; gap: 18px; align-items: start; }
.fig-grid.two { grid-template-columns: 1fr 1fr; }
.fig-grid.four { grid-template-columns: repeat(4, 1fr); }
.fig-grid.toy { grid-template-columns: 0.33fr 1fr; align-items: center; }
.fig-grid.side { grid-template-columns: 1fr 1fr; align-items: center; gap: 28px; }
.panel-group { display: grid; gap: 10px; }
.panel-group .legend { max-width: 80%; margin: 0 auto; }
.panel-title { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; margin: 0; }
figcaption, .caption {
  font-family: var(--sans); font-size: 14.5px; line-height: 1.55; color: var(--muted); margin-top: 14px;
}
figcaption strong { color: var(--ink); }
.quote {
  margin: 18px 0 0; padding: 12px 18px; border-left: 3px solid var(--rule);
  font-style: italic; color: var(--ink);
}

/* Tables */
.table-wrap { overflow-x: auto; }
table {
  border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule); }
thead th { border-bottom: 2px solid var(--ink); font-weight: 600; }
tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
td.num, th.num { text-align: right; }
.table-caption { font-family: var(--sans); font-size: 13.5px; color: var(--muted); margin: 0 0 8px; }

/* Videos */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.video-card video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; background: var(--bg-soft); }
.video-card .label { font-family: var(--sans); font-size: 14px; font-weight: 600; margin: 8px 0 0; text-align: center; }
.video-card .sublabel { font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 2px 0 0; text-align: center; }

/* BibTeX */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 18px 20px; background: var(--bg-soft); border: 1px solid var(--rule);
  border-radius: 6px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.55;
}
.copy-btn {
  position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--rule); background: var(--bg); color: var(--muted);
  font-family: var(--sans); font-size: 12.5px; cursor: pointer;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

footer {
  border-top: 1px solid var(--rule); padding: 24px 16px 40px; text-align: center;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}

/* Responsive */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 26px; }
  .topbar-actions { display: none; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; }
  section { margin: 56px 0; }
  .fig-grid.four { grid-template-columns: 1fr 1fr; }
  .fig-grid.side, .fig-grid.toy { grid-template-columns: 1fr; }
  .fig-grid.toy figure:first-child { max-width: 220px; margin: 0 auto; }
  .video-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .abstract p { text-align: left; }
}

/* Grid children must be allowed to shrink below their images' intrinsic width. */
.fig-grid > *, .panel-group > *, .video-grid > * { min-width: 0; }
@media (max-width: 720px) {
  .fig-grid.stack-mobile { grid-template-columns: 1fr; gap: 32px; }
}
