:root {
  color-scheme: dark;
  --bg: #090b0d;
  --panel: #111418;
  --panel-2: #171b20;
  --text: #f3f5f7;
  --muted: #9ca5ae;
  --line: #2a3037;
  --accent: #e43b34;
  --accent-soft: rgba(228, 59, 52, 0.14);
  --max: 1160px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 70% -10%, rgba(228, 59, 52, 0.13), transparent 30rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

.topbar {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  letter-spacing: 0.06em;
}
nav { display: flex; gap: 24px; color: var(--muted); font-size: 14px; }
nav a:hover { color: var(--text); }

main { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }
.hero { padding: 38px 0 30px; max-width: 960px; }
.hero h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.08; margin: 12px 0; }
.hero .lede { font-size: 16px; margin: 14px 0 0; }
.hero .hero-actions { margin-top: 20px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; }
h1 {
  margin: 16px 0 22px;
  font-size: clamp(46px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  max-width: 1050px;
}
h1 em { font-style: normal; color: #b9c0c7; }
.lede { max-width: 760px; color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { padding: 13px 18px; border: 1px solid var(--line); font-weight: 750; font-size: 14px; }
.button.primary { background: var(--accent); border-color: var(--accent); }
.button.secondary { background: var(--panel); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.metric-card {
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.metric-card.feature { grid-column: span 3; min-height: 300px; }
.metric-kicker { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.14em; }
.score { margin-top: 22px; font-size: clamp(76px, 12vw, 150px); line-height: 0.8; font-weight: 900; letter-spacing: -0.08em; color: var(--accent); }
.mini-score { font-size: 48px; font-weight: 900; color: var(--accent); }
h2, h3 { margin: 18px 0 10px; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 4vw, 48px); }
h3 { font-size: 22px; }
.metric-card p { color: var(--muted); line-height: 1.55; margin-bottom: 0; }

.rankings { margin: 12px 0 40px; scroll-margin-top: 16px; }
.rankings h2 { font-size: clamp(25px, 3vw, 34px); margin-top: 8px; }
.rankings .section-heading { margin-bottom: 18px; }
.section-heading {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 42px;
  align-items: end;
  margin-bottom: 28px;
}
.section-heading h2 { margin-bottom: 0; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.ranking-controls {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.ranking-controls label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; flex: 1; }
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
}
.ranking-list { border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.ranking-row {
  display: grid;
  grid-template-columns: 54px 52px minmax(0, 1fr) 130px 88px;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}
.ranking-row:last-child { border-bottom: 0; }
.ranking-row:hover { background: var(--panel-2); }
.rank-number { color: var(--muted); font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rank-fighter { min-width: 0; display: grid; gap: 4px; }
.rank-fighter strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }
.rank-fighter small, .rank-confidence, .rank-score small { color: var(--muted); font-size: 12px; }
.rank-confidence { text-align: right; display: grid; gap: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.rank-confidence small { color: var(--muted); font-size: 11px; }
.rank-score { display: grid; justify-items: end; gap: 1px; }
.rank-score strong { color: var(--accent); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ranking-loading { padding: 28px 18px; color: var(--muted); }
.model-note { color: var(--muted); font-size: 12px; line-height: 1.5; max-width: 780px; }

.method {
  margin: 96px 0 88px;
  padding: 56px 0 0;
  border-top: 1px solid var(--line);
}
.method-intro {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 56px;
  align-items: end;
  margin-bottom: 34px;
}
.method-intro h2 { margin-bottom: 0; max-width: 620px; }
.method-intro p,
.method-step p,
.example-copy p,
.breakdown-grid p,
.performance-vs-ranked p {
  color: var(--muted);
  line-height: 1.65;
}
.method-intro p { margin: 0; font-size: 16px; }

.method-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  background: var(--panel);
}
.method-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  min-height: 210px;
  padding: 28px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.method-step:nth-child(2n) { border-right: 0; }
.method-step:nth-last-child(-n+2) { border-bottom: 0; }
.step-number {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding-top: 7px;
}
.method-step h3 { margin-top: 0; }
.method-step p { margin-bottom: 0; }

.method-example {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 42px;
  align-items: stretch;
  margin-top: 56px;
  padding: 42px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--panel), #0d1014);
}
.example-copy h2 { margin-top: 12px; }
.example-copy strong { color: var(--text); }
.example-note { font-size: 12px; color: #737c85 !important; }
.example-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.example-fighter {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.example-title {
  display: grid;
  gap: 4px;
  padding-bottom: 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.example-title strong { font-size: 20px; }
.example-title span { color: var(--muted); font-size: 12px; }
.example-stat,
.example-result {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.example-stat span,
.example-result span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.example-stat strong,
.example-result strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.example-result { margin-top: auto; border-bottom: 0; padding-bottom: 0; }
.example-result strong { color: #c0c7ce; font-size: 22px; }
.example-result.positive strong { color: var(--accent); }

.cmr-breakdown {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 48px;
  margin-top: 56px;
  padding: 48px 0;
  border-bottom: 1px solid var(--line);
}
.cmr-breakdown h2 { margin-bottom: 0; }
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.breakdown-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.breakdown-grid article strong { font-size: 17px; }
.breakdown-grid p { margin-bottom: 0; font-size: 13px; }

.performance-vs-ranked {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  padding: 42px 0;
  border-bottom: 1px solid var(--line);
}
.performance-vs-ranked h3 { font-size: clamp(24px, 3vw, 34px); margin-bottom: 0; }
.performance-vs-ranked p { margin: 0; }
.performance-vs-ranked strong { color: var(--text); }

.status-panel {
  margin: 0 0 80px;
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: #6d737a; }
.status-dot.ok { background: #55c983; box-shadow: 0 0 0 4px rgba(85, 201, 131, 0.1); }
.status-dot.bad { background: var(--accent); }
.muted { color: var(--muted); }
footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 30px 0 44px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .topbar { height: 64px; }
  nav { gap: 14px; font-size: 12px; }
  .hero { padding: 30px 0 24px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card.feature { grid-column: span 1; }
  .section-heading { grid-template-columns: 1fr; gap: 12px; }
  .ranking-controls { flex-direction: column; }
  .ranking-row { grid-template-columns: 28px 40px minmax(0, 1fr) 62px; gap: 8px; padding: 10px; }
  .rank-confidence { display: none; }
  .rank-fighter strong { font-size: 15px; }
  .rank-fighter small { font-size: 10px; }
  .rank-score strong { font-size: 22px; }

  .method { margin: 68px 0 62px; padding-top: 40px; }
  .method-intro,
  .method-example,
  .cmr-breakdown,
  .performance-vs-ranked { grid-template-columns: 1fr; gap: 22px; }
  .method-steps { grid-template-columns: 1fr; }
  .method-step {
    grid-template-columns: 42px 1fr;
    min-height: 0;
    padding: 22px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line) !important;
  }
  .method-step:last-child { border-bottom: 0 !important; }
  .method-example { margin-top: 34px; padding: 24px 18px; }
  .example-board { grid-template-columns: 1fr; }
  .example-fighter { padding: 18px; }
  .cmr-breakdown { margin-top: 34px; padding: 34px 0; }
  .breakdown-grid { grid-template-columns: 1fr; }
  .performance-vs-ranked { padding: 34px 0; }
  .status-panel, footer { flex-direction: column; }
}
