:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --navy: #0f172a;
  --border: #cbd5e1;
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --accent-wage: #2563eb;
  --accent-inflation: #ea580c;
  --accent-real: #16a34a;
  --accent-loss: #dc2626;
  --accent-gain: #16a34a;
  --accent-trend-2017: #7c3aed;
  --accent-trend-2000: #06b6d4;
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}
.skip-link:focus { left: 0; }

a { color: var(--accent-wage); }
a:focus-visible { outline: 2px solid var(--accent-wage); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
p { margin: 0 0 1rem; }

ul { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

.hero {
  min-height: 100vh;
  background: var(--navy);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-content { max-width: 720px; position: relative; z-index: 2; }
.hero h1 { color: #fff; margin-bottom: 0.5rem; }
.hero .lede { font-size: clamp(1.2rem, 3vw, 1.6rem); color: #e2e8f0; margin-bottom: 1rem; }
.hero .sublede { font-size: 1rem; color: #94a3b8; margin-bottom: 2rem; }

.cta {
  display: inline-block;
  background: var(--accent-wage);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}
.cta:hover, .cta:focus { background: #1d4ed8; transform: translateY(-1px); }

.hero-chart {
  width: 100%;
  max-width: 920px;
  height: clamp(260px, 35vh, 360px);
  margin-top: 2.5rem;
  position: relative;
  z-index: 1;
}

.section { padding: clamp(3rem, 8vw, 6rem) 0; }
.section-dark { background: #0f172a; color: #f8fafc; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .section-lead { color: #cbd5e1; }
.section-dark .chart-caption, .section-dark .card p, .section-dark .card li { color: #cbd5e1; }
.section-alt { background: #f1f5f9; }

.section-lead { font-size: clamp(1.05rem, 2.5vw, 1.25rem); color: var(--muted); margin-bottom: 2.5rem; max-width: 760px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow);
}

.section-dark .card { background: #1e293b; border-color: #334155; }

.two-col, .three-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 2rem;
  align-items: start;
}

.full-width { grid-column: 1 / -1; }

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}

.control-row button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  min-height: 44px;
}

.section-dark .control-row button { background: #1e293b; color: #e2e8f0; border-color: #475569; }

.control-row button:hover { background: #e2e8f0; }
.control-row button.active { background: var(--accent-wage); color: #fff; border-color: var(--accent-wage); }
.section-dark .control-row button.active { background: var(--accent-wage); color: #fff; }

.control-row button:focus-visible { outline: 2px solid var(--accent-wage); outline-offset: 2px; }

.chart-wrap {
  width: 100%;
  min-height: 260px;
  max-height: 420px;
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  max-height: 420px;
  overflow: visible;
}

.chart-caption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.cost-list { list-style: none; padding: 0; }
.cost-list li { padding-left: 1.5rem; position: relative; }
.cost-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent-inflation);
}

.mini-compare {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.mini-item {
  border-left: 4px solid var(--border);
  padding: 1rem 1rem 1rem 1.25rem;
  background: rgba(15,23,42,0.03);
  border-radius: 0 0.5rem 0.5rem 0;
}
.mini-item strong { display: block; margin-bottom: 0.25rem; }
.mini-item span { display: block; color: var(--muted); font-size: 0.9rem; }
.mini-item.loss { border-left-color: var(--accent-loss); }
.mini-item.gain { border-left-color: var(--accent-gain); }

.final-card { text-align: center; background: #1e293b; border-color: #334155; }
.final-card .big { font-size: clamp(1.1rem, 3vw, 1.35rem); max-width: 820px; margin: 0 auto 1.5rem; color: #e2e8f0; }
.source-line { font-size: 0.95rem; color: #94a3b8; }

.site-footer {
  background: var(--navy);
  color: #94a3b8;
  padding: 2.5rem 0;
  font-size: 0.9rem;
}
.site-footer a { color: #e2e8f0; }

/* SVG chart styles */
.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.chart-line-thin { stroke-width: 2; }
.chart-bar { stroke: none; }
.chart-bar:hover, .chart-bar:focus { opacity: 0.85; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.6; }
.section-dark .chart-grid { stroke: #475569; opacity: 0.5; }
.chart-axis { stroke: var(--muted); stroke-width: 1; }
.section-dark .chart-axis { stroke: #94a3b8; }
.chart-text {
  fill: var(--muted);
  font-size: 12px;
  font-family: var(--font);
}
.section-dark .chart-text { fill: #94a3b8; }
.chart-label-bg { fill: var(--surface); opacity: 0.9; }
.section-dark .chart-label-bg { fill: #1e293b; }
.chart-label-text { fill: var(--text); font-size: 12px; font-weight: 600; }
.section-dark .chart-label-text { fill: #f8fafc; }

.dial-face { fill: none; stroke: #334155; stroke-width: 12; }
.dial-tick { stroke: #475569; stroke-width: 2; }
.dial-needle { stroke: var(--accent-inflation); stroke-width: 4; stroke-linecap: round; transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.dial-center { fill: var(--accent-inflation); }

.waffle-cell { stroke: var(--surface); stroke-width: 2; rx: 2; }
.waffle-cell.lost { fill: var(--accent-loss); }
.waffle-cell.kept { fill: #cbd5e1; }
.section-dark .waffle-cell.kept { fill: #334155; }

/* Animation and reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

.chart-path-anim {
  stroke-dasharray: var(--path-length);
  stroke-dashoffset: var(--path-length);
  transition: stroke-dashoffset 1.2s ease;
}
.in-view .chart-path-anim, .chart-path-anim.animated {
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .chart-path-anim, .dial-needle, .waffle-cell, .chart-bar {
    transition: none !important;
    animation: none !important;
    stroke-dashoffset: 0 !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Mobile */
@media (max-width: 640px) {
  .hero { padding: 2rem 1rem; text-align: center; }
  .hero-chart { height: 240px; margin-top: 2rem; }
  .container { padding: 0 1rem; }
  .card { padding: 1.25rem; }
  .control-row { gap: 0.4rem; }
  .control-row button { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
  .chart-wrap { min-height: 220px; max-height: 320px; }
  .chart-text { font-size: 10px; }
}
