/* Out of One Hundred — warm ground, flat colour, people as units.
   Titles stay small on purpose: the object does the talking. */

:root {
  --bg: #FFFCF5;
  --ink: #262019;
  --sub: #5C544A;
  --mut: #94897B;
  --line: #EFE7D9;
  --rule: #DCD2C0;
  --gold: #E9B44C;
  --hot: #D6532C;
  --font: "Bricolage Grotesque", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── type ─────────────────────────────────────────────── */

.kicker, .eyebrow {
  font-size: clamp(10.5px, 1.3vw, 12px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--mut);
}

.eyebrow .num {
  color: var(--ink);
  margin-right: 12px;
  padding-right: 12px;
  border-right: 1.5px solid var(--rule);
}

h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.022em;
  margin: 0.32em 0 0.3em;
}

h2 {
  font-size: clamp(22px, 2.7vw, 31px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.015em;
  max-width: 20em;
  margin: 8px 0 0.35em;
  text-wrap: balance;
}

.lede {
  font-size: clamp(15px, 1.6vw, 17.5px);
  color: var(--sub);
  max-width: 40em;
  text-wrap: pretty;
}

.lede b { color: var(--ink); font-weight: 700; }

/* ── structure ────────────────────────────────────────── */

.hero {
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(56px, 9vh, 96px) clamp(20px, 4vw, 40px) clamp(18px, 3vh, 30px);
}

.object-wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding: 0 clamp(20px, 4vw, 40px) clamp(40px, 7vh, 76px);
}

.block {
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(56px, 9vh, 104px) clamp(20px, 4vw, 40px);
  border-top: 2px dotted var(--line);
}

.stage { position: relative; width: 100%; }
canvas { display: block; width: 100%; }

.hint {
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--mut);
  text-transform: uppercase;
}

.legend-wrap { margin-top: 20px; }
.legend-wrap summary {
  display: flex; align-items: center; gap: 12px;
  list-style: none; cursor: pointer; padding: 6px 0; width: fit-content;
}
.legend-wrap summary::-webkit-details-marker { display: none; }
.legend-strip { display: flex; width: 168px; height: 10px; border-radius: 3px; overflow: hidden; }
.legend-strip i { flex: 1; }
.legend-count {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--mut);
}
.legend-count::after { content: " +"; }
.legend-wrap[open] .legend-count::after { content: " –"; }
.legend-wrap summary:hover .legend-count,
.legend-wrap summary:focus-visible .legend-count { color: var(--ink); }

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 20px;
  margin-top: 14px;
  max-width: 1000px;
}
.legend li {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--sub);
}
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.plate { margin-top: clamp(26px, 4vh, 40px); }
.plate svg { display: block; width: 100%; height: auto; overflow: visible; }

/* SVG text classes */
.axis-t { fill: var(--mut); font-weight: 500; letter-spacing: 0.01em; }
.bar-t { font-variant-numeric: tabular-nums; }
.anno-b { fill: var(--ink); font-weight: 700; }
.anno-s { fill: var(--sub); font-weight: 500; }

/* ── the pop-up ───────────────────────────────────────── */

.pop {
  position: absolute;
  pointer-events: none;
  width: 268px;
  background: var(--bg);
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  padding: 15px 16px 13px;
  box-shadow: 5px 6px 0 rgba(38, 32, 25, 0.13);
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 5;
}
.pop.on { opacity: 1; }

/* the 04 card is a panel, not a tooltip — the big output above it already says the age */
.pop--static { position: static; width: 100%; max-width: 360px; }
.pop--static .pop-age { display: none; }
.pop--static .pop-kick { margin-top: 0; }
/* the stats list below already carries the rate — don't say it twice */
.pop--static .pop-foot { display: none; }

.pop-age { display: flex; align-items: baseline; gap: 9px; }
.pop-age b {
  font-size: 44px; font-weight: 800; line-height: 0.88;
  letter-spacing: -0.035em; font-variant-numeric: tabular-nums;
}
.pop-age span { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--mut); }

.pop-kick {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.11em;
  color: var(--mut); margin-top: 10px;
}

.pop-bar { display: flex; height: 16px; margin: 7px 0 12px; border-radius: 3px; overflow: hidden; }
.pop-bar i { height: 100%; }

