/* openttd-bench.com — the OpenTTD-Bench pixel language from the play-openttd
   infographics (docs/infographics/shared/bench.css), made responsive.
   Pixel rule: no rounded panels, no soft shadows; depth comes from inset
   bevels and hard offset shadows. Motion is transform/opacity apart from the
   drawer height and the sparkline draw, and is off under prefers-reduced-motion.
   Jersey 15 has one weight, so faux bold is disabled to keep its digits crisp. */

@font-face {
  font-family: "Jersey 15";
  src: url(fonts/jersey15-latin.woff2) format("woff2");
  font-display: swap;
}

@font-face {
  font-family: Nunito;
  src: url(fonts/nunito-latin.woff2) format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

:root {
  --sky1: #8ec0e8;
  --sky2: #7eb4de;
  --sky3: #6ea8d4;
  --sky4: #5e9cca;
  --sky5: #5290c0;
  --sky6: #4884b6;
  --cloud: #f4f7fb;
  --cloud-lo: #d9e4ef;
  --sun: #f0c44a;
  --sun2: #d89a1c;
  --grass-a: #62a03c;
  --grass-b: #4e8a2e;
  --grass-c: #3d701f;
  --dirt-a: #8a5a30;
  --dirt-b: #6e4420;
  --stone: #b0aa9f;
  --ink: #24160a;
  --muted: #5c4030;
  --panel: #ead6a0;
  --panel2: #e2cb8f;
  --hi: #f7ebc4;
  --lo: #a07a3c;
  --bar: #2c4874;
  --bar-hi: #4a6a9e;
  --bar-lo: #1e3454;
  --ink-on-bar: #f3e6c0;
  --close: #c45a32;
  --close-hi: #f0a080;
  --close-lo: #6a2010;
  --strip: #3a2818;
  --strip-hi: #5a4030;
  --strip-lo: #24180c;
  --strip-ink: #ead6a8;
  --gold: #f0c070;
  --title: #ff6e00;
  --title-lo: #7a3200;
  --brand: hsl(50 100% 60%);
  --brand-lo: hsl(50 100% 20%);
  --tag: hsl(50 100% 50%);
  --tag-lo: hsl(50 100% 17%);
  --track: rgba(36, 22, 10, 0.1);
  --pix: "Jersey 15", "Courier New", monospace;
  --body: Nunito, "Trebuchet MS", system-ui, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --wrap: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  font-synthesis: none;
  background: var(--strip);
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  color: var(--ink);
  font: 600 16px/1.5 var(--body);
  background-color: var(--stone);
  background-image:
    linear-gradient(45deg, rgba(36, 22, 10, 0.08) 25%, transparent 25%, transparent 75%, rgba(36, 22, 10, 0.08) 75%),
    linear-gradient(45deg, rgba(36, 22, 10, 0.08) 25%, transparent 25%, transparent 75%, rgba(36, 22, 10, 0.08) 75%);
  background-size: 96px 96px;
  background-position: 0 0, 48px 48px;
}

/* Big windows scale the page instead of leaving a thin column: from 2200px
   wide everything grows with the window, up to 1.75x (a 4K screen at 100%).
   tan(atan2(a, b)) is a / b as a plain number. The tooltip sits outside.
   Lengths inside are zoomed too, so viewport-relative ones divide by --zoom. */
:root { --zoom: clamp(1, tan(atan2(100vw, 2200px)), 1.75); }
.sky, main, footer { zoom: var(--zoom); }

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--title); outline-offset: 2px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--panel);
  font-weight: 800;
}
.skip:focus { top: 8px; }

/* ---------- sky header ---------- */

.sky {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background: linear-gradient(
    var(--sky1) 0 16.66%,
    var(--sky2) 16.66% 33.33%,
    var(--sky3) 33.33% 50%,
    var(--sky4) 50% 66.66%,
    var(--sky5) 66.66% 83.33%,
    var(--sky6) 83.33% 100%
  );
}

.sky .wrap { position: relative; z-index: 1; }

.sun, .cloud { position: absolute; pointer-events: none; image-rendering: pixelated; }

