/* DN-MOPD project page, p5_landing: modern landing style.
   Palette follows the paper figures: DN-MOPD teal #148F86, math gold #C58A24, code blue #3E83B5, IF purple #9271B4, ink navy #173B5B. */

:root {
  --bg: #FAFBFC;
  --bg-alt: #F3F6F9;
  --surface: #FFFFFF;
  --surface-2: #F4F7FA;
  --surface-3: #E7EDF3;
  --border: #E1E8EF;
  --border-soft: #EDF1F5;
  --border-strong: #C9D4DF;
  --heading: #112B45;
  --text: #2A3F55;
  --text-2: #43576C;
  --muted: #56697D;
  --teal: #148F86;
  --teal-ink: #0D6F67;
  --teal-wash: rgba(20, 143, 134, .09);
  --gold: #C58A24;
  --gold-ink: #85590C;
  --gold-wash: rgba(197, 138, 36, .10);
  --blue: #3E83B5;
  --blue-ink: #2A628E;
  --blue-wash: rgba(62, 131, 181, .10);
  --purple: #9271B4;
  --purple-ink: #674A8C;
  --purple-wash: rgba(146, 113, 180, .11);
  --if-soft: #C4B2DA;
  --c16: #3063B0;
  --c8: #14968B;
  --whisker: #15202B;
  --ring: #FFFFFF;
  --grid: #E6ECF2;
  --axis: #8FA0B2;
  --btn-bg: #0E756D;
  --btn-bg-hover: #0A625B;
  --btn-fg: #FFFFFF;
  --nav-bg: rgba(250, 251, 252, .72);
  --nav-border: rgba(17, 43, 69, .08);
  --pill-bg: rgba(255, 255, 255, .72);
  --code-bg: #0E1C2A;
  --code-fg: #D5E1EC;
  --code-dim: #8EA4B9;
  --code-border: #0E1C2A;
  --algo-bg: #0F2438;
  --algo-fg: #DCE7F1;
  --algo-muted: #A3B8CC;
  --algo-border: #0F2438;
  --algo-line: rgba(255, 255, 255, .10);
  --dn-row-bg: #EDF7F6;
  --dn-row-hover: #E1F1EF;
  --grp-bg: #F7F9FB;
  --row-hover: #F5F8FA;
  --tot-bg: rgba(17, 43, 69, .025);
  --tip-bg: #10263D;
  --tip-fg: #F2F6FA;
  --focus: #148F86;
  --gridline: rgba(17, 43, 69, .055);
  --a-teal: rgba(20, 143, 134, .30);
  --a-blue: rgba(62, 131, 181, .24);
  --a-purple: rgba(146, 113, 180, .20);
  --a-gold: rgba(197, 138, 36, .17);
  --shadow-sm: 0 1px 2px rgba(16, 38, 61, .06);
  --shadow: 0 1px 2px rgba(16, 38, 61, .05), 0 10px 28px -12px rgba(16, 38, 61, .16);
  --shadow-lg: 0 2px 6px rgba(16, 38, 61, .05), 0 30px 70px -28px rgba(16, 38, 61, .32);
  --sun-d: none;
  --moon-d: block;
  --font-display: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1200px;
  --gutter: 24px;
  --nav-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A131C;
    --bg-alt: #0D1822;
    --surface: #101D29;
    --surface-2: #152433;
    --surface-3: #1C2E40;
    --border: #1F3245;
    --border-soft: #1A2B3B;
    --border-strong: #2D4862;
    --heading: #EFF4F9;
    --text: #CFDBE6;
    --text-2: #B2C2D2;
    --muted: #92A6BA;
    --teal: #2FB5A7;
    --teal-ink: #62D5C7;
    --teal-wash: rgba(47, 181, 167, .12);
    --gold: #E0AE55;
    --gold-ink: #EEC784;
    --gold-wash: rgba(224, 174, 85, .10);
    --blue: #6FA8D6;
    --blue-ink: #96C2E6;
    --blue-wash: rgba(111, 168, 214, .12);
    --purple: #B39BDC;
    --purple-ink: #CDBBEE;
    --purple-wash: rgba(179, 155, 220, .12);
    --if-soft: #6B5A8E;
    --c16: #6C8FE6;
    --c8: #26A596;
    --whisker: #EAF1F7;
    --ring: #101D29;
    --grid: #1E3044;
    --axis: #4F6780;
    --btn-bg: #2FB5A7;
    --btn-bg-hover: #4BC7BA;
    --btn-fg: #03211E;
    --nav-bg: rgba(10, 19, 28, .72);
    --nav-border: rgba(255, 255, 255, .07);
    --pill-bg: rgba(16, 29, 41, .72);
    --code-bg: #0B1620;
    --code-fg: #D5E1EC;
    --code-dim: #8EA4B9;
    --code-border: #1F3245;
    --algo-bg: #0C1822;
    --algo-fg: #DCE7F1;
    --algo-muted: #A3B8CC;
    --algo-border: #1F3245;
    --algo-line: rgba(255, 255, 255, .08);
    --dn-row-bg: #132C36;
  --dn-row-hover: #173541;
    --grp-bg: #122130;
    --row-hover: #14222F;
    --tot-bg: rgba(255, 255, 255, .022);
    --tip-bg: #EFF4F9;
    --tip-fg: #0B1620;
    --focus: #62D5C7;
    --gridline: rgba(255, 255, 255, .045);
    --a-teal: rgba(47, 181, 167, .26);
    --a-blue: rgba(111, 168, 214, .20);
    --a-purple: rgba(179, 155, 220, .17);
    --a-gold: rgba(224, 174, 85, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 30px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .25), 0 34px 80px -30px rgba(0, 0, 0, .75);
    --sun-d: block;
    --moon-d: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0A131C;
  --bg-alt: #0D1822;
  --surface: #101D29;
  --surface-2: #152433;
  --surface-3: #1C2E40;
  --border: #1F3245;
  --border-soft: #1A2B3B;
  --border-strong: #2D4862;
  --heading: #EFF4F9;
  --text: #CFDBE6;
  --text-2: #B2C2D2;
  --muted: #92A6BA;
  --teal: #2FB5A7;
  --teal-ink: #62D5C7;
  --teal-wash: rgba(47, 181, 167, .12);
  --gold: #E0AE55;
  --gold-ink: #EEC784;
  --gold-wash: rgba(224, 174, 85, .10);
  --blue: #6FA8D6;
  --blue-ink: #96C2E6;
  --blue-wash: rgba(111, 168, 214, .12);
  --purple: #B39BDC;
  --purple-ink: #CDBBEE;
  --purple-wash: rgba(179, 155, 220, .12);
  --if-soft: #6B5A8E;
  --c16: #6C8FE6;
  --c8: #26A596;
  --whisker: #EAF1F7;
  --ring: #101D29;
  --grid: #1E3044;
  --axis: #4F6780;
  --btn-bg: #2FB5A7;
  --btn-bg-hover: #4BC7BA;
  --btn-fg: #03211E;
  --nav-bg: rgba(10, 19, 28, .72);
  --nav-border: rgba(255, 255, 255, .07);
  --pill-bg: rgba(16, 29, 41, .72);
  --code-bg: #0B1620;
  --code-fg: #D5E1EC;
  --code-dim: #8EA4B9;
  --code-border: #1F3245;
  --algo-bg: #0C1822;
  --algo-fg: #DCE7F1;
  --algo-muted: #A3B8CC;
  --algo-border: #1F3245;
  --algo-line: rgba(255, 255, 255, .08);
  --dn-row-bg: #132C36;
  --dn-row-hover: #173541;
  --grp-bg: #122130;
  --row-hover: #14222F;
  --tot-bg: rgba(255, 255, 255, .022);
  --tip-bg: #EFF4F9;
  --tip-fg: #0B1620;
  --focus: #62D5C7;
  --gridline: rgba(255, 255, 255, .045);
  --a-teal: rgba(47, 181, 167, .26);
  --a-blue: rgba(111, 168, 214, .20);
  --a-purple: rgba(179, 155, 220, .17);
  --a-gold: rgba(224, 174, 85, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 12px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .25), 0 34px 80px -30px rgba(0, 0, 0, .75);
  --sun-d: block;
  --moon-d: none;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
/* merge (p5_all): the text measures below were 58ch / 70ch / 52ch / 74ch. Chrome resolved ch with the fallback font and
   re-resolved it late (on the next document-wide style change), so a lede could re-wrap by a line during a smooth jump
   and the jump landed ~30px off. They are now the same widths in em (Inter: 1ch = 0.6138em), which do not depend on
   when the fonts arrive. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { color: var(--heading); margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
b, strong { font-weight: 650; }
sup { font-size: .68em; line-height: 0; position: relative; top: -.1em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
section[id], figure[id], #abstract { scroll-margin-top: calc(var(--nav-h) + 16px); }

.skip {
  position: absolute; left: 16px; top: 10px; z-index: 100; transform: translateY(-200%);
  background: var(--surface); color: var(--heading); padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong);
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--nav-border); }
.nav-inner {
  height: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-logo { width: 26px; height: 26px; display: block; flex: none; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  color: var(--text-2); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: color .15s, background-color .15s;
}
.nav-links a:hover { color: var(--heading); background: var(--surface-3); }
.nav-links a.active { color: var(--heading); background: var(--surface-3); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  list-style: none; padding: 0;
}
.icon-btn:hover { color: var(--heading); border-color: var(--border-strong); }
.icon-btn::-webkit-details-marker { display: none; }
.theme-toggle .i-sun { display: var(--sun-d); }
.theme-toggle .i-moon { display: var(--moon-d); }
.menu { display: none; position: relative; }
.menu > summary { list-style: none; }
.menu[open] > summary { background: var(--surface-3); color: var(--heading); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 200px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: grid;
}
.menu-panel a { padding: 10px 12px; border-radius: 9px; color: var(--heading); text-decoration: none; font-weight: 500; }
.menu-panel a:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 11px; font-family: var(--font-body); font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; border: 1px solid transparent; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn svg { flex: none; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn-primary {
  background: var(--btn-bg); color: var(--btn-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 20px -10px rgba(20, 143, 134, .8);
}
.btn-primary:hover { background: var(--btn-bg-hover); transform: translateY(-1px); text-decoration: none; }
.btn-ghost { background: var(--pill-bg); color: var(--heading); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--axis); transform: translateY(-1px); }
.btn.is-disabled { cursor: not-allowed; color: var(--muted); border-style: dashed; background: transparent; }
.btn.is-disabled:hover { transform: none; border-color: var(--border-strong); }
.soon {
  font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 3px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
}

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: 0 0 24px; isolation: isolate; }
.aurora { position: absolute; inset: 0 0 auto 0; height: 900px; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; }
.aurora .a1 { width: 760px; height: 620px; left: -220px; top: -260px; background: radial-gradient(closest-side, var(--a-teal), transparent); }
.aurora .a2 { width: 720px; height: 600px; right: -240px; top: -220px; background: radial-gradient(closest-side, var(--a-blue), transparent); }
.aurora .a3 { width: 560px; height: 480px; right: 6%; top: 260px; background: radial-gradient(closest-side, var(--a-purple), transparent); }
.aurora .a4 { width: 560px; height: 440px; left: 10%; top: 330px; background: radial-gradient(closest-side, var(--a-gold), transparent); }
@media (prefers-reduced-motion: no-preference) {
  .aurora .a1 { animation: drift1 26s ease-in-out infinite alternate; }
  .aurora .a2 { animation: drift2 30s ease-in-out infinite alternate; }
  .aurora .a3 { animation: drift1 34s ease-in-out infinite alternate-reverse; }
  .aurora .a4 { animation: drift2 28s ease-in-out infinite alternate-reverse; }
}
@keyframes drift1 { to { transform: translate3d(60px, 40px, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-50px, 30px, 0) scale(1.06); } }
.hero-grid {
  position: absolute; inset: 0 0 auto 0; height: 760px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--gridline) 1px, transparent 1px), linear-gradient(90deg, var(--gridline) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 28%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 28%, #000 25%, transparent 78%);
}
.hero-inner { padding-top: 84px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.eyebrow-pill {
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2);
  background: var(--pill-bg); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.eyebrow-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-wash); }
.eyebrow-pill .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--axis); }
.display {
  margin-top: 26px; max-width: 1120px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.1rem, 1.05rem + 3.9vw, 4.15rem);
  line-height: 1.04; letter-spacing: -.032em;
  text-wrap: balance;
}
.display .nw { white-space: nowrap; }
.display .grad {
  background: linear-gradient(95deg, var(--teal-ink) 5%, var(--blue-ink) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  margin-top: 24px; max-width: 35.6em; font-size: clamp(1.07rem, .98rem + .45vw, 1.3rem); line-height: 1.55;
  color: var(--text-2); text-wrap: balance;
}
.lede strong { color: var(--heading); font-weight: 600; }
.authors {
  margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  font-size: 1.02rem; font-weight: 550; color: var(--heading); max-width: 820px;
}
.authors sup { color: var(--teal-ink); font-weight: 600; margin-left: 1px; }
.authors a.author-link { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 4px; transition: text-decoration-color .15s; }
.authors a.author-link:hover, .authors a.author-link:focus-visible { text-decoration-color: currentColor; }
.affils { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; font-size: .92rem; color: var(--muted); }
.affils sup { color: var(--teal-ink); font-weight: 600; margin-right: 2px; }
.cta { margin-top: 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* floating figure cards */
.float-card {
  margin: 64px 0 0; padding: 10px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.float-card.teaser { margin-top: 64px; }
.float-card.mid { max-width: 1040px; margin-left: auto; margin-right: auto; }
.fig-white { background: #FFFFFF; border-radius: 14px; padding: clamp(10px, 2vw, 22px); border: 1px solid #EEF2F6; }
.fig-white img { width: 100%; height: auto; }
.float-card figcaption { padding: 14px 12px 6px; font-size: .92rem; line-height: 1.55; color: var(--text-2); }
.float-card figcaption b { color: var(--heading); font-weight: 600; }
.fig-open { font-weight: 600; white-space: nowrap; margin-left: 4px; text-decoration: none; }
.fig-open:hover { text-decoration: underline; }
.fig-tag, .t-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .02em;
  color: var(--teal-ink); background: var(--teal-wash); padding: 2px 8px; border-radius: 6px; margin-right: 6px;
  vertical-align: 1px; white-space: nowrap;
}

/* ------------------------------------------------------------------ sections */
.section { padding: 120px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-alt + .section-alt { border-top: 0; }
#overview { padding-top: 96px; }
.sec-head { max-width: 860px; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-ink);
}
.kicker span {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface);
}
.sec-head h2 {
  margin-top: 14px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.8rem, 1.15rem + 2.3vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance;
}
.sec-lede { margin-top: 18px; font-size: 1.12rem; line-height: 1.65; color: var(--text-2); max-width: 43em; }

/* ------------------------------------------------------------------ bento */
.bento { margin-top: 48px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 26px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.b-a { grid-column: span 7; grid-row: span 2; justify-content: space-between; gap: 20px;
  background: radial-gradient(90% 70% at 100% 0%, var(--purple-wash), transparent 62%), var(--surface); }
.b-b { grid-column: span 5; }
.b-f { grid-column: span 5; }
.b-c { grid-column: span 5; }
.b-d { grid-column: span 4; }
.b-e { grid-column: span 3; }
.card-accent {
  background: radial-gradient(110% 90% at 100% 0%, var(--teal-wash), transparent 62%), var(--surface);
  border-color: color-mix(in srgb, var(--teal) 35%, var(--border));
}
.card-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.kdot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.k-if { background: var(--purple); } .k-dn { background: var(--teal); } .k-math { background: var(--gold); } .k-code { background: var(--blue); }
.card-title { font-family: var(--font-display); font-weight: 650; font-size: 1.32rem; line-height: 1.22; letter-spacing: -.015em; }
.card-body { color: var(--text-2); font-size: .97rem; line-height: 1.6; }
.card-body.small { font-size: .9rem; }
.card-body strong { color: var(--heading); }
.card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: .86rem; color: var(--muted); line-height: 1.5; }

.big-stat { display: grid; gap: 10px; }
.big-num {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(3.2rem, 2rem + 4.4vw, 5.6rem);
  line-height: .95; letter-spacing: -.045em; color: var(--heading);
}
.big-num .unit { color: var(--purple-ink); margin-left: 2px; font-weight: 600; }
.big-note { color: var(--text-2); font-size: 1rem; max-width: 32em; }
.meter-block { display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.meter-title { font-size: .86rem; font-weight: 600; color: var(--text-2); }
.meter-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label val" "track track"; gap: 6px 12px; align-items: baseline; }
.meter-label { grid-area: label; font-size: .9rem; color: var(--text); }
.meter-val { grid-area: val; font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.meter-track { grid-area: track; height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 0 999px 999px 0; background: var(--purple); }
.meter-fill.soft { background: var(--if-soft); }
.mini-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-facts p { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--surface); }
.mf-num { font-family: var(--font-display); font-weight: 650; font-size: 1.3rem; color: var(--heading); letter-spacing: -.01em; }
.mf-txt { font-size: .86rem; color: var(--muted); line-height: 1.45; }

.formula {
  font-size: 1.12rem; padding: 14px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); color: var(--heading); text-align: center; overflow-x: auto; overflow-y: hidden;
}
.formula .katex-display { margin: 0; }
.eq-pair { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 2.4em; row-gap: 2px; }
.eq-pair > .tex-display { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.only-narrow { display: none; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.chips li {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2);
  padding: 6px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft);
}
.chips li::before {
  content: ""; width: 10px; height: 6px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg) translate(1px, -1px); display: inline-block;
}

