:root {
  --ink: #13243a;
  --ink-soft: #425166;
  --paper: #f7f3ea;
  --paper-deep: #eee8dc;
  --white: #fffdf8;
  --sun: #f5a623;
  --sun-deep: #b95f16;
  --sky: #0f7890;
  --mint: #dce9df;
  --line: rgba(19, 36, 58, 0.16);
  --shadow: 0 24px 70px rgba(19, 36, 58, 0.1);
  --radius: 24px;
  --shell: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.narrow { max-width: 940px; }
.section { padding: 112px 0; scroll-margin-top: 72px; }
.skip-link { position: fixed; z-index: 100; top: -60px; left: 16px; padding: 10px 14px; background: var(--ink); color: white; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  background: rgba(247, 243, 234, 0.86);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(16px);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 6px 30px rgba(19, 36, 58, 0.06); }
.nav { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.025em; }
.brand-mark { width: 20px; height: 20px; border: 5px solid var(--sun); border-radius: 50%; box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink-soft); font-size: .84rem; font-weight: 700; text-decoration: none; }
.nav-links a:hover { color: var(--sun-deep); }
.nav-toggle { display: none; border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: 7px 13px; color: var(--ink); font-weight: 700; }

.hero {
  position: relative;
  min-height: 100svh;
  padding-top: 70px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 22%, rgba(245,166,35,.2), transparent 18%),
    linear-gradient(145deg, #fbf8f1 0%, var(--paper) 55%, #e5ece7 100%);
}
.hero::before { content: ""; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(19,36,58,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(19,36,58,.08) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
.hero-inner { position: relative; z-index: 2; padding: 100px 0 76px; text-align: center; }
.conference-tag, .eyebrow { color: var(--sun-deep); font-family: "DM Mono", monospace; font-size: .77rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; }
.conference-tag { display: inline-block; margin: 0 0 24px; padding: 8px 14px; border: 1px solid rgba(185,95,22,.28); border-radius: 999px; background: rgba(255,253,248,.7); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 1040px; margin: 0 auto 28px; font-size: clamp(2.5rem, 5.1vw, 4.9rem); line-height: 1.01; letter-spacing: -.06em; overflow-wrap: anywhere; }
h2 { margin-bottom: 24px; font-size: clamp(2.2rem, 4.2vw, 4.4rem); line-height: 1.03; letter-spacing: -.055em; }
h3 { letter-spacing: -.03em; }
.hero-deck { max-width: 820px; margin: 0 auto 30px; color: var(--ink-soft); font-size: clamp(1rem, 1.8vw, 1.3rem); }
.authors { max-width: 930px; margin: 0 auto 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-weight: 700; }
.authors span:not(:last-child)::after { content: "·"; position: relative; left: 10px; color: var(--sun-deep); }
.authors a { color: var(--sky); text-decoration: none; text-underline-offset: 3px; }
.authors a:hover { text-decoration: underline; }
.affiliation { color: var(--ink-soft); font-size: .9rem; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 134px; padding: 12px 19px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: white; font-size: .9rem; font-weight: 800; text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease; }
.button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button[href*="github.com"] svg { fill: currentColor; stroke: none; }
.button:hover:not(.disabled) { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(19,36,58,.12); }
.button.primary { background: var(--ink); color: white; }
.button.disabled { color: var(--ink); background: rgba(255,253,248,.5); opacity: .45; cursor: not-allowed; border-style: dashed; }
.sun-orbit { position: absolute; z-index: 1; width: 460px; height: 460px; border: 1px solid rgba(19,36,58,.13); border-radius: 50%; right: -170px; top: 90px; animation: spin 22s linear infinite; }
.sun-orbit span { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); left: 48px; top: 43px; box-shadow: 0 0 50px rgba(245,166,35,.75); }
@keyframes spin { to { transform: rotate(360deg); } }
.conference-strip { position: relative; z-index: 2; border-top: 1px solid var(--line); background: rgba(255,253,248,.68); }
.strip-grid { min-height: 116px; display: grid; grid-template-columns: repeat(3, 1fr) auto; align-items: center; gap: 30px; }
.strip-grid small { display: block; color: var(--ink-soft); font-family: "DM Mono", monospace; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; }
.strip-grid strong { font-size: .95rem; }
.strip-grid > a { color: var(--sun-deep); font-size: .85rem; font-weight: 800; text-decoration: none; }

.eyebrow { margin-bottom: 14px; }
.lead { color: var(--ink-soft); font-size: clamp(1.1rem, 2vw, 1.36rem); line-height: 1.55; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .7fr); gap: 80px; align-items: end; margin-bottom: 48px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { margin-bottom: 6px; color: var(--ink-soft); }
.contract-section, .erf-section { background: var(--ink); color: var(--white); }
.contract-section .eyebrow, .erf-section .eyebrow { color: #ffc65f; }
.contract-section .section-heading > p, .erf-section .section-heading > p { color: #b9c4d1; }
.architecture-figure { margin: 0; }
figcaption { margin-top: 10px; color: var(--ink-soft); font-size: .75rem; text-align: center; }
.variable-card { display: grid; grid-template-columns: .55fr 1fr 1.4fr; gap: 30px; align-items: center; margin-bottom: 16px; padding: 30px; border: 1px solid rgba(245,166,35,.4); border-radius: 22px; background: linear-gradient(120deg, rgba(245,166,35,.18), rgba(255,255,255,.06)); }
.variable-card span { color: #ffc65f; font-family: "DM Mono", monospace; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.variable-card strong { font-size: 1.25rem; }
.variable-card p { margin: 0; color: #c5cfda; font-size: .82rem; }
.fixed-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fixed-list article { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 22px; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.055); }
.fixed-list span { color: #ffc65f; font-family: "DM Mono", monospace; }
.fixed-list strong { display: block; margin-bottom: 3px; }
.fixed-list p { margin: 0; color: #b9c4d1; font-size: .87rem; line-height: 1.5; }
.architecture-figure { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.architecture-figure img { border-radius: 12px; }

.results-section { background: #e7eee8; }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.score-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,253,248,.7); }
.score-card p { margin-bottom: 24px; color: var(--ink-soft); font-family: "DM Mono", monospace; font-size: .72rem; text-transform: uppercase; }
.score-card strong { display: block; font-size: clamp(2.7rem, 5vw, 4.5rem); line-height: 1; letter-spacing: -.06em; }
.score-card > span { color: var(--ink-soft); font-size: .75rem; }
.score-card footer { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 800; }
.score-card.accent { background: var(--ink); color: white; }
.score-card.accent p, .score-card.accent > span { color: #bdc8d5; }
.score-card.warning { background: #f4c46e; }
.pareto-panel { display: grid; grid-template-columns: minmax(210px, .42fr) minmax(0, 1fr); gap: 30px; margin-bottom: 32px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.panel-copy { align-self: center; }
.panel-copy h3 { margin-bottom: 12px; font-size: 1.8rem; }
.panel-copy p:last-child { color: var(--ink-soft); font-size: .85rem; }
.pareto-chart-wrap { position: relative; min-width: 0; }
#pareto-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: rgba(19,36,58,.12); stroke-width: 1; }
.chart-axis { stroke: var(--ink); stroke-width: 1.5; }
.chart-label { fill: var(--ink-soft); font: 12px "DM Mono", monospace; }
.chart-axis-title { fill: var(--ink); font: 600 13px "Manrope", sans-serif; }
.chart-best-line { stroke: var(--sun-deep); stroke-width: 1.5; stroke-dasharray: 7 6; }
.chart-point { stroke: white; stroke-width: 2.5; cursor: crosshair; transition: r 140ms ease, opacity 140ms ease; }
.chart-point:hover, .chart-point:focus { r: 9; outline: none; }
.chart-tooltip { position: absolute; z-index: 3; pointer-events: none; opacity: 0; transform: translate(-50%, -115%); padding: 8px 10px; border-radius: 9px; background: var(--ink); color: white; font-size: .7rem; box-shadow: 0 8px 24px rgba(19,36,58,.2); transition: opacity 100ms ease; white-space: nowrap; }
.chart-tooltip.visible { opacity: 1; }
.chart-legend { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .7rem; font-weight: 700; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; }
.results-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 30px; border-bottom: 1px solid var(--line); }
.table-toolbar h3, .table-toolbar p { margin: 0; }
.table-toolbar p { color: var(--ink-soft); font-size: .8rem; }
.segmented { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-deep); }
.segmented button { border: 0; border-radius: 999px; padding: 7px 16px; background: transparent; color: var(--ink-soft); font-size: .78rem; font-weight: 800; cursor: pointer; }
.segmented button.active { background: var(--ink); color: white; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.results-table { min-width: 740px; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.results-table th { color: var(--ink-soft); background: #f3efe7; font-family: "DM Mono", monospace; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.results-table th:first-child, .results-table td:first-child { padding-left: 30px; text-align: left; font-weight: 800; }
.results-table td:nth-child(2) { font-family: "DM Mono", monospace; }
.results-table tbody tr:hover { background: rgba(245,166,35,.08); }
.results-table tbody tr.baseline-row { background: #f3efe7; }
.results-table tbody tr.rank-1 { background: rgba(245,166,35,.2); }
.results-table tbody tr.rank-2 { background: rgba(153,166,181,.18); }
.results-table tbody tr.rank-3 { background: rgba(185,95,22,.1); }
.results-table tbody tr.rank-1 td:nth-last-child(2)::after,
.results-table tbody tr.rank-2 td:nth-last-child(2)::after,
.results-table tbody tr.rank-3 td:nth-last-child(2)::after { margin-left: 7px; font-family: "DM Mono", monospace; font-size: .6rem; vertical-align: middle; }
.results-table tbody tr.rank-1 td:nth-last-child(2)::after { content: "#1"; color: #8d5700; }
.results-table tbody tr.rank-2 td:nth-last-child(2)::after { content: "#2"; color: #596576; }
.results-table tbody tr.rank-3 td:nth-last-child(2)::after { content: "#3"; color: #9a5017; }
.table-note { margin: 0; padding: 17px 30px; color: var(--ink-soft); background: #f3efe7; font-size: .75rem; }
.secondary-panel { display: grid; grid-template-columns: .55fr 1fr; gap: 30px; margin-top: 32px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,248,.72); }
.secondary-panel h3 { margin: 0; font-size: 1.65rem; }
.secondary-table { min-width: 590px; font-variant-numeric: tabular-nums; }
.secondary-table th, .secondary-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; font-size: .78rem; }
.secondary-table th { color: var(--ink-soft); font-family: "DM Mono", monospace; font-size: .65rem; text-transform: uppercase; }
.secondary-table th:first-child, .secondary-table td:first-child, .secondary-table th:nth-child(2), .secondary-table td:nth-child(2) { text-align: left; }
.secondary-table td:nth-child(2) { font-weight: 800; }

.repro-wrap { max-width: 1080px; margin: auto; }
.repro-wrap > .lead { max-width: 940px; }
.repro-table-wrap { margin-top: 30px; overflow-x: auto; }
.repro-table { min-width: 720px; font-size: .9rem; }
.repro-table th, .repro-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.repro-table th { width: 18%; font-weight: 800; white-space: nowrap; }
.repro-table td { width: 32%; color: var(--ink-soft); }
.split-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 42px; }
.split-cards article { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
.split-cards span { display: block; color: var(--sun-deep); font-family: "DM Mono", monospace; font-size: .72rem; text-transform: uppercase; }
.split-cards strong { font-size: 1.05rem; }
.split-cards dl { display: grid; grid-template-columns: 1fr auto; margin: 0; color: var(--ink-soft); font-size: .8rem; }
.split-cards dt, .split-cards dd { margin: 0; }
.split-cards dd { color: var(--ink); font-family: "DM Mono", monospace; }

.erf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.erf-grid figure { margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: white; }
.erf-grid img { width: 100%; }
.erf-grid figcaption { margin: 0; padding: 12px; color: white; background: var(--ink); font-weight: 700; }
.citation-box { position: relative; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink); color: #e9eef4; }
.citation-box pre { overflow-x: auto; margin: 0; font: .76rem/1.65 "DM Mono", monospace; white-space: pre; }
.copy-button { position: absolute; top: 16px; right: 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 7px 12px; background: rgba(255,255,255,.08); color: white; cursor: pointer; font-size: .7rem; font-weight: 800; }
.footer { padding: 36px 0; background: #0c1a2b; color: #b8c3cf; }
.footer .shell { display: flex; justify-content: space-between; gap: 24px; }
.footer p { margin: 0; }
.footer div div { display: flex; flex-wrap: wrap; gap: 20px; }
.footer div div span { font-size: .8rem; opacity: .55; }
.footer a { color: white; font-size: .8rem; text-decoration: none; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } .sun-orbit { animation: none; } }

@media (max-width: 900px) {
  .section { padding: 84px 0; }
  .section-heading { grid-template-columns: 1fr; gap: 28px; }
  .variable-card { grid-template-columns: 1fr; gap: 8px; }
  .pareto-panel, .secondary-panel { grid-template-columns: 1fr; }
  .chart-legend { grid-column: 1; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .score-card:last-child { grid-column: 1 / -1; }
  .erf-grid { grid-template-columns: 1fr 1fr; }
  .strip-grid { grid-template-columns: 1fr 1fr; padding-block: 24px; }
}

@media (max-width: 680px) {
  :root { --shell: min(calc(100% - 28px), 1180px); }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 62px; right: 14px; width: min(260px, calc(100% - 28px)); padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; gap: 5px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 8px; }
  .hero-inner { padding-top: 76px; }
  h1 { width: 100%; font-size: clamp(2rem, 10.5vw, 2.8rem); letter-spacing: -.05em; word-break: break-word; }
  .hero-deck { font-size: .96rem; }
  .authors span::after { display: none; }
  .strip-grid { grid-template-columns: 1fr; gap: 14px; }
  .fixed-list { grid-template-columns: 1fr; }
  .score-grid, .split-cards { grid-template-columns: 1fr; }
  .score-card:last-child { grid-column: auto; }
  .split-cards article { grid-template-columns: 1fr; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .erf-grid { grid-template-columns: 1fr; }
  .footer .shell { flex-direction: column; }
  .repro-table { min-width: 0; }
  .repro-table, .repro-table tbody, .repro-table tr, .repro-table th, .repro-table td { display: block; width: 100%; }
  .repro-table tr { display: grid; grid-template-columns: 1fr 1.4fr; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .repro-table th, .repro-table td { border: 0; padding: 4px 8px; }
}
