/* Infog — house style. UK palette: muted navy / red / cream.
   Zero frameworks, mobile-first. */

:root {
  --navy: #1b2a4a;
  --navy-deep: #121d36;
  --navy-soft: #33456e;
  --red: #a63a3a;
  --red-bright: #c14646;
  --cream: #f4efe4;
  --cream-deep: #e9e2d0;
  --ink: #22293a;
  --muted: #6b7186;
  --line: #d5cfbe;
  --was: #7a8db8;      /* WAS series (survey) */
  --wid: #c14646;      /* WID series (top-10) */
  --rest: #33456e;     /* the other 90% */
  --proj: #b9a86a;     /* projection (dashed, sandy) */
  --proj-band: rgba(185, 168, 106, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream: #171c28;
    --cream-deep: #10141e;
    --ink: #dfe2ec;
    --muted: #9aa1b5;
    --line: #2c3347;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--red); }
h1, h2, h3 { font-family: "Gill Sans", "Trebuchet MS", system-ui, sans-serif; color: var(--navy); letter-spacing: 0.01em; }
@media (prefers-color-scheme: dark) { h1, h2, h3 { color: #c9d3ec; } }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); line-height: 1.15; margin: 0.4em 0; }
h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 0.5rem; top: 0.5rem; background: var(--red); color: #fff; padding: 0.3rem 0.6rem; z-index: 10; }

.site-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: var(--navy-deep); color: var(--cream);
  border-bottom: 4px solid var(--red);
}
.brand { font-family: "Gill Sans", system-ui, sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--cream); text-decoration: none; }
.brand-dot { color: var(--red-bright); }
.tagline { font-size: 0.8rem; color: #9fb0d0; font-style: italic; }

main { min-height: 60vh; }
.wrap { max-width: 56rem; margin-inline: auto; padding: clamp(1rem, 3vw, 2rem); }

.hero { text-align: center; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin-top: 1.5rem; }
.hero p { max-width: 40rem; margin-inline: auto; color: var(--muted); font-size: 1.05rem; }

.series { display: grid; gap: 1.2rem; }
.card {
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  padding: 1.2rem 1.4rem;
  border-radius: 4px;
}
.card-kicker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.card h2 { margin: 0.3rem 0 0.5rem; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; color: var(--red); }
.teaser { margin: 0 0 0.8rem; }
.card-links { margin: 0; font-size: 0.95rem; }
.cta {
  display: inline-block; padding: 0.5rem 1.1rem; margin-right: 0.8rem;
  background: var(--red); color: #fff; text-decoration: none; border: none;
  font-family: "Gill Sans", system-ui, sans-serif; font-size: 1rem; border-radius: 3px;
  cursor: pointer;
}
.cta:hover { background: var(--red-bright); }
.ghost {
  padding: 0.5rem 1.1rem; background: transparent; color: var(--navy);
  border: 1px solid var(--navy); border-radius: 3px; cursor: pointer;
  font-family: "Gill Sans", system-ui, sans-serif; font-size: 1rem;
}
@media (prefers-color-scheme: dark) { .ghost { color: #c9d3ec; border-color: #c9d3ec; } }

.crumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.8rem; }
.about h2 { margin-top: 1.6rem; }
.about-watch { margin-top: 2rem; }
blockquote { border-left: 4px solid var(--line); margin: 1rem 0; padding: 0.4rem 1rem; color: var(--muted); font-style: italic; }
code { background: var(--cream-deep); padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
pre { background: var(--navy-deep); color: var(--cream); padding: 0.8rem; overflow-x: auto; border-radius: 4px; }
pre code { background: none; color: inherit; }

/* ---------- view selector (draft-2) ---------- */
.viewsel { margin-top: 1.6rem; }
.viewsel-note { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.6rem; }
.viewsel-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 0; }
.viewsel-item {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  padding: 0.55rem 0.9rem; background: var(--cream-deep);
  border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  font-family: "Gill Sans", "Trebuchet MS", system-ui, sans-serif;
  font-size: 0.95rem; color: var(--navy); line-height: 1.2;
}
@media (prefers-color-scheme: dark) { .viewsel-item { color: #c9d3ec; } }
.viewsel-item:hover { border-color: var(--red); }
.viewsel-item:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.viewsel-item.viewsel-active { background: var(--red); border-color: var(--red); color: #fff; }
.viewsel-item.viewsel-active .viewsel-hint { color: #f4d9d9; }
.viewsel-hint { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }

@media (max-width: 430px) {
  .viewsel-item { flex: 1 1 100%; }
}

/* ---------- Infographic stage ---------- */
.stage {
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(0.6rem, 2vw, 1.4rem);
  min-height: 26rem;
  display: flex; flex-direction: column;
}
.stage-static { max-width: 42rem; margin: auto; }
.stage svg { width: 100%; height: auto; display: block; }
.stage text { font-family: "Gill Sans", "Trebuchet MS", system-ui, sans-serif; fill: var(--ink); }
@media (prefers-color-scheme: dark) { .stage text { fill: var(--ink); } }
.stage .stage-title { font-size: 1.15rem; font-weight: 700; fill: var(--navy); }
.stage .stage-sub { font-size: 0.85rem; fill: var(--muted); }
.stage .pool-label { font-size: 0.95rem; font-weight: 700; }
.stage .pool-value { font-size: 1.35rem; font-weight: 700; }
.stage .share-top { fill: var(--wid); }
.stage .share-rest { fill: var(--navy-soft); }
.stage .proj-mark { stroke: var(--proj); stroke-dasharray: 5 4; fill: none; stroke-width: 2; }
.stage .proj-band { fill: var(--proj-band); }
.stage .legend { font-size: 0.8rem; }
.stage .year-big { font-size: 2rem; font-weight: 700; fill: var(--navy); }
@media (prefers-color-scheme: dark) { .stage .stage-title, .stage .year-big { fill: #c9d3ec; } }

.stagebar {
  margin-top: 0.5rem; background: var(--cream-deep); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
}
.stagebar-fill { height: 0.45rem; width: 0%; background: var(--red); transition: width 0.2s linear; }
.stagebar-labels { display: flex; justify-content: space-between; padding: 0.25rem 0.6rem; font-size: 0.8rem; color: var(--muted); font-family: "Gill Sans", system-ui, sans-serif; }

.controls { margin-top: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem; }
.controls-note { font-size: 0.85rem; color: var(--muted); margin: 0; flex: 1 1 16rem; }

.verdict { margin-top: 1.6rem; }
.verdict h2 { border-bottom: 3px solid var(--red); padding-bottom: 0.3rem; }
.verdict .verdict-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.verdict figure { margin: 0; background: var(--cream-deep); border: 1px solid var(--line); border-radius: 4px; padding: 1rem; }
.verdict figcaption { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }
.verdict .big-number { font-size: 2rem; font-weight: 700; color: var(--navy); font-family: "Gill Sans", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) { .verdict .big-number { color: #c9d3ec; } }
.verdict ul { padding-left: 1.1rem; }

/* reduced motion: no JS timings change needed (JS checks), but CSS transitions off */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stagebar-fill { transition: none; }
}

/* mobile 375px */
@media (max-width: 430px) {
  .cta { display: block; width: 100%; text-align: center; margin: 0 0 0.5rem; }
  .card-links { display: flex; flex-direction: column; gap: 0.6rem; }
  .stage { min-height: 22rem; }
  .tagline { display: none; }
}

.site-foot {
  margin-top: 3rem; padding: 1.2rem clamp(1rem, 4vw, 3rem);
  background: var(--navy-deep); color: #9fb0d0; font-size: 0.85rem;
}
.site-foot a { color: var(--cream); }