.hero-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.hn {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.1rem, 1.4rem + 1.9vw, 3.05rem);
  letter-spacing: -.035em; line-height: 1;
  background: linear-gradient(95deg, var(--teal-ink), var(--blue-ink)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hn-unit { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--muted); }
.size-chips { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size-chips li { display: grid; gap: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.sc-size { font-size: 12px; font-weight: 600; color: var(--muted); }
.sc-val { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; color: var(--heading); font-variant-numeric: tabular-nums; }

/* range mini (seeds) */
.range-mini { display: grid; gap: 6px; }
.rm-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 104px; gap: 10px; align-items: center; min-height: 40px; }
.rm-size, .bm-size { font-family: var(--font-display); font-weight: 650; font-size: .98rem; color: var(--heading); }
.rm-track { position: relative; height: 24px; }
.rm-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid); }
.rm-track::after { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px; background: var(--axis); }
.rm-ci { position: absolute; top: 50%; height: 8px; transform: translateY(-50%); border-radius: 999px; background: color-mix(in srgb, var(--teal) 32%, transparent); }
.rm-dot { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface); }
.rm-val { text-align: right; line-height: 1.2; }
.rm-val b { display: block; font-family: var(--font-display); font-weight: 650; color: var(--heading); font-variant-numeric: tabular-nums; }
.rm-val small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rm-axis { display: grid; grid-template-columns: 30px minmax(0, 1fr) 104px; gap: 10px; }
.rm-ticks { grid-column: 2; position: relative; height: 16px; }
.rm-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rm-ticks span:first-child { transform: none; }

