/* ─────────────────────────────────────────────
   MLP Splatting — project page
   Mobile-first, light/dark via prefers-color-scheme
   ───────────────────────────────────────────── */

:root {
  --bg: #fefefc;
  --fg: #2a241f;
  --fg-muted: #7a6e62;
  --border: #d9cfb6;
  --surface: #f5eedb;
  --accent: #8a6a3d;
  --accent-fg: #fefefc;
  --code-bg: #efe6cd;

  --font-sans:    "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Google Sans", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --container: 920px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 2px;
}
a:hover { text-decoration: underline; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
@media (min-width: 720px) {
  .page { padding: 3rem 2rem 5rem; }
}

/* ───── Hero / header ───── */
.hero {
  text-align: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.title {
  font-family: var(--font-display);
  font-weight: 700;
  margin: .25rem 0 1.5rem;
  line-height: 1.15;
}
.title-main {
  display: block;
  font-size: clamp(2.2rem, 6.5vw, 3.5rem);
  letter-spacing: -.01em;
}
.title-sub {
  display: block;
  margin-top: .45rem;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--fg-muted);
  font-weight: 500;
}

.authors,
.affiliations {
  font-family: var(--font-display);
  list-style: none;
  padding: 0;
  margin: .5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.1rem;
  font-size: 1.05rem;
}
.authors li,
.authors li a {
  color: var(--fg);
  font-weight: 500;
}
.authors li a:hover { color: var(--accent); text-decoration: underline; }
.authors sup,
.affiliations sup { font-size: .7em; }

.affiliations {
  font-size: .95rem;
  color: var(--fg-muted);
  margin-top: .4rem;
  margin-bottom: 0;
}

.equal-contrib {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.65;     /* match body paragraph line-height */
}

.venue {
  margin: 1.25rem 0 0;
  font-family: var(--font-sans);   /* Noto Sans — same as vMAP's .publication-venue */
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  font-weight: 700;
  color: var(--fg-muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
  font-size: .95rem;
  border: 1px solid var(--fg);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { text-decoration: none; opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

/* ───── Section spacing & prose ───── */
section { margin-top: 3rem; }
section:first-of-type { margin-top: 2rem; }

.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin: 0 0 1rem;
  letter-spacing: -.005em;
}
.prose p {
  margin: 0 0 1rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.prose .muted { color: var(--fg-muted); }

/* KaTeX overflow safety */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: .25rem 0;
}

/* ───── Placeholders / media ───── */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--fg-muted);
  background:
    repeating-linear-gradient(
      45deg,
      var(--surface),
      var(--surface) 10px,
      var(--bg) 10px,
      var(--bg) 20px
    );
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  width: 100%;
  font-size: .95rem;
}
.placeholder code {
  font-family: var(--font-mono);
  font-size: .82em;
  background: var(--code-bg);
  padding: .1em .35em;
  border-radius: 4px;
}
.placeholder--video,
.placeholder--demo { aspect-ratio: 16 / 9; }
.placeholder--image { aspect-ratio: 4 / 3; }

.teaser { margin-top: 2rem; }
.teaser .muted { margin-bottom: 1rem; }
.gallery figure { margin: 0; }
.card figcaption {
  margin-top: .6rem;
  font-size: .9rem;
  color: var(--fg-muted);
  text-align: center;
}

/* Responsive media inside teaser/gallery */
.teaser img,
.teaser video,
.gallery img,
.gallery video,
.placeholder iframe,
.prose iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: var(--radius);
  object-fit: cover;
}

/* ───── Gallery grid ───── */
.gallery {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

.card .placeholder { margin: 0; }

/* ───── Code block ───── */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.55;
}
pre code { background: transparent; padding: 0; }

/* ───── Footer ───── */
.footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .85rem;
  color: var(--fg-muted);
}

/* ───── TL;DR + video embed ───── */
.tldr {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}
.tldr strong { color: var(--fg); }

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ───── Poster ───── */
.poster-embed {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.poster-embed:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,.06), 0 12px 28px rgba(0,0,0,.08);
}
.poster-embed img {
  display: block;
  width: 100%;
  height: auto;
}

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
