:root {
  color-scheme: light;

  --paper: #f5f1e8;
  --paper-deep: #ece7d8;
  --paper-soft: #f9f5ec;
  --surface: #fcfaf3;

  --ink: #1a160e;
  --ink-soft: #2a251c;
  --muted: #5d564a;
  --faint: #918a7c;

  --rule: #e0d8c5;
  --rule-strong: #c8bfa8;

  --accent: #a23b17;
  --accent-deep: #7e2d11;
  --accent-soft: rgba(162, 59, 23, 0.09);

  --good: #2f6b3a;
  --warn: #b56b1c;
  --bad: #9b3022;

  --c-dense: #234b3d;
  --c-late: #a23b17;
  --c-hybrid: #5b3f6e;
  --c-sparse: #3f5d75;
  --c-unknown: #8e887b;

  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans: "Inter Tight", "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Cursor-following soft warm light. Smaller and dimmer than the first
   iteration, paired with the grain so it reads as ambient warmth rather
   than a discrete spotlight. */
.cursor-light {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(216, 158, 96, 0.10),
    rgba(216, 158, 96, 0.03) 30%,
    transparent 65%
  );
  will-change: background;
}

@media (prefers-reduced-motion: reduce) {
  .cursor-light {
    display: none;
  }
}

/* Interactive paper-grain particle field. Sits above all UI surfaces so the
   grain reads as ink on top of paper, including over content. The cursor's
   presence physically displaces particles (handled in app.js). */
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  width: 100vw;
  height: 100vh;
}

a {
  color: inherit;
}

button,
select {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

@media (min-width: 720px) {
  .shell {
    width: min(1200px, calc(100% - 64px));
  }
}

@media (min-width: 1100px) {
  .shell {
    width: min(1200px, calc(100% - 96px));
  }
}

@media (min-width: 960px) {
  .site-header-inner,
  .hero,
  #leaderboard {
    max-width: 1040px;
    margin-inline: auto;
  }
}

/* === Header ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 8px 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 24, "SOFT" 80;
}

.brand-tag {
  display: none;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

@media (min-width: 720px) {
  .brand-tag {
    display: inline;
  }
  .brand-tag::before {
    content: "/ ";
    color: var(--faint);
  }
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.main-nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 120ms ease;
}

.main-nav a:hover,
.main-nav a[aria-current] {
  color: var(--ink);
}

.main-nav .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  opacity: 0.75;
  transition: opacity 140ms ease, color 140ms ease;
}

.main-nav .nav-icon:hover {
  opacity: 1;
  color: var(--ink);
}

.main-nav .nav-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* === Main =============================================================== */

main {
  padding: 22px 0 64px;
}

@media (min-width: 720px) {
  main {
    padding: 28px 0 72px;
  }
}

/* === Hero =============================================================== */

.hero {
  margin: 6px 0 24px;
}

@media (min-width: 720px) {
  .hero {
    margin: 12px auto 30px;
  }
}


.eyebrow {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-weight: 500;
}

.hero h1 {
  margin: 0 0 12px;
  max-width: 760px;
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.018em;
  color: var(--ink);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.lede {
  margin: 0 0 18px;
  max-width: 610px;
  font-size: 15.5px;
  line-height: 1.48;
  color: var(--ink-soft);
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.stat-line .stat {
  white-space: nowrap;
}

.stat-line .stat + .stat::before {
  content: "·";
  margin: 0 10px;
  color: var(--faint);
}

.stat-line strong {
  color: var(--ink);
  font-weight: 500;
}

.stat-line--leader {
  margin-top: 8px;
  min-height: 1.2em;
  align-items: center;
  gap: 0;
}

.stat-line--leader .stat {
  white-space: normal;
}

.leader-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  margin-right: 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
}

.leader-sep {
  margin: 0 6px;
  color: var(--faint);
}

/* === Benchmark tabs ===================================================== */

.benchmark-tabs {
  position: relative;
  display: flex;
  gap: 0;
  margin-top: 18px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.benchmark-tabs::-webkit-scrollbar {
  display: none;
}

.benchmark-tabs button {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 0;
  margin-right: 24px;
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  color: var(--muted);
  transition: color 140ms ease;
}

.benchmark-tabs button:last-child {
  margin-right: 0;
}

.benchmark-tabs button:hover {
  color: var(--ink-soft);
}

.benchmark-tabs button[aria-selected="true"] {
  color: var(--ink);
}

.tab-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(0);
  pointer-events: none;
}

.tab-indicator.animated {
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
              width 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  .tab-indicator,
  .tab-indicator.animated {
    transition: none;
  }
}

.tab-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.005em;
  line-height: 1.1;
}

