/* thestory.today — single stylesheet, no framework */
:root {
  --ink: #1b1b22;
  --ink-soft: #494952;
  --paper: #fbfaf7;
  --card: #ffffff;
  --line: #e3e1da;
  --accent: #1d3a5f;
  --accent-ink: #16304f;
  --met: #0a5c36;
  --met-bg: #e7f4ec;
  --missed: #a11a2e;
  --missed-bg: #fdecee;
  --pending: #6b5300;
  --pending-bg: #fbf3d9;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}

.wrap { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: .5rem 1rem; z-index: 10;
}
.skip:focus { left: 0; }

/* Header */
.site-head { background: var(--accent); color: #fff; }
.head-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; padding: .65rem 1rem; }
.brand { color: #fff; text-decoration: none; font-size: 1.15rem; letter-spacing: .01em; }
.brand strong { font-weight: 800; }
.nav { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem .9rem; margin: 0; padding: 0; }
.nav a { color: #e8eef7; text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a:focus { color: #fff; border-bottom-color: #fff; }
.nav a[aria-current="page"] { color: #fff; border-bottom-color: #f0c541; font-weight: 600; }

main { padding: 1.75rem 1rem 3rem; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: .5rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .4rem; }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }

.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 42rem; }

/* Evidence tier badges */
.badge {
  display: inline-block;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .1rem .4rem;
  border-radius: .25rem;
  vertical-align: .12em;
  white-space: nowrap;
}
.b-established { color: #0a5c36; background: #e7f4ec; border: 1px solid #b5dcc5; }
.b-unverified  { color: #7a5200; background: #fdf3dd; border: 1px solid #ecd9a4; }
.b-contested   { color: #a11a2e; background: #fdecee; border: 1px solid #f2c2c9; }
.b-testimony   { color: #4338ca; background: #edebfc; border: 1px solid #cdc8f2; }

.stat { font-weight: 600; }
.stat .src { font-weight: 400; font-size: .85rem; }

/* Cards / lists */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .5rem;
  padding: 1rem 1.15rem;
  margin: .8rem 0;
}

/* Timeline */
.tl { list-style: none; margin: 0; padding: 0; border-left: 3px solid var(--line); }
.tl li { position: relative; margin: 0 0 1.4rem; padding: 0 0 0 1.25rem; }
.tl li::before {
  content: ""; position: absolute; left: -.5rem; top: .45rem;
  width: .8rem; height: .8rem; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper);
}
.tl time { font-weight: 700; color: var(--accent-ink); display: block; font-size: .95rem; }
.tl h2 { font-size: 1.1rem; margin: .1rem 0 .25rem; }
.tl p { margin: 0 0 .3rem; }
.tl .src-line { font-size: .9rem; }
.tl-era { margin-top: 2.4rem; }

/* Tracker */
.milestone { border-left: .35rem solid var(--line); }
.milestone.is-met { border-left-color: var(--met); }
.milestone.is-missed { border-left-color: var(--missed); }
.milestone.is-pending { border-left-color: var(--pending); }
.m-head { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: baseline; }
.m-head h2 { font-size: 1.1rem; margin: 0; }
.status {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: .12rem .5rem; border-radius: .25rem;
}
.s-met { color: var(--met); background: var(--met-bg); }
.s-missed { color: var(--missed); background: var(--missed-bg); }
.s-pending { color: var(--pending); background: var(--pending-bg); }
.m-meta { font-size: .92rem; color: var(--ink-soft); margin: .25rem 0; }
.counter { font-weight: 700; }
.counter.overdue { color: var(--missed); }

/* Recommendations */
details.report { margin: 1rem 0; }
details.report summary {
  cursor: pointer; font-size: 1.15rem; font-weight: 700; padding: .6rem .2rem;
}
.rec-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.rec-table caption { text-align: left; font-size: .9rem; color: var(--ink-soft); padding: .3rem 0 .5rem; }
.rec-table th, .rec-table td { text-align: left; vertical-align: top; padding: .5rem .5rem .5rem 0; border-top: 1px solid var(--line); }
.rec-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.rs { white-space: nowrap; }
.rs-implemented { color: var(--met); font-weight: 700; }
.rs-partial { color: var(--pending); font-weight: 700; }
.rs-ignored { color: var(--missed); font-weight: 700; }
.tally { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: .4rem 0 1rem; padding: 0; list-style: none; }

/* Utility */
.note {
  background: #f2f0ea; border-left: .3rem solid var(--accent);
  padding: .7rem 1rem; border-radius: 0 .4rem .4rem 0; font-size: .95rem;
}
.grid2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: .55rem 1.1rem; border-radius: .4rem; font-weight: 600;
}
.btn:hover, .btn:focus { background: var(--accent-ink); color: #fff; }

/* At a glance: hero, tiles, bars, map */
.hero-tile {
  background: var(--accent); color: #fff; border-radius: .6rem;
  padding: 1.4rem 1.5rem; margin: 1.2rem 0 1.8rem;
}
.hero-label { margin: 0 0 .2rem; color: #cfdcee; font-size: .95rem; }
.hero-num { margin: 0; font-size: clamp(2.6rem, 7vw, 3.4rem); font-weight: 650; line-height: 1.1; }
.hero-sub { margin: .5rem 0 0; color: #e8eef7; font-size: .95rem; }
.hero-sub a { color: #f0c541; }

.tiles { display: grid; gap: .8rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: .5rem; padding: .9rem 1rem; }
.tile-label { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.tile-value { margin: .15rem 0; font-size: 1.45rem; font-weight: 650; line-height: 1.25; }
.tile-value .src { font-size: .8rem; }
.tile-sub { margin: 0; font-size: .85rem; color: var(--ink-soft); }

.bar-row { margin: .9rem 0 1.1rem; }
.bar-title { margin: 0 0 .25rem; font-weight: 650; }
.bar-year { font-weight: 400; color: var(--ink-soft); }
.bar { display: flex; gap: 2px; height: 24px; }
.seg {
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; min-width: 6px;
  flex-basis: 0;
}
.seg-imp { background: #2e7d4f; color: #fff; }
.seg-par { background: #eda100; color: #1b1b22; }
.seg-ign { background: #d64545; color: #fff; }
.bar .seg:first-child { border-radius: 4px 0 0 4px; }
.bar .seg:last-child { border-radius: 0 4px 4px 0; }
.bar-sub { margin: .25rem 0 0; font-size: .85rem; color: var(--ink-soft); }

.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; font-size: .85rem; color: var(--ink-soft); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.key-imp { background: #2e7d4f; }
.key-par { background: #eda100; }
.key-ign { background: #d64545; }
.key-est { background: #2a78d6; border-radius: 50%; }
.key-alg { background: var(--paper); border: 2.5px solid #b7791f; border-radius: 2px; transform: rotate(45deg); width: 10px; height: 10px; }

.map-wrap { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; margin: 1rem 0; }
@media (min-width: 640px) { .map-wrap { grid-template-columns: minmax(260px, 340px) 1fr; } }
.ukmap { width: 100%; max-width: 340px; height: auto; display: block; }
.ukmap .coast { fill: #eceade; stroke: #cfccbe; stroke-width: 1; }
.ukmap .dot-est { fill: #2a78d6; stroke: var(--paper); stroke-width: 2; }
.ukmap .dot-alg { fill: var(--paper); stroke: #b7791f; stroke-width: 2.5; }
.ukmap a:hover .dot-est, .ukmap a:focus .dot-est,
.ukmap a:hover .dot-alg, .ukmap a:focus .dot-alg { stroke-width: 4; }
.ukmap .map-label { font-size: 10px; fill: var(--ink-soft); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: #f2f0ea; margin-top: 2rem; }
.site-foot .wrap { padding: 1.4rem 1rem 2rem; font-size: .95rem; }
.foot-small { color: var(--ink-soft); font-size: .85rem; }

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