/* bars mini (math) */
.bars-mini { display: grid; gap: 10px; margin-top: 4px; }
.bm-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.bm-track { position: relative; height: 14px; border-left: 1px solid var(--axis); }
.bm-bar { display: block; height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; }
.bm-val { text-align: right; font-family: var(--font-display); font-weight: 650; color: var(--heading); font-variant-numeric: tabular-nums; }

/* abstract + contributions */
.abstract {
  margin-top: 88px; padding-top: 48px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px;
}
.side-label { font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; letter-spacing: -.01em; }
.side-label::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 3px; background: var(--teal); margin-bottom: 12px; }
.abstract-body p { font-size: 1.1rem; line-height: 1.78; color: var(--text); max-width: 45.4em; }
.contribs { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.contrib {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.contrib-n { font-family: var(--font-mono); font-size: 12.5px; color: var(--teal-ink); }
.contrib h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.14rem; line-height: 1.32; letter-spacing: -.01em; }
.contrib ul, .props, .lim ul, .facts { list-style: none; display: grid; gap: 8px; }
.contrib li, .props li, .lim li { position: relative; padding-left: 18px; font-size: .95rem; color: var(--text-2); line-height: 1.55; }
.contrib li::before, .props li::before, .lim li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--teal);
}

/* ------------------------------------------------------------------ method */
.float-card.wide { margin-top: 48px; }
.method-grid { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 20px; align-items: start; }
.eq-stack { display: grid; gap: 16px; min-width: 0; }
.eq-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px 24px; display: grid; gap: 12px; min-width: 0; }
.eq-dn {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--border));
  background: radial-gradient(100% 80% at 100% 0%, var(--teal-wash), transparent 60%), var(--surface);
}
.eq-step { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eq-step span {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; letter-spacing: 0;
  background: var(--surface-3); color: var(--heading);
}
.eq-dn .eq-step span { background: var(--teal); color: #fff; }
.eq-note { font-size: .96rem; color: var(--text-2); line-height: 1.65; }
.tex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 2px; color: var(--heading); font-size: 1.04rem; }
.tex-display .katex-display { margin: .2em 0; }
.props { margin-top: 2px; }

.algo {
  position: sticky; top: calc(var(--nav-h) + 20px); min-width: 0;
  background: var(--algo-bg); color: var(--algo-fg); border: 1px solid var(--algo-border); border-radius: 20px;
  padding: 24px; box-shadow: var(--shadow-lg);
}
.algo-head { display: grid; gap: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--algo-line); }
.algo-tag { font-family: var(--font-mono); font-size: 12px; color: #7FDCCF; letter-spacing: .02em; }
.algo h3 { color: #F3F7FB; font-family: var(--font-display); font-weight: 650; font-size: 1.2rem; letter-spacing: -.01em; }
.algo-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--algo-muted); margin-top: 4px; }
.lg-dn { width: 10px; height: 10px; border-radius: 3px; background: #2FB5A7; }
.steps { list-style: none; display: grid; gap: 2px; margin-top: 14px; counter-reset: none; }
.steps > li {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 9px 10px; border-radius: 10px; font-size: .95rem; line-height: 1.55; border-left: 2px solid transparent;
}
.steps > li.dn { background: rgba(47, 181, 167, .10); border-left-color: #2FB5A7; }
.sn {
  width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; margin-top: 1px;
  font-family: var(--font-mono); font-size: 12px; background: rgba(255, 255, 255, .08); color: var(--algo-fg);
}
.steps > li.dn .sn { background: #2FB5A7; color: #03211E; font-weight: 600; }
.steps ul { list-style: none; display: grid; gap: 4px; margin-top: 6px; }
.steps ul li { position: relative; padding-left: 14px; color: var(--algo-fg); }
.steps ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 1.5px; background: var(--algo-muted); }
.algo-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--algo-line); font-size: .88rem; color: var(--algo-muted); }