.tab-meta {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.benchmark-tabs button[aria-selected="true"] .tab-meta {
  color: var(--muted);
}

/* === Benchmark intro ==================================================== */

.benchmark-intro {
  padding: 12px 0 2px;
}

.benchmark-intro p {
  margin: 0;
  max-width: 640px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.45;
}

.dataset-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  min-height: 26px;
}

.dataset-chips-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 6px;
}

.dataset-chips button {
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 999px;
  transition: all 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: var(--sans);
  font-weight: 500;
}

.dataset-chips button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.dataset-chips button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.dataset-chips button:disabled {
  cursor: default;
}

/* === Filter bar ========================================================= */

.filter-bar {
  display: grid;
  gap: 0;
  margin: 14px 0 10px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 720px) {
  .filter-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.filter {
  position: relative;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.filter:last-child {
  border-bottom: 0;
}

@media (min-width: 720px) {
  .filter {
    padding: 9px 18px;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
  .filter:first-child {
    padding-left: 0;
  }
  .filter:last-child {
    border-right: 0;
    padding-right: 0;
  }
}

.filter label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
  transition: color 120ms ease;
}

.filter:focus-within label {
  color: var(--accent);
}

.filter select {
  width: 100%;
  padding: 4px 24px 4px 0;
  background: transparent;
  border: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5l3.5 3.5 3.5-3.5' stroke='%235d564a' stroke-width='1.3' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px;
}

/* === Custom dropdown =================================================== */

.cs {
  position: relative;
  width: 100%;
}

.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: color 120ms ease;
}

.cs-trigger:hover .cs-chevron,
.cs-trigger:focus-visible .cs-chevron {
  color: var(--ink);
}

.cs-trigger:focus-visible {
  outline: none;
}

.cs-trigger:focus-visible .cs-value {
  color: var(--accent);
}

.cs-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 120ms ease;
}

.cs-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1), color 120ms ease;
}

.cs-trigger[aria-expanded="true"] .cs-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.cs-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: -10px;
  right: -10px;
  z-index: 40;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(20, 17, 11, 0.10), 0 2px 6px rgba(20, 17, 11, 0.06);
  max-height: 320px;
  overflow-y: auto;
}

.cs-menu.open {
  display: block;
  animation: cs-menu-in 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes cs-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cs-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 5px;
  transition: background 80ms ease, color 80ms ease;
}

.cs-option:hover,
.cs-option.cs-active {
  background: var(--paper-deep);
  color: var(--ink);
}

.cs-option[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}

.cs-option[aria-selected="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cs-menu.open {
    animation: none;
  }
  .cs-chevron {
    transition: none;
  }
}

.filter select:focus {
  outline: none;
  color: var(--accent);
}

.filter select:focus + .filter-helper,
.filter:focus-within .filter-helper {
  color: var(--accent);
}

/* === Chart ============================================================== */

.chart-shell {
  position: relative;
  background: transparent;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 0 8px;
}

@media (min-width: 720px) {
  .chart-shell {
    padding: 13px 8px 9px;
  }
}

.chart-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--rule);
}

.chart-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px dashed var(--rule);
  margin-top: 4px;
  padding-top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.chart-legend .swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .swatch::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--c-unknown);
}

.chart-legend .swatch.dense::before {
  background: var(--c-dense);
}

.chart-legend .swatch.late_interaction::before {
  background: var(--c-late);
}

.chart-legend .swatch.hybrid::before {
  background: var(--c-hybrid);
}

