@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,450;9..144,550;9..144,650&family=Hanken+Grotesk:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --ink: #2d3337;
  --ink-2: #485057;
  --muted: #687178;
  --faint: #737c83;
  --bg: #faf8f4;
  --surface: #fffefa;
  --surface-2: #f6f2ec;
  --sand: #f3e3d0;
  --line: #e2dbd2;
  --line-2: #cfc3b7;
  --accent: #6f98b9;
  --accent-ink: #4e7492;
  --accent-soft: #e7f0f5;
  --best: #3f6682;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(52, 45, 38, 0.03), 0 10px 30px rgba(52, 45, 38, 0.045);
  --type-sequence: #3d7a78;
  --type-seq_structure: #9b5d2e;
  --type-structure: #9c5b4d;
  --type-alignment: #4e7492;
  --type-seq_encdec: #6b5b8a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px / 1.55 var(--sans);
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
:focus-visible { outline: 3px solid rgba(129, 166, 198, 0.45); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed;
  z-index: 100;
  left: 14px;
  top: 10px;
  transform: translateY(-150%);
  padding: 8px 11px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.skip-link:focus { transform: none; }

.topbar {
  height: 60px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 30px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
}
.brand img { width: 28px; height: 28px; display: block; }
.brand-copy { display: inline-flex; align-items: baseline; gap: 5px; line-height: 1; }
.brand-name { color: var(--ink); font-size: 16px; letter-spacing: -0.025em; }
.brand-tag { color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.topbar nav { height: 100%; display: flex; gap: 23px; }
.topbar nav a {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  padding-top: 2px;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.toplinks {
  margin-left: auto;
  display: flex;
  gap: 17px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.toplinks a:hover { color: var(--accent-ink); }

.page {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}
.wrap { width: 100%; }

.post-header {
  padding: 76px 0 38px;
  border-bottom: 1px solid var(--line);
}
.post-date {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.post-title-row { display: flex; align-items: flex-end; gap: 26px; }
.post-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 550 clamp(36px, 5vw, 52px) / 1.05 var(--serif);
  letter-spacing: -0.04em;
}
.post-paper-link {
  flex: none;
  margin-bottom: 7px;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.post-paper-link:hover { color: var(--accent); }
.post-byline { margin: 23px 0 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.post-byline a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.post-byline a:hover { color: var(--accent-ink); }
.post-byline sup, .post-affiliations sup { font-size: 0.72em; vertical-align: super; }
.post-affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}
.post-affiliations a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.post-affiliations-note {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 11px;
}

.post-contents {
  padding: 16px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 21px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.post-contents a:hover { color: var(--accent-ink); }

.post-lede { width: 100%; max-width: none; min-width: 0; padding: 47px 0 5px; }
.post-lede > p, .post-section > p {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.post-lede > p {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.66;
  letter-spacing: -0.01em;
}

.post-section { padding: 72px 0 0; scroll-margin-top: 80px; }
.post-section > h2, .post-heading h2 {
  margin: 0 0 18px;
  font: 550 clamp(28px, 3.8vw, 38px) / 1.13 var(--serif);
  letter-spacing: -0.032em;
}
.post-section > p { width: 100%; max-width: none; min-width: 0; margin: 0 0 19px; }
.post-section a:not(.source-link):not(.post-paper-link) {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: rgba(78, 116, 146, 0.35);
  text-underline-offset: 3px;
}

.task-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0 8px;
}
.task-flow article {
  min-height: 186px;
  padding: 23px 22px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.task-flow span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
}
.task-flow h3 {
  margin: 17px 0 8px;
  font: 550 21px / 1.15 var(--serif);
  letter-spacing: -0.02em;
}
.task-flow p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}
.stat-row article {
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.stat-row b {
  display: block;
  font: 550 26px / 1 var(--serif);
  letter-spacing: -0.03em;
}
.stat-row span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.board-block { padding-top: 72px; }
.board-intro { width: 100%; max-width: none; min-width: 0; margin: 0 0 22px; overflow-wrap: break-word; }

.controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(52, 45, 38, 0.025);
}
.control { display: grid; gap: 5px; }
.control[hidden], [hidden] { display: none !important; }
.control > label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--muted);
  font-weight: 700;
}
select {
  min-height: 35px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 6px 28px 6px 10px;
  font-size: 13px;
}
select:hover { border-color: var(--accent); }
.seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  min-height: 33px;
  padding: 6px 11px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); color: var(--ink); }
.seg button[aria-pressed="true"] { background: #aacddc; color: var(--ink); }

.type-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
}
.type-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chip);
}
.type-chip[aria-pressed="false"] { opacity: 0.38; }