.practice { margin-top: 40px; }
.practice-h, .mini-h { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; letter-spacing: -.01em; }
.practice-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pd { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px 22px 20px 24px; display: grid; gap: 4px; overflow: hidden; }
.pd::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.pd-math::before { background: var(--gold); } .pd-code::before { background: var(--blue); } .pd-if::before { background: var(--purple); }
.pd-dom { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.pd-dom i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pd-math .pd-dom i { background: var(--gold); } .pd-code .pd-dom i { background: var(--blue); } .pd-if .pd-dom i { background: var(--purple); }
.pd-val { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: -.03em; color: var(--heading); }
.pd-txt { font-size: .92rem; color: var(--text-2); line-height: 1.55; }

/* ------------------------------------------------------------------ results */
.setup { margin-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; }
.setup-facts, .setup-bench { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; min-width: 0; }
.facts { margin-top: 12px; gap: 12px; }
.facts li { font-size: .95rem; color: var(--text-2); line-height: 1.6; }
.facts b { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.mini-h-gap { margin-top: 22px; }
.baselines { margin-top: 10px; gap: 8px; }
.baselines li { position: relative; padding-left: 18px; }
.baselines li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--axis); }
.dd { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: 1px; }
.dd-math { background: var(--gold); } .dd-code { background: var(--blue); } .dd-if { background: var(--purple); }