.chart-legend .swatch.sparse::before {
  background: var(--c-sparse);
}

.chart-legend .swatch.frontier::before {
  background: var(--ink);
  border-radius: 0;
  height: 2px;
  width: 16px;
}

.plot {
  width: 100%;
  height: clamp(290px, 34vh, 340px);
  min-height: 0;
  /* Initial state for the structural-change crossfade. JS toggles
     `is-fading` to drop opacity before swapping the trace set, then
     clears it for the fade-back. Pure opacity, no spatial motion. */
  opacity: 1;
  will-change: opacity;
}

.plot.is-fading {
  opacity: 0;
  transition: opacity 180ms ease;
}

.plot.is-restoring {
  opacity: 1;
  transition: opacity 220ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .plot,
  .plot.is-fading,
  .plot.is-restoring {
    transition: none;
    opacity: 1;
  }
}

@media (min-width: 720px) {
  .plot {
    height: clamp(300px, 34vh, 355px);
  }
}


.empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* === Frontier strip ===================================================== */

.frontier-strip {
  display: grid;
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
}

@media (min-width: 760px) {
  .frontier-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--rule);
  }
}

.frontier-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.frontier-pick::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.frontier-pick:hover {
  transform: translateY(-3px);
}

.frontier-pick:hover::before {
  transform: scaleY(1);
}

.frontier-pick:hover .frontier-name {
  color: var(--accent-deep);
}

.frontier-pick:last-child {
  border-bottom: 0;
}

@media (min-width: 760px) {
  .frontier-pick {
    padding: 22px 28px 22px 0;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }
  .frontier-pick:last-child {
    border-right: 0;
    padding-right: 0;
  }
  .frontier-pick + .frontier-pick {
    padding-left: 28px;
  }
}

.frontier-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.frontier-note {
  display: inline-block;
  margin-left: 2px;
  vertical-align: super;
  font-size: 0.85em;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.frontier-note:hover,
.frontier-note:focus-visible {
  color: var(--accent);
}

.frontier-name {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.18;
  color: var(--ink);
  font-variation-settings: "opsz" 48, "SOFT" 90;
  transition: color 120ms ease;
}

.frontier-system {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.frontier-stats {
  display: flex;
  gap: 28px;
  margin-top: auto;
}

.frontier-stat {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.frontier-stat > span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 4px;
}

/* === Table ============================================================== */

.systems-table-shell {
  margin-top: 40px;
}

.systems-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.systems-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.systems-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.012em;
  color: var(--ink);
  font-variation-settings: "opsz" 48, "SOFT" 90;
}

.table-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.systems-table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--rule);
}

table.systems {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}

table.systems th {
  text-align: left;
  padding: 12px 20px 12px 0;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: var(--paper);
  position: sticky;
  top: 0;
  transition: color 120ms ease;
}

table.systems th:first-child {
  padding-left: 0;
}

table.systems th:last-child {
  padding-right: 0;
}

table.systems th:hover {
  color: var(--ink);
}

table.systems th[aria-sort] {
  color: var(--accent);
}

table.systems th[aria-sort]::after {
  content: " " attr(data-arrow);
  font-family: var(--mono);
  margin-left: 4px;
  font-weight: 500;
  letter-spacing: 0;
}

table.systems th.num-col {
  text-align: right;
}

table.systems td {
  padding: 14px 20px 14px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink);
}

table.systems td:first-child {
  padding-left: 0;
}

table.systems td:last-child {
  padding-right: 0;
}

table.systems td.num {
  text-align: right;
}

table.systems tbody tr {
  position: relative;
  transition: background 140ms ease, transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: pointer;
}

table.systems tbody tr td:first-child {
  position: relative;
}

table.systems tbody tr td:first-child::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 160ms ease;
}

table.systems tbody tr:hover {
  background: var(--paper-deep);
}

table.systems tbody tr:hover td:first-child::before {
  opacity: 1;
}

.cell-model strong {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}

.cell-model small {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.family-glyph {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.family-glyph::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--c-unknown);
  flex-shrink: 0;
}

