:root {
  --paper: #111416;
  --paper-deep: #171b1f;
  --paper-soft: #1d2227;
  --ink: #e8ecef;
  --ink-soft: #c8d0d6;
  --muted: #9aa4ad;
  --line: #30363c;
  --line-strong: #49525a;
  --accent: #d9a648;
  --accent-soft: rgb(217 166 72 / 0.14);
  --positive: #79d89b;
  --positive-soft: rgb(121 216 155 / 0.13);
  --negative: #ff7b72;
  --negative-soft: rgb(255 123 114 / 0.12);
  --shadow: 0 16px 46px rgb(4 6 8 / 0.42);
  --radius-small: 6px;
  --radius-large: 12px;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    linear-gradient(90deg, rgb(232 236 239 / 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, rgb(232 236 239 / 0.028) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 8% 12%, rgb(232 236 239 / 0.055), transparent 30%),
    radial-gradient(circle at 88% 4%, rgb(232 236 239 / 0.04), transparent 26%);
}

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

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid rgb(232 236 239 / 0.72);
  outline-offset: 4px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgb(17 20 22 / 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--paper-soft);
  font-family: var(--font-display);
  font-size: 0.9rem;
  background: var(--accent);
  border-radius: var(--radius-small);
  box-shadow: inset 0 0 0 2px rgb(17 20 22 / 0.12);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 0.88rem;
  font-weight: 600;
}

.header-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
}

.header-nav a::after {
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease-out;
}

.header-nav a:hover {
  color: var(--ink);
}

.header-nav a:hover::after {
  transform: scaleX(1);
}

.section-shell {
  width: min(1180px, calc(100% - clamp(32px, 7vw, 96px)));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.72fr);
  gap: clamp(32px, 6vw, 86px);
  align-items: end;
  padding-block: clamp(34px, 5.5vw, 64px) clamp(18px, 3vw, 32px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 6.2vw, 5rem);
  line-height: 0.92;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 640px;
  margin-bottom: 24px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  line-height: 1.58;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease-out, background 160ms ease-out, color 160ms ease-out;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--paper-soft);
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:hover {
  background: #e4b75c;
  border-color: #e4b75c;
}

.button-secondary {
  color: var(--ink);
  background: transparent;
}

.button-secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.leader-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3vw, 30px);
  color: var(--ink);
  background: linear-gradient(145deg, #22272c, #15191c);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.leader-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  content: "";
  background: linear-gradient(180deg, var(--accent), rgb(217 166 72 / 0.04));
}

.leader-panel::after {
  position: absolute;
  right: 28px;
  bottom: 28px;
  width: 74px;
  height: 74px;
  content: "";
  border-right: 1px solid rgb(232 236 239 / 0.17);
  border-bottom: 1px solid rgb(232 236 239 / 0.17);
  transform: rotate(45deg);
}