.chart-card { margin: 16px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.chart-title { margin-top: 8px; font-family: var(--font-display); font-weight: 650; font-size: 1.4rem; letter-spacing: -.015em; line-height: 1.25; }
.chart-sub { margin-top: 6px; font-size: .9rem; color: var(--muted); }

.gc { margin-top: 20px; }
.gc-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: var(--text-2); }
.gc-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.s16, .gc-bar.s16 { background: var(--c16); }
.sw.s8, .gc-bar.s8 { background: var(--c8); }
.wh { width: 18px; height: 12px; display: inline-block; border-left: 2px solid var(--whisker); border-right: 2px solid var(--whisker);
  background: linear-gradient(var(--whisker), var(--whisker)) center / 100% 2px no-repeat; }
.gc-plot { --sz: 44px; --cap: 36px; --val: 150px; --gap: 12px; position: relative; margin-top: 20px; }
.gc-grid { position: absolute; top: 0; bottom: 24px; left: calc(var(--sz) + var(--cap) + 2 * var(--gap)); right: calc(var(--val) + var(--gap)); pointer-events: none; }
.gc-grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.gc-grid i:first-child { background: var(--axis); }
.gc-group { padding: 6px 0; }
.gc-group + .gc-group { border-top: 1px dashed transparent; margin-top: 8px; }
.gc-row {
  position: relative; display: grid; grid-template-columns: var(--sz) var(--cap) minmax(0, 1fr) var(--val);
  column-gap: var(--gap); align-items: center; min-height: 40px; border-radius: 8px;
}
.gc-size { font-family: var(--font-display); font-weight: 650; font-size: 1.08rem; color: var(--heading); }
.gc-cap { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }
.gc-track { position: relative; height: 24px; }
.gc-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; transform-origin: left center; }
.gc-ci { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--whisker); box-shadow: 0 0 0 1.5px var(--ring); }
.gc-ci::before, .gc-ci::after { content: ""; position: absolute; top: -5px; width: 2px; height: 12px; background: var(--whisker); box-shadow: 0 0 0 1.5px var(--ring); }
.gc-ci::before { left: -1px; } .gc-ci::after { right: -1px; }
.gc-val { line-height: 1.25; }
.gc-val b { font-family: var(--font-display); font-weight: 650; font-size: 1.05rem; color: var(--heading); font-variant-numeric: tabular-nums; }
.gc-val small { margin-left: 6px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gc-tip {
  position: absolute; bottom: calc(100% + 8px); left: 0; width: 200px; z-index: 5;
  padding: 8px 10px; border-radius: 9px; background: var(--tip-bg); color: var(--tip-fg); font-size: 12px; line-height: 1.45;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.gc-tip b { display: block; font-weight: 600; margin-bottom: 1px; }
.gc-row:hover .gc-tip, .gc-row:focus-visible .gc-tip { opacity: 1; transform: none; }
.gc-row:hover, .gc-row:focus-visible { background: var(--row-hover); }
.gc-row:focus-visible { outline-offset: 1px; }
.gc-axis { display: grid; grid-template-columns: var(--sz) var(--cap) minmax(0, 1fr) var(--val); column-gap: var(--gap); margin-top: 6px; }
.gc-ticks { position: relative; height: 18px; }
.gc-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gc-axis-label { margin: 6px calc(150px + 12px) 0 calc(44px + 36px + 24px); text-align: center; font-size: 12.5px; color: var(--muted); }

.data-view { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.data-view summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--teal-ink); width: max-content; border-radius: 6px; }
.data-view[open] summary { margin-bottom: 4px; }

.two-up { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.two-up-uneven { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); margin-top: 48px; }
.two-up-uneven .dt th, .two-up-uneven .dt td { padding: 9px 12px; }
.two-up-uneven .dt tr.grp th { padding: 6px 12px; }
.table-card { margin: 16px 0 0; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 24px; min-width: 0; }
.two-up .table-card { margin-top: 0; }
.table-card.big { margin-top: 24px; }
.table-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.table-title .t-tag { margin-right: 0; }
.table-title h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.22rem; letter-spacing: -.01em; }
.table-lede { margin-top: 10px; font-size: .95rem; color: var(--text-2); }
.table-card figcaption { margin-top: 14px; font-size: .88rem; line-height: 1.55; color: var(--muted); }

