:root {
  --ink: #2a1a3a;
  --text: #413752;
  --muted: #736a83;
  --teal: #0f8a6c;
  --mint: #43c9a0;
  --mint-soft: #e5f7f0;
  --lav: #f5f1fb;
  --lav-2: #ebe4f6;
  --line: #e7e1ef;
  --coral: #e0645a;
  --gray: #8b8594;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: #fff; color: var(--text); font: 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); }
h2 { font: 500 clamp(1.9rem, 3.4vw, 2.7rem)/1.18 var(--serif); letter-spacing: -0.015em; max-width: 820px; }
h3 { font-size: 1.08rem; font-weight: 600; line-height: 1.4; }
p + p { margin-top: 0.9rem; }
sup { font-size: 0.68em; }
figure { margin: 0; }
figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 12px; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

.container { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.narrow { width: min(860px, calc(100% - 64px)); }
.section { padding-block: 96px; }
.tinted { background: linear-gradient(180deg, var(--lav) 0%, #fbf9fd 100%); }
.kicker { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; }
.lead { max-width: 780px; margin-top: 22px; font-size: 1.04rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 32px; padding: 12px 4vw; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: 0.06em; }
.wordmark img { width: 34px; height: 34px; }
.site-header nav { display: flex; gap: 28px; margin: auto; font-size: 0.9rem; }
.site-header nav a, .header-links a { color: var(--text); text-decoration: none; }
.site-header nav a:hover, .header-links a:hover { color: var(--teal); }
.header-links { display: flex; gap: 18px; font-size: 0.88rem; font-weight: 600; }

/* Hero */
.hero { text-align: center; padding-top: 56px; padding-bottom: 56px; }
.hero-logo { width: min(440px, 80%); margin: 0 auto 30px; }
.eyebrow { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin-bottom: 16px; }
.eyebrow.light { color: var(--teal); }
.hero h1 { font: 500 clamp(2rem, 4vw, 3.3rem)/1.14 var(--serif); letter-spacing: -0.025em; max-width: 1060px; margin: 0 auto; }
.subtitle { font: 400 clamp(1.25rem, 2.2vw, 1.7rem)/1.4 var(--serif); color: var(--text); margin: 14px 0 30px; }
.subtitle em { color: var(--teal); }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; max-width: 860px; margin: 0 auto; color: var(--ink); font-size: 1rem; }
.authors sup, .affiliations sup { color: var(--teal); margin-left: 1px; }
.affiliations { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 24px; margin-top: 10px; font-size: 0.9rem; }
.note { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.lab { display: inline-flex; align-items: center; gap: 9px; margin-top: 20px; padding: 6px 16px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #1a3d62; font-size: 0.85rem; line-height: 1; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.lab img { display: block; width: 24px; height: auto; flex: none; }
.lab strong { font-weight: 700; letter-spacing: 0.03em; }
.lab-sep { margin: 0 6px; color: #9aa5b4; }
.lab:hover { border-color: #6e88a8; box-shadow: 0 4px 14px rgba(26, 61, 98, 0.10); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 0.92rem; text-decoration: none; background: #fff; transition: border-color .15s, transform .15s; }
.btn:hover { border-color: var(--mint); transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #3a2651; }
.btn-icon { width: 18px; height: auto; margin-left: -4px; }
.btn.ghost { border-color: transparent; color: var(--teal); }

/* Central idea */
.idea { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 48px 52px; border-radius: 22px; background: linear-gradient(135deg, var(--lav) 0%, #f0faf6 100%); border: 1px solid var(--line); }
.idea h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 18px; }
.idea-text p:not(.eyebrow) { font-size: 0.98rem; }
.idea-math { display: flex; flex-direction: column; align-items: stretch; }
.eq-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px 14px; box-shadow: 0 6px 20px rgba(42, 26, 58, 0.06); }
.eq-card.accent { border-left: 4px solid var(--mint); }
.eq-card .katex-display { margin: 6px 0; }
.eq-card .katex { font-size: 1.12em; }
.eq-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.eq-note { display: block; font-size: 0.8rem; color: var(--muted); text-align: center; }
.eq-arrow { text-align: center; color: var(--mint); font-size: 1.4rem; line-height: 1; margin: 8px 0; }
.takeaways { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.takeaways li { display: flex; gap: 12px; font-size: 0.93rem; line-height: 1.55; }
.takeaways li span { font-size: 0.75rem; font-weight: 700; color: var(--teal); padding-top: 3px; }
.takeaways strong { color: var(--ink); }

.figure-wide { padding-top: 72px; }
.figure-wide img { border-radius: 12px; }
.figure-wide figcaption { text-align: center; max-width: 760px; margin-inline: auto; }

/* Grids */
.grid-2 > *, .grid-3 > *, .grid-4 > *, .idea > *, .explorer > *, .stat-block > *, .takeaways > * { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.figs { margin-top: 44px; align-items: end; }
.figs img { max-height: 380px; width: auto; margin-inline: auto; }

/* Stat table */
.stat-block { margin-top: 48px; display: grid; grid-template-columns: 280px 1fr; gap: 36px; align-items: start; padding-top: 36px; border-top: 1px solid var(--line); }
.stat-head p { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.02em; padding: 8px 14px; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.stat-table td, .stat-table th { white-space: nowrap; }
.stat-table td.hl { color: var(--teal); font-weight: 600; }

/* Explorer */
.explorer { margin-top: 44px; display: grid; grid-template-columns: 330px 1fr; gap: 36px; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(42, 26, 58, 0.06); }
.explorer-controls h3 { font-size: 1.15rem; }
.explorer-controls > p { margin-top: 4px; font-size: 0.9rem; }
.explorer label { display: block; margin-top: 22px; font-size: 0.9rem; font-weight: 500; color: var(--ink); }
.explorer output { float: right; font-weight: 600; color: var(--teal); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin-top: 10px; accent-color: var(--teal); }
.readout { margin: 24px 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.readout div { display: flex; justify-content: space-between; padding: 9px 14px; font-size: 0.9rem; }
.readout div + div { border-top: 1px solid var(--line); }
.readout strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.readout .cis { background: var(--mint-soft); }
.readout .cut { color: var(--coral); }
.explorer-plot svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.sw.cis { background: var(--teal); }
.sw.tis { background: var(--gray); }
.sw.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }

/* Cards */
.cards { margin-top: 32px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.95rem; }
pre { margin: 16px 0 0; padding: 16px 18px; background: #221531; color: #ece6f5; border-radius: 12px; font: 0.84rem/1.6 var(--mono); overflow-x: auto; }
pre .k { color: var(--mint); }
pre .c { color: #a79bb8; }

/* Results */
.table-wrap { margin-top: 36px; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.results th, .results td { padding: 14px 18px; }
.results thead th { background: #faf8fc; }
.results tbody tr:last-child td { border-bottom: 0; }
.results td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.results small { color: var(--muted); font-size: 0.8em; }
.results em { font-style: normal; font-size: 0.78rem; color: var(--muted); margin-left: 4px; }
.results .ours { background: var(--mint-soft); color: var(--ink); font-weight: 700; }
.results th.ours { color: var(--teal); }
.figure-block { margin-top: 48px; }
.more { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.more .grid-2 { margin: 22px 0 12px; }
.more p { font-size: 0.9rem; }

/* Resources */
.resource-cards { margin-top: 36px; }
.rcard { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.rcard:hover { border-color: var(--mint); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(42, 26, 58, 0.07); }
.rcard strong { color: var(--ink); font-size: 1.05rem; }
.rcard .muted { font-size: 0.88rem; line-height: 1.5; }
.with-icon { display: inline-flex; align-items: center; gap: 8px; }
.with-icon img { width: 20px; height: auto; }
.rtag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.use { margin-top: 20px; }
.use .card { display: flex; flex-direction: column; }
.use pre { flex: 1; }

/* Citation */
.bib { position: relative; }
.bib pre { margin-top: 0; padding-right: 90px; white-space: pre-wrap; }
#copy-bib { position: absolute; top: 12px; right: 12px; padding: 5px 14px; border-radius: 999px; border: 1px solid #4a3a5e; background: transparent; color: #ece6f5; font: 600 0.78rem var(--sans); cursor: pointer; }
#copy-bib:hover { border-color: var(--mint); color: var(--mint); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 0.84rem; color: var(--muted); }
.footer-lab { color: #1a3d62; font-weight: 600; text-decoration: none; white-space: nowrap; }
.footer-lab img { display: inline-block; height: 15px; width: auto; vertical-align: -2px; margin-right: 6px; }
.footer-lab:hover { text-decoration: underline; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero h1 br { display: none; }
  .site-header { gap: 12px; padding: 10px 18px; }
  .explorer { padding: 22px 18px; }
  .figs img { max-height: none; width: 100%; }
  .site-header nav { display: none; }
  .site-header { justify-content: space-between; }
  .idea, .explorer, .stat-block, .grid-2, .grid-3, .grid-4, .takeaways { grid-template-columns: 1fr; }
  .idea { padding: 32px 26px; gap: 28px; }
  .section { padding-block: 72px; }
  .container, .narrow { width: calc(100% - 36px); }
}