.sun {
  right: max(56px, calc((100% - var(--wrap)) / 2 + 40px));
  top: 104px;
  width: 40px;
  height: 40px;
  background: var(--sun);
  box-shadow:
    0 -10px 0 var(--sun), 0 10px 0 var(--sun), 10px 0 0 var(--sun), -10px 0 0 var(--sun),
    8px -8px 0 var(--sun), -8px -8px 0 var(--sun), 8px 8px 0 var(--sun), -8px 8px 0 var(--sun),
    12px -4px 0 var(--sun2), 12px 4px 0 var(--sun2), -12px -4px 0 var(--sun2), -12px 4px 0 var(--sun2),
    4px -12px 0 var(--sun2), -4px -12px 0 var(--sun2), 4px 12px 0 var(--sun2), -4px 12px 0 var(--sun2);
}

.sun::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 17px;
  width: 6px;
  height: 6px;
  box-shadow:
    0 -44px 0 var(--sun), 0 44px 0 var(--sun), 44px 0 0 var(--sun), -44px 0 0 var(--sun),
    0 -56px 0 var(--sun2), 0 56px 0 var(--sun2), 56px 0 0 var(--sun2), -56px 0 0 var(--sun2),
    33px -33px 0 var(--sun2), -33px -33px 0 var(--sun2), 33px 33px 0 var(--sun2), -33px 33px 0 var(--sun2),
    42px -42px 0 var(--sun2), -42px -42px 0 var(--sun2), 42px 42px 0 var(--sun2), -42px 42px 0 var(--sun2);
}

/* clouds drift right across the whole sky; a negative delay spreads them out.
   --x is where each cloud rests when motion is reduced. */
.cloud {
  left: 0;
  transform: translateX(calc(var(--x) / var(--zoom)));
  height: 14px;
  width: var(--w);
  top: var(--y);
  opacity: var(--o, 1);
  background: var(--cloud);
  box-shadow: calc(var(--w) / 5) -10px 0 0 var(--cloud), inset 0 -3px 0 var(--cloud-lo);
  animation: drift var(--t) linear infinite;
  animation-delay: var(--d);
  will-change: transform;
}

@keyframes drift {
  from { transform: translateX(-160px); }
  to { transform: translateX(calc(100vw / var(--zoom))); }
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
}

.brand {
  font-family: var(--pix);
  font-size: 34px;
  line-height: 1;
  color: var(--brand);
  text-shadow: 3px 3px 0 var(--brand-lo);
  text-decoration: none;
}

.top nav { display: flex; gap: 4px; }

.top nav a {
  font-family: var(--pix);
  font-size: 21px;
  line-height: 1;
  color: var(--ink-on-bar);
  background: rgba(30, 52, 84, 0.72);
  box-shadow: inset 2px 2px 0 rgba(74, 106, 158, 0.6), inset -2px -2px 0 rgba(20, 34, 56, 0.6);
  text-decoration: none;
  padding: 6px 10px;
  transition: transform 0.18s var(--ease);
}
.top nav a:hover { transform: translateY(-2px); }

.hero { padding: 40px 0 34px; max-width: 820px; }

.tag {
  font-family: var(--pix);
  font-size: 23px;
  line-height: 1;
  color: var(--tag);
  text-shadow: 2px 2px 0 var(--tag-lo);
}

.hero h1 {
  margin-top: 10px;
  font-family: var(--pix);
  font-weight: 400;
  font-size: clamp(44px, 7.4vw, 76px);
  line-height: 0.92;
  color: var(--title);
  text-shadow: 3px 3px 0 var(--title-lo), -1px -1px 0 var(--title-lo), 1px -1px 0 var(--title-lo), -1px 1px 0 var(--title-lo);
  text-wrap: balance;
}

.lede {
  margin-top: 16px;
  max-width: 660px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.news {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 7px 12px 7px 8px;
  background: var(--panel);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo), 3px 3px 0 rgba(36, 22, 10, 0.4);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.3;
  text-decoration: none;
  transition: transform 0.18s var(--ease);
}
.news:hover { transform: translateY(-2px); }