.table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; -webkit-overflow-scrolling: touch; }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.dt .num, .dt .ci { font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }
.dt th, .dt td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border-soft); }
.dt thead th { background: var(--surface-2); font-size: 12.5px; font-weight: 600; color: var(--text-2); vertical-align: bottom; }
.dt thead tr:first-child th { border-bottom-color: var(--border); }
.dt thead th.cg { text-align: center; color: var(--heading); }
.dt thead th .sub { font-weight: 500; color: var(--muted); margin-left: 4px; font-family: var(--font-mono); font-size: 11px; }
.dt tbody th { font-weight: 500; color: var(--heading); }
.dt td { color: var(--text-2); }
.dt .num { text-align: right; }
.dt thead th.num { text-align: right; }
.dt .gsep { border-left: 1px solid var(--border); }
.dt td.tot, .dt th.tot { background: var(--tot-bg); }
.dt strong { font-weight: 700; color: var(--heading); }
.dt tbody tr:last-child th, .dt tbody tr:last-child td { border-bottom: 0; }
.dt tbody tr:hover th, .dt tbody tr:hover td { background: var(--row-hover); }
.dt tr.grp th {
  background: var(--grp-bg); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); padding: 7px 14px; border-bottom: 1px solid var(--border-soft);
}
.dt tr.dn-row th, .dt tr.dn-row td { background: var(--dn-row-bg); color: var(--heading); }
.dt tr.dn-row th:first-child { box-shadow: inset 3px 0 0 var(--teal); }
.dt tr.dn-row:hover th, .dt tr.dn-row:hover td { background: var(--dn-row-hover); }
/* sticky first column when a table scrolls sideways */
.dt thead th:first-child, .dt tbody tr:not(.grp) th:first-child { position: sticky; left: 0; z-index: 2; }
.dt tbody tr:not(.grp):not(.dn-row) th:first-child { background: var(--surface); }
.dt tbody tr:not(.grp):not(.dn-row):hover th:first-child { background: var(--row-hover); }
.dt tr.grp th span { position: sticky; left: 14px; }
.table-wrap.is-scrollable .dt thead th:first-child, .table-wrap.is-scrollable .dt tbody tr:not(.grp) th:first-child { box-shadow: 1px 0 0 var(--border); }
.table-wrap.is-scrollable .dt tr.dn-row th:first-child { box-shadow: inset 3px 0 0 var(--teal), 1px 0 0 var(--border); }
.scroll-hint { display: none; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.scroll-hint.on { display: block; }
.scroll-hint + .table-wrap { margin-top: 6px; }
.dn-name { display: inline-flex; align-items: center; gap: 8px; }
.dn-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); display: inline-block; }
.ours {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--teal-ink);
  background: var(--teal-wash); border: 1px solid color-mix(in srgb, var(--teal) 30%, transparent); padding: 1px 6px; border-radius: 999px;
}
.dt-compact th, .dt-compact td { padding: 8px 12px; }
.dt .ci { color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.dt .sub-line { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.dt td.mean b, .dt td b { color: var(--heading); font-weight: 600; }
.setup-bench .dt td { white-space: normal; min-width: 150px; }
.setup-bench .dt td:last-child { white-space: nowrap; min-width: 0; }

.stack { display: grid; grid-template-rows: auto 1fr; gap: 16px; min-width: 0; }
.callout-wide { margin-top: 16px; }
.callout { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px 24px; display: grid; gap: 8px; align-content: start; }
.callout h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; letter-spacing: -.01em; }
.callout p { font-size: .95rem; color: var(--text-2); line-height: 1.6; }
.callout p b { color: var(--heading); font-variant-numeric: tabular-nums; }
.callout-warn { background: linear-gradient(0deg, var(--gold-wash), var(--gold-wash)), var(--surface); border-color: color-mix(in srgb, var(--gold) 35%, var(--border)); }
.callout-warn h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 8px; vertical-align: 2px; }

