:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #8a8984;
  --grid: #e6e5e1;
  --rule: #d8d7d2;
  --solar: #eb6834;
  --gas: #2a78d6;
  --coal: #1baf7a;
  --cross: #0b0b0b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1a1a19;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #8f8e88;
    --grid: #2e2e2c;
    --rule: #3a3a37;
    --solar: #d95926;
    --gas: #3987e5;
    --coal: #199e70;
    --cross: #f0efec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a19;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #8f8e88;
  --grid: #2e2e2c;
  --rule: #3a3a37;
  --solar: #d95926;
  --gas: #3987e5;
  --coal: #199e70;
  --cross: #f0efec;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 860px; margin: 0 auto; padding: 32px 16px 48px; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
.lede { color: var(--text-2); margin: 0 0 8px; max-width: 70ch; }
a { color: inherit; }

.chart { border-top: 1px solid var(--rule); margin-top: 36px; padding-top: 24px; }
.chart h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 6px; }
.sub { color: var(--text-2); font-size: 0.92rem; margin: 0 0 14px; max-width: 75ch; }
.canvas { position: relative; height: 380px; }
.note { color: var(--muted); font-size: 0.85rem; margin: 8px 0 0; }
details { margin-top: 10px; font-size: 0.88rem; color: var(--text-2); }
summary { cursor: pointer; }
.tablewrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 3px 12px 3px 0; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--text); }

footer { border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 20px; font-size: 0.88rem; color: var(--text-2); }
footer h2 { font-size: 1rem; color: var(--text); margin: 0 0 6px; }
footer h3 { font-size: 0.95rem; color: var(--text); margin: 18px 0 6px; }
footer ul { padding-left: 18px; margin: 0; }
footer li { margin-bottom: 4px; }
.method { margin-top: 18px; }

@media (max-width: 560px) {
  h1 { font-size: 1.5rem; }
  .canvas { height: 300px; }
}

/* Hero: the answer first, the charts below the fold. */
:root { --good: #0ca30c; --warn: #fab219; --bad: #d03b3b; --card: #f3f2ef; --track: #e6e5e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --card: #232322; --track: #333331; } }
:root[data-theme="dark"] { --card: #232322; --track: #333331; }

.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 40px 16px 24px; max-width: 860px; margin: 0 auto;
}
.hero-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.hero h1 {
  font-size: clamp(1.1rem, 2.6vw, 1.4rem); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2); margin: 0;
}
.answer {
  font-size: clamp(4rem, 15vw, 8.5rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em;
  margin: 8px 0 24px; color: var(--solar);
}
.bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-width: 520px; }
.seg { height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--solar) var(--fill), var(--track) var(--fill)); }
.score { font-weight: 600; margin: 10px 0 18px; }
.hero .lede { margin-bottom: 22px; }
.tests { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.test {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 10px;
  background: var(--card); text-decoration: none; color: var(--text); border: 1px solid transparent;
}
.test:hover { border-color: var(--rule); }
.test strong { font-size: 0.98rem; line-height: 1.3; }
.test .detail { font-size: 0.86rem; color: var(--text-2); }
.status { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.status.good { color: var(--good); }
.status.warn { color: var(--text); }
.status.warn span { color: var(--warn); }
.status.bad { color: var(--bad); }
.scroll {
  align-self: center; margin-top: 28px; color: var(--text-2); text-decoration: none; font-size: 0.92rem;
}
.scroll span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .scroll span { animation: none; } }
main { padding-top: 0; }
@media (max-width: 620px) { .tests { grid-template-columns: 1fr; } }
