/* Shared style for project pages */

:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --text: #1f2328;
  --muted: #59636e;
  --border: #e3e6ea;
  --accent: #1772d0;
  --accent-hover: #f09228;
  --ours-bg: #eaf3fc;
  --figure-bg: #ffffff;
  --code-bg: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1e2126;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --border: #2f343a;
    --accent: #5aa7f0;
    --accent-hover: #f5a84d;
    --ours-bg: #1b3149;
    --figure-bg: #ffffff;
    --code-bg: #1e2126;
  }
}

:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1e2126;
  --text: #e6e8eb;
  --muted: #9aa3ad;
  --border: #2f343a;
  --accent: #5aa7f0;
  --accent-hover: #f5a84d;
  --ours-bg: #1b3149;
  --figure-bg: #ffffff;
  --code-bg: #1e2126;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

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

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 72px;
}

/* ---------- Header ---------- */

.hero {
  text-align: center;
  padding: 56px 0 8px;
}

.hero h1 {
  font-size: 34px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 14px;
}

.venue {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--ours-bg);
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 18px;
}

.authors {
  list-style: none;
  padding: 0;
  margin: 0 0 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 28px;
  font-size: 18px;
}

.authors .affil {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

.affiliation {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  margin: 2px 0 0;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 8px;
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 15px;
  transition: opacity 0.15s ease;
}

.links a:hover, .links a:focus { opacity: 0.82; color: var(--bg); }

.links svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ---------- Sections ---------- */

section { margin-top: 44px; }

section h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

section h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 10px;
}

p { margin: 0 0 14px; text-align: justify; hyphens: auto; }

/* ---------- Figures ---------- */

figure {
  margin: 20px auto 24px;
  text-align: center;
}

figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--figure-bg);
}

/* white pad behind figures so they read well in dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) figure img { padding: 8px; }
}
:root[data-theme="dark"] figure img { padding: 8px; }

figcaption {
  margin: 10px auto 0;
  max-width: 760px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

.teaser { margin-top: 32px; }
.teaser figcaption { text-align: justify; }

.w-sm { width: 450px; }
.w-md { width: 600px; }
.w-lg { width: 750px; }
.w-full { width: 100%; }

/* ---------- Video ---------- */

.video {
  position: relative;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; margin: 8px 0 6px; }

table.results {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

table.results th, table.results td {
  padding: 6px 14px;
  text-align: center;
  white-space: nowrap;
}

table.results th:first-child, table.results td:first-child { text-align: left; }

table.results thead th {
  font-weight: 700;
  border-bottom: 1.5px solid var(--text);
}

table.results thead tr:first-child th { border-top: 1.5px solid var(--text); }
table.results thead tr.group th { border-bottom: 1px solid var(--border); }
table.results thead tr.group th.rowspan { vertical-align: bottom; border-bottom: 1.5px solid var(--text); }

table.results tbody tr { border-bottom: 1px solid var(--border); }
table.results tbody tr:last-child { border-bottom: 1.5px solid var(--text); }
table.results tbody tr.sep { border-top: 1.5px solid var(--muted); }
table.results tr.ours td { background: var(--ours-bg); }

.table-note {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- Animation grid (Div3DAfford) ---------- */

.anim-title { text-align: center; margin-top: 32px; }

.anim-grid {
  display: grid;
  grid-template-columns: 130px repeat(3, 1fr);
  align-items: center;
  border-top: 1.5px solid var(--text);
  border-bottom: 1.5px solid var(--text);
  background: var(--figure-bg);
  color: #1f2328;
  border-radius: 6px;
}

.anim-col {
  text-align: center;
  font-weight: 700;
  padding: 6px 0;
  border-bottom: 1px solid #e3e6ea;
}

.anim-method {
  font-weight: 700;
  font-size: 14px;
  color: #59636e;
  padding-left: 10px;
}

.anim-method.ours { color: #1772d0; }

/* Each GIF is 1944x640 (3 methods side by side). Show one 648px-wide third
   and trim 90px of empty space from the top and bottom (visible: 648x460). */
.anim-cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 648 / 460;
}

.anim-cell img {
  position: absolute;
  top: -19.565%;
  height: 139.13%;
  width: 300%;
  max-width: none;
}

.anim-cell img.c0 { left: 0; }
.anim-cell img.c1 { left: -100%; }
.anim-cell img.c2 { left: -200%; }

@media (max-width: 600px) {
  .anim-grid { grid-template-columns: repeat(3, 1fr); }
  .anim-grid > .anim-spacer { display: none; }
  .anim-method { grid-column: 1 / -1; padding: 6px 10px 0; }
}

/* ---------- Citation ---------- */

.bibtex {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.bibtex pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font: inherit;
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}

.copy-btn:hover { color: var(--text); }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 26px; }
  .authors { font-size: 16px; gap: 4px 18px; }
  section h2 { font-size: 21px; }
  p { text-align: left; }
  .teaser figcaption { text-align: left; }
  table.results { font-size: 13px; }
  table.results th, table.results td { padding: 5px 8px; }
}
