:root {
  --bg: #fefffe;
  --surface: #f8fafc;
  --surface-strong: #f1f5f9;
  --card: #ffffff;
  --ink: #1e293b;
  --ink-strong: #0f172a;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: rgba(226, 232, 240, .68);
  --accent: #d4a562;
  --accent-light: #f5e8d2;
  --accent-dark: #ad7d3e;
  --blue: #607da0;
  --blue-light: #e8eff7;
  --nav-bg: rgba(254, 255, 254, .86);
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
  --shadow-soft: 0 8px 30px rgba(15, 23, 42, .06);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #131d30;
  --surface-strong: #1e293b;
  --card: #182338;
  --ink: #e2e8f0;
  --ink-strong: #f8fafc;
  --muted: #a7b3c5;
  --faint: #738198;
  --line: #334155;
  --line-soft: rgba(71, 85, 105, .58);
  --accent: #e4b976;
  --accent-light: rgba(228, 185, 118, .13);
  --accent-dark: #f0c674;
  --blue: #9db4ce;
  --blue-light: rgba(96, 125, 160, .17);
  --nav-bg: rgba(15, 23, 42, .86);
  --shadow: 0 18px 50px rgba(0, 0, 0, .25);
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: color .25s, background .25s;
}
body.menu-open { overflow: hidden; }
img, video, svg { display: block; }
img, video { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--ink-strong); background: var(--accent-light); }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  color: #fff;
  background: var(--ink-strong);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.section { position: relative; padding: 112px 0; }
.muted-section { background: var(--surface); border-block: 1px solid var(--line-soft); }

