:root {
  --ink: #18242d;
  --muted: #53636d;
  --faint: #718089;
  --line: #d7e0e4;
  --line-strong: #b7c7ce;
  --paper: #f7fafb;
  --surface: #ffffff;
  --blue: #176b87;
  --blue-dark: #0d4d63;
  --blue-soft: #e6f2f5;
  --green: #1d6a4a;
  --green-soft: #e5f4ec;
  --amber-soft: #fff3d9;
  --amber: #805b13;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); color: var(--ink); }

body {
  margin: 0;
  font-family: var(--sans);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--blue-dark); }
a:hover { color: var(--blue); }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .91em; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner, .footer-inner, .page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .01em;
}

nav { display: flex; align-items: center; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; font-size: .93rem; }
nav a:hover, nav a.active { color: var(--blue-dark); }
nav a.active { font-weight: 700; }

.page-shell { padding: 60px 0 90px; }

.hero { max-width: 880px; }
.eyebrow {
  color: var(--blue-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.3;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); letter-spacing: -.025em; margin: 0 0 18px; }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -.015em; margin: 0 0 18px; }
h3 { font-size: 1.35rem; margin: 0 0 8px; }

.lede { color: var(--muted); font-size: 1.1rem; max-width: 760px; margin: 0; }

.rule-callout {
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  margin: 34px 0 0;
  padding: 18px 22px 19px;
}
.callout-label { color: var(--blue-dark); display: block; font-size: .73rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
blockquote { margin: 6px 0 0; font-family: var(--serif); font-size: 1.08rem; }

.benchmark-meta {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 52px 0 76px;
  padding: 20px 0;
}
.benchmark-meta > div { display: flex; flex-direction: column; gap: 2px; }
.meta-label { color: var(--faint); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.section-heading { align-items: end; display: flex; justify-content: space-between; gap: 30px; margin-bottom: 22px; }
.section-heading .eyebrow { margin-bottom: 10px; }
.section-heading h2 { margin-bottom: 0; }
.sort-note { color: var(--muted); font-size: .86rem; margin: 0 0 4px; max-width: 350px; text-align: right; }

.dataset-group { margin: 0 0 48px; }
.dataset-title { align-items: baseline; display: flex; gap: 10px; margin: 0 0 12px; }
.dataset-title h3 { margin: 0; }
.dataset-title span { color: var(--faint); font-size: .85rem; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 14px 15px; text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: #f1f6f7; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { font-size: .91rem; }
tbody tr:hover { background: #fbfdfd; }
.strategy-cell { min-width: 245px; }
.strategy-cell a { display: block; font-family: var(--serif); font-size: 1.08rem; font-weight: 700; text-decoration: none; }
.entry-id { color: var(--faint); display: block; font-family: ui-monospace, monospace; font-size: .7rem; margin-top: 3px; }
.description-snippet { color: var(--muted); display: block; font-size: .82rem; line-height: 1.35; margin-top: 8px; max-width: 350px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sort-button { background: transparent; border: 0; color: inherit; cursor: pointer; font: inherit; letter-spacing: inherit; padding: 0; text-align: left; text-transform: inherit; }
.sort-button::after { color: var(--blue); content: " ↕"; font-size: .95em; }
.sort-button.sorted-asc::after { content: " ↑"; }
.sort-button.sorted-desc::after { content: " ↓"; }
.pareto { background: var(--green-soft); border-radius: 999px; color: var(--green); display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; padding: 4px 9px; white-space: nowrap; }
.pareto.no { background: var(--amber-soft); color: var(--amber); }

.definitions-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 54px; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.definition { background: var(--surface); padding: 18px 20px; }
.definition dt { font-family: var(--serif); font-size: 1.06rem; font-weight: 700; }
.definition dd { color: var(--muted); font-size: .91rem; margin: 5px 0 0; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { color: var(--faint); display: flex; font-size: .85rem; justify-content: space-between; gap: 20px; padding: 24px 0; }

.detail-page { padding-top: 46px; }
.back-link { display: inline-block; font-size: .9rem; margin-bottom: 34px; text-decoration: none; }
.detail-header { align-items: start; display: flex; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.detail-header h1 { font-size: clamp(2rem, 4vw, 3.25rem); margin-bottom: 13px; }
.detail-header .lede { font-size: 1rem; max-width: 810px; }
.detail-badge { flex: 0 0 auto; margin-top: 10px; }
.entry-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 22px 0 0; }
.fact { display: flex; flex-direction: column; min-width: 130px; }
.fact-label { color: var(--faint); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fact-value { font-variant-numeric: tabular-nums; }
.figure-panel { background: var(--surface); border: 1px solid var(--line); margin: 35px 0 45px; padding: 10px; }
.figure-panel img { display: block; height: auto; width: 100%; }
.figure-caption { color: var(--faint); font-size: .78rem; margin: 9px 5px 2px; }
.detail-block { margin: 0 0 44px; }
.detail-block h2 { font-size: 1.8rem; }
.selection-box { background: #eef3f4; border: 1px solid var(--line); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.65; margin: 0; overflow-wrap: anywhere; padding: 17px 19px; white-space: pre-wrap; }
.description { color: var(--muted); font-size: 1.02rem; max-width: 880px; }
.score-table-wrap { border: 1px solid var(--line); overflow-x: auto; }
.score-table th, .score-table td { font-size: .8rem; min-width: 118px; padding: 10px 12px; }
.score-table th:first-child, .score-table td:first-child { min-width: 190px; position: sticky; left: 0; }
.score-table th:first-child { z-index: 2; }
.score-table td:first-child { background: var(--surface); font-weight: 700; }
.score-table tbody tr:hover td:first-child { background: #fbfdfd; }
.score-table .group-row td { background: #f1f6f7; color: var(--blue-dark); font-family: var(--serif); font-size: 1rem; font-weight: 700; min-width: 0; position: static; }
.score-table .group-row:hover td { background: #f1f6f7; }
.gaussian-ref { color: var(--muted); display: block; font-size: .7rem; margin-top: 3px; white-space: nowrap; }
.table-footnote { color: var(--faint); font-size: .8rem; margin-top: 9px; }
.definitions-inline { border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 20px; padding-top: 18px; }
.definitions-inline div { padding: 7px 0; }
.definitions-inline dt { display: inline; font-family: var(--serif); font-weight: 700; }
.definitions-inline dd { color: var(--muted); display: inline; margin: 0; }

.about-intro { border-bottom: 1px solid var(--line); margin-bottom: 42px; padding-bottom: 36px; }
.about-intro h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); }
.markdown-content { max-width: 930px; }
.markdown-content h1 { border-bottom: 1px solid var(--line); font-size: 2.15rem; margin: 48px 0 18px; padding-bottom: 10px; }
.markdown-content h1:first-child { display: none; }
.markdown-content h2 { font-size: 1.7rem; margin: 42px 0 15px; }
.markdown-content h3 { font-size: 1.28rem; margin: 30px 0 12px; }
.markdown-content p { margin: 0 0 15px; }
.markdown-content ul, .markdown-content ol { margin: 0 0 18px; padding-left: 25px; }
.markdown-content li { margin: 4px 0; }
.markdown-content blockquote { border-left: 3px solid var(--line-strong); color: var(--muted); margin: 18px 0; padding: 2px 0 2px 17px; }
.markdown-content pre { background: #17262d; color: #edf6f7; font-size: .82rem; overflow-x: auto; padding: 18px; }
.markdown-content code { background: #edf3f4; border-radius: 2px; padding: 1px 4px; }
.markdown-content pre code { background: transparent; padding: 0; }
.markdown-content strong { color: var(--ink); }
.markdown-table { border: 1px solid var(--line); margin: 20px 0 26px; overflow-x: auto; }
.markdown-table table { min-width: 520px; }
.markdown-table th, .markdown-table td { font-size: .87rem; padding: 10px 12px; }

.loading, .error { color: var(--muted); }
.error { background: #fff0ee; border-left: 3px solid #c14b3f; padding: 13px 16px; }

@media (max-width: 720px) {
  .header-inner, .footer-inner, .page-shell { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 58px; }
  nav { gap: 14px; }
  .page-shell { padding: 40px 0 60px; }
  .benchmark-meta { gap: 14px; margin: 38px 0 56px; }
  .benchmark-meta > div { font-size: .86rem; }
  .section-heading, .detail-header { align-items: start; display: block; }
  .sort-note { margin-top: 12px; text-align: left; }
  .definition-grid, .definitions-inline { grid-template-columns: 1fr; }
  .detail-badge { margin-top: 18px; }
  .figure-panel { margin-left: -4px; margin-right: -4px; padding: 5px; }
  .footer-inner { align-items: start; flex-direction: column; gap: 7px; }
}

@media (max-width: 460px) {
  body { font-size: 15px; }
  h1 { font-size: 2.25rem; }
  .benchmark-meta { grid-template-columns: 1fr; }
  th, td { padding: 11px 12px; }
}

/* theory section */
.theory h3 { margin: 1.4rem 0 0.5rem; font-size: 1rem; }
.theory-list { margin: 0; padding-left: 1.2rem; }
.theory-list li { margin: 0.3rem 0; line-height: 1.5; }
.formula { overflow-x: auto; padding: 0.9rem 1rem; border-radius: 6px; background: var(--blue-soft); border: 1px solid var(--line); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; line-height: 1.6; white-space: pre; }
.grid-count .num { font-size: 2rem; font-weight: 700; }
