:root {
  --bg: #ffffff;
  --bg-soft: #f5f8fc;
  --ink: #1f2933;
  --ink-soft: #52606d;
  --line: #e1e7ef;
  --accent: #3d8bd8;
  --accent-ink: #1f5f9e;
  --accent-soft: #e6f0fa;
  --maxw: 1100px;
  --narrow: 820px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: var(--narrow); margin-left: auto; margin-right: auto; }
section { padding: 36px 16px; }
section.wrap { padding-left: 16px; padding-right: 16px; }

h2 {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -0.01em;
  text-align: center; margin: 0 0 22px;
}
h3 { font-size: 1.3rem; font-weight: 700; margin: 44px 0 6px; }
h4 { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { color: var(--ink-soft); margin-bottom: 18px; }
.note { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 20px; text-align: center; }
.title-row {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin: 0 0 22px;
}
.title-row .logo { width: clamp(72px, 9vw, 112px); height: auto; flex: none; }
.title-row .title { margin: 0; text-align: left; }
.title {
  font-size: clamp(1.75rem, 4.4vw, 2.9rem);
  line-height: 1.2; font-weight: 800; letter-spacing: -0.02em;
  margin: 0 0 22px; color: #4a4f57;
}
.title .acc { color: var(--accent); }
.venue {
  display: inline-block; margin: -6px 0 20px; padding: 4px 16px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; letter-spacing: .02em;
}
.authors { font-size: 1.12rem; margin: 0 0 4px; }
.authors a { font-weight: 600; margin: 0 10px; white-space: nowrap; }
.authors sup, .affils sup { font-size: 0.7em; margin-right: 1px; }
.authors a + sup { margin-left: -9px; margin-right: 6px; }
.affils { color: var(--ink-soft); margin-bottom: 24px; }
.affils span { margin: 0 10px; white-space: nowrap; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: #2b2f36; color: #fff; font-weight: 600; font-size: 0.95rem;
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--accent-ink); text-decoration: none; transform: translateY(-1px); }
.btn small { font-weight: 400; opacity: .75; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- TL;DR + teaser ---------- */
.tldr {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: 12px 18px; border-radius: 6px; margin: 0 auto 28px; max-width: var(--narrow);
  font-size: 1.08rem; text-align: center;
}
.tldr strong { color: var(--accent-ink); margin-right: 6px; }

.teaser-demo {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 0 auto 30px;
}
.teaser-demo .inputs img { width: 120px; }
.teaser-demo .arrow { font-size: 2rem; color: var(--ink-soft); }
.teaser-demo .video-box { margin: 0; max-width: 520px; flex: 1 1 auto; }
.teaser-demo .video-box video { width: 100%; }
.teaser-demo .video-box figcaption { text-align: center; }

.inputs { display: flex; gap: 6px; }
.inputs.col { flex-direction: column; }
.inputs img { border-radius: 4px; aspect-ratio: 1; object-fit: cover; }
.inputs .lbl { font-size: 0.8rem; color: var(--ink-soft); text-align: center; }

.fig { margin: 26px 0; }
.fig img { margin: 0 auto; border-radius: 4px; }
figcaption { font-size: 0.93rem; color: var(--ink-soft); margin-top: 10px; line-height: 1.55; }
.fig figcaption { max-width: var(--narrow); margin-left: auto; margin-right: auto; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 12px;
}
.stat {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; text-align: center;
}
.stat .num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--accent-ink); line-height: 1.2; }
.stat .cap { display: block; font-size: 0.88rem; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }

#abstract p { text-align: justify; hyphens: auto; }

/* ---------- method ---------- */
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.two-figs { display: grid; grid-template-columns: 1fr; gap: 0; }

/* ---------- demos ---------- */
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.demo {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff;
}
.demo .inputs { flex: 0 0 auto; }
.demo .inputs.col img { width: 88px; }
.demo video { flex: 1 1 0; min-width: 0; width: 100%; height: 280px; object-fit: contain; }
.demo-grid.mv video { height: 300px; flex: none; }
.demo-grid.mv .demo { flex-direction: column; align-items: stretch; }
.inputs.row4 { display: grid; grid-template-columns: repeat(4, 1fr); }

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib pre {
  background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem;
  overflow-x: auto; margin: 0; line-height: 1.55;
}
.copy {
  position: absolute; top: 10px; right: 10px;
  background: #fff; color: var(--accent-ink); border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 12px; font: 600 0.8rem "Inter", sans-serif; cursor: pointer;
}
.copy:hover { background: var(--accent-soft); }


footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 20px 16px 32px; text-align: center; color: var(--ink-soft); font-size: 0.9rem; }
footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .demo-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .title br { display: none; }
  .title-row { flex-direction: column; gap: 14px; }
  .title-row .title { text-align: center; }
  .teaser-demo { flex-direction: column; }
  .teaser-demo .inputs.col { flex-direction: row; }
  .teaser-demo .inputs .lbl { display: none; }
  .teaser-demo .arrow { transform: rotate(90deg); font-size: 1.5rem; }
  .teaser-demo .inputs img { width: 110px; }
  .demo .inputs.col img { width: 64px; }
  .demo video, .demo-grid.mv video { height: 220px; }
  .stat .num { font-size: 1.5rem; }
  #abstract p { text-align: left; }
}
