/* Palette supplied for this page */
:root {
  --black: #000000ff;
  --prussian-blue: #14213dff;
  --orange: #fca311ff;
  --alabaster-grey: #e5e5e5ff;
  --white: #ffffffff;

  /* Light theme roles */
  color-scheme: light;
  --bg: var(--white);
  --bg-alt: #f4f4f4;
  --card: var(--white);
  --ink: var(--black);
  --ink-2: var(--prussian-blue);
  --muted: #5b6478;
  --line: var(--alabaster-grey);
  --grid: #ececec;
  --accent: var(--orange);
  --on-accent: var(--black);

  /* Chart roles (validated: blue/orange ΔE 57.8, CVD-safe) */
  --s1: var(--prussian-blue);
  --s2: var(--orange);
  --s-neutral: #b4bac6;
  --nest-1: var(--alabaster-grey);
  --nest-2: #8a96b0;
  --nest-3: var(--prussian-blue);
  --nest-4: var(--orange);
  --nest-3-ink: var(--white);

  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--black);
    --bg-alt: #070c18;
    --card: var(--prussian-blue);
    --ink: var(--white);
    --ink-2: var(--alabaster-grey);
    --muted: #aab3c5;
    --line: #26334f;
    --grid: #22304d;
    --s1: #9db0dc;
    --s-neutral: #5a6a8f;
    --nest-1: #2a3b63;
    --nest-2: #3a4f80;
    --nest-3: #9db0dc;
    --nest-3-ink: var(--black);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--black);
  --bg-alt: #070c18;
  --card: var(--prussian-blue);
  --ink: var(--white);
  --ink-2: var(--alabaster-grey);
  --muted: #aab3c5;
  --line: #26334f;
  --grid: #22304d;
  --s1: #9db0dc;
  --s-neutral: #5a6a8f;
  --nest-1: #2a3b63;
  --nest-2: #3a4f80;
  --nest-3: #9db0dc;
  --nest-3-ink: var(--black);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: inherit;
}
h1,
h2,
h3 {
  margin: 0;
}
.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus {
  left: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.noscript-note {
  margin: 0;
  padding: 12px 16px;
  background: var(--prussian-blue);
  color: var(--white);
  font-size: 0.9rem;
  text-align: center;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px max(16px, calc((100% - 1120px) / 2));
  background: var(--black);
  color: var(--white);
  border-bottom: 1px solid #1c2438;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-tag {
  width: 18px;
  height: 18px;
  background: var(--orange);
  clip-path: polygon(0 30%, 30% 0, 100% 0, 100% 100%, 0 100%);
  border-radius: 2px;
}
.topbar nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.topbar nav a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--alabaster-grey);
}
.topbar nav a:hover {
  background: var(--prussian-blue);
  color: var(--white);
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--alabaster-grey);
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #2a3550;
  position: relative;
  transition: background 0.2s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s;
}
.switch input:checked + .switch-track {
  background: var(--orange);
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--black);
}
.switch input:focus-visible + .switch-track {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */
.hero {
  background: var(--black);
  color: var(--white);
  padding: clamp(40px, 7vw, 88px) 0 clamp(36px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 60vw;
  height: 60vw;
  max-width: 720px;
  max-height: 720px;
  background: radial-gradient(circle, rgba(252, 163, 17, 0.18), transparent 65%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 32px;
}
.kicker {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
}
h1 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.86;
  font-size: clamp(4rem, 15vw, 10.5rem);
  letter-spacing: -0.01em;
}
h1 span {
  display: block;
}
h1 span:last-child {
  color: transparent;
  -webkit-text-stroke: 2px var(--orange);
}
.lede {
  max-width: 34rem;
  margin: 22px 0 0;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--alabaster-grey);
}
.lede strong {
  color: var(--orange);
}
.tag {
  width: clamp(130px, 18vw, 210px);
  transform: rotate(8deg);
  overflow: visible;
  filter: drop-shadow(0 20px 40px rgba(252, 163, 17, 0.25));
}
.tag-body {
  fill: var(--orange);
}
.tag-hole {
  fill: var(--black);
}
.tag-string {
  fill: none;
  stroke: var(--alabaster-grey);
  stroke-width: 3;
}
.tag-small {
  font: 700 15px var(--sans);
  letter-spacing: 0.08em;
  fill: var(--black);
}
.tag-big {
  font: 400 80px var(--display);
  fill: var(--black);
}

.stats {
  list-style: none;
  padding: 0;
  margin: clamp(32px, 5vw, 56px) 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: #1c2438;
  border: 2px solid #1c2438;
  border-radius: var(--radius);
  overflow: hidden;
}
.stats li {
  background: var(--prussian-blue);
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats li.stat-hot {
  background: var(--orange);
  color: var(--black);
}
.stat-num {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--alabaster-grey);
}
.stat-hot .stat-label {
  color: var(--black);
}
.stat-src {
  margin-top: auto;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8f9ab3;
}
.stat-hot .stat-src {
  color: var(--prussian-blue);
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(56px, 8vw, 104px) 0;
}
.section-alt {
  background: var(--bg-alt);
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  background: var(--accent);
  border-radius: 2px;
}
h2 {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5.5vw, 3.75rem);
  line-height: 0.98;
  max-width: 20ch;
  text-wrap: balance;
}
.section-lede {
  max-width: 44rem;
  margin: 14px 0 32px;
  font-size: 1.08rem;
  color: var(--muted);
}
.card {
  margin: 0 0 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 28px);
  min-width: 0;
}
figcaption h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
figcaption p {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.cap-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.cap-row > div:first-child {
  flex: 1 1 320px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-2 .card {
  margin: 0;
}
.grid-2 + .card,
.card + .grid-2 {
  margin-top: 20px;
}
.note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 14px 0 0;
}

/* ---------- Myth vs record ---------- */
.myth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}
.myth-card {
  position: relative;
  padding: 22px 22px 18px;
  border-radius: var(--radius);
  border: 2px dashed var(--line);
  background: var(--card);
}
.myth-card p {
  margin: 10px 0 8px;
  font-size: 1.05rem;
  font-weight: 500;
}
.myth-card:not(.myth-true) p,
.myth-card:not(.myth-true) s {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  color: var(--muted);
}
.myth-true {
  border-style: solid;
  border-color: var(--ink-2);
}
.myth-badge {
  display: inline-block;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--line);
  color: var(--ink);
}
.myth-true .myth-badge {
  background: var(--accent);
  color: var(--on-accent);
}
.myth-note {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.timeline li {
  background: var(--bg);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.tl-year {
  font-family: var(--display);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.tl-year::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--line);
}
.tl-kind {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--line);
  color: var(--ink);
}
.tl-kind[data-kind="online"] {
  background: var(--accent);
  color: var(--on-accent);
}
.tl-kind[data-kind="name"] {
  background: var(--ink-2);
  color: var(--bg);
}
.tl-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}
.tl-text {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- Nested squares ---------- */
.nest {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-top: 20px;
}
.nest-plot svg {
  display: block;
  width: 100%;
  height: auto;
}
.nest-l {
  font: 700 17px var(--sans);
  fill: var(--ink);
  font-variant-numeric: tabular-nums;
}
.nest-l-1 {
  font: 400 26px var(--display);
}
.nest-l-2 {
  font-size: 18px;
}
.nest-l-3 {
  fill: var(--nest-3-ink);
}
.nest-l-sm {
  font-size: 14px;
}
.nest-l-xs {
  font-size: 11.5px;
  font-weight: 600;
}
.nest-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}
.nest-legend li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 4px 14px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.nest-legend li:last-child {
  border-bottom: 0;
}
.nest-legend .sw {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  align-self: center;
}
.nest-name {
  font-weight: 600;
}
.nest-val {
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.nest-share {
  grid-column: 2 / -1;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Charts ---------- */
.chart {
  position: relative;
  margin-top: 16px;
  height: 260px;
}
.chart-tall {
  height: 340px;
}
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.axis text,
.dlabel,
.ref-label {
  font: 500 11.5px var(--sans);
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dlabel {
  font-weight: 700;
  font-size: 12.5px;
  fill: var(--ink);
}
.gridline {
  stroke: var(--grid);
  stroke-width: 1;
}
.baseline {
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.6;
}
.ref-line {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.ref-label {
  fill: var(--ink);
  font-weight: 700;
}
.crosshair {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.bar {
  transition: opacity 0.15s;
}
.chart.is-hovering .bar:not(.is-active) {
  opacity: 0.45;
}
.hit {
  fill: transparent;
  cursor: crosshair;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  font-size: 0.85rem;
  font-weight: 500;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.sw-1 {
  background: var(--s1);
}
.sw-2 {
  background: var(--s2);
}
.sw-dash {
  width: 22px;
  height: 0;
  border-top: 2px dashed var(--muted);
  border-radius: 0;
}

.table-view {
  margin-top: 14px;
  font-size: 0.85rem;
}
.table-view summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.table-view table {
  border-collapse: collapse;
  margin-top: 10px;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.table-view th,
.table-view td {
  text-align: right;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}
.table-view th:first-child,
.table-view td:first-child {
  text-align: left;
}
.table-wrap {
  overflow-x: auto;
}

/* Tooltip */
.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  min-width: 140px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--black);
  color: var(--white);
  font-size: 0.8125rem;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 1px solid #2a3550;
}
.tip strong {
  display: block;
  font-size: 0.875rem;
  margin-bottom: 4px;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.tip-row span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--alabaster-grey);
}
.tip-row b {
  font-variant-numeric: tabular-nums;
}
.tip .sw {
  width: 10px;
  height: 10px;
}
.tip .tip-note {
  margin-top: 6px;
  color: #aab3c5;
  font-size: 0.75rem;
}

/* ---------- Head to head ---------- */
.h2h {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}
.h2h-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.h2h-head span:first-child {
  text-align: right;
  padding-right: 10px;
}
.h2h-head span:last-child {
  padding-left: 10px;
}
.h2h-row-label {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.h2h-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: center;
}
.h2h-side {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
}
.h2h-side.left {
  flex-direction: row-reverse;
}
.h2h-bar {
  height: 100%;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.h2h-side.left .h2h-bar {
  background: var(--s1);
}
.h2h-side.right .h2h-bar {
  background: var(--s2);
}
.h2h-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.95rem;
}
.h2h-win {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--ink);
}

/* ---------- Cyber week stack ---------- */
.stack {
  margin-top: 22px;
}
.stack-bar {
  display: flex;
  gap: 2px;
  height: 64px;
}
.stack-seg {
  height: 100%;
  border-radius: 4px;
  cursor: default;
  transition: filter 0.15s;
}
.stack-seg:hover,
.stack-seg:focus-visible {
  filter: brightness(1.12);
}
.stack-labels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.stack-labels div {
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.3;
}
.stack-labels b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stack-labels span {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
.stack-labels .sw {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
}
.stack-total {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
.stack-total b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2.2rem;
  color: var(--ink);
}

/* ---------- Segmented control ---------- */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.seg button {
  font: 600 0.85rem var(--sans);
  border: 0;
  background: none;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Horizontal bars ---------- */
.hbars {
  margin-top: 22px;
  display: grid;
  gap: 4px;
}
.hb-row {
  display: grid;
  grid-template-columns: minmax(150px, 260px) 1fr;
  gap: 16px;
  align-items: center;
  padding: 6px 0;
  border-radius: 8px;
}
.hb-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}
.hb-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}
.hb-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.hb-bar {
  height: 26px;
  border-radius: 0 4px 4px 0;
  background: var(--s-neutral);
  min-width: 3px;
  transition:
    width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.15s;
}
.hb-row[data-group="us"] .hb-bar {
  background: var(--s1);
}
.hb-row[data-group="cn"] .hb-bar {
  background: var(--s2);
}
.hbars.is-hovering .hb-row:not(.is-active) .hb-bar {
  opacity: 0.45;
}
.hb-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.95rem;
}
.hb-legend {
  margin-top: 8px;
}

/* ---------- Births ---------- */
.births {
  margin-top: 20px;
  position: relative;
}
.births-axis {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 6px;
  position: relative;
}
.births-axis::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 15px;
  height: 2px;
  background: var(--line);
}
.b-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.b-year {
  position: relative;
  z-index: 1;
  font: 700 0.8rem var(--sans);
  background: var(--card);
  padding: 6px 4px;
  font-variant-numeric: tabular-nums;
}
.b-col.has .b-year {
  background: var(--ink);
  color: var(--card);
  border-radius: 6px;
  padding: 6px 8px;
}
.b-chip {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.25;
  padding: 6px 4px;
  border-radius: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.b-chip small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}
.b-chip[data-kind="bf"] {
  border-color: var(--s1);
  border-width: 2px;
}
.b-chip[data-kind="local"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.b-chip[data-kind="local"] small {
  color: var(--prussian-blue);
}
.births-legend {
  margin-top: 16px;
}
.sw-chip-bf {
  background: transparent;
  border: 2px solid var(--s1);
}
.sw-chip-local {
  background: var(--accent);
}

/* ---------- Countries ---------- */
.countries-heading {
  margin: 28px 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.countries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.country {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.country-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.country-code {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-2);
}
.country-when {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-alt);
  color: var(--muted);
  white-space: nowrap;
}
.country-event {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}
.country-name {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.country p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--black);
  color: var(--alabaster-grey);
  padding: 56px 0 64px;
}
.footer h2 {
  font-size: 2rem;
  color: var(--white);
}
.footer .note {
  color: #aab3c5;
  max-width: 50rem;
  font-size: 0.875rem;
}
.sources {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  columns: 2 320px;
  column-gap: 32px;
  font-size: 0.875rem;
}
.sources li {
  break-inside: avoid;
  padding: 6px 0;
  border-bottom: 1px solid #1c2438;
}
.sources a {
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}
.sources a:hover {
  color: var(--orange);
}
.colophon {
  margin-top: 28px;
  font-size: 0.8rem;
  color: #8f9ab3;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2,
  .nest {
    grid-template-columns: 1fr;
  }
  .nest-plot {
    max-width: 420px;
  }
}
@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .topbar nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .switch {
    margin-left: auto;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .tag {
    position: absolute;
    right: 16px;
    top: 28px;
    width: 96px;
    opacity: 0.95;
  }
  .hero .kicker {
    padding-right: 100px;
  }
  .myth {
    grid-template-columns: 1fr;
  }
  .hb-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .births-axis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 18px;
  }
  .births-axis::before {
    display: none;
  }
}
@media (max-width: 540px) {
  .stack-labels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .stack-labels b {
    font-size: 1.05rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
@media (forced-colors: active) {
  .hb-bar,
  .h2h-bar,
  .stack-seg,
  .bar {
    forced-color-adjust: none;
    border: 1px solid CanvasText;
  }
}