.family-glyph.dense::before {
  background: var(--c-dense);
}
.family-glyph.late_interaction::before {
  background: var(--c-late);
}
.family-glyph.hybrid::before {
  background: var(--c-hybrid);
}
.family-glyph.sparse::before {
  background: var(--c-sparse);
}

.cell-system {
  font-size: 14px;
}

.cell-system strong {
  display: block;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.cell-system small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.num.dim {
  color: var(--faint);
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--sans);
  white-space: nowrap;
}

.status-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faint);
  flex-shrink: 0;
}

.status-tag.completed::before {
  background: var(--good);
}
.status-tag.completed {
  color: var(--ink);
}

.status-tag.quality_only::before,
.status-tag.latency_skipped::before {
  background: var(--warn);
}

.status-tag.failed::before {
  background: var(--bad);
}

/* === Drawer ============================================================= */

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(440px, 100vw);
  height: 100vh;
  background: var(--paper);
  border-left: 1px solid var(--rule-strong);
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  overflow-y: auto;
  visibility: hidden;
}

.detail-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-close {
  position: sticky;
  top: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--paper);
  border: 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 120ms ease;
}

.drawer-close:hover {
  color: var(--ink);
}

.drawer-close .x {
  font-size: 18px;
  font-family: var(--sans);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}

.drawer-content {
  padding: 28px 24px 60px;
}

.drawer-content .eyebrow {
  margin-bottom: 10px;
}

.drawer-content h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  line-height: 1.15;
  font-variation-settings: "opsz" 60, "SOFT" 100;
}

.drawer-system {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.4;
}

.drawer-system strong {
  color: var(--ink);
  font-weight: 500;
}

.drawer-section {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.drawer-section-title {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 14px;
}

.drawer-rows {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer-rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
}

.drawer-rows .label {
  color: var(--muted);
}

.drawer-rows .value {
  font-family: var(--mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  word-break: break-all;
  max-width: 60%;
}

.drawer-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}

.drawer-link:hover {
  border-bottom-color: var(--accent);
}

/* === Footer ============================================================ */

.site-footer {
  margin-top: 80px;
  padding: 28px 0 56px;
  border-top: 1px solid var(--rule);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color 120ms ease;
}

.site-footer a:hover {
  border-color: var(--accent);
}

.site-footer-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.maker-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.maker-link span {
  color: var(--accent);
  font-size: 11px;
  line-height: 1;
}

/* === Methodology ======================================================== */

main.method {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

@media (min-width: 720px) {
  main.method {
    padding: 72px 0 120px;
  }
}

.method h1 {
  font-family: var(--serif);
  font-weight: 450;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin: 0 0 24px;
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.method .inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 120ms ease;
}

.method .inline-link:hover {
  border-bottom-color: var(--accent);
}

.method h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.method-lede {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 56px;
  line-height: 1.6;
  max-width: 620px;
}

.method h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.012em;
  margin: 48px 0 10px;
  font-variation-settings: "opsz" 48, "SOFT" 100;
}

.method h2 + p {
  margin-top: 0;
}

.method p,
.method li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.method ul {
  padding-left: 18px;
  margin: 12px 0 24px;
}

.method li {
  margin-bottom: 6px;
}

.method code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--paper-deep);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--ink);
}

.method-divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 56px 0 0;
}

/* === Animation ========================================================== */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-rise] {
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

[data-rise="1"] {
  animation-delay: 0ms;
}
[data-rise="2"] {
  animation-delay: 90ms;
}
[data-rise="3"] {
  animation-delay: 180ms;
}
[data-rise="4"] {
  animation-delay: 270ms;
}
[data-rise="5"] {
  animation-delay: 360ms;
}
[data-rise="6"] {
  animation-delay: 450ms;
}

@media (prefers-reduced-motion: reduce) {
  [data-rise] {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

/* === Mobile tweaks ====================================================== */

@media (max-width: 640px) {
  .main-nav {
    gap: 16px;
    font-size: 13px;
  }

  .filter select {
    font-size: 17px;
  }

  .systems-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-caption {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Focus ============================================================== */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline-offset: 3px;
}
