/* The Freight & Fire wiki, in the game's Board look (game/src/Ui/Kit.cs): a
   dark halftone board, cream cards that tilt a degree or so, amber for money
   and what is picked, pink for trouble; Space Grotesk for headings and
   numbers, Space Mono for labels and anything measured, Chivo for the rest.
   The fonts are the game's own (OFL), served from fonts/. */

@font-face { font-family: "Space Grotesk"; src: url(fonts/SpaceGrotesk-Variable.ttf) format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Chivo"; src: url(fonts/Chivo-Variable.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url(fonts/SpaceMono-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url(fonts/SpaceMono-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --board: #221e2e;
  --board-2: #2c2739;
  --board-3: #37314a;
  --line: rgba(255, 255, 255, .08);
  --cream: #f3ead9;
  --cream-2: #fbf6ec;
  --ink: #1a1724;
  --ink-soft: #3d3848;
  --amber: #ffd35a;
  --pink: #ff5c8a;
  --teal: #6fd0c4;
  --brown: #8a6f3c;
  --amber-ink: #6b4e00;
  --money-ink: #9a6c00;
  --pink-ink: #5a1030;
  --alarm: #b0204a;
  --on-board: #cfc6b4;
  --muted: #bdb4a2;
  --shadow: 0 12px 28px rgba(0, 0, 0, .42);
  --radius: 18px;
  --grotesk: "Space Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --body: "Chivo", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background-color: var(--board);
  background-image: radial-gradient(rgba(255, 255, 255, .085) 1px, transparent 1.4px);
  background-size: 14px 14px;
  color: var(--on-board);
  font: 16px/1.6 var(--body);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
kbd {
  font: 700 11px var(--mono); padding: 1px 6px; border-radius: 6px;
  background: rgba(26, 23, 36, .08); border: 1px solid rgba(26, 23, 36, .18); color: var(--ink);
}
code { font: .9em var(--mono); background: rgba(26, 23, 36, .07); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--board); color: var(--cream); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--amber); color: var(--ink); padding: 6px 12px; border-radius: 10px; }
.kicker {
  margin: 0; font: 700 11px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brown);
}
.mono { font-family: var(--mono); font-size: .88em; }
.small { font-size: .86em; color: var(--ink-soft); }
.money { color: var(--money-ink); font-family: var(--mono); font-weight: 700; }
b.money { font-size: .95em; }

/* ---- the top bar ---------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
  background: rgba(34, 30, 46, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--cream); color: var(--ink); padding: 6px 16px 7px; border-radius: 14px;
  transform: rotate(-2deg); box-shadow: 0 6px 14px rgba(0, 0, 0, .35); flex: none;
}
.brand .name { font: 700 19px/1.1 var(--grotesk); letter-spacing: -.01em; }
.brand .kicker { font-size: 9px; }
.menu {
  display: none; background: none; border: 0; color: var(--cream); padding: 6px; border-radius: 10px; cursor: pointer;
}
.menu svg { width: 24px; height: 24px; display: block; }
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input {
  width: 100%; font: 15px var(--body); color: var(--cream);
  background: var(--board-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 44px 10px 42px; outline: none; -webkit-appearance: none;
}
.search input::placeholder { color: #8f8799; }
.search input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255, 211, 90, .18); }
.search .glass { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search .glass svg { width: 18px; height: 18px; }
.search kbd {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: var(--board-3); color: var(--muted); border-color: var(--line);
}
.search input::-webkit-search-cancel-button { display: none; }
.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--cream); color: var(--ink); border-radius: 16px; box-shadow: var(--shadow);
  padding: 6px; max-height: min(70vh, 560px); overflow-y: auto;
}
.results a, .hits a {
  display: grid; grid-template-columns: 36px 1fr; gap: 2px 12px; align-items: center;
  padding: 8px 10px; border-radius: 11px; text-decoration: none;
}
.results a[aria-selected="true"], .results a:hover, .hits a:hover { background: var(--amber); }
.results img, .hits img, .results .no-pic, .hits .no-pic { grid-row: span 2; width: 36px; height: 36px; }
.results .no-pic, .hits .no-pic { border-radius: 10px; background: rgba(26, 23, 36, .07); display: grid; place-items: center; color: var(--brown); }
.results .no-pic svg, .hits .no-pic svg { width: 18px; height: 18px; }
.results .t, .hits .t { font: 700 15px/1.2 var(--grotesk); }
.results .k, .hits .k { font: 700 10px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brown); }
.results .k span, .hits .k span { color: var(--ink-soft); letter-spacing: 0; text-transform: none; font-weight: 400; font-family: var(--body); font-size: 12px; margin-left: 6px; }
.results .none { padding: 12px 14px; color: var(--ink-soft); }
.results .all { display: block; text-align: center; font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--brown); padding: 10px; }

/* ---- the shell: nav, main, contents ------------------------------------------ */