.chip {
  display: inline-block;
  font-family: var(--pix);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  padding: 3px 6px 2px;
  color: #fff;
  background: var(--title);
  white-space: nowrap;
}
.chip.gold { color: var(--title-lo); background: var(--sun); box-shadow: inset 1px 1px 0 #fbe08c, inset -1px -1px 0 var(--sun2); }
.chip.dim { color: var(--strip-ink); background: #7a6a58; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.facts div {
  padding: 8px 14px 7px;
  background: var(--strip);
  color: var(--strip-ink);
  box-shadow: inset 2px 2px 0 var(--strip-hi), inset -2px -2px 0 var(--strip-lo);
}
.facts dt { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.facts dd { font-family: var(--pix); font-size: 26px; line-height: 1; color: var(--gold); }

/* ground: stepped grass and dirt blocks with a few pixel tufts */
.ground { position: relative; }
.ground .grass {
  height: 18px;
  background: repeating-linear-gradient(90deg, var(--grass-b) 0 34px, var(--grass-c) 34px 68px, var(--grass-a) 68px 102px);
  box-shadow: inset 0 3px 0 rgba(226, 242, 190, 0.4);
}
.ground .dirt {
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--dirt-a) 0 68px, var(--dirt-b) 68px 136px);
  box-shadow: inset 0 2px 0 rgba(20, 10, 4, 0.22), inset 0 -2px 0 rgba(20, 10, 4, 0.3);
}
.tuft {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 2px;
  background: var(--grass-c);
  box-shadow:
    -4px -2px 0 var(--grass-c), -4px -4px 0 var(--grass-b), -6px -6px 0 var(--grass-b), -6px -8px 0 var(--grass-a),
    0 -2px 0 var(--grass-c), 0 -4px 0 var(--grass-b), 0 -6px 0 var(--grass-b), 0 -8px 0 var(--grass-a), 0 -10px 0 var(--grass-a),
    4px -2px 0 var(--grass-c), 4px -4px 0 var(--grass-b), 6px -6px 0 var(--grass-b), 6px -8px 0 var(--grass-a);
}

/* ---------- windows ---------- */

main { padding: 34px 0 56px; }
main .wrap { display: grid; gap: 30px; }

.win {
  background: var(--panel);
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 var(--lo), 5px 5px 0 rgba(36, 22, 10, 0.42);
  min-width: 0;
}

.cap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px 6px;
  background: var(--bar);
  color: var(--ink-on-bar);
  box-shadow: inset 3px 3px 0 var(--bar-hi), inset -3px -3px 0 var(--bar-lo);
}
.cap h2 { margin-right: auto; font-family: var(--pix); font-weight: 400; font-size: 26px; line-height: 1.1; }
.cap .sub { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; text-align: right; }

.x {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  position: relative;
  background: var(--close);
  box-shadow: inset 2px 2px 0 var(--close-hi), inset -2px -2px 0 var(--close-lo);
}
.x::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 2px;
  height: 2px;
  background: #f8e0d4;
  box-shadow: 4px 0 0 #f8e0d4, 2px 2px 0 #f8e0d4, 0 4px 0 #f8e0d4, 4px 4px 0 #f8e0d4;
}

.body { padding: 16px 18px 18px; }
.intro { max-width: 760px; font-size: 15px; color: var(--muted); font-weight: 700; }
.intro + * { margin-top: 14px; }

/* reveal on scroll: windows rise a few pixels into place, once */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- controls ---------- */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  padding: 2px 4px 6px 2px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 6px 12px 5px;
  font-size: 14px;
  font-weight: 800;
  background: var(--panel2);
  box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo);
  transition: transform 0.15s var(--ease), background-color 0.15s;
}
.tab:hover { transform: translateY(-1px); }
.tab[aria-pressed="true"] {
  color: var(--ink-on-bar);
  background: var(--bar);
  box-shadow: inset 2px 2px 0 var(--bar-lo), inset -2px -2px 0 var(--bar-hi);
  transform: none;
}

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 34px; height: 18px; background: var(--strip); box-shadow: inset 2px 2px 0 var(--strip-lo), inset -2px -2px 0 var(--strip-hi); position: relative; cursor: pointer; flex: 0 0 auto; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; background: var(--panel); transition: transform 0.18s var(--ease), background-color 0.18s; }
.toggle input:checked::after { transform: translateX(16px); background: var(--gold); }

.metric-note { font-size: 13.5px; color: var(--muted); font-weight: 700; margin-bottom: 10px; min-height: 2.9em; }

/* ---------- leaderboard ---------- */

.board { position: relative; overflow-x: clip; }
.js .board.loading { min-height: 545px; } /* about ten rows, so the page doesn't jump when they arrive */

