:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --line: #e2dfd8;
  --accent: #c2410c;
  --accent-soft: #fdeee6;
  --reached: #15803d;
  --plan: #1d4ed8;
  --on-accent: #ffffff;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1d1b;
    --text: #f0eee9;
    --muted: #a19d95;
    --line: #34322e;
    --accent: #fb923c;
    --accent-soft: #3a2416;
    --reached: #4ade80;
    --plan: #93b4fd;
    --on-accent: #1c1208;
  }
}

* { box-sizing: border-box; }

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

main, footer {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 16px;
}

main { padding-top: 24px; }
footer { padding-bottom: 32px; }

h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
header { margin-bottom: 16px; }
header p { margin: 2px 0 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.big {
  margin: 0;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.hero p:last-child, .next p { margin: 4px 0 0; }
.next { background: var(--accent-soft); border-color: transparent; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

a { color: var(--accent); }

.tabs { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }

.tab {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.tab[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Ladder: a vertical rail, highest score at the top. */
.ladder { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 3px solid var(--line); }

.step {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.step::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--line);
}

.step-dots { font-weight: 600; }
.step.rung.reached::before { border-color: var(--reached); background: var(--reached); }
.step.rung.reached .step-label::after { content: " ✓"; color: var(--reached); }

.step.now { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.step.now::before { border-color: var(--accent); background: var(--accent); }

.step.plan, .step.projection { color: var(--plan); font-style: italic; }
.step.plan::before, .step.projection::before { border-style: dashed; border-color: var(--plan); }

.error {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
}