.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; padding: 0 24px; max-width: 1480px; margin: 0 auto; }
.side { position: sticky; top: 74px; align-self: start; max-height: calc(100vh - 74px); overflow-y: auto; padding: 22px 4px 40px 0; }
.navhead { font: 700 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); opacity: .75; margin: 16px 12px 6px; }
.navhead:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a {
  display: flex; align-items: center; gap: 11px; padding: 5px 12px; border-radius: 11px;
  text-decoration: none; color: var(--on-board); font-size: 14.5px;
}
.side a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side a:hover { background: var(--board-2); color: var(--cream); }
.side a[aria-current="page"] { background: var(--amber); color: var(--ink); font-weight: 700; }
.side a[aria-current="page"] svg { opacity: 1; }

main { padding: 26px 0 40px; min-width: 0; }
.pagehead { margin: 4px 0 26px; }
.titlecard {
  display: inline-flex; align-items: center; gap: 18px; max-width: 100%;
  background: var(--cream); color: var(--ink); border-radius: 20px; padding: 16px 26px 18px;
  transform: rotate(-1.1deg); box-shadow: var(--shadow); margin-left: 4px;
}
.titlecard h1 { margin: 2px 0 0; font: 700 clamp(28px, 4.4vw, 42px)/1.05 var(--grotesk); letter-spacing: -.02em; }
.titlecard .hero { width: 84px; height: 84px; flex: none; margin: -6px -4px -6px -10px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 14px 10px; border-radius: 12px;
  background: var(--board-2); border: 1px solid var(--line); min-width: 110px;
}
.chip .label { font: 700 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.chip .value { font: 700 19px/1.2 var(--grotesk); color: var(--cream); }
.chip.amber .value { color: var(--amber); }
.chip.pink .value { color: var(--pink); }

.content.with-toc { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 28px; }
.content.with-toc .page { order: 1; }
.toc { order: 2; position: sticky; top: 90px; align-self: start; font-size: 14px; }
.toc .kicker { color: var(--muted); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--board-3); }
.toc li { margin: 5px 0; }
.toc a { color: var(--on-board); text-decoration: none; }
.toc a:hover { color: var(--amber); }

/* ---- cards --------------------------------------------------------------------- */

.page { max-width: 1060px; }
.page > p, .page > ul { max-width: 72ch; }
.page > p.lede, .card p.lede { font-size: 18px; }
.page > p.lede { color: var(--cream); }
.card {
  background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow); margin: 0 0 20px;
}
.card h2, .prose h2 { font: 700 22px/1.2 var(--grotesk); margin: 0 0 12px; letter-spacing: -.01em; }
.card h3, .prose h3 { font: 700 17px/1.3 var(--grotesk); margin: 22px 0 8px; }
.card > :last-child { margin-bottom: 0; }
.card.note { background: var(--board-2); color: var(--on-board); border: 1px solid var(--line); box-shadow: none; }
.card a:not(.ref):not(.tile):not(.link) { color: var(--ink); text-decoration-color: var(--brown); text-underline-offset: 2px; }
.card a:not(.ref):not(.tile):not(.link):hover { background: var(--amber); text-decoration: none; }

/* A hand-written page: one long cream sheet. */
.prose {
  background: var(--cream); color: var(--ink); border-radius: 22px; padding: 30px 36px 34px;
  box-shadow: var(--shadow);
}
.prose h2 { font-size: 26px; margin: 36px 0 12px; padding-top: 22px; border-top: 2px dashed rgba(26, 23, 36, .12); }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--brown); }
.prose a:not(.ref) { color: var(--ink); text-decoration-color: var(--brown); text-underline-offset: 2px; }
.prose a:not(.ref):hover { background: var(--amber); text-decoration: none; }
.prose .card { box-shadow: none; background: var(--cream-2); border: 1px solid rgba(26, 23, 36, .08); }
.prose hr { border: 0; border-top: 2px dashed rgba(26, 23, 36, .15); margin: 28px 0; }
h1 .anchor, h2 .anchor, h3 .anchor { margin-left: 8px; color: var(--brown); text-decoration: none; opacity: 0; font-size: .8em; }
h2:hover .anchor, h3:hover .anchor { opacity: .7; }