.panel-kicker {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.leader-panel strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.leader-score {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-block: 24px 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgb(232 236 239 / 0.16);
}

.leader-score span {
  font-family: var(--font-display);
  font-size: clamp(3.3rem, 6.4vw, 5.1rem);
  font-weight: 800;
  line-height: 0.76;
  letter-spacing: -0.06em;
}

.leader-score small {
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leader-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.leader-facts div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.leader-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leader-facts dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: clamp(34px, 5vw, 58px);
  border-block: 1px solid var(--line-strong);
}

.metric-strip > div {
  min-height: 92px;
  padding: 18px clamp(14px, 2.2vw, 26px);
  border-right: 1px solid var(--line);
}

.metric-strip > div:first-child {
  padding-left: 0;
}

.metric-strip > div:last-child {
  border-right: 0;
}

.strip-value,
.strip-label {
  display: block;
}

.strip-value {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.3vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.strip-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.leaderboard-section,
.charts-section,
.method-section {
  margin-bottom: clamp(50px, 7vw, 86px);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 0.55fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 20px;
}

.leaderboard-controls > p,
.chart-heading > p {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.leaderboard-controls {
  display: grid;
  gap: 14px;
}

.view-toggle {
  display: inline-flex;
  width: fit-content;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--paper-deep);
}

.view-toggle-button {
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.view-toggle-button:hover {
  color: var(--ink);
}

.view-toggle-button.is-active {
  color: var(--paper-soft);
  background: var(--accent);
}

.view-toggle-button.is-active:hover {
  color: var(--paper-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-large);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}

.leaderboard-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child,
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  text-align: left;
}

.leaderboard-table thead th {
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--paper-deep);
}

.leaderboard-table tbody tr {
  transition: background 140ms ease-out;
}

.leaderboard-table tbody tr:hover {
  background: rgb(232 236 239 / 0.045);
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.leaderboard-table tbody tr.is-leader {
  background: linear-gradient(90deg, var(--accent-soft), transparent 72%);
}

.rank-number {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  font-family: var(--font-display);
  font-weight: 800;
}

tr.is-leader .rank-number {
  color: var(--paper-soft);
  background: var(--accent);
  border-color: var(--accent);
}

.model-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
}

.model-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.model-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.score-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.score-value {
  display: block;
  font-size: 0.95rem;
  line-height: 1.15;
}

.metric-score-cell.is-best {
  background: var(--positive-soft);
  box-shadow: inset 0 -2px 0 rgb(121 216 155 / 0.65);
}

.metric-score-cell.is-best .score-value {
  color: var(--positive);
  font-weight: 800;
}

.metric-score-cell.is-worst {
  background: var(--negative-soft);
  box-shadow: inset 0 -2px 0 rgb(255 123 114 / 0.58);
}

.metric-score-cell.is-worst .score-value {
  color: var(--negative);
  font-weight: 800;
}

.score-delta {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.delta-positive {
  color: var(--positive);
}

.delta-negative {
  color: var(--negative);
}

.delta-neutral,
.delta-baseline {
  color: var(--muted);
}

.int-index-cell .score-value {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.sort-button:hover {
  color: var(--ink);
}

.sort-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.sort-button:disabled:hover {
  color: inherit;
}

.sort-indicator {
  width: 0.72em;
  color: var(--accent);
  font-size: 0.82em;
  line-height: 1;
}

.charts-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.chart-panel {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-large);
  background: var(--paper-soft);
  box-shadow: var(--shadow);
}

.chart-panel-large {
  background:
    linear-gradient(135deg, #20252a, #181c20);
}

.chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 26px;
  align-items: start;
  margin-bottom: 18px;
}

.chart-heading h2 {
  font-size: clamp(1.65rem, 2.7vw, 2.25rem);
}

.chart-heading > p {
  max-width: 240px;
  padding-top: 8px;
  font-size: 0.88rem;
}

.chart-canvas {
  width: 100%;
  overflow-x: auto;
}

.chart-canvas svg {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

.axis-label {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tick-label {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.point-label {
  fill: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
}

.grid-line {
  stroke: rgb(154 164 173 / 0.24);
  stroke-width: 1;
}

.axis-line {
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.release-path {
  fill: none;
  stroke: rgb(217 166 72 / 0.55);
  stroke-width: 2;
  stroke-dasharray: 5 7;
}

.chart-point {
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.chart-point.is-dimmed {
  opacity: 0.18;
}

.best-tag {
  fill: var(--positive);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.scaling-delta {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.scaling-delta.delta-positive {
  fill: var(--positive);
}

.scaling-delta.delta-negative {
  fill: var(--negative);
}

.scaling-delta.delta-neutral {
  fill: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.legend-button {
  padding: 4px 7px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: color 140ms ease-out, background 140ms ease-out, border-color 140ms ease-out, opacity 140ms ease-out;
}

.legend-button:hover {
  color: var(--ink);
  background: rgb(232 236 239 / 0.06);
}

.legend-button.is-active {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: rgb(217 166 72 / 0.42);
}

.legend-button.is-dimmed {
  opacity: 0.42;
}

.legend-swatch {
  width: 16px;
  height: 8px;
  border-radius: 2px;
}

.legend-note {
  color: var(--ink-soft);
  font-weight: 600;
}

.profile-line {
  opacity: 0.94;
}

.profile-value {
  fill: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: #111416;
  stroke-width: 3px;
}

.profile-value.is-best {
  fill: var(--positive);
}

.profile-value.is-worst {
  fill: var(--negative);
}

.profile-inline-delta {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: #111416;
  stroke-width: 3px;
}

.profile-inline-delta.delta-positive {
  fill: var(--positive);
}

.profile-inline-delta.delta-negative {
  fill: var(--negative);
}

.profile-inline-delta.delta-neutral,
.profile-inline-delta.delta-baseline {
  fill: var(--muted);
}

.method-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: 24px;
  align-items: stretch;
}

.method-card,
.source-card {
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius-large);
}

.method-card {
  color: var(--ink);
  background: linear-gradient(145deg, #20252a, #15191c);
  border: 1px solid var(--line-strong);
}

.method-card .eyebrow {
  color: var(--muted);
}

.method-card p {
  max-width: 760px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.method-card code {
  padding: 3px 7px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9em;
  font-weight: 800;
  background: rgb(232 236 239 / 0.14);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.source-card {
  border: 1px solid var(--line-strong);
  background: var(--paper-soft);
}

.source-label {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.source-card ul {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-card a {
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.source-card a:hover {
  color: var(--accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 54px);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .hero,
  .section-heading,
  .method-section {
    grid-template-columns: 1fr;
  }

  .leader-panel {
    max-width: 560px;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-strip > div:nth-child(2) {
    border-right: 0;
  }

  .metric-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .chart-heading {
    display: block;
  }

  .chart-heading > p {
    max-width: none;
    margin-top: 14px;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 14px;
  }

  .header-nav {
    width: 100%;
    justify-content: space-between;
  }

  .section-shell {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding-top: 34px;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 3.8rem);
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip > div {
    min-height: auto;
    padding-inline: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-strip > div:last-child {
    border-bottom: 0;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 15px 14px;
  }

  .chart-panel,
  .method-card,
  .source-card {
    border-radius: var(--radius-large);
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