.lrow {
  position: relative;
  background: var(--panel);
  border-top: 1px solid rgba(36, 22, 10, 0.12);
  transition: transform 0.45s var(--ease), opacity 0.3s;
}
.lrow.is-first { border-top: 0; }
.lrow.retired .who, .lrow.retired .val { opacity: 0.86; }
.lrow.retired .layer { opacity: 0.6; }
.lrow.hidden { display: none; }

.lhead {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(190px, 250px) 1fr 118px 18px;
  align-items: center;
  gap: 14px;
  padding: 9px 8px;
  text-align: left;
  transition: background-color 0.15s;
}
.lhead:hover { background: rgba(36, 22, 10, 0.05); }
.lrow.open .lhead { background: rgba(36, 22, 10, 0.07); }

.rk { font-family: var(--pix); font-size: 24px; color: #7a5a2a; text-align: center; line-height: 1; }
.lrow.is-first .rk { color: var(--title); text-shadow: 1px 1px 0 var(--title-lo); }

.who { min-width: 0; }
.who b { display: block; font-size: 16px; font-weight: 800; color: color-mix(in srgb, var(--c) 78%, #000); line-height: 1.2; }
.who small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.who .chip { margin-left: 6px; vertical-align: 2px; }

.val { font-family: var(--pix); font-size: 26px; line-height: 1; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.val.na { color: #6e5c3e; }

.caret { width: 10px; height: 10px; justify-self: center; border-right: 3px solid var(--muted); border-bottom: 3px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.25s var(--ease); }
.lrow.open .caret { transform: rotate(225deg) translate(-2px, -2px); }

/* strip: one dot per game, a line from worst to best, a tick at the median.
   Every moving part is a full-width layer translated by a percentage of the
   track, so metric changes animate on the compositor. */
.strip { position: relative; height: 28px; }
.strip .grid { position: absolute; inset: 0; }
.strip .grid i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(36, 22, 10, 0.12); }
.layer { position: absolute; inset: 0; pointer-events: none; transition: transform 0.6s var(--ease), opacity 0.4s; }
.range { top: 13px; bottom: auto; height: 2px; background: var(--c); opacity: 0.55; transform-origin: 0 50%; }
.dot { display: block; width: 13px; height: 13px; margin: 7.5px 0 0 -6.5px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(36, 22, 10, 0.55); pointer-events: auto; cursor: default; transition: transform 0.15s var(--ease); }
.dot.alt { background: color-mix(in srgb, var(--c) 18%, var(--panel)); box-shadow: inset 0 0 0 2px var(--c); }
.dot:hover { transform: scale(1.35); }
.med { display: block; width: 5px; height: 24px; margin: 2px 0 0 -2.5px; background: var(--ink); box-shadow: 0 0 0 1px var(--panel); }

/* first draw: every dot drives in from the left edge, row by row */
.js .board:not(.drawn) .layer { opacity: 0; transform: translateX(0) !important; }
.js .board:not(.drawn) .range { transform: scaleX(0) !important; }
.board.drawing .layer { transition-duration: 0.9s, 0.5s; transition-delay: calc(var(--i, 0) * 45ms); }

.axis { position: relative; height: 20px; margin: 4px 0 0; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.axis-row { display: grid; grid-template-columns: 34px minmax(190px, 250px) 1fr 118px 18px; gap: 14px; padding: 0 8px; }
.axis-row .axis { grid-column: 3; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.legend .ldot { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); }
.legend .lmed { width: 4px; height: 14px; background: var(--ink); }
.legend .lalt { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); }

/* details drawer: animates its row track from 0fr to 1fr */
.drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease); }
.lrow.open .drawer { grid-template-rows: 1fr; }
.drawer > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s 0.35s; }
.lrow.open .drawer > div { visibility: visible; transition: none; }
.drawer-in { padding: 4px 8px 16px 56px; }
.drawer p { font-size: 13.5px; font-weight: 700; color: var(--muted); margin: 6px 0 10px; max-width: 760px; }

/* ---------- tables ---------- */

.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  padding: 4px 8px 6px;
  border-bottom: 2px solid #c4ae7c;
  vertical-align: bottom;
  line-height: 1.15;
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
td {
  font-family: var(--pix);
  font-size: 21px;
  line-height: 1.05;
  text-align: right;
  padding: 5px 8px;
  border-top: 1px solid rgba(36, 22, 10, 0.1);
  white-space: nowrap;
}
td.n { font: 800 14px var(--body); }
td.na { color: #6e5c3e; }
tbody th[scope="row"] { font: 800 14px var(--body); color: var(--ink); text-align: left; text-transform: none; letter-spacing: 0; padding: 5px 8px; border-top: 1px solid rgba(36, 22, 10, 0.1); border-bottom: 0; vertical-align: middle; }
td.best { color: var(--title-lo); }
td.best::before { content: "BEST"; font-size: 11px; letter-spacing: 0.06em; color: var(--title-lo); background: var(--sun); padding: 1px 4px 0; margin-right: 6px; vertical-align: 3px; }
tr.grp th { padding: 16px 8px 6px; text-align: left; text-transform: none; letter-spacing: 0; font-size: 15px; color: color-mix(in srgb, var(--c) 78%, #000); border-bottom: 2px solid var(--c); white-space: normal; }
tr.grp th small { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 8px; }
tr.grp th .chip { margin-left: 8px; vertical-align: 2px; }
tr.median td, tr.median th { background: rgba(36, 22, 10, 0.06); border-top: 2px solid #c4ae7c; }

/* ---------- families ---------- */

.families { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 16px; }

.fam {
  --c: var(--ink);
  background: var(--hi);
  box-shadow: inset 2px 2px 0 #fffbe8, inset -2px -2px 0 var(--lo);
  padding: 14px 16px 16px;
}
.fam h3 { font-family: var(--pix); font-weight: 400; font-size: 26px; line-height: 1; color: var(--c); }
.fam h3 small { font-family: var(--body); font-size: 12px; font-weight: 800; color: var(--muted); margin-left: 8px; letter-spacing: 0.03em; text-transform: uppercase; }
.fam ol { list-style: none; margin-top: 8px; display: grid; gap: 9px; }
.fam li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.fam li b { font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.fam li b small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.fam li .v { font-family: var(--pix); font-size: 22px; line-height: 1; text-align: right; }
.fam .bar { grid-column: 1 / -1; height: 8px; background: var(--track); position: relative; overflow: hidden; }
.fam .bar i { position: absolute; inset: 0; background: var(--lc, var(--c)); transform-origin: 0 50%; transform: scaleX(var(--s)); transition: transform 0.9s var(--ease); }
.fam .sw { display: inline-block; width: 16px; height: 0; margin-right: 7px; vertical-align: 4px; border-top: 3px solid var(--lc); }
.fam .sw.dash { border-top-style: dashed; }
.fam li.retired b { color: var(--muted); }
.js .families:not(.in) .bar i { transform: scaleX(0); }
.delta { font-size: 12px; font-weight: 800; color: var(--muted); grid-column: 1 / -1; margin-top: -3px; }
.delta b { font-size: 12px; display: inline; }
.delta .up { color: #2a6a28; }
.delta .down { color: #8a2218; }

/* ---------- family sparklines ---------- */

.fam-k { margin-top: 12px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.spark { display: block; width: 100%; height: auto; margin-top: 4px; overflow: visible; }
.spark .gl { stroke: rgba(36, 22, 10, 0.12); stroke-width: 1; }
.spark .tl { font: 800 10.5px var(--body); fill: var(--muted); }
.spark .ln {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.3s var(--ease) calc(var(--k) * 150ms + 150ms), opacity 0.2s, stroke-width 0.2s;
}
.spark .ln.retired { stroke-dasharray: 0.018 0.014; transition: opacity 0.4s, stroke-width 0.2s; }
.js .families:not(.in) .spark .ln { stroke-dashoffset: 1; }
.js .families:not(.in) .spark .ln.retired { stroke-dashoffset: 0; opacity: 0; }
.fam.focus .ln:not(.on) { opacity: 0.15; }
.fam .ln.on { stroke-width: 4; }
.fam li { cursor: default; }
.qt { margin-top: 6px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.qt summary { cursor: pointer; width: max-content; }
.qt summary:hover { color: var(--ink); }
.qt table { margin-top: 6px; }
.qt th, .qt td { font-size: 12px; padding: 3px 6px; }
.qt td { font-family: var(--pix); font-size: 17px; }
.qt thead th { white-space: normal; text-transform: none; letter-spacing: 0; }

/* ---------- method ---------- */

.method { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.method div { padding: 14px 16px; background: var(--strip); color: var(--strip-ink); box-shadow: inset 2px 2px 0 var(--strip-hi), inset -2px -2px 0 var(--strip-lo); }
.method h3 { font-family: var(--pix); font-weight: 400; font-size: 23px; line-height: 1.05; color: var(--gold); margin-bottom: 6px; }
.method p { font-size: 14px; font-weight: 600; line-height: 1.5; }
.defs { margin-top: 16px; display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); max-width: 900px; }
.defs b { color: var(--ink); font-weight: 800; }

/* ---------- mcp ---------- */

.hn { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.hn > div { padding: 14px 16px; background: var(--strip); color: var(--strip-ink); box-shadow: inset 2px 2px 0 var(--strip-hi), inset -2px -2px 0 var(--strip-lo); }
.hn h3 { font-family: var(--pix); font-weight: 400; font-size: 23px; line-height: 1.05; color: var(--gold); margin-bottom: 8px; }
.hn .brain h3 { color: var(--close-hi); }
.hn ul { list-style: none; display: grid; gap: 6px; }
.hn li { position: relative; padding-left: 18px; font-size: 14px; font-weight: 600; line-height: 1.5; }
.hn li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; background: var(--grass-a); box-shadow: inset -2px -2px 0 var(--grass-c); }
.hn .brain li::before { background: var(--close); box-shadow: inset -2px -2px 0 var(--close-lo); }
.toolbelt { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.toolbelt span { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.toolbelt code { font-family: var(--pix); font-size: 17px; line-height: 1; padding: 4px 7px 3px; color: var(--ink-on-bar); background: var(--bar); box-shadow: inset 2px 2px 0 var(--bar-hi), inset -2px -2px 0 var(--bar-lo); overflow-wrap: anywhere; }
.mcp-foot { margin-top: 14px; max-width: 760px; font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.5; }
.cta { margin-top: 14px; }

/* ---------- tooltip ---------- */

.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  pointer-events: none;
  padding: 6px 9px 5px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--strip-ink);
  background: var(--strip);
  box-shadow: inset 2px 2px 0 var(--strip-hi), inset -2px -2px 0 var(--strip-lo), 3px 3px 0 rgba(36, 22, 10, 0.35);
  opacity: 0;
  transition: opacity 0.12s;
  white-space: nowrap;
}
.tip.on { opacity: 1; }
.tip b { font-family: var(--pix); font-weight: 400; font-size: 20px; color: var(--gold); display: block; line-height: 1; }

/* ---------- footer ---------- */

footer { background: var(--strip); color: var(--strip-ink); padding: 26px 0 34px; font-size: 14px; font-weight: 700; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
footer a { color: var(--gold); }
footer .brand { font-size: 26px; }

.noscript { padding: 16px 18px; font-weight: 800; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px; }
  .top nav { flex-wrap: wrap; }
  .top nav a { font-size: 17px; padding: 5px 7px; }
  .js .board.loading { min-height: 880px; }
  .hero { padding: 26px 0 26px; }
  .sun { top: 20px; right: 34px; transform: scale(0.5); }
  .lede { font-size: 16px; }
  .facts dd { font-size: 22px; }
  .body { padding: 14px 12px 16px; }
  .cap h2 { font-size: 23px; }
  .cap .sub { display: none; }
  .lhead { grid-template-columns: 26px 1fr auto 14px; grid-template-areas: "rk who val car" ". strip strip strip"; gap: 4px 10px; padding: 9px 9px 9px 4px; }
  .lhead .rk { grid-area: rk; font-size: 21px; }
  .lhead .who { grid-area: who; }
  .lhead .val { grid-area: val; font-size: 23px; }
  .lhead .caret { grid-area: car; }
  .lhead .strip { grid-area: strip; }
  .axis-row { grid-template-columns: 26px 1fr; gap: 10px; padding: 0 4px; }
  .axis-row .axis { grid-column: 2; }
  .drawer-in { padding: 4px 2px 14px; }
  td { font-size: 19px; padding: 5px 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