.callout { border-radius: 16px; padding: 12px 18px; margin: 18px 0; background: var(--cream-2); border: 1px solid rgba(26, 23, 36, .1); }
.callout p { margin: 6px 0; }
.callout.tip { background: var(--amber); border: 0; color: var(--ink); }
.callout.warn { background: var(--pink); border: 0; color: var(--ink); }
.callout.tip a, .callout.warn a { color: var(--ink); }
.page > .callout { max-width: 72ch; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; align-items: start; }
.pair > .card { margin: 0; }
.pair.tight { margin: 0; gap: 22px; }
.shot { margin: 0; }
.card.shot { padding: 10px; }
.shot img { display: block; width: 100%; border-radius: 12px; }

dl.facts { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 8px 16px; margin: 0; }
dl.facts dt { font: 700 10.5px/1.9 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--brown); }
dl.facts dd { margin: 0; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin: 6px 0; }
ul.plain.icons li { display: flex; align-items: center; gap: 10px; }

/* A link into the reference: a small pill with the model's icon. */
a.ref {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  background: rgba(26, 23, 36, .06); border-radius: 999px; padding: 1px 10px 1px 3px; margin: 2px 1px;
  text-decoration: none; color: var(--ink); font-size: .92em; line-height: 1.5; white-space: nowrap;
}
a.ref img { width: 22px; height: 22px; }
a.ref:hover { background: var(--amber); }
.page:not(.prose) > p a.ref, .page > .lede a.ref { background: var(--board-3); color: var(--cream); }
.refs { display: flex; flex-wrap: wrap; gap: 4px; }
.inline-icon { width: 36px; height: 36px; vertical-align: middle; }
.ui-icon { display: inline-flex; vertical-align: -3px; }
.ui-icon svg { width: 18px; height: 18px; }
.star { color: var(--money-ink); }

/* Tables. */
.table { overflow-x: auto; margin: 6px -6px; padding: 0 6px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font: 700 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--brown); padding: 8px 10px; border-bottom: 2px solid rgba(26, 23, 36, .14); vertical-align: bottom; }
td { padding: 8px 10px; border-bottom: 1px solid rgba(26, 23, 36, .08); vertical-align: top; }
tbody th { font-size: 10px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.table:not(.wrap) td { white-space: nowrap; }
.table.wrap td { min-width: 110px; }
.table.wrap td:first-child { white-space: nowrap; }
tr:target td { background: rgba(255, 211, 90, .35); }

/* Tiles: goods and machines in a grid. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-decoration: none; color: var(--ink);
  background: var(--cream-2); border: 1px solid rgba(26, 23, 36, .07); border-radius: 14px; padding: 10px 12px 12px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile img { width: 64px; height: 64px; margin: -2px 0 2px -4px; }
.tile .name { font: 700 15px/1.2 var(--grotesk); }
.tile .money { font-size: 13px; }
.tile .tags { font: 10px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--brown); }
.tile:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 8px 18px rgba(26, 23, 36, .18); border-color: var(--amber); }

/* The home page's cards. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin: 12px 0 30px; }
a.card.link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; margin: 0; transition: transform .12s ease; }
a.card.link svg { width: 24px; height: 24px; color: var(--brown); margin-bottom: 4px; }
a.card.link b { font: 700 19px/1.2 var(--grotesk); }
a.card.link span { font-size: 14px; color: var(--ink-soft); }
a.card.link.tilt0 { transform: rotate(-.8deg); }
a.card.link.tilt1 { transform: rotate(.5deg); }
a.card.link.tilt2 { transform: rotate(-.3deg); }
a.card.link:hover { transform: rotate(0) translateY(-3px); background: var(--amber); }
a.card.link:hover svg { color: var(--ink); }
.cards.small { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cards.small a.card.link { background: var(--board-2); color: var(--on-board); border: 1px solid var(--line); box-shadow: none; padding: 14px 16px; }
.cards.small a.card.link b { color: var(--cream); font-size: 16px; }
.cards.small a.card.link span { color: var(--muted); font-size: 13px; }
.cards.small a.card.link svg { color: var(--amber); }
.cards.small a.card.link:hover { background: var(--board-3); }
.page:not(.prose) > h2 { font: 700 13px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 30px 0 4px; }

/* Units, defences, vehicles. */
.unit-head { display: flex; align-items: center; gap: 14px; margin: -4px 0 12px; }
.unit-head img { width: 72px; height: 72px; flex: none; }
.unit-head h2 { margin: 0; }
.vehicle .unit-head img { width: 64px; height: 64px; }

/* Chains: trees of goods. */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 18px; padding-left: 16px; border-left: 2px solid rgba(138, 111, 60, .3); }
.tree li { position: relative; padding: 3px 0; }
.tree ul > li::before { content: ""; position: absolute; left: -16px; top: 18px; width: 12px; border-top: 2px solid rgba(138, 111, 60, .3); }
.tree .node { display: inline-flex; align-items: center; gap: 4px; }
.tree .qty { font: 700 12px var(--mono); background: var(--amber); color: var(--ink); border-radius: 7px; padding: 1px 6px; min-width: 26px; text-align: center; }
.tree .node.raw .qty { background: var(--teal); }
.tree .via { font-size: 13px; color: var(--ink-soft); margin-left: 8px; }
.tree .via::before { content: "← "; color: var(--brown); }
.tree .via a.ref { font-size: 12.5px; background: none; padding: 0 6px 0 0; }
.tree .via a.ref img { width: 18px; height: 18px; }
details.chain { border-top: 1px solid rgba(26, 23, 36, .1); }
details.chain:first-of-type { border-top: 0; }
details.chain summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 4px; list-style: none;
  font: 700 16px var(--grotesk);
}
details.chain summary::-webkit-details-marker { display: none; }
details.chain summary::after { content: "+"; margin-left: 8px; font: 700 16px var(--mono); color: var(--brown); }
details.chain[open] summary::after { content: "–"; }
details.chain summary .money { margin-left: auto; font-size: 13px; }
details.chain summary:hover { color: var(--money-ink); }
details.chain[open] { padding-bottom: 12px; }