/* ------------------------------------------------------------------ analysis */
#analysis .float-card { margin-top: 44px; }
#analysis .float-card + .float-card { margin-top: 24px; }
.mech { margin-top: 24px; max-width: 1040px; margin-left: auto; margin-right: auto; }
.mech-card {
  display: grid; gap: 10px; padding: 24px 26px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--purple) 30%, var(--border));
  background: radial-gradient(90% 120% at 0% 0%, var(--purple-wash), transparent 70%), var(--surface);
}
.mech-text { font-size: 1.08rem; line-height: 1.65; color: var(--text); }
.mech-text b { color: var(--heading); }
.block-h { margin-top: 64px; font-family: var(--font-display); font-weight: 650; font-size: 1.45rem; letter-spacing: -.015em; }
.controls { list-style: none; margin-top: 16px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.controls li { grid-column: span 2; }
.controls li:nth-child(n+4) { grid-column: span 3; }
.controls li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 20px; }
.controls h4 { font-size: 1rem; font-weight: 650; }
.controls p { margin-top: 4px; font-size: .93rem; color: var(--text-2); line-height: 1.55; }
.ctl-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.ic-neutral { background: var(--surface-3); color: var(--text-2); }
.ic-math { background: var(--gold-wash); color: var(--gold-ink); }
.ic-if { background: var(--purple-wash); color: var(--purple-ink); }
.ic-dn { background: var(--teal-wash); color: var(--teal-ink); }

/* ------------------------------------------------------------------ limitations */
.lim-grid { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.lim { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px; }
.lim h3 { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; margin-bottom: 14px; }
.lim li::before { background: var(--axis); }

/* ------------------------------------------------------------------ cite */
.cite-grid { margin-top: 36px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: stretch; }
.bib { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); min-width: 0; }
.bib-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.bib-dots { display: inline-flex; gap: 6px; }
.bib-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.bib-name { font-family: var(--font-mono); font-size: 12.5px; color: var(--code-dim); flex: 1; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  font: 600 13px var(--font-body); color: #E8F0F7; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
}
.copy-btn:hover { background: rgba(255, 255, 255, .14); }
.copy-btn.done { color: #7FDCCF; border-color: rgba(127, 220, 207, .45); }
.bib pre { margin: 0; padding: 20px 22px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; color: var(--code-fg); }
.bib pre:focus-visible { outline-offset: -3px; }
.copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.paper-card {
  display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 18px; padding: 16px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.paper-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); text-decoration: none; }
