:root {
  --bg: #090b0a;
  --surface: #101412;
  --surface-2: #161b18;
  --surface-3: #1d241f;
  --text: #f3f6f4;
  --muted: #9da7a1;
  --line: #29312d;
  --mint: #77d3a8;
  --mint-strong: #45b881;
  --coral: #f08869;
  --shell: 1160px;
  --wide: 1320px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, blockquote { margin-top: 0; }
h1, h2, h3 { letter-spacing: 0; line-height: 1.12; }
h2 { margin-bottom: 22px; font-size: 40px; }
h3 { font-size: 19px; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  color: #08100c;
  background: var(--mint);
  border-radius: 6px;
}
.skip-link:focus { transform: translateY(0); }
.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;
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  height: var(--header-h);
  color: var(--text);
  background: rgba(9, 11, 10, .86);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color .2s, background .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(9, 11, 10, .96); }
.nav-inner {
  width: min(calc(100% - 48px), var(--wide));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}
.cube-mark { position: relative; width: 19px; height: 19px; border: 2px solid var(--mint); }
.cube-mark span { position: absolute; width: 13px; height: 13px; top: -7px; right: -7px; border: 2px solid var(--coral); background: var(--bg); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.site-nav a:hover { color: var(--text); }
.nav-toggle { display: none; }

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}
.icon-button:hover { color: var(--mint); border-color: #486252; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button.nav-toggle { display: none; }

.hero {
  position: relative;
  min-height: min(780px, calc(100svh - 48px));
  padding: calc(var(--header-h) + 64px) 24px 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}
.hero-backdrop { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .36; }
.hero-overlay { position: absolute; z-index: -1; inset: 0; background: rgba(5, 7, 6, .72); }
.hero-content { width: min(100%, 1080px); }
.venue-badge {
  display: inline-flex;
  margin-bottom: 28px;
  padding: 8px 18px;
  color: var(--mint);
  background: rgba(119, 211, 168, .08);
  border: 1px solid rgba(119, 211, 168, .36);
  border-radius: 8px;
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  font-weight: 500;
}
.hero h1 { margin-bottom: 25px; font-size: 62px; font-weight: 800; }
.hero h1 span { display: block; margin-bottom: 8px; color: var(--mint); font-size: 76px; }
.hero-authors { max-width: 1040px; margin: 0 auto 8px; font-size: 18px; font-weight: 600; line-height: 1.65; }
.hero-authors .author { display: inline-block; white-space: nowrap; }
.hero-authors sup,
.hero-affiliations sup { margin-left: 1px; color: var(--mint); font-size: .68em; vertical-align: super; }
.hero-affiliations { max-width: 1080px; margin: 0 auto 34px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.resource-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.resource-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  color: var(--text);
  background: rgba(16, 20, 18, .9);
  border: 1px solid #343d38;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s, border-color .2s, background .2s;
}
.resource-button:hover { transform: translateY(-2px); border-color: var(--mint-strong); background: #18201c; }
.resource-button svg { width: 17px; height: 17px; }
.resource-primary { color: #07110c; background: var(--mint); border-color: var(--mint); }
.resource-primary:hover { color: #07110c; background: #91dfbb; }
.resource-pending { cursor: default; color: #b6bdb9; }
.resource-pending:hover { transform: none; border-color: #343d38; background: rgba(16, 20, 18, .9); }
.resource-pending small { color: var(--coral); font-size: 9px; font-weight: 700; text-transform: uppercase; }

.section { position: relative; padding: 96px 24px; }
.section-inner { width: min(100%, var(--shell)); margin: 0 auto; }
.section-inner.wide { width: min(100%, var(--wide)); }
.reading-width { width: min(100%, 900px); }
.section-heading { margin-bottom: 42px; }
.section-heading.centered { text-align: center; }
.section-label {
  margin-bottom: 12px;
  color: var(--mint);
  font-family: "Roboto Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}
.split-heading { display: flex; align-items: end; justify-content: space-between; gap: 60px; }
.split-heading > div:first-child { flex: 1 1 auto; }
.split-heading > p { width: min(100%, 470px); margin-bottom: 3px; color: var(--muted); font-size: 15px; }

.video-section { padding-top: 78px; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.video-frame { width: min(100%, 1180px); margin: 0 auto; background: #000; border: 1px solid #323a36; box-shadow: 0 26px 70px rgba(0, 0, 0, .32); }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; }
.chapter-row { width: min(100%, 1180px); margin: 18px auto 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.chapter {
  min-width: 0;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.chapter:hover, .chapter.is-active { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.chapter.is-active { border-bottom-color: var(--mint); }
.chapter img { width: 70px; aspect-ratio: 16 / 9; object-fit: cover; }
.chapter span { min-width: 0; font-size: 11px; line-height: 1.35; }
.chapter strong { display: block; color: var(--mint); font-family: "Roboto Mono", monospace; font-size: 9px; font-weight: 500; }

.abstract-section { background: #0c0f0e; }
.abstract-copy { color: #c4cbc7; font-size: 17px; line-height: 1.85; }
.abstract-copy strong { color: var(--text); }
.metric-strip { margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-strip > div { min-height: 142px; display: flex; flex-direction: column; justify-content: center; padding: 26px 30px; border-right: 1px solid var(--line); }
.metric-strip > div:last-child { border-right: 0; }
.metric-strip strong { color: var(--coral); font-size: 30px; line-height: 1.1; }
.metric-strip span { margin-top: 8px; color: var(--muted); font-size: 12px; }

.mesh-section { padding-right: 0; padding-left: 0; background: var(--bg); }
.mesh-section > .section-inner { width: min(calc(100% - 48px), var(--wide)); }
.mesh-tool { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mesh-toolbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 16px; background: var(--surface); }
.mesh-toolbar h3 { margin: 2px 0 0; }
.mesh-kicker { margin: 0; color: var(--muted); font-family: "Roboto Mono", monospace; font-size: 9px; text-transform: uppercase; }
.mesh-actions { display: flex; align-items: center; gap: 8px; }
.mode-switch { display: inline-flex; padding: 3px; background: #0d100f; border: 1px solid var(--line); border-radius: 7px; }
.mode-button { min-width: 84px; padding: 7px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 600; }
.mode-button.is-active { color: #07110c; background: var(--mint); }
.mesh-stage { position: relative; width: 100%; aspect-ratio: 16 / 8.2; min-height: 480px; overflow: hidden; background: #0c100e; touch-action: none; }
.mesh-stage::after { content: ""; position: absolute; pointer-events: none; inset: 0; border: 1px solid rgba(255, 255, 255, .025); }
.mesh-stage canvas { width: 100%; height: 100%; cursor: grab; }
.mesh-stage canvas:active { cursor: grabbing; }
.mesh-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; filter: contrast(1.05); }
.mesh-load-button {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 17px;
  color: #07110c;
  background: var(--mint);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}
.mesh-load-button:hover { background: #91dfbb; }
.mesh-load-button svg { width: 18px; height: 18px; }
.mesh-status { position: absolute; z-index: 4; left: 16px; bottom: 14px; color: var(--muted); font-family: "Roboto Mono", monospace; font-size: 10px; }
.mesh-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.mesh-option { min-width: 0; min-height: 82px; display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 13px; padding: 9px; color: var(--muted); background: var(--surface); border: 0; cursor: pointer; text-align: left; }
.mesh-option:hover { color: var(--text); background: var(--surface-2); }
.mesh-option.is-active { color: var(--text); box-shadow: inset 0 -3px var(--mint); }
.mesh-option img { width: 84px; height: 62px; object-fit: cover; background: #252d29; }
.mesh-option span { overflow-wrap: anywhere; font-size: 12px; font-weight: 600; }

.comparisons-section { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prompt-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.prompt-tab { min-width: 92px; padding: 9px 14px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; }
.prompt-tab:hover, .prompt-tab.is-active { color: var(--text); border-color: var(--mint-strong); }
.prompt-tab.is-active { color: #07110c; background: var(--mint); }
.comparisons-section blockquote { min-height: 56px; margin: 0 0 22px; color: #bbc4bf; font-size: 15px; line-height: 1.6; }
.figure-button { position: relative; width: 100%; display: block; padding: 0; overflow: hidden; color: inherit; background: transparent; border: 0; cursor: zoom-in; text-align: left; }
.figure-button img { width: 100%; }
.figure-expand { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; display: grid; place-items: center; color: var(--text); background: rgba(9, 11, 10, .82); border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px; }
.figure-expand svg { width: 16px; height: 16px; }
.comparison-scroll { overflow-x: auto; }
.comparison-media { width: 100%; }
.comparison-figure { background: white; }
.method-key { display: grid; grid-template-columns: repeat(5, 1fr); padding-top: 11px; color: var(--muted); font-family: "Roboto Mono", monospace; font-size: 10px; text-align: center; }
.method-key .ours { color: var(--mint); font-weight: 700; }

.method-section { background: #0c0f0e; }
.method-figure { background: #fff; }
.method-figure img { max-height: 690px; object-fit: contain; }
.figure-caption { margin: 15px auto 0; color: var(--muted); font-size: 12px; text-align: center; }
.method-steps { margin-top: 52px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.method-steps article { min-height: 188px; padding: 25px; border-right: 1px solid var(--line); }
.method-steps article:last-child { border-right: 0; }
.method-steps article > span { color: var(--coral); font-family: "Roboto Mono", monospace; font-size: 11px; }
.method-steps h3 { margin: 20px 0 9px; }
.method-steps p { margin-bottom: 0; color: var(--muted); font-size: 13px; }

.gallery-section { background: var(--surface); }
.gallery-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 2px; background: var(--line); }
.gallery-grid .figure-button { min-height: 440px; background: #fff; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }
.gallery-additional img { object-fit: contain; }
.figure-label { position: absolute; left: 14px; bottom: 14px; padding: 10px 12px; color: var(--text); background: rgba(9, 11, 10, .86); border-radius: 5px; }
.figure-label strong, .figure-label small { display: block; }
.figure-label strong { font-size: 12px; }
.figure-label small { color: var(--muted); font-size: 9px; }

.citation-section { background: #090b0a; border-top: 1px solid var(--line); }
.citation-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: 72px; }
.citation-note { color: var(--muted); font-size: 14px; }
.logo-row { margin-top: 32px; display: flex; align-items: center; gap: 24px; }
.logo-row img { max-width: 130px; max-height: 40px; object-fit: contain; filter: grayscale(1) brightness(2.8); opacity: .72; }
.bibtex-wrap { position: relative; min-width: 0; }
.bibtex-wrap pre { margin: 0; overflow-x: auto; padding: 28px; color: #cdd8d2; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-family: "Roboto Mono", monospace; font-size: 11px; line-height: 1.75; }
.copy-button { position: absolute; z-index: 1; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--text); background: var(--surface-3); border: 1px solid #3a453f; border-radius: 6px; cursor: pointer; font-size: 11px; }
.copy-button:hover { border-color: var(--mint-strong); }
.copy-button svg { width: 14px; height: 14px; }

.site-footer { padding: 24px; color: #747f79; background: #060807; border-top: 1px solid #171c19; text-align: center; }
.site-footer p { margin: 0; font-size: 11px; }
.site-footer .footer-note { margin-bottom: 6px; color: #9aa39e; }
.site-footer .footer-note sup { color: var(--mint); }
.site-footer .footer-contact { margin-bottom: 6px; }
.site-footer .footer-contact a { color: #9aa39e; }

.image-modal { width: min(96vw, 1500px); max-height: 94vh; padding: 50px 16px 16px; color: var(--text); background: #0a0d0b; border: 1px solid #39413d; border-radius: 6px; }
.image-modal::backdrop { background: rgba(0, 0, 0, .88); backdrop-filter: blur(6px); }
.image-modal img { width: 100%; max-height: calc(94vh - 95px); object-fit: contain; }
.image-modal p { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.modal-close { position: absolute; top: 6px; right: 8px; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 980px) {
  .site-nav { gap: 18px; }
  .hero h1 { font-size: 50px; }
  .hero h1 span { font-size: 66px; }
  .chapter { grid-template-columns: 1fr; }
  .chapter img { width: 100%; }
  .mesh-stage { min-height: 420px; }
  .mesh-option { grid-template-columns: 64px minmax(0, 1fr); }
  .mesh-option img { width: 64px; height: 54px; }
  .method-steps { grid-template-columns: 1fr 1fr; }
  .method-steps article:nth-child(2) { border-right: 0; }
  .method-steps article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid .figure-button { min-height: 56vw; }
  .gallery-additional { min-height: 78vw !important; }
}

@media (max-width: 760px) {
  :root { --header-h: 58px; }
  .nav-inner { width: calc(100% - 28px); }
  .icon-button.nav-toggle { display: inline-grid; }
  .site-nav { position: absolute; top: var(--header-h); left: 0; right: 0; display: none; padding: 14px 18px 22px; background: #0b0e0c; border-bottom: 1px solid var(--line); }
  .site-nav.is-open { display: grid; }
  .site-nav a { padding: 7px 0; }
  .hero { min-height: min(735px, calc(100svh - 34px)); padding: calc(var(--header-h) + 44px) 18px 42px; }
  .hero h1 { font-size: 34px; }
  .hero h1 span { font-size: 48px; }
  .hero-authors { font-size: 15px; line-height: 1.7; }
  .hero-affiliations { font-size: 12px; line-height: 1.65; }
  .resource-row { gap: 7px; }
  .resource-button { min-height: 45px; padding: 8px 11px; font-size: 12px; }
  .resource-pending { gap: 6px; }
  .resource-pending small { font-size: 7px; }
  .section { padding: 72px 18px; }
  h2 { font-size: 32px; }
  .split-heading { display: grid; gap: 18px; }
  .split-heading > p { width: 100%; }
  .video-section { padding-top: 66px; }
  .chapter-row { display: flex; overflow-x: auto; padding-bottom: 8px; }
  .chapter { flex: 0 0 142px; }
  .abstract-copy { font-size: 15px; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip > div { min-height: 120px; padding: 18px; }
  .metric-strip > div:nth-child(2) { border-right: 0; }
  .metric-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .metric-strip strong { font-size: 24px; }
  .mesh-section > .section-inner { width: calc(100% - 36px); }
  .mesh-toolbar { align-items: flex-start; }
  .mesh-actions { flex-wrap: wrap; justify-content: flex-end; }
  .mesh-actions .mode-switch { order: 3; }
  .mesh-stage { min-height: 360px; aspect-ratio: 1 / 1; }
  .mesh-selector { grid-template-columns: 1fr 1fr; }
  .mesh-option { grid-template-columns: 64px minmax(0, 1fr); }
  .comparisons-section blockquote { min-height: 106px; font-size: 13px; }
  .comparison-media { width: 800px; }
  .comparison-figure img { width: 100%; max-width: none; }
  .comparisons-section .section-inner { overflow-x: hidden; }
  .method-section .mode-switch { width: 100%; }
  .method-section .mode-button { flex: 1; }
  .method-steps { grid-template-columns: 1fr; }
  .method-steps article { min-height: 155px; border-right: 0; border-bottom: 1px solid var(--line); }
  .method-steps article:nth-child(3) { border-bottom: 1px solid var(--line); }
  .method-steps article:last-child { border-bottom: 0; }
  .gallery-grid .figure-button { min-height: 68vw; }
  .gallery-additional { min-height: 110vw !important; }
  .citation-layout { grid-template-columns: 1fr; gap: 40px; }
  .bibtex-wrap pre { padding: 52px 18px 20px; font-size: 9px; }
}

@media (max-width: 430px) {
  .venue-badge { margin-bottom: 21px; }
  .hero { min-height: min(760px, calc(100svh - 24px)); }
  .hero h1 { font-size: 30px; }
  .hero h1 span { font-size: 43px; }
  .resource-button { flex: 1 1 42%; }
  .mesh-toolbar { display: grid; }
  .mesh-actions { justify-content: flex-start; }
  .mesh-actions .mode-switch { order: 0; }
  .mesh-option { min-height: 68px; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .mesh-option img { width: 52px; height: 48px; }
  .mesh-option span { font-size: 11px; }
}