/* The search page. */
.hits { display: grid; gap: 4px; }
.hits a { color: var(--ink); }
.hits .d { grid-column: 2; font-size: 13.5px; color: var(--ink-soft); }

.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); max-width: 1060px; }
.foot a { color: var(--on-board); }

/* The features page (docs/wiki/features.md): a hero, then each feature as
   screenshots beside a tilted cream card, alternating sides. */
.hero { position: relative; margin: 0 0 34px; }
.hero .shot { position: relative; }
.hero .shot img { border-radius: 22px; box-shadow: var(--shadow); }
.hero .shot figcaption {
  position: absolute; right: 14px; top: 14px; max-width: 46%; margin: 0;
  background: rgba(34, 30, 46, .82); color: var(--on-board); padding: 5px 11px; border-radius: 10px;
}
.hero .words {
  position: relative; max-width: 780px; margin: -84px 0 0 26px; padding: 22px 28px 20px;
  background: var(--cream); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow); transform: rotate(-.6deg);
}
.hero .words p { margin: 0 0 12px; }
.hero .words p:first-child { font: 700 23px/1.25 var(--grotesk); letter-spacing: -.01em; }
.buttons p { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 2px; }
.buttons a {
  text-decoration: none; font: 700 15px/1 var(--grotesk); padding: 11px 18px; border-radius: 999px;
  background: var(--ink); color: var(--cream); transition: transform .12s ease;
}
.buttons a:first-child { background: var(--amber); color: var(--ink); }
.buttons a:hover { transform: translateY(-2px); background: var(--pink); color: var(--ink); }

.shot figcaption { font: 12px/1.45 var(--mono); color: var(--muted); margin: 7px 2px 0; }
.feature {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; margin: 0 0 44px;
}
.feature .shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feature .shots .shot:first-child { grid-column: 1 / -1; }
/* One more picture: it and its caption side by side, under the first. */
.feature .shots .shot:nth-child(2):last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: center; }
.feature .shots .shot:nth-child(2):last-child figcaption { margin: 0; }
.feature .shot img { border-radius: 16px; box-shadow: var(--shadow); }
.feature .words {
  background: var(--cream); color: var(--ink); border-radius: var(--radius); padding: 22px 26px 14px;
  box-shadow: var(--shadow); transform: rotate(-.6deg);
}
.feature:nth-of-type(odd) .shots { order: 2; }
.feature:nth-of-type(odd) .words { transform: rotate(.5deg); }
.feature .words h3 { font: 700 23px/1.2 var(--grotesk); letter-spacing: -.01em; margin: 0 0 10px; }
.feature .words p { margin: 0 0 10px; }
.feature .words .anchor { display: none; }
.page:not(.prose) > p a:not(.ref) { color: var(--amber); text-underline-offset: 3px; }

