/* ── MVHOI project page ─────────────────────────────────────────────
   Palette: paper white / ink / research blue accent
   Type:    Space Grotesk (display) · Inter (body) · JetBrains Mono (code)
──────────────────────────────────────────────────────────────────── */

:root {
  --paper: #fdfdfc;
  --paper-alt: #f3f5f9;
  --ink: #16181d;
  --ink-soft: #4b5262;
  --accent: #1d4ed8;
  --accent-deep: #16389b;
  --line: #dde1e9;
  --tag-bg: rgba(22, 24, 29, 0.72);
  --radius: 14px;
  --display: "Space Grotesk", "Helvetica Neue", sans-serif;
  --body: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }
.container.wide { max-width: 1240px; }

section { padding: 72px 0; }
section.alt { background: var(--paper-alt); }

h2 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 auto 40px;
}

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

.variant-note {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa1b0;
}

/* ── Hero ── */

.hero { padding: 72px 0 40px; text-align: center; }

.title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4.2vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  max-width: 980px;
  margin: 0 auto 28px;
}

.title .brand { color: var(--accent); }

.authors {
  max-width: 860px;
  margin: 0 auto 10px;
  font-size: 1.02rem;
}

.authors span { white-space: nowrap; margin: 0 7px; }

.authors a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.authors a:hover { color: var(--accent); border-color: var(--accent); }

.authors sup, .affiliations sup { color: var(--ink-soft); }

.affiliations { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 6px; }
.affiliations span { white-space: nowrap; margin: 0 9px; }

.equal-note { color: #9aa1b0; font-size: 0.85rem; margin-bottom: 30px; }

.links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  padding: 10px 22px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-deep); transform: translateY(-1px); }

.btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Teaser ── */

.teaser { padding: 28px 0 64px; }

.teaser-stage { display: flex; justify-content: center; }

.teaser-stage video {
  width: min(760px, 92vw);
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -24px rgba(22, 24, 29, 0.45);
  background: #000;
}

.caption {
  max-width: 860px;
  margin: 26px auto 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ── Abstract ── */

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

/* ── Comparison stage: reference strip + slider ── */

.cmp-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.cmp-stage .cmp-slider { flex: 0 1 360px; }

.ref-strip {
  position: relative;
  flex: 0 0 92px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 60px -24px rgba(22, 24, 29, 0.35);
}

.ref-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 4;
  object-fit: cover;
}

.ref-strip figcaption {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
}

.cmp-slider {
  user-select: none;
  -webkit-user-select: none;
}

.cmp-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px -24px rgba(22, 24, 29, 0.45);
  touch-action: none;
  cursor: ew-resize;
}

.cmp-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.cmp-over-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.cmp-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 0;
  outline: none;
}

.cmp-handle::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -1.5px;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}

.cmp-handle:focus-visible::before { background: var(--accent); }

.cmp-grip {
  position: absolute;
  top: 50%; left: 0;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}

.cmp-grip svg {
  width: 22px; height: 22px;
  fill: none; stroke: var(--ink);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.cmp-tag {
  position: absolute;
  top: 14px;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--tag-bg);
  backdrop-filter: blur(4px);
  padding: 5px 12px;
  border-radius: 999px;
  pointer-events: none;
}

.cmp-tag-left { left: 14px; }
.cmp-tag-right { right: 14px; }

.cmp-tag-left { background: rgba(29, 78, 216, 0.85); }

/* ── Case chips ── */

.case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}

.chip {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip .chip-dur { font-size: 0.75rem; opacity: 0.7; margin-left: 4px; }

/* ── Baseline tabs (variant B) ── */

.baseline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.baseline-tabs .chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Demo gallery ── */

.demo-grid {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 820px;
  margin: 0 auto;
}

.demo-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.demo-row .demo-card.source { padding-right: 16px; border-right: 1px solid var(--line); }

.demo-card { position: relative; }

.demo-card.source .demo-label { color: #9aa1b0; font-style: italic; }

.demo-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
  display: block;
}

.demo-card .ref-chip {
  position: absolute;
  right: 10px; top: 10px;
  width: 64px; height: 64px;
  border-radius: 10px;
  border: 2px solid #fff;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.demo-card .demo-label {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ── BibTeX ── */

.bib-box {
  position: relative;
  background: #101319;
  border-radius: var(--radius);
  overflow: hidden;
}

.bib-box pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #d5dbe8;
  padding: 26px 28px;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  font-family: var(--display);
  font-size: 0.8rem;
  color: #d5dbe8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy-btn:hover { background: rgba(255, 255, 255, 0.16); }

/* ── Footer ── */

footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: #9aa1b0;
  font-size: 0.85rem;
  text-align: center;
}

footer .credit { margin-top: 6px; }

footer a { color: var(--ink-soft); }
footer a:hover { color: var(--accent); }

/* ── Vs styling ── */

.vs {
  color: #9aa1b0;
  font-weight: 400;
  font-style: italic;
  font-size: 0.7em;
  margin: 0 4px;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .caption br { display: none; }
}

@media (max-width: 640px) {
  section { padding: 52px 0; }
  .hero { padding: 48px 0 28px; }
  .authors { font-size: 0.92rem; }
  .demo-row { grid-template-columns: repeat(2, 1fr); }
  .demo-row .demo-card.source { padding-right: 0; border-right: none; }
  .demo-card .ref-chip { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