.result-meta {
  min-height: 24px;
  padding: 0 2px 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.figure-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 14px;
  margin-bottom: 14px;
}
.figure-card h3 {
  margin: 0 0 16px;
  font: 550 20px / 1.15 var(--serif);
  letter-spacing: -0.02em;
}
.figure-chart {
  display: grid;
  gap: 0;
}
.figure-row,
.figure-axis-row {
  display: grid;
  grid-template-columns: minmax(108px, 200px) minmax(0, 1fr) 4.6em;
  gap: 10px;
  align-items: center;
  min-height: 32px;
}
.figure-row:hover { background: var(--accent-soft); }
.figure-label {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.figure-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.figure-label i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
}
.figure-track {
  min-width: 0;
  height: 18px;
  border-left: 1px solid var(--line);
}
.figure-bar {
  height: 18px;
  border-radius: 0 2px 2px 0;
  min-width: 2px;
}
.figure-value {
  width: 4.6em;
  max-width: 100%;
  text-align: right;
  font: 600 12px / 1 var(--mono);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink-2);
  white-space: nowrap;
}
.figure-axis-row { min-height: 28px; align-items: start; }
.figure-axis {
  position: relative;
  height: 24px;
  min-width: 0;
  border-top: 1px solid var(--line-2);
}
.figure-axis span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  font: 700 10.5px / 1 var(--mono);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
  white-space: nowrap;
}
.figure-axis span.is-first { transform: none; }
.figure-axis span.is-last { transform: translateX(-100%); }
.figure-axis span.is-first.is-last { transform: none; }
.figure-note { margin: 10px 2px 0; color: var(--muted); font-size: 12px; }

.tablewrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
  font-variant-numeric: tabular-nums lining-nums;
}
th, td {
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
  font-size: 12.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ece7df;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.01em;
  font-weight: 650;
}
.sortable button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  padding: 0;
  cursor: pointer;
}
.sortable button:hover { color: var(--accent-ink); }
.sort-mark { margin-left: 3px; color: var(--faint); font-weight: 500; }
.sortable button[data-sorted] .sort-mark { color: var(--accent-ink); }
tbody tr:nth-child(even) td { background: #fcfaf6; }
tbody tr:hover td { background: #edf4f7; }
.col-rank { width: 44px; min-width: 44px; color: var(--faint); }
.col-model { width: 220px; min-width: 200px; text-align: left; white-space: normal; }
.col-num,
.col-mean {
  width: 4.8em;
  min-width: 4.8em;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.col-mean { font-weight: 700; }
.col-ref { width: 44px; min-width: 44px; }
th.col-model, td.col-model { text-align: left; padding-left: 14px; }
.score-cell { font-weight: 700; }
td.best { background: #e5eff4 !important; color: var(--best); font-weight: 700; }
.model-cell { font-weight: 700; }
.model-cell > i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
  background: var(--dot);
}
.model-cell small {
  display: block;
  margin: 2px 0 0 15px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}
.source-link { color: var(--accent-ink); font-weight: 700; }

.post-citation {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 36px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.post-citation p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.post-citation strong { color: var(--ink-2); }
.bibtex {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 14px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font: 11.5px / 1.55 var(--mono);
  white-space: pre-wrap;
  box-sizing: border-box;
}
.post-footer {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 28px 0 0;
  padding: 18px 0 56px;
  border-top: 1px solid var(--line);
}
.post-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 700;
}
.post-footer-links span { color: var(--line-2); }

@media (max-width: 900px) {
  .topbar { padding: 0 18px; gap: 16px; }
  .page { width: min(100% - 28px, 1080px); }
  .task-flow, .stat-row { grid-template-columns: 1fr 1fr; }
  .figure-row,
  .figure-axis-row { grid-template-columns: minmax(88px, 150px) minmax(0, 1fr) 4.6em; gap: 8px; }
}
@media (max-width: 720px) {
  .figure-axis span:not(.is-first):not(.is-last) { display: none; }
}
@media (max-width: 650px) {
  .topbar {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    padding-top: 10px;
  }
  .brand { width: 100%; }
  .topbar nav { height: 38px; order: 3; width: 100%; gap: 14px; }
  .toplinks { position: absolute; right: 16px; top: 17px; }
  .post-header { padding-top: 44px; }
  .post-title-row { display: block; }
  .post-header h1 { font-size: 34px; }
  .post-paper-link { display: inline-block; margin: 16px 0 0; }
  .task-flow, .stat-row { grid-template-columns: 1fr; }
  .controls { align-items: stretch; }
  .control { min-width: calc(50% - 8px); }
  .control select { width: 100%; }
  .figure-card { padding: 16px 14px 12px; }
  .figure-row,
  .figure-axis-row { grid-template-columns: minmax(64px, 86px) minmax(0, 1fr) 4.4em; gap: 6px; }
  .figure-label { font-size: 11px; }
  .figure-value { width: 4.4em; font-size: 11px; }
}