.steps ol {
  list-style: none; counter-reset: step; padding: 0; margin: 14px 0 18px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px;
}
.steps li {
  counter-increment: step; position: relative; padding: 14px 18px 14px 62px; border-radius: 16px;
  background: var(--board-2); border: 1px solid var(--line);
  color: var(--on-board);
}
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 10px;
  background: var(--amber); color: var(--ink); font: 700 17px/32px var(--grotesk); text-align: center; transform: rotate(-4deg);
}
.steps li strong { color: var(--cream); }

.status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 14px 0 20px; align-items: start; }
.status .col { border-radius: var(--radius); padding: 20px 24px 12px; }
.status .col.now { background: var(--cream); color: var(--ink); box-shadow: var(--shadow); transform: rotate(-.5deg); }
.status .col.next { background: var(--board-2); color: var(--on-board); border: 2px dashed rgba(255, 211, 90, .45); }
.status h3 { font: 700 20px/1.2 var(--grotesk); margin: 0 0 10px; }
.status .col.next h3 { color: var(--amber); }
.status h3 .anchor { display: none; }
.status ul { list-style: none; padding: 0; margin: 0; }
.status li { position: relative; padding-left: 24px; margin: 0 0 9px; }
.status .now li::before { content: "✓"; position: absolute; left: 0; color: var(--money-ink); font-weight: 700; }
.status .next li::before { content: "→"; position: absolute; left: 0; color: var(--amber); font-weight: 700; }

/* The link back to the site the public guide is part of (--home). */
.top .home {
  flex: none; font: 700 11px/1 var(--mono); letter-spacing: .06em; color: var(--muted); text-decoration: none;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
}
.top .home:hover { color: var(--ink); background: var(--amber); border-color: var(--amber); }
.navhome { margin: 22px 12px 0; font: 700 11px var(--mono); letter-spacing: .06em; }
.navhome a { color: var(--muted); }

/* ---- narrower screens -------------------------------------------------------------- */

@media (max-width: 1180px) {
  .content.with-toc { display: block; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .top { padding: 10px 14px; gap: 10px; }
  .menu { display: block; }
  .brand { padding: 4px 11px 5px; }
  .brand .name { font-size: 15px; }
  .brand .kicker { display: none; }
  .search kbd { display: none; }
  .search input { padding-right: 14px; font-size: 16px; }
  .results { position: fixed; top: 62px; left: 10px; right: 10px; max-height: calc(100vh - 80px); }
  .shell { display: block; padding: 0 16px; }
  .side {
    display: none; position: fixed; z-index: 30; top: 58px; left: 0; bottom: 0; width: min(300px, 86vw);
    max-height: none; background: var(--board); border-right: 1px solid var(--line); padding: 18px 12px 40px;
    box-shadow: 20px 0 40px rgba(0, 0, 0, .5);
  }
  body.nav-open .side { display: block; }
  main { padding-top: 18px; }
  .titlecard { padding: 12px 18px 14px; gap: 12px; }
  .titlecard .hero { width: 60px; height: 60px; }
  .chip { min-width: 0; padding: 7px 11px 8px; }
  .chip .value { font-size: 16px; }
  .pair { grid-template-columns: 1fr; }
  .card { padding: 16px 16px; border-radius: 16px; }
  .prose { padding: 20px 18px 24px; border-radius: 18px; }
  .prose h2 { font-size: 22px; }
  dl.facts { grid-template-columns: 1fr; gap: 0; }
  dl.facts dd { margin-bottom: 8px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .cards { grid-template-columns: 1fr; }
  .tree ul { margin-left: 8px; padding-left: 12px; }
  .tree ul > li::before { left: -12px; width: 9px; }
  .tree .via { display: block; margin: 0 0 0 34px; }
  .hero .words { margin: 12px 0 0; padding: 18px 18px 16px; transform: none; }
  .hero .words p:first-child { font-size: 20px; }
  .hero .shot figcaption { position: static; max-width: none; background: none; padding: 0; margin: 7px 2px 0; color: var(--muted); }
  .feature { grid-template-columns: 1fr; gap: 14px; margin-bottom: 34px; }
  .feature:nth-of-type(odd) .shots { order: 0; }
  .feature .words, .feature:nth-of-type(odd) .words { transform: none; padding: 18px 18px 10px; }
  .feature .shots { gap: 10px; }
  .status { grid-template-columns: 1fr; }
  .status .col.now { transform: none; }
  .steps ol { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .top .home { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
