:root {
  --paper: #f7f6f2;
  --paper-deep: #efede7;
  --ink: #161b24;
  --muted: #606875;
  --line: #d9d8d2;
  --blue: #315fa9;
  --blue-dark: #204883;
  --blue-soft: #e8eef8;
  --orange: #df8238;
  --orange-soft: #f8e8d9;
  --white: #fff;
  --shadow: 0 18px 60px rgba(29, 36, 47, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--white); background: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.shell { width: min(1220px, calc(100% - 48px)); margin-inline: auto; }
#mesh-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 20;
  visibility: hidden;
}
#mesh-canvas.is-ready { visibility: visible; }

.site-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  width: min(1040px, calc(100% - 36px));
  height: 58px;
  margin: 14px auto 0;
  padding: 0 16px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(214, 214, 210, .88);
  border-radius: 16px;
  background: rgba(250, 249, 246, .87);
  backdrop-filter: blur(16px);
  box-shadow: 0 9px 34px rgba(35, 39, 46, .08);
}
.brand { display: flex; align-items: center; gap: 11px; font: 700 16px "Manrope", sans-serif; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { position: relative; width: 28px; height: 28px; display: inline-block; }
.brand-mark i { position: absolute; width: 20px; height: 20px; border: 3px solid; border-radius: 50%; }
.brand-mark i:first-child { top: 0; left: 0; border-color: var(--blue); border-right-color: transparent; transform: rotate(-35deg); }
.brand-mark i:last-child { right: 0; bottom: 0; border-color: var(--orange); border-left-color: transparent; transform: rotate(-35deg); }
.site-header nav { display: flex; gap: 6px; }
.site-header nav a { padding: 8px 12px; border-radius: 9px; color: #4f5763; font-size: 14px; font-weight: 600; text-decoration: none; transition: .2s ease; }
.site-header nav a:hover { color: var(--ink); background: var(--white); }

.hero { padding: 48px 0 96px; text-align: center; }
.hero-lede { max-width: 900px; margin: 0 auto 26px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.authors { max-width: 900px; margin: 0 auto 7px; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 9px; font-family: "Manrope", sans-serif; font-size: 16px; font-weight: 600; }
.authors b { color: #b2b2ad; font-weight: 400; }
.affiliation { margin: 0; color: var(--muted); font-size: 15px; }
.hero-actions { margin: 30px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.button { min-height: 46px; padding: 0 17px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; font-weight: 700; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31,39,51,.1); }
.button-primary { color: var(--white); border-color: var(--blue); background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { background: rgba(255,255,255,.66); }
.button small { padding: 2px 5px; border-radius: 5px; background: rgba(0,0,0,.06); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.cover-section { width: min(1360px, calc(100% - 40px)); margin: 40px auto 0; }
.cover-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--shadow); }
.cover-card img { display: block; width: 100%; height: auto; }

.idea-section { padding-block: 140px 130px; }
.section-kicker { margin-bottom: 14px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
h2 { margin: 0; font: 700 clamp(30px, 3.7vw, 46px)/1.14 "Manrope", sans-serif; letter-spacing: -.04em; }
.section-intro { max-width: 720px; margin: 18px 0 50px; color: var(--muted); font-size: 17px; }
.idea-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line); }
.idea-grid article { min-height: 230px; padding: 32px 34px 32px 0; }
.idea-grid article + article { padding-left: 34px; border-left: 1px solid var(--line); }
.step-index { color: var(--orange); font: 700 13px "Manrope", sans-serif; }
.idea-grid h3 { margin: 38px 0 10px; font: 700 20px "Manrope", sans-serif; letter-spacing: -.025em; }
.idea-grid p { margin: 0; color: var(--muted); font-size: 16px; }

.method-section, .video-section { padding-block: 110px; background: var(--paper-deep); }
.video-shell { max-width: 1040px; }
.section-heading { margin-bottom: 38px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.section-heading p { max-width: 390px; margin: 0 0 5px; color: var(--muted); }
.method-card { margin: 0; padding: 12px; overflow: hidden; border: 1px solid #d2d1cb; border-radius: 20px; background: var(--white); box-shadow: 0 14px 50px rgba(35,39,46,.07); }
.method-card img { width: 100%; border-radius: 12px; }

.results-section { padding-block: 130px; }
.results-heading p { color: #7a8089; font-size: 14px; font-weight: 600; }
.result-note { margin: -10px 0 24px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #54a66c; box-shadow: 0 0 0 4px #e2f0e6; }
.mesh-table-wrap { position: relative; overflow-x: auto; padding-bottom: 12px; scrollbar-color: #a9adb4 transparent; }
.mesh-table { min-width: 980px; display: grid; grid-template-columns: 84px repeat(4, minmax(210px, 1fr)); gap: 9px; }
.table-corner, .method-label { min-height: 48px; display: flex; align-items: center; justify-content: center; font: 700 14px "Manrope", sans-serif; }
.table-corner { justify-content: flex-start; color: #8a8e95; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.method-label { border-bottom: 2px solid #d8d8d4; }
.ours-label { color: var(--blue); border-color: var(--blue); }
.ours-label span { margin-left: 7px; padding: 3px 6px; border-radius: 6px; color: var(--white); background: var(--blue); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.scan-label { min-height: 250px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-top: 1px solid var(--line); }
.scan-label span { color: #b5b6b4; font: 700 30px "Manrope", sans-serif; letter-spacing: -.04em; }
.scan-label small { color: #737983; font-size: 12px; font-weight: 700; }
.mesh-viewer { position: relative; min-height: 250px; overflow: hidden; border: 1px solid #deded9; border-radius: 14px; background: #eeede9; cursor: grab; touch-action: none; }
.mesh-viewer:active { cursor: grabbing; }
.mesh-viewer::after { content: ""; position: absolute; inset: 0; z-index: 25; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.ours-viewer { border-color: #a9bee0; background: #edf1f7; }
.mesh-status { position: absolute; z-index: 24; inset: 0; display: grid; place-items: center; color: #96999e; font-size: 12px; font-weight: 600; letter-spacing: .03em; pointer-events: none; transition: opacity .25s; }
.mesh-status::after { content: ""; width: 16px; height: 16px; margin-left: 8px; display: inline-block; border: 2px solid #b4b6ba; border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
.mesh-viewer.ready .mesh-status { opacity: 0; }
.mesh-viewer.error .mesh-status { color: #a35353; }
.mesh-viewer.error .mesh-status::after { display: none; }
.mesh-hint { position: absolute; z-index: 24; left: 50%; bottom: 9px; translate: -50% 7px; padding: 4px 8px; border-radius: 8px; color: #666d77; background: rgba(255,255,255,.8); box-shadow: 0 3px 14px rgba(0,0,0,.08); font-size: 10px; font-weight: 700; opacity: 0; white-space: nowrap; pointer-events: none; transition: .2s ease; }
.mesh-viewer.ready:hover .mesh-hint { translate: -50% 0; opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.metrics-strip { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--line); }
.metrics-strip div { padding: 28px 24px; display: flex; flex-direction: column; gap: 5px; }
.metrics-strip div + div { border-left: 1px solid var(--line); }
.metrics-strip strong { color: var(--blue); font: 700 26px "Manrope", sans-serif; letter-spacing: -.035em; }
.metrics-strip span { color: var(--muted); font-size: 13px; }

.video-embed { overflow: hidden; aspect-ratio: 16 / 9; border: 1px solid #d2d1cb; border-radius: 22px; background: #101722; box-shadow: var(--shadow); }
.video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

.resources-section { padding-block: 130px; display: grid; grid-template-columns: .85fr 1.15fr; gap: 72px; align-items: center; }
.resource-copy h2 { max-width: 500px; }
.resource-copy > p { max-width: 460px; margin: 20px 0 30px; color: var(--muted); }
.bibtex-card { overflow: hidden; border: 1px solid #d9d8d2; border-radius: 18px; background: #222a36; box-shadow: 0 16px 45px rgba(24,29,38,.14); color: #e8ebef; }
.bibtex-head { height: 52px; padding: 0 16px 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.09); color: #aeb6c1; font-size: 13px; font-weight: 700; }
.bibtex-head button { padding: 6px 10px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; color: #dfe4ea; background: rgba(255,255,255,.05); font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.bibtex-card pre { margin: 0; padding: 24px; overflow-x: auto; }
.bibtex-card code { font: 12px/1.75 Consolas, "SFMono-Regular", monospace; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer .shell { min-height: 78px; display: flex; align-items: center; justify-content: space-between; }
footer a { color: var(--ink); font-weight: 700; text-decoration: none; }

@media (max-width: 900px) {
  .idea-grid { grid-template-columns: 1fr; }
  .idea-grid article { min-height: auto; padding: 28px 0; }
  .idea-grid article + article { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .idea-grid h3 { margin-top: 16px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .metrics-strip div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metrics-strip div:nth-child(4) { border-top: 1px solid var(--line); }
  .resources-section { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1220px); }
  .site-header { width: calc(100% - 20px); top: 8px; margin-top: 8px; }
  .site-header nav a { display: none; }
  .site-header nav a:nth-last-child(2) { display: block; }
  .hero { padding-top: 66px; }
  .hero-lede { font-size: 16px; }
  .authors { font-size: 15px; }
  .hero { padding: 34px 0 72px; }
  .cover-section { width: calc(100% - 28px); margin-top: 24px; }
  .cover-card { border-radius: 14px; }
  .idea-section, .results-section, .resources-section { padding-block: 92px; }
  .method-section, .video-section { padding-block: 80px; }
  .mesh-table-wrap { margin-right: -14px; }
  .mesh-table { min-width: 980px; }
  .metrics-strip div { padding: 22px 14px; }
  .metrics-strip strong { font-size: 23px; }
  .resources-section { gap: 42px; }
  .bibtex-card pre { padding: 18px; }
  .bibtex-card code { font-size: 11px; }
}

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