:root {
  --bg: #0f1419;
  --panel: #1a212b;
  --panel-2: #222b37;
  --text: #e6edf3;
  --muted: #8b98a5;
  --line: #2d3742;
  --link: #5aa9e6;
  --tail: #2ecc71;
  --head: #e67e22;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 64px;
}

/* Header */
.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}
.head h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.02em; }
.tagline { margin: 0; color: var(--muted); max-width: 64ch; }
.head-links { margin: 10px 0 0; font-size: 14px; }
.head-links a { color: var(--link); text-decoration: none; }
.head-links a:hover { text-decoration: underline; }
.head-aside { text-align: right; flex: none; }
.asof-label { font-size: 11px; color: var(--muted); letter-spacing: 0.12em; }
.asof-date { font-size: 15px; color: var(--text); margin-top: 2px; }

/* Cards */
section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-top: 24px;
}
h2 {
  margin: 0 0 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-note { color: var(--muted); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.grid-2 > section { margin-top: 0; }
.about-card .grid-2 { margin-top: 0; gap: 40px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 36px;
  align-items: center;
}
.hero-gauge { text-align: center; }
#gauge { width: 100%; max-width: 360px; height: auto; }
.score { font-size: 60px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; margin-top: 2px; }
.label { font-size: 20px; font-weight: 600; margin-top: 4px; }
.score-note { color: var(--muted); font-size: 12px; margin-top: 10px; }

.hero-read { min-width: 0; }
.hero-desc { font-size: 22px; line-height: 1.35; font-weight: 500; color: var(--text); margin: 0 0 8px; }

/* Horizontal band bar with marker */
.band-bar { position: relative; padding-top: 30px; margin: 22px 0 0; }
.bandbar-marker {
  position: absolute; top: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.bandbar-mlabel { font-size: 12px; color: var(--text); white-space: nowrap; }
.bandbar-tri {
  width: 0; height: 0; margin-top: 3px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--text);
}
.bandbar-track { display: flex; height: 14px; border-radius: 7px; overflow: hidden; }
.bandbar-seg { height: 100%; }
.bandbar-axis { position: relative; height: 16px; margin-top: 8px; }
.bandbar-axis > div {
  position: absolute; transform: translateX(-50%);
  font-size: 11px; color: var(--muted);
}

/* Tailwind / headwind chip rows */
.drivers { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.driver-row { display: flex; align-items: center; gap: 14px; }
.driver-title { font-size: 11px; letter-spacing: 0.1em; width: 84px; flex: none; }
.driver-title.is-tail { color: var(--tail); }
.driver-title.is-head { color: var(--head); }
.driver-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.driver-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--panel-2); font-size: 13px; color: var(--text);
}
.driver-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Components: diverging bars centred at 50 */
.components { display: grid; gap: 16px; }
.component { display: grid; grid-template-columns: 140px 1fr 32px; align-items: center; gap: 14px; }
.component .name { color: var(--text); font-size: 14px; }
.component .track { position: relative; height: 12px; background: var(--panel-2); border-radius: 6px; }
.component .track-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.component .fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.component .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-size: 14px; }

/* History */
#history { width: 100%; height: auto; }
.history-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* About */
.about-card p { margin: 0 0 12px; color: var(--muted); }
.about-card p:last-child { margin-bottom: 0; }
.factors { margin: 0; padding-left: 18px; color: var(--muted); }
.factors li { margin-bottom: 10px; }
.factors li:last-child { margin-bottom: 0; }
.factors strong { color: var(--text); }

/* Footer */
.foot { margin-top: 24px; }
.foot p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.disclaimer { font-size: 12px; }

/* Methodology page */
.method section h2 { color: var(--text); font-size: 19px; text-transform: none; letter-spacing: 0; }
.method section h3 { color: var(--text); font-size: 15px; margin: 20px 0 8px; }
.method section p { color: var(--muted); margin: 0 0 12px; max-width: 78ch; }
.method .factors, .method .steps { max-width: 78ch; }
.method .steps { color: var(--muted); padding-left: 20px; margin: 0 0 12px; }
.method .steps li { margin-bottom: 8px; }
.method-table { width: 100%; border-collapse: collapse; margin: 4px 0 16px; font-size: 13px; }
.method-table th, .method-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.method-table th { color: var(--muted); font-weight: 600; }
.method-table td { color: var(--text); }

/* Responsive */
@media (max-width: 760px) {
  .wrap { padding: 24px 16px 48px; }
  .head { flex-direction: column; gap: 12px; }
  .head-aside { text-align: left; }
  .hero { grid-template-columns: 1fr; gap: 8px; }
  .grid-2, .about-card .grid-2 { grid-template-columns: 1fr; gap: 24px; }
  .score { font-size: 52px; }
  .hero-desc { font-size: 19px; }
  .component { grid-template-columns: 104px 1fr 30px; }
  .driver-row { align-items: flex-start; flex-direction: column; gap: 6px; }
}