.pop-list { list-style: none; display: grid; gap: 5px; }
.pop-list li {
  display: grid; grid-template-columns: 12px 26px 1fr;
  align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--sub); line-height: 1.25;
}
.pop-list li u { width: 10px; height: 10px; border-radius: 3px; text-decoration: none; display: block; }
.pop-list li b { color: var(--ink); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

.pop-foot {
  margin-top: 11px; padding-top: 10px;
  border-top: 1.5px dotted var(--line);
  font-size: 12px; font-weight: 600; color: var(--mut);
}
.pop-foot b { color: var(--ink); font-weight: 800; }

/* ── 04 · your year ───────────────────────────────────── */

/* phone order: age → slider → the card it drives → the three stats.
   the card sits under the thumb so it reads while the finger is still on it. */
.you {
  display: grid;
  gap: clamp(26px, 3.4vw, 44px);
  margin-top: clamp(26px, 4vh, 40px);
  align-items: start;
  grid-template-areas: "head" "card" "stats";
}
.you-head { grid-area: head; }
.you .pop--static { grid-area: card; }
.you-stats { grid-area: stats; }

@media (min-width: 900px) {
  .you {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    grid-template-areas: "head card" "stats card";
    align-content: start;
  }
  .you .pop--static { justify-self: end; max-width: none; }
}

.you-age { display: flex; align-items: baseline; gap: 10px; }
.you-age output {
  font-size: clamp(60px, 9vw, 104px); font-weight: 800; line-height: 0.85;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.you-age span { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--mut); }

#ageRange {
  -webkit-appearance: none; appearance: none;
  width: 100%; margin: 15px 0 0; height: 44px; background: none; cursor: pointer;
}
#ageRange::-webkit-slider-runnable-track { height: 3px; background: var(--rule); border-radius: 2px; }
#ageRange::-moz-range-track { height: 3px; background: var(--rule); border-radius: 2px; }
#ageRange::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -9.5px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--ink);
}
#ageRange::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--ink);
}
#ageRange:focus-visible { outline: none; }
#ageRange:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 5px rgba(214, 83, 44, .35); }

.you-scale {
  display: flex; justify-content: space-between; margin-top: -4px;
  font-size: 11.5px; font-weight: 600; color: var(--mut); font-variant-numeric: tabular-nums;
}

.you-stats { list-style: none; display: grid; gap: 16px; }
.you-stats li { display: grid; gap: 1px; }
.you-stats b {
  font-size: clamp(22px, 2.6vw, 29px); font-weight: 800;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.you-stats span { font-size: 13.5px; font-weight: 600; color: var(--mut); }

/* ── colophon ─────────────────────────────────────────── */

.colophon {
  border-top: 2px dotted var(--line);
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(40px, 6vh, 72px) clamp(20px, 4vw, 40px) clamp(56px, 8vh, 88px);
}

.method summary {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mut);
  cursor: pointer; list-style: none; padding: 6px 0;
  border-bottom: 1.5px solid transparent; width: fit-content;
}
.method summary::-webkit-details-marker { display: none; }
.method summary::after { content: " +"; }
.method[open] summary::after { content: " –"; }
.method summary:hover, .method summary:focus-visible { color: var(--ink); border-bottom-color: var(--rule); outline: none; }

.colo-text { max-width: 660px; margin: 22px 0 0; display: grid; gap: 15px; }
.colo-text p { font-size: 13.5px; line-height: 1.65; color: var(--sub); }
.colo-text b { color: var(--ink); }
.cite { font-size: 11.5px; color: var(--mut); }

.sig { margin-top: 40px; }
.sig a {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--sub);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  padding: 6px 0;
  transition: color .18s ease, text-decoration-color .18s ease;
}
.sig a:hover, .sig a:focus-visible { color: var(--ink); text-decoration-color: var(--ink); }

/* ── reveal ───────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (min-width: 701px) {
  .legend-wrap summary { display: none; }
  .legend { margin-top: 2px; }
}

@media (max-width: 700px) {
  .pop { width: 240px; padding: 13px 14px 11px; }
  .pop-age b { font-size: 38px; }
  .pop--static { width: 100%; max-width: none; }
}