.paper-card img { border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.paper-meta { display: grid; gap: 6px; padding: 0 4px 0 0; }
.paper-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.paper-title { font-family: var(--font-display); font-weight: 650; font-size: 1.02rem; line-height: 1.32; color: var(--heading); }
.paper-go { margin-top: 4px; font-size: .9rem; font-weight: 600; color: var(--teal-ink); }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0 36px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; font-size: .9rem; color: var(--muted); }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--heading); font-weight: 600; }
.foot-brand .brand-logo { width: 22px; height: 22px; border-radius: 6px; }
.foot-sep { color: var(--muted); font-weight: 400; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-links a { color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--heading); text-decoration: underline; }

/* ------------------------------------------------------------------ KaTeX tweaks */
.katex { font-size: 1.06em; }
.tex .katex { white-space: nowrap; }
.algo .katex { color: var(--algo-fg); }

/* ------------------------------------------------------------------ reveal (JS adds .rv-on only when motion is allowed) */
@media (prefers-reduced-motion: no-preference) {
  html.rv-on .rv { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  html.rv-on .rv.in { opacity: 1; transform: none; }
  /* merge: scoped to .rv; the gains card (#dm-gains) is no longer a generic reveal, so its static fallback bars
     (shown only when the animated chart cannot load its data) must not wait for a reveal that never comes */
  html.rv-on .rv .gc-bar { transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .7, .2, 1) .15s; }
  html.rv-on .rv.in .gc-bar { transform: scaleX(1); }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .b-a { grid-column: span 6; grid-row: auto; }
  .b-b, .b-f { grid-column: span 3; }
  .b-c { grid-column: span 6; }
  .b-d, .b-e { grid-column: span 3; }
  .method-grid { grid-template-columns: minmax(0, 1fr); }
  .algo { position: static; }
  .contribs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls li, .controls li:nth-child(n+4) { grid-column: auto; }
  .controls li:last-child { grid-column: 1 / -1; }
  .setup, .two-up, .two-up-uneven, .lim-grid { grid-template-columns: minmax(0, 1fr); }
  .cite-grid { grid-template-columns: minmax(0, 1fr); }
  .paper-card { max-width: 560px; }
  .abstract { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .practice-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .menu { display: block; }
}
@media (max-width: 680px) {
  :root { --gutter: 16px; --nav-h: 58px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .b-a, .b-b, .b-f, .b-c, .b-d, .b-e { grid-column: auto; }
  .section { padding: 80px 0; }
  #overview { padding-top: 72px; }
  .hero-inner { padding-top: 52px; }
  .display { letter-spacing: -.03em; }
  .card { padding: 22px 20px; border-radius: 20px; }
  .mini-facts { grid-template-columns: minmax(0, 1fr); }
  .float-card { padding: 6px; border-radius: 18px; margin-top: 44px; }
  .float-card.teaser { margin-top: 44px; }
  .fig-white { border-radius: 12px; }
  .chart-card, .table-card { padding: 20px 16px; border-radius: 20px; }
  .gc-plot { --sz: 30px; --cap: 30px; --val: 96px; --gap: 8px; }
  .gc-val small { display: block; margin-left: 0; font-size: 11.5px; }
  .gc-row { min-height: 46px; }
  .controls { grid-template-columns: minmax(0, 1fr); }
  .controls li:last-child { grid-column: auto; }
  .controls li { padding: 16px; }
  .brand-name { font-size: 16px; }
  .btn { height: 42px; padding: 0 15px; font-size: 14.5px; }
  .cta { gap: 8px; }
  .eq-card { padding: 18px 16px; }
  .algo { padding: 20px 14px; }
  .steps > li { padding: 8px 8px; gap: 10px; }
  .paper-card { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; }
  .size-chips li { padding: 8px 10px; }
  .abstract { margin-top: 64px; padding-top: 36px; }
  .abstract-body p { font-size: 1.02rem; }
  .btn.btn-sm { height: 36px; padding: 0 13px; font-size: 14px; }
  .ep-brand { display: none; }
  .gc-axis-label { margin: 6px 0 0 calc(30px + 30px + 16px); text-align: left; }
  .dt .ci { display: block; margin-left: 0; }
  .dt { font-size: 13.5px; }
  .dt th, .dt td { padding: 8px 10px; }
  .dt tr.grp th { padding: 6px 10px; }
  .dt tr.grp th span { left: 10px; }
  .dt-compact th, .dt-compact td { padding: 7px 9px; }
  .tex-display { font-size: .95rem; }
  .only-narrow { display: block; }
  .only-wide { display: none; }
  .formula { padding: 12px 10px; }
}
@media (max-width: 400px) {
  .nav-actions .btn-sm { padding: 0 11px; }
  .eyebrow-pill { font-size: 12px; padding: 6px 12px; }
}

@media (forced-colors: active) {
  .gc-bar, .bm-bar, .meter-fill, .rm-dot { forced-color-adjust: none; }
}
@media print {
  .nav, .aurora, .hero-grid, .theme-toggle { display: none !important; }
  .rv { opacity: 1 !important; transform: none !important; }
}
