:root {
  --ink: #261d2f;
  --muted: #756d7d;
  --paper: #fcfaff;
  --paper-2: #f6f1fb;
  --line: #dfd7e8;
  --green: #8755d4;
  --green-dark: #6632b7;
  --green-soft: #eadffa;
  --green-pale: #f4edfd;
  --purple: #7847d7;
  --orange: #dd5a20;
  --shadow: 0 18px 55px rgba(71, 42, 100, .11);
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }

.section-shell { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.section-shell.narrow { width: min(920px, calc(100% - 48px)); }
.section-pad { padding-block: 100px; }
.section-kicker {
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
h2 { max-width: 900px; margin-bottom: 18px; font-size: clamp(34px, 5vw, 56px); line-height: 1.06; font-weight: 500; }
.section-intro { max-width: 800px; margin-bottom: 36px; color: var(--muted); font-size: 18px; }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(223, 215, 232, .84);
  background: rgba(252, 250, 255, .90);
  backdrop-filter: blur(14px);
}
.wordmark { display: flex; align-items: center; text-decoration: none; }
.wordmark img { width: auto; height: 42px; }
.site-header nav { display: flex; gap: 27px; }
.site-header nav a { color: #4a3d55; font-size: 14px; font-weight: 650; text-decoration: none; }
.site-header nav a:hover { color: var(--green); }

.hero { padding-top: 86px; text-align: center; }
.eyebrow { margin-bottom: 20px; color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 1220px; margin: 0 auto 23px; font-size: clamp(42px, 4.6vw, 64px); font-weight: 500; line-height: 1.08; white-space: nowrap; }
.hero h1 span { color: var(--green-dark); font-style: italic; }
.hero-deck { max-width: 820px; margin: 0 auto 15px; color: #564a60; font-size: clamp(18px, 2.4vw, 23px); line-height: 1.45; }
.author-block { max-width: 1000px; margin: 22px auto 24px; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 20px; margin-bottom: 12px; color: var(--green-dark); font-size: 17px; font-weight: 600; }
.authors span { white-space: nowrap; }
.author-block sup { margin-left: 2px; font-size: .7em; }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.author-notes { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 54px; }
.button { display: inline-flex; align-items: center; gap: 10px; padding: 10px 17px; border: 1px solid #d8cce3; border-radius: 100px; background: rgba(255,255,255,.65); font-size: 14px; font-weight: 700; text-decoration: none; }
.button.primary { border-color: var(--green-dark); color: white; background: var(--green-dark); }
.button.disabled { color: #9b92a2; cursor: not-allowed; }
.hero-reel { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; border: 7px solid #281c34; border-radius: 20px; background: #281c34; box-shadow: var(--shadow); gap: 5px; }
.hero-video { position: relative; overflow: hidden; background: #191220; aspect-ratio: 832 / 480; }
.hero-video video { width: 100%; height: 100%; object-fit: cover; }
.hero-video span { position: absolute; right: 12px; bottom: 12px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 100px; color: white; background: rgba(31,19,43,.68); backdrop-filter: blur(7px); font-size: 11px; font-weight: 700; letter-spacing: .03em; }

.abstract-copy { color: #3c3045; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.62; }
.contribution-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 58px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.contribution-grid article { padding: 28px 24px 24px 0; }
.contribution-grid article + article { padding-left: 24px; border-left: 1px solid var(--line); }
.contribution-grid span { color: var(--purple); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.contribution-grid h3 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 21px; }
.contribution-grid p { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.method-section, .video-section { border-block: 1px solid var(--line); background: var(--paper-2); }
.paper-figure { margin: 0; }
.paper-figure .image-button { width: 100%; padding: 0; border: 0; border-radius: 14px; background: white; cursor: zoom-in; box-shadow: 0 10px 40px rgba(75, 45, 101, .07); }
.paper-figure img { width: 100%; border: 1px solid #e4ddea; border-radius: 14px; }
.paper-figure figcaption { max-width: 900px; margin: 13px auto 0; color: var(--muted); font-family: Georgia, serif; font-size: 14px; line-height: 1.5; text-align: center; }
.wide-figure { margin-top: 42px; }
.embedded-figure .image-button { background: transparent; box-shadow: none; }
.embedded-figure img { border: 0; border-radius: 0; }
.concept-figure { margin: 46px 0 52px; }
.concept-figure figcaption { max-width: 820px; }
.method-narrative { margin-top: 74px; }
.objective-strip { display: grid; grid-template-columns: minmax(430px, .95fr) 1.05fr; align-items: center; gap: 36px; padding: 22px 27px; border: 1px solid #d8c9ee; border-left: 4px solid var(--purple); border-radius: 13px; background: rgba(255, 255, 255, .45); }
.objective-strip p { margin: 0; color: #665b6e; font-family: Georgia, serif; font-size: 14px; line-height: 1.55; }
.formula-label { display: block; margin-bottom: 5px; color: var(--purple); font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.formula-main { color: #292033; font-family: "Times New Roman", Times, serif; font-size: clamp(20px, 2vw, 27px); white-space: nowrap; }
.discriminator-block { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(480px, 1.2fr); align-items: center; gap: 72px; margin-top: 82px; padding-top: 70px; border-top: 1px solid #dfd7e7; }
.discriminator-figure img { width: auto; max-height: 690px; margin: auto; }
.discriminator-copy h3 { max-width: 610px; margin-bottom: 14px; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 40px); font-weight: 500; line-height: 1.08; }
.discriminator-copy > p { color: var(--muted); font-size: 15px; }
.formula-card { margin-top: 11px; padding: 13px 16px; border: 1px solid #dfd6e7; border-radius: 10px; background: rgba(255, 255, 255, .48); }
.formula-card > span { display: block; margin-bottom: 3px; color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.formula-card > div { overflow-x: auto; color: #35293d; font-family: "Times New Roman", Times, serif; font-size: 18px; white-space: nowrap; }
.discriminator-copy .inference-note { margin: 18px 0 0; padding-left: 14px; border-left: 2px solid var(--green); color: #665b6e; font-size: 13px; }
.results-title { font-size: clamp(30px, 3.8vw, 46px); }
h2.section-title, h3.section-title {
  max-width: none;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.2vw, 30px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.result-tabs, .mode-tabs, .case-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.result-tabs { margin: 32px 0 18px; }
.result-tab, .ablation-tab, .mode-tab, .case-tab {
  padding: 9px 15px;
  border: 1px solid #d5c9df;
  border-radius: 999px;
  color: #5c4e65;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.result-tab.active, .ablation-tab.active, .mode-tab.active, .case-tab.active { border-color: var(--green-dark); color: white; background: var(--green-dark); }
.result-panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 12px 35px rgba(72,43,97,.06); }
.table-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.table-heading strong, .table-heading span { display: block; }
.table-heading strong { font-family: Georgia, serif; font-size: 20px; }
.table-heading div > span { color: var(--muted); font-size: 12px; }
.metric-pill { padding: 5px 11px; border-radius: 99px; color: var(--green-dark); background: var(--green-pale); font-size: 11px; font-weight: 800; white-space: nowrap; }
.table-scroll { overflow-x: auto; border: 1px solid #e3dce9; border-radius: 10px; }
.metrics-table { width: 100%; min-width: 1220px; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.compact-table .metrics-table { min-width: 920px; }
.metrics-table th, .metrics-table td { padding: 9px 10px; border-bottom: 1px solid #ebe5f0; text-align: center; white-space: nowrap; }
.metrics-table thead th { color: #55465f; background: #faf7fc; font-size: 11px; font-weight: 800; }
.metrics-table thead tr:first-child th { border-bottom-color: #d7ccdf; }
.metrics-table tbody th { position: sticky; z-index: 1; left: 0; min-width: 138px; background: white; text-align: left; }
.metrics-table tbody tr:last-child th, .metrics-table tbody tr:last-child td { border-bottom: 0; }
.metrics-table .ours th { color: var(--green-dark); font-weight: 900; }
.metrics-table .ours th, .metrics-table .ours td { background-color: #f6effc; }
.metrics-table .score.second { background: #e7d9f8; }
.metrics-table .score.best { color: #4a1e82; background: #c7a6ed; font-weight: 850; }
.metrics-table .muted { color: #807487; font-weight: 500; }
.ablation-section { border-top: 1px solid var(--line); background: #faf7fd; }
.ablation-wide { min-width: 1180px; }
.ablation-compact { min-width: 700px !important; }
.reference-row th, .reference-row td { color: #77717c; background: #f0edf2 !important; }

.video-app { margin-top: 30px; }
.mode-tabs { margin-bottom: 18px; }
.video-case-panel { padding: 22px; border: 1px solid #dfd7e6; border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.case-tabs { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid #e9e2ee; }
.comparison-header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 28px; margin-bottom: 17px; }
.comparison-header h3 { margin: 0 0 5px; font-family: Georgia, serif; font-size: 25px; }
.comparison-header p { max-width: 780px; margin: 0; color: #6d6175; font-family: Georgia, serif; font-size: 15px; font-style: italic; line-height: 1.45; }
.sync-controls { display: grid; min-width: 280px; grid-template-columns: auto auto auto 1fr auto; align-items: center; gap: 7px; }
.sync-controls button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid #d5c9df; border-radius: 9px; color: #563c69; background: #faf7fc; cursor: pointer; }
.sync-controls button:hover { border-color: var(--green); background: var(--green-pale); }
.sync-controls input { width: 100%; accent-color: var(--green); }
.sync-time { min-width: 42px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.comparison-grid { display: grid; gap: 10px; }
.comparison-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.comparison-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.comparison-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.method-card { position: relative; overflow: hidden; border: 1px solid #ddd5e5; border-radius: 12px; background: #17111d; }
.method-card.ours { border: 2px solid #8c5bd1; box-shadow: 0 0 0 3px rgba(140,91,209,.11); }
.method-card video { width: 100%; aspect-ratio: 832 / 480; object-fit: cover; cursor: pointer; }
.method-label { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 8px 10px; color: #f3eef8; background: #241a2d; font-size: 12px; font-weight: 750; }
.method-label em { color: #c9a6ef; font-size: 9px; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.sync-note { margin: 13px 0 0; color: #8b8092; font-size: 11px; }

.more-section { background: #21162c; color: #f7f2fb; }
.more-section .section-kicker { color: #c6a3ee; }
.more-section h2 { margin-bottom: 12px; }
.more-section .section-intro { margin-bottom: 0; color: #c4b8cc; }
.more-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.carousel-controls { display: flex; gap: 8px; padding-bottom: 5px; }
.carousel-controls button { width: 42px; height: 42px; border: 1px solid #6b5878; border-radius: 50%; color: white; background: transparent; cursor: pointer; }
.carousel-controls button:hover { background: #3a2849; }
.more-carousel { display: grid; grid-auto-columns: minmax(330px, 43%); grid-auto-flow: column; gap: 16px; overflow-x: auto; margin-top: 38px; padding: 2px 2px 15px; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-width: none; }
.more-carousel::-webkit-scrollbar { display: none; }
.more-card { overflow: hidden; border: 1px solid #554263; border-radius: 16px; background: #2b1e36; scroll-snap-align: start; }
.more-card video { width: 100%; aspect-ratio: 832 / 480; object-fit: cover; background: #17101d; cursor: pointer; }
.more-copy { padding: 15px 17px 18px; }
.more-copy span { color: #c9a5ef; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.more-copy h3 { margin: 4px 0 6px; font-family: Georgia, serif; font-size: 20px; }
.more-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #c9bfd0; font-family: Georgia, serif; font-size: 13px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.scroll-hint { display: flex; justify-content: space-between; margin: 8px 2px 0; color: #a99bb2; font-size: 11px; }

.citation-section pre { overflow-x: auto; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f5f1f8; color: #3a2f42; font-size: 13px; line-height: 1.55; }
.copy-button { padding: 8px 13px; border: 1px solid #d6cadf; border-radius: 8px; color: var(--green-dark); background: white; cursor: pointer; font-size: 12px; font-weight: 750; }
footer { padding: 28px 0; border-top: 1px solid var(--line); color: #7b7083; font-size: 12px; }
footer .section-shell { display: flex; justify-content: space-between; gap: 20px; }
footer strong { color: var(--ink); }

#lightbox { width: min(95vw, 1600px); max-width: none; padding: 0; border: 0; background: transparent; }
#lightbox::backdrop { background: rgba(20, 12, 27, .90); backdrop-filter: blur(5px); }
#lightbox img { width: 100%; max-height: 91vh; object-fit: contain; border-radius: 10px; background: white; }
#lightbox button { position: fixed; top: 18px; right: 23px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: white; background: rgba(0,0,0,.35); cursor: pointer; font-size: 27px; }

@media (max-width: 980px) {
  .site-header nav { display: none; }
  .hero h1 { white-space: normal; }
  h2.section-title, h3.section-title { white-space: normal; }
  .section-pad { padding-block: 76px; }
  .contribution-grid { grid-template-columns: 1fr; }
  .contribution-grid article + article { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .objective-strip, .discriminator-block { grid-template-columns: 1fr; }
  .objective-strip { gap: 13px; }
  .discriminator-block { gap: 34px; }
  .discriminator-figure img { max-height: 720px; }
  .comparison-header { grid-template-columns: 1fr; }
  .sync-controls { min-width: 0; }
  .comparison-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .more-carousel { grid-auto-columns: minmax(300px, 66%); }
}

@media (max-width: 680px) {
  .section-shell, .section-shell.narrow { width: min(100% - 24px, 1240px); }
  .site-header { height: 58px; padding-inline: 14px; }
  .wordmark img { height: 34px; }
  .hero { padding-top: 58px; }
  .hero h1 br { display: none; }
  .hero-reel { grid-template-columns: 1fr; }
  .hero-video:nth-child(n+3) { display: none; }
  .section-pad { padding-block: 60px; }
  .abstract-copy { font-size: 18px; }
  .result-panel, .video-case-panel { padding: 13px; border-radius: 13px; }
  .table-heading { align-items: flex-start; }
  .comparison-grid.cols-5, .comparison-grid.cols-3, .comparison-grid.cols-2 { grid-template-columns: 1fr; }
  .sync-controls { grid-template-columns: auto auto auto 1fr; }
  .sync-time { display: none; }
  .more-heading { display: block; }
  .carousel-controls { margin-top: 18px; }
  .more-carousel { grid-auto-columns: 88%; }
  footer .section-shell { display: block; }
  footer span { display: block; margin-top: 4px; }
}

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