.site-nav {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.site-nav.scrolled {
  background: var(--nav-bg);
  border-color: var(--line-soft);
  box-shadow: 0 4px 20px rgba(15, 23, 42, .035);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-inner {
  display: flex;
  width: min(1280px, calc(100% - 48px));
  height: 72px;
  margin: auto;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-strong);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.025em;
}
.mark { position: relative; display: inline-flex; width: 26px; height: 24px; }
.mark i {
  position: absolute;
  top: 3px;
  width: 12px;
  height: 18px;
  border: 2px solid var(--ink-strong);
  border-radius: 50%;
  transform: rotate(24deg);
}
.mark i:first-child { left: 2px; border-color: var(--accent); }
.mark i:last-child { right: 2px; transform: rotate(-24deg); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 13px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink-strong); background: var(--surface-strong); }
.nav-actions { display: flex; gap: 8px; }
.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  place-items: center;
  transition: color .2s, border-color .2s, transform .2s;
}
.icon-button:hover { color: var(--accent-dark); border-color: var(--accent); transform: translateY(-1px); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.theme-toggle {}
.moon { display: none; }
[data-theme="dark"] .sun { display: none; }
[data-theme="dark"] .moon { display: block; }
.menu-button { display: none; }
.mobile-menu { display: none; }

.hero { padding-top: 156px; overflow: hidden; }
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(1px); pointer-events: none; }
.glow-one {
  top: 80px;
  left: -180px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 165, 98, .12), rgba(212, 165, 98, 0) 70%);
}
.glow-two {
  top: 160px;
  right: -160px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(96, 125, 160, .11), rgba(96, 125, 160, 0) 70%);
}
.venue {
  display: inline-flex;
  margin-bottom: 24px;
  padding: 6px 12px;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
}
.venue span { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 17%, transparent); }
.hero h1 {
  margin: 0 auto;
  color: var(--ink-strong);
  font-family: var(--serif);
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.hero h1 em { color: var(--accent-dark); font-style: normal; }
.hero-lead { margin: 24px auto 28px; color: var(--muted); font-size: clamp(17px, 2vw, 20px); }
.authors { display: flex; max-width: 820px; margin: 0 auto; flex-wrap: wrap; justify-content: center; column-gap: 22px; row-gap: 3px; font-size: 15px; font-weight: 600; }
.authors a { color: var(--accent-dark); transition: opacity .2s; }
.authors a:hover { opacity: .72; text-decoration: underline; text-underline-offset: 3px; }
sup { font-size: .7em; }
.author-note { margin: 7px 0 12px; color: var(--faint); font-size: 11px; }
.affiliations { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.affiliations i { width: 3px; height: 3px; background: var(--faint); border-radius: 50%; }
.hero-actions { display: flex; margin-top: 30px; justify-content: center; gap: 10px; }
.button {
  display: inline-flex;
  min-width: 118px;
  height: 44px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.button.primary { color: #fff; background: var(--ink-strong); border-color: var(--ink-strong); }
[data-theme="dark"] .button.primary { color: #0f172a; background: #f8fafc; border-color: #f8fafc; }
.button.secondary { color: var(--ink); background: var(--card); }
.button:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.button.secondary:hover { border-color: var(--accent); }
#arxiv-link[href="#"] { opacity: .6; cursor: not-allowed; }
#arxiv-link[href="#"]:hover { border-color: var(--line); box-shadow: none; transform: none; }

.teaser { margin-top: 76px; }
.media-frame { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.media-frame img { width: 100%; height: auto; }
.teaser figcaption, .paper-figure figcaption {
  margin: 15px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}
.teaser figcaption b { color: var(--ink); }

.section-heading { margin-bottom: 56px; }
.section-heading .eyebrow {
  display: block;
  margin-bottom: 13px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.section-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  letter-spacing: -.04em;
  line-height: 1.06;
}
.section-heading p { margin: 20px 0 0; color: var(--muted); font-size: 17px; }
.abstract { color: var(--muted); font-size: 17px; line-height: 1.9; }
.abstract p { margin: 0 0 20px; }
.abstract strong { color: var(--ink); }
.dropcap::first-letter {
  float: left;
  margin: 10px 9px 0 0;
  color: var(--accent-dark);
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 700;
  line-height: .72;
}
.paper-figure { margin: 72px 0 0; }
.figure-pad { padding: clamp(12px, 2vw, 24px); }
.paper-figure figcaption span {
  display: inline-block;
  margin-right: 9px;
  padding: 2px 7px;
  color: var(--accent-dark);
  background: var(--accent-light);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.method-figure { margin-top: 72px; }
.method-figure figcaption {
  max-width: 100%;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
}
.method-figure figcaption strong { color: var(--ink); }

.video-demo { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.demo-toolbar { display: flex; min-height: 66px; padding: 10px 14px 10px 20px; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.scene-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.scene-tabs::-webkit-scrollbar { display: none; }
.scene-tabs button {
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.scene-tabs button:hover { color: var(--ink); }
.scene-tabs button.active { color: var(--accent-dark); background: var(--accent-light); }
.play-control {
  display: inline-flex;
  height: 36px;
  padding: 0 12px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.play-control svg { width: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.play-icon { display: none; }
.play-control.paused .pause-icon { display: none; }
.play-control.paused .play-icon { display: block; }
.video-grid { display: grid; padding: 18px; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.video-grid figure { margin: 0; }
.video-shell { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #111827; border: 1px solid var(--line); border-radius: 10px; }
.video-shell video { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.video-grid figcaption { display: flex; padding: 11px 3px 4px; flex-direction: column; line-height: 1.35; }
.video-grid figcaption span { color: var(--faint); font-size: 10px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.video-grid figcaption b { margin-top: 3px; color: var(--ink-strong); font-family: var(--serif); font-size: 17px; }
.ours-video .video-shell { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
.ours-badge { position: absolute; top: 9px; right: 9px; padding: 3px 8px; color: #fff; background: var(--accent-dark); border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.demo-note { margin: 0; padding: 0 20px 18px; color: var(--faint); font-size: 11px; text-align: center; }
.metrics { display: grid; margin-top: 72px; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.metrics article { padding: 27px 24px; border-right: 1px solid var(--line); }
.metrics article:last-child { border: 0; }
.metrics span { display: block; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metrics strong { display: block; margin: 8px 0 2px; color: var(--ink-strong); font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); font-weight: 500; letter-spacing: -.02em; }
.metrics small { color: var(--accent-dark); font-size: .48em; }
.metrics p { margin: 0; color: var(--muted); font-size: 11px; }

.citation-section { background: var(--ink-strong); }
[data-theme="dark"] .citation-section { background: #090f1d; }
.citation-grid { display: grid; grid-template-columns: 1fr; gap: 44px; }
.citation-section .section-heading { margin: 0; }
.citation-section .section-heading h2 { color: #f8fafc; }
.citation-section .section-heading p { color: #94a3b8; font-size: 15px; }
.code-card { overflow: hidden; background: #111b2c; border: 1px solid #334155; border-radius: 14px; box-shadow: 0 22px 60px rgba(0, 0, 0, .3); }
.code-toolbar { display: flex; height: 52px; padding: 0 14px 0 20px; align-items: center; justify-content: space-between; color: #94a3b8; border-bottom: 1px solid #27364a; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.code-toolbar button { display: inline-flex; padding: 7px 9px; align-items: center; gap: 6px; color: #aab7c8; background: #19263a; border: 1px solid #334155; border-radius: 7px; cursor: pointer; font-size: 10px; letter-spacing: .04em; }
.code-toolbar button:hover { color: var(--accent); border-color: var(--accent); }
.code-toolbar svg { width: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.code-card pre { margin: 0; padding: 25px 28px 29px; overflow-x: auto; color: #c7d2e1; font: 12px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", monospace; tab-size: 2; }

footer { background: var(--surface); border-top: 1px solid var(--line-soft); }
.footer-inner { display: grid; min-height: 150px; padding-block: 35px; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 30px; }
.footer-inner > p { margin: 0; color: var(--muted); font-size: 11px; text-align: center; }
.footer-inner .copyright { text-align: right; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .section { padding: 90px 0; }
  .nav-links { display: none; }
  .menu-button { display: grid; }
  .mobile-menu {
    display: grid;
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    max-height: 0;
    padding: 0 24px;
    overflow: hidden;
    background: var(--nav-bg);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(18px);
    opacity: 0;
    transition: max-height .3s, opacity .2s, padding .3s, border-color .3s;
  }
  .mobile-menu.open { max-height: 300px; padding-block: 12px 20px; border-color: var(--line); opacity: 1; }
  .mobile-menu a { padding: 11px 8px; color: var(--muted); border-bottom: 1px solid var(--line-soft); font-size: 14px; font-weight: 600; }
  .mobile-menu a:last-child { border: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .footer-inner { grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .footer-inner .copyright { text-align: center; }
}

@media (max-width: 720px) {
  .container, .nav-inner { width: min(100% - 30px, 1120px); }
  .section { padding: 76px 0; }
  .hero { padding-top: 124px; }
  .hero h1 { font-size: clamp(36px, 10vw, 50px); }
  .hero-lead { font-size: 16px; }
  .authors { column-gap: 15px; }
  .affiliations { display: block; line-height: 1.6; }
  .affiliations span { display: block; }
  .affiliations i { display: none; }
  .teaser { width: calc(100% - 20px); margin-top: 52px; }
  .media-frame { border-radius: 11px; }
  .section-heading { margin-bottom: 40px; }
  .abstract { font-size: 15px; }
  .paper-figure { margin-top: 50px; }
  .demo-toolbar { align-items: flex-start; }
  .scene-tabs { max-width: calc(100% - 82px); }
  .play-control span { display: none; }
  .video-grid { grid-template-columns: 1fr; padding: 12px; gap: 22px; }
  .video-shell { aspect-ratio: 16 / 10; }
  .metrics { margin-top: 52px; }
  .metrics article { padding: 21px 13px; }
  .code-card pre { padding: 21px 18px; font-size: 10px; }
  .github-button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
