/* Vonix Wiki — game-wiki presentation layer.

   Built to the measured design of the reference wiki (book-of-dragons):
     container 1240 · sidebar 240 · helpers 300 · article 836 · gap 24
     cards: 6px radius, 3px SOLID BLACK border, 10-12px pad, #141a24 on #0e1015
     3px black borders are the visual signature — every tile, card, table and
     panel carries one. No soft 1px hairlines for surfaces.
     accent is green (#1ed45f); headings use a pixel display face.
     body type is small and dense (11–15px), not a docs site's 16–17px.

   Every visual value is a custom property so theme.json can re-skin it. */

@font-face {
  font-family: 'Silkscreen';
  src: url('/assets/fonts/Silkscreen-Regular.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Silkscreen';
  src: url('/assets/fonts/Silkscreen-Bold.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'InterVariable';
  src: url('/assets/fonts/InterVariable.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap;
}

:root {
  --bg:#0e1015; --bg-deep:#07090c; --surface:#141a24; --surface-alt:#1a1f2e;
  --surface-raised:#1f2536; --elevated:#232a3d;
  --border:#000; --border-soft:#2a3247; --border-strong:#000;
  --text:#fff; --text-body:#cfd6e3; --text-muted:#a8b3c2; --text-dim:#8b96ab;
  --accent:#1ed45f; --accent-deep:#12a247; --accent-soft:#5ee88d; --accent-ink:#04150a;
  --gold:#ffe08a; --gold-deep:#7a5b00; --purple:#8566ff;
  --danger:#ff5f6d; --warning:#f0b445; --info:#59c2e8;
  --hover:#242c40;
  --mote-lime:#d4ff5e; --mote-purple:#b98cff; --mote-cyan:#8fe3ff;

  --font-display:'Silkscreen',ui-monospace,monospace;
  --font-body:'InterVariable','Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --font-size:15px; --line-height:1.65;

  --r-xs:3px; --r-sm:4px; --r-md:6px; --r-lg:8px; --r-xl:10px; --r-pill:999px;

  --max-width:1240px; --sidebar-width:240px; --helpers-width:300px;
  --article-width:836px; --gap:24px; --gap-tight:10px;
  --header-h:56px;

  --motion:140ms; --ease:cubic-bezier(.2,.6,.3,1);

  --t-2xs:10px; --t-xs:11px; --t-sm:12px; --t-md:13px; --t-lg:15px; --t-xl:17px;

  /* the signature: a hard offset shadow, no blur — reads as a game UI panel */
  --shadow-hard:0 3px 0 rgba(0,0,0,.55);
  --shadow-pop:0 10px 34px rgba(0,0,0,.6);
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 9px 16px;
  font-family: var(--font-display); font-size: 12px;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: var(--bg-deep);
  border-bottom: 3px solid var(--border);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; height: 100%;
  padding: 0 16px; display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  background: var(--accent); border: 2px solid var(--border);
  position: relative; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px;
  border: 2px solid var(--accent-ink); border-radius: 1px;
}
.brand-name {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; line-height: 1;
}
.brand-sub {
  display: block; font-family: var(--font-body); font-size: 9.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim);
  margin-top: 3px; font-weight: 600;
}

.header-nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.header-nav a {
  font-family: var(--font-display); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted);
  padding: 8px 11px; border-radius: var(--r-sm); white-space: nowrap;
  border: 1px solid transparent;
}
.header-nav a:hover { color: var(--text); background: var(--surface); border-color: var(--border-soft); }
.header-nav a[aria-current="true"] {
  color: var(--accent-ink); background: var(--accent); border-color: var(--border);
  font-weight: 700;
}

.header-spacer { flex: 1 1 auto; }

.search-trigger {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text-dim); border-radius: var(--r-md);
  padding: 7px 11px; font-size: var(--t-sm); font-family: inherit;
  cursor: pointer; min-width: 210px;
}
.search-trigger:hover { color: var(--text); background: var(--surface-alt); }
.search-trigger svg { width: 13px; height: 13px; flex: 0 0 auto; }
.search-trigger span { flex: 1 1 auto; text-align: left; }
.search-trigger kbd {
  font-family: var(--font-mono); font-size: 9.5px;
  border: 1px solid var(--border-soft); border-radius: 3px; padding: 1px 5px;
  color: var(--text-dim); background: var(--bg-deep);
}

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md);
  color: var(--text-muted); cursor: pointer; flex: 0 0 auto;
}
.icon-btn:hover { color: var(--text); background: var(--surface-alt); }
.icon-btn svg { width: 15px; height: 15px; }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------- shell */
.shell {
  max-width: var(--max-width); margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--helpers-width);
  gap: var(--gap);
  padding: 20px 16px 72px;
  align-items: start;
}
.shell.no-helpers { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.shell.full { grid-template-columns: minmax(0, 1fr); }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 34px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 3px solid var(--border);
  border-radius: var(--r-lg); padding: 0 0 8px;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }

.side-badge {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 12px; border-bottom: 2px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.side-badge-icon {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--bg-deep); border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 15px; flex: 0 0 auto;
  color: var(--accent);
}
.side-badge-text { min-width: 0; }
.side-badge-name {
  display: block; font-family: var(--font-display); font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text); line-height: 1.2;
}
.side-badge-count {
  display: block; font-size: 9.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; font-weight: 600;
}

.nav-group { border-bottom: 1px solid var(--border-soft); }
.nav-group:last-child { border-bottom: 0; }
.nav-group > summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 9px 12px; font-family: var(--font-display); font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--text); font-weight: 700; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--hover); }
.nav-group > summary .chev {
  width: 9px; height: 9px; margin-left: auto; flex: 0 0 auto;
  color: var(--text-dim); transition: transform var(--motion) var(--ease);
}
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group > summary .count {
  font-family: var(--font-body); font-size: 9.5px; color: var(--accent-ink);
  background: var(--accent); border-radius: var(--r-xs); padding: 0 5px;
  font-weight: 800; line-height: 15px; min-width: 16px; text-align: center;
}
.nav-list { list-style: none; margin: 0; padding: 0 0 5px; }
.nav-list li { margin: 0; }
.nav-list a {
  display: block; padding: 6px 12px 6px 20px;
  color: var(--text-muted); font-size: var(--t-sm); line-height: 1.4;
  border-left: 3px solid transparent;
}
.nav-list a:hover { background: var(--hover); color: var(--text); }
/* External nav entry: the Servers button leaves the wiki for the main site,
   where the live server listing lives. Marked with an arrow so it never reads
   as another wiki page. */
.header-nav a.nav-ext { display: inline-flex; align-items: center; gap: 4px; }
.ext-mark { font-size: 9px; opacity: .75; line-height: 1; }
.nav-jump {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 4px 6px 6px; padding: 9px 10px;
  border: 2px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-alt); color: var(--text);
  font-family: var(--font-display); font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em;
}
.nav-jump:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.nav-jump-note {
  font-family: var(--font-body); font-size: 9.5px; text-transform: none;
  letter-spacing: 0; color: var(--text-dim); display: inline-flex; align-items: center; gap: 3px;
}

.nav-list a[aria-current="page"] {
  background: var(--surface-raised); color: var(--text);
  border-left-color: var(--accent); font-weight: 600;
}

/* ---------------------------------------------------------------- article */
.article { min-width: 0; }
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-family: var(--font-display); font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); margin-bottom: 10px;
}
.breadcrumb a { color: var(--accent-soft); }
.breadcrumb .sep { opacity: .45; }

.page-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 9px; }
.pill {
  font-family: var(--font-display); font-size: 9px; text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700;
  background: var(--gold-deep); color: var(--gold);
  border: 1px solid var(--border); border-radius: var(--r-xs); padding: 3px 7px;
}
.pill-accent { background: var(--accent); color: var(--accent-ink); }
.pill-quiet { background: var(--surface-alt); color: var(--text-muted); }

h1.page-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3.6vw, 40px); line-height: 1.14;
  margin: 0 0 10px; color: var(--text); letter-spacing: .005em;
}
.pill-retired { background: var(--surface-raised); color: var(--text-muted); border-color: var(--border-soft); }
.retired-note {
  border: 2px solid var(--border); border-left: 5px solid var(--warning);
  background: var(--surface); border-radius: var(--r-md);
  padding: 10px 13px; margin: 0 0 16px; font-size: var(--t-md);
  color: var(--text-muted); box-shadow: var(--shadow-hard);
}
.retired-note strong { color: var(--text); }

.page-lead {
  font-size: var(--t-lg); line-height: 1.6; color: var(--text-body);
  margin: 0 0 14px; max-width: 70ch;
}
.page-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 13px;
  font-size: var(--t-sm); color: var(--text-dim);
  padding: 9px 0 13px; border-bottom: 2px solid var(--border); margin-bottom: 18px;
}
.page-meta .dot { opacity: .4; }
.page-meta .tagset { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: var(--t-xs); color: var(--text-muted);
  background: var(--surface-alt); border: 1px solid var(--border-soft);
  border-radius: var(--r-xs); padding: 2px 7px;
}
.tag:hover { color: var(--text); border-color: var(--accent); }

/* ---------------------------------------------------------------- infobox */
.infobox {
  float: right; width: 300px; margin: 0 0 16px 20px;
  background: var(--surface); border: 3px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-hard); font-size: var(--t-md);
}
.infobox-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 11px; border-bottom: 2px solid var(--border);
  background: var(--surface-alt);
}
.infobox-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex: 0 0 auto;
  display: grid; place-items: center; font-size: 17px;
  background: var(--bg-deep); border: 2px solid var(--border); color: var(--accent);
}
.infobox-titles { min-width: 0; }
.infobox-title {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  line-height: 1.3; color: var(--text); text-transform: uppercase; letter-spacing: .02em;
}
.infobox-sub { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em; }
.infobox-body { padding: 0; }
.infobox-row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px;
  padding: 7px 11px; align-items: baseline;
}
.infobox-row + .infobox-row { border-top: 1px solid var(--border-soft); }
.infobox-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 700;
}
.infobox-value { font-size: var(--t-sm); color: var(--text); overflow-wrap: anywhere; }
.infobox-value code {
  font-family: var(--font-mono); font-size: 11px;
  background: var(--bg-deep); border: 1px solid var(--border-soft);
  border-radius: var(--r-xs); padding: 1px 5px;
}
.copyable { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; }
.copyable code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-btn {
  border: 1px solid var(--border-soft); background: var(--surface-alt);
  color: var(--text-dim); border-radius: var(--r-xs); cursor: pointer;
  width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto;
  padding: 0; font-size: 0;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn svg { width: 10px; height: 10px; }
.copy-btn.done { color: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- slider */
.slider {
  margin: 0 0 20px; clear: both;
  border-radius: var(--r-lg); overflow: hidden;
  border: 3px solid var(--border); background: var(--bg-deep);
  box-shadow: var(--shadow-hard);
}
.slider-viewport { position: relative; overflow: hidden; background: var(--bg-deep); }
.slider-track { display: flex; transition: transform var(--motion) var(--ease); }
.slider-slide { min-width: 100%; position: relative; }
.slider-slide img {
  display: block; width: 100%; height: auto; max-height: 58vh;
  object-fit: cover; background: var(--bg-deep);
}
.slider-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(7,9,12,.82); border: 2px solid var(--border);
  color: #fff; cursor: pointer; z-index: 2;
}
.slider-nav:hover { background: var(--accent); color: var(--accent-ink); }
.slider-nav.prev { left: 9px; }
.slider-nav.next { right: 9px; }
.slider-nav svg { width: 15px; height: 15px; }
.slider-counter {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  font-family: var(--font-display); font-size: 9px;
  background: rgba(7,9,12,.85); border: 2px solid var(--border);
  border-radius: var(--r-xs); padding: 3px 8px; color: #fff;
}
.slider-caption {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 9px 12px; font-size: var(--t-sm); color: var(--text-muted);
  border-top: 2px solid var(--border); background: var(--surface);
}
.slider-caption .cap-text { flex: 1 1 240px; min-width: 0; }
.slider-caption .cap-credit {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em;
  border-left: 1px solid var(--border-soft); padding-left: 9px;
}
.slider-dots { display: flex; gap: 5px; padding: 0 12px 9px; background: var(--surface); }
.slider-dots button {
  width: 20px; height: 4px; border-radius: 1px; padding: 0;
  background: var(--border-soft); border: 0; cursor: pointer;
}
.slider-dots button[aria-current="true"] { background: var(--accent); }

/* ---------------------------------------------------------------- prose */
.prose { font-size: var(--font-size); color: var(--text-body); }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: calc(var(--header-h) + 18px); }

.prose h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(19px, 2.2vw, 24px); line-height: 1.2; color: var(--text);
  margin: 1.9em 0 .55em; padding-bottom: .3em;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
.prose h2::before {
  content: ""; width: 4px; align-self: stretch; min-height: 18px;
  background: var(--accent); border-radius: 1px; flex: 0 0 auto;
}
.prose h3 {
  font-family: var(--font-body); font-weight: 750;
  font-size: var(--t-xl); margin: 1.5em 0 .4em; color: var(--text);
  letter-spacing: -.01em;
}
.prose h4 { font-size: var(--t-lg); margin: 1.3em 0 .35em; color: var(--text-muted); font-weight: 700; }
.prose p { margin: 0 0 .95em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.25em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--accent); }
.prose li.task { list-style: none; margin-left: -1.25em; }
.prose li.task input { margin-right: .5em; accent-color: var(--accent); }
.task-done { color: var(--text-dim); text-decoration: line-through; }
.prose hr { border: 0; border-top: 2px solid var(--border); margin: 1.9em 0; }

.prose code {
  font-family: var(--font-mono); font-size: .875em;
  background: var(--bg-deep); border: 1px solid var(--border-soft);
  border-radius: var(--r-xs); padding: .1em .38em; overflow-wrap: anywhere;
  color: var(--accent-soft);
}
.prose pre.code {
  background: var(--bg-deep); border: 2px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px; overflow-x: auto;
  margin: 0 0 1.1em; font-size: var(--t-md); line-height: 1.6;
}
.prose pre.code code {
  background: none; border: 0; padding: 0; font-size: inherit; color: var(--text-body);
  overflow-wrap: normal; white-space: pre;
}
.prose blockquote {
  margin: 0 0 1.1em; padding: 9px 14px;
  border-left: 4px solid var(--accent); background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text-muted);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img {
  max-width: 100%; height: auto; border-radius: var(--r-md);
  border: 2px solid var(--border);
}

/* tables — full-width grids with hard borders */
.table-wrap {
  margin: 0 0 1.2em; overflow-x: auto;
  border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-hard);
}
.table-wrap table { border-collapse: collapse; width: 100%; font-size: var(--t-md); }
.table-wrap caption {
  caption-side: top; text-align: left; padding: 8px 12px;
  font-family: var(--font-display); font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); border-bottom: 2px solid var(--border);
  background: var(--surface-alt);
}
.table-wrap th, .table-wrap td {
  padding: 8px 11px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft);
}
.table-wrap th:last-child, .table-wrap td:last-child { border-right: 0; }
.table-wrap th {
  background: var(--surface-alt); font-family: var(--font-display);
  font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent-soft); white-space: nowrap;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: var(--hover); }

/* callouts — bordered panels, not tinted boxes */
.callout {
  margin: 0 0 1.2em; border-radius: var(--r-md);
  border: 2px solid var(--border); border-left: 5px solid var(--accent);
  background: var(--surface); padding: 11px 14px;
  box-shadow: var(--shadow-hard);
}
.callout-title {
  display: flex; align-items: center; gap: 7px; margin: 0 0 6px !important;
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--accent);
}
.callout-icon {
  width: 16px; height: 16px; border-radius: var(--r-xs); display: grid; place-items: center;
  font-size: 9px; font-weight: 700; background: var(--accent); color: var(--accent-ink);
  flex: 0 0 auto;
}
.callout-body { font-size: var(--t-md); color: var(--text-muted); }
.callout-body > *:last-child { margin-bottom: 0; }
.callout-warning { border-left-color: var(--warning); }
.callout-warning .callout-title { color: var(--warning); }
.callout-warning .callout-icon { background: var(--warning); }
.callout-danger { border-left-color: var(--danger); }
.callout-danger .callout-title { color: var(--danger); }
.callout-danger .callout-icon { background: var(--danger); }
.callout-info { border-left-color: var(--info); }
.callout-info .callout-title { color: var(--info); }
.callout-info .callout-icon { background: var(--info); }
.callout-note { border-left-color: var(--purple); }
.callout-note .callout-title { color: var(--purple); }
.callout-note .callout-icon { background: var(--purple); }

/* steps — numbered pills like the reference's progression tiles */
ol.steps { list-style: none; counter-reset: step; padding: 0 !important; margin: 0 0 1.2em !important; }
ol.steps li {
  counter-increment: step; position: relative; padding: 0 0 0 40px; margin: 0 0 11px;
  min-height: 26px;
}
ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  min-width: 28px; height: 22px; border-radius: var(--r-xs); display: grid; place-items: center;
  background: var(--accent); border: 2px solid var(--border); color: var(--accent-ink);
  font-family: var(--font-display); font-size: 9px; font-weight: 700;
  padding: 0 4px;
}

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--gap-tight); margin: 0 0 1.2em;
}
.card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text); box-shadow: var(--shadow-hard);
  transition: transform var(--motion) var(--ease), border-color var(--motion) var(--ease);
}
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-title { font-weight: 700; font-size: var(--t-md); line-height: 1.35; }
.card-desc { font-size: var(--t-sm); color: var(--text-muted); line-height: 1.45; }

.hlink {
  margin-left: .35em; opacity: 0; color: var(--text-dim); font-weight: 400;
  text-decoration: none; font-family: var(--font-mono);
  transition: opacity var(--motion) var(--ease);
}
h2:hover .hlink, h3:hover .hlink, .hlink:focus-visible { opacity: 1; }

.wl { color: var(--accent-soft); }
.wl-missing { color: var(--text-dim); border-bottom: 1px dashed var(--border-soft); cursor: help; }

/* ---------------------------------------------------------------- faq */
.faq { margin: 2em 0 0; }
.faq > h2 {
  font-family: var(--font-display); font-size: 19px; margin: 0 0 10px;
  border: 0; padding: 0;
}
.faq details {
  border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); margin-bottom: 7px; overflow: hidden;
  box-shadow: var(--shadow-hard);
}
.faq summary {
  padding: 10px 13px; cursor: pointer; font-size: var(--t-md); font-weight: 650;
  display: flex; align-items: center; gap: 9px; list-style: none; color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--accent);
  font-family: var(--font-mono); font-size: 15px; line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { background: var(--hover); }
.faq .faq-a { padding: 0 13px 11px; font-size: var(--t-md); color: var(--text-muted); }
.faq .faq-a > *:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- mentioned in */
.mentioned { margin: 2.2em 0 0; padding-top: 16px; border-top: 2px solid var(--border); }
.mentioned h2 { font-family: var(--font-display); font-size: 15px; margin: 0 0 3px; border: 0; }
.mentioned .lede { font-size: var(--t-sm); color: var(--text-dim); margin: 0 0 10px; }
.mentioned ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.mentioned li a {
  display: flex; align-items: baseline; gap: 9px;
  font-size: var(--t-md); color: var(--text-muted);
  padding: 5px 9px; border-radius: var(--r-xs); border: 1px solid transparent;
}
.mentioned li a:hover { background: var(--surface); color: var(--text); border-color: var(--border-soft); }
.mentioned .m-cat {
  font-family: var(--font-display); font-size: 9px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-dim); flex: 0 0 82px;
}

/* ---------------------------------------------------------------- prev/next */
.pagenav {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-tight);
  margin: 2.2em 0 0; padding-top: 16px; border-top: 2px solid var(--border);
}
.pagenav a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 13px; border: 2px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); min-width: 0;
  box-shadow: var(--shadow-hard);
}
.pagenav a:hover { border-color: var(--accent); }
.pagenav .dir {
  font-family: var(--font-display); font-size: 9px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim);
}
.pagenav .ttl {
  font-size: var(--t-md); font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pagenav .next { text-align: right; grid-column: 2; }

/* ---------------------------------------------------------------- helpers rail */
.helpers {
  position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 34px);
  overflow-y: auto; display: grid; gap: var(--gap-tight);
  scrollbar-width: thin;
}
.helper {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-hard);
}
.helper-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 11px; border-bottom: 2px solid var(--border); background: var(--surface-alt);
}
.helper-title {
  font-family: var(--font-display); font-size: 10px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text); font-weight: 700;
}
.helper-note {
  font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .07em;
}
.helper ul { list-style: none; margin: 0; padding: 4px; display: grid; gap: 1px; }
.helper li a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 7px; border-radius: var(--r-xs);
  font-size: var(--t-sm); color: var(--text-muted);
}
.helper li a:hover { background: var(--hover); color: var(--text); }
.helper .h-num {
  font-family: var(--font-display); font-size: 9px; color: var(--accent-ink);
  background: var(--accent); border-radius: var(--r-xs);
  min-width: 16px; height: 15px; display: grid; place-items: center;
  flex: 0 0 auto; font-weight: 700;
}
.helper .h-title-sm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.helper .h-side { font-size: 9.5px; color: var(--text-dim); flex: 0 0 auto; }

.toc-list { list-style: none; margin: 0; padding: 4px 4px 6px; }
.toc-list li a {
  display: block; padding: 4px 8px; font-size: var(--t-sm);
  color: var(--text-dim); border-left: 2px solid transparent; border-radius: 0 var(--r-xs) var(--r-xs) 0;
}
.toc-list li a:hover { color: var(--text); background: var(--hover); }
.toc-list li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-list li.lvl-3 a { padding-left: 18px; font-size: var(--t-xs); }

/* ---------------------------------------------------------------- hub / home */

/* Animated hero. Structure and values lifted from the reference wiki's
   `header.mcg-gh--wiki.mcg-gh--hub`, measured over CDP rather than guessed:
     position:relative; isolation:isolate; overflow:visible; z-index:20
     base #111520 · image layer ::before z-index:-2 (blur 6px, saturate 1.15,
     opacity .55, 50% 30%/cover, inset -20px 0) · scrim ::after z-index:-1
     content at z-index 3, motes at z-index 0.

   `overflow:visible` + `z-index:20` is deliberate: the glow and the motes spill
   past the hero's bottom edge onto the page. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: visible;
  z-index: 20;
  background: #111520;
  margin: 0 0 18px;
  padding: 34px 0 30px;
}

/* Image layer. --wa-bg is the featured screenshot; empty until Pargon supplies
   a real in-game capture, so this layer renders nothing and the fallback below
   takes over. No AI imagery, ever. */
.hero::before {
  content: "";
  position: absolute;
  inset: -20px 0;
  z-index: -2;
  background-image: var(--wa-bg, none);
  background-position: 50% 30%;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(6px) saturate(1.15);
  opacity: .55;
  pointer-events: none;
}

/* No-image fallback: flat base plus soft radial glows, purple top-right and
   green along the bottom. This is the documented reference behaviour when a
   page has no featured image. */
.hero--noimg::before {
  background-image:
    radial-gradient(60% 70% at 82% 12%, rgba(150, 110, 245, .30), transparent 70%),
    radial-gradient(70% 65% at 45% 108%, rgba(30, 212, 95, .20), transparent 72%);
  filter: none;
  opacity: 1;
}

/* Scrim: keeps text readable over any image, and fades into the page. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9, 11, 17, .97) 0%, rgba(9, 11, 17, .88) 50%, rgba(9, 11, 17, .6) 100%),
    linear-gradient(0deg, rgb(17, 21, 32) 0%, rgba(17, 21, 32, 0) 45%);
}

/* Mote field: ~30 tiny glowing squares rising from below the hero.
   Pure CSS, pointer-events:none, will-change on transform+opacity only, and
   gated on prefers-reduced-motion. No canvas, no JS, no per-frame work. */
.hero-motes {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-motes i {
  --sz: calc(var(--s) * 2px + 2px);
  position: absolute;
  left: var(--x);
  bottom: -14px;
  width: var(--sz);
  height: var(--sz);
  opacity: 0;
  will-change: transform, opacity;
  background: var(--mote-lime);
  box-shadow: 0 0 10px rgba(212, 255, 94, .85), 0 0 2px #fff;
  animation: waMoteRise var(--w, 10s) linear var(--d, 0s) infinite;
}
.hero-motes i.v1 {
  background: var(--mote-purple);
  box-shadow: 0 0 10px rgba(185, 140, 255, .8);
}
.hero-motes i.v2 {
  background: var(--mote-cyan);
  box-shadow: 0 0 10px rgba(143, 227, 255, .7);
}

@keyframes waMoteRise {
  0%   { transform: translate(0, 0); opacity: 0; }
  12%  { opacity: var(--o, .8); }
  50%  { transform: translate(var(--dx, 14px), -45vh); }
  85%  { opacity: var(--o, .8); }
  100% { transform: translate(calc(var(--dx, 14px) * -.45), -90vh); opacity: 0; }
}

/* The hero is emitted as a slot before .shell, so it is full-bleed by default.
   The wrapper only exists so the hero never participates in the grid. */
.hero-slot { display: block; }

/* Hero content sits above the motes; z-index 3 matches the reference. */
.hero-inner {
  position: relative;
  z-index: 3;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Copy staggers in. */
.hero-copy > * {
  animation: waRise .6s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-copy > :nth-child(2) { animation-delay: .05s; }
.hero-copy > :nth-child(3) { animation-delay: .1s; }
.hero-copy > :nth-child(4) { animation-delay: .15s; }
.hero-copy > :nth-child(5) { animation-delay: .2s; }

@keyframes waRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* Showcase card springs in rotated, and untilts on hover. */
.hero-card {
  animation: waCard .8s .15s cubic-bezier(.34, 1.56, .64, 1) both;
}
.hero-card:hover { transform: rotate(0deg) !important; }

@keyframes waCard {
  from { opacity: 0; transform: rotate(8deg) translateY(30px) scale(.94); }
  to   { opacity: 1; transform: rotate(2.5deg); }
}

/* Rotated tile mosaic: a grid of tiles held at -6deg and drifting sideways on
   an 80s alternate loop. Used as the cover-card art layer when a card has no
   approved screenshot, so the grid reads as deliberate art rather than a hole. */
.mosaic {
  position: absolute;
  inset: -22%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  opacity: .9;
  transform: rotate(-6deg);
}
.mosaic span {
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface-raised) 75%, var(--border-soft));
  border: 1px solid var(--border-soft);
}
.mosaic span:nth-child(3n) { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.mosaic span:nth-child(4n) { background: color-mix(in srgb, var(--purple) 38%, var(--surface)); border-color: color-mix(in srgb, var(--purple) 45%, var(--border)); }
.mosaic span:nth-child(5n) { background: color-mix(in srgb, var(--info) 30%, var(--surface)); }
.ccard-cover .mosaic { animation: waDrift 80s linear infinite alternate; }
/* vignette so the centred glyph stays legible over the tile field */
.ccard-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 50%, rgba(7,9,12,.72), rgba(7,9,12,.25) 70%, transparent);
}
.ccard-cover { position: relative; }

/* Rotated tile mosaic drift, borrowed for card art. */
.hero-mosaic {
  animation: waDrift 80s linear infinite alternate;
}
@keyframes waDrift {
  from { transform: rotate(-6deg) scale(1.05) translateX(0); }
  to   { transform: rotate(-6deg) scale(1.05) translateX(-5%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-motes { display: none; }
  .hero-copy > *, .hero-card, .hero-mosaic { animation: none !important; }
  .hero-card { transform: rotate(0deg); }
}

.page-head { padding: 0; }
.hero-copy h1,
.page-head h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3.8vw, 38px); line-height: 1.12; margin: 0 0 10px;
  color: var(--text);
}
.hero-copy .head-lead,
.page-head .head-lead {
  font-size: var(--t-lg); color: var(--text-body); max-width: 72ch; margin: 0 0 14px;
  line-height: 1.6;
}
.head-meta {
  display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: var(--t-sm);
  color: var(--text-dim); margin: 0 0 16px;
}
.head-meta span { display: inline-flex; align-items: center; gap: 6px; }
.head-meta .hm-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.hub-search {
  display: flex; gap: 0; margin: 0 0 20px;
  border: 3px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-hard);
}
.hub-search input {
  flex: 1 1 auto; background: none; border: 0; outline: none;
  padding: 12px 14px; color: var(--text); font-family: inherit; font-size: var(--t-lg);
}
.hub-search input::placeholder { color: var(--text-dim); }
.hub-search button {
  border: 0; border-left: 3px solid var(--border); background: var(--accent);
  color: var(--accent-ink); font-family: var(--font-display); font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  padding: 0 20px; cursor: pointer;
}
.hub-search button:hover { background: var(--accent-soft); }

.sec-head {
  display: flex; align-items: center; gap: 9px;
  margin: 26px 0 11px; padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.sec-head:first-of-type { margin-top: 4px; }
.sec-icon {
  width: 24px; height: 24px; border-radius: var(--r-xs); flex: 0 0 auto;
  background: var(--surface-alt); border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 12px; color: var(--accent);
}
.sec-name {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--text); margin: 0;
}
.sec-more {
  margin-left: auto; font-family: var(--font-display); font-size: 9px;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--gold); background: var(--gold-deep); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 2px 7px;
}
.sec-link { margin-left: auto; font-size: var(--t-sm); color: var(--accent-soft); }

.tile-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-tight);
}
.tile {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 9px;
  padding: 10px; border-radius: var(--r-md);
  background: var(--surface); border: 3px solid var(--border);
  color: var(--text); box-shadow: var(--shadow-hard);
  transition: transform var(--motion) var(--ease), border-color var(--motion) var(--ease);
}
.tile:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.tile-slot {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--bg-deep); border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 17px; color: var(--accent);
  flex: 0 0 auto;
}
.tile-body { min-width: 0; }
.tile-name {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; line-height: 1.35;
  color: var(--text); margin: 0 0 3px;
  display: flex; align-items: baseline; gap: 5px;
}
.tile-num {
  font-family: var(--font-display); font-size: 8px; color: var(--accent-ink);
  background: var(--accent); border-radius: 2px; padding: 1px 3px;
  flex: 0 0 auto; font-weight: 700;
}
.tile-desc {
  font-size: 11px; line-height: 1.45; color: var(--text-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.cover-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.ccard {
  display: flex; flex-direction: column;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--surface); border: 3px solid var(--border);
  color: var(--text); box-shadow: var(--shadow-hard);
  transition: transform var(--motion) var(--ease), border-color var(--motion) var(--ease);
}
.ccard:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.ccard-cover {
  position: relative; aspect-ratio: 16 / 9; background: var(--bg-deep);
  border-bottom: 2px solid var(--border); overflow: hidden;
}
.ccard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Placeholder cover: a diagonal token gradient plus a large glyph. It must
   read as a deliberate "no screenshot yet" state, not as a broken image.
   No AI art and no stock art — the real fix is an approved in-game capture. */
.ccard-cover .ccard-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 34px; line-height: 1;
  color: var(--accent); opacity: .55;
  background:
    repeating-linear-gradient(135deg,
      transparent 0 9px,
      rgba(30,212,95,.055) 9px 18px),
    radial-gradient(circle at 30% 20%, var(--surface-raised), var(--bg-deep) 70%);
}
.ccard-cover .ccard-ph::after {
  content: ""; position: absolute; inset: 0;
  border: 1px dashed var(--border-soft); opacity: .35; margin: 7px;
}
.ccard-tag {
  position: absolute; top: 7px; right: 7px; z-index: 1;
  font-family: var(--font-display); font-size: 8px; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--border); border-radius: var(--r-xs); padding: 2px 5px;
}
.ccard-body { padding: 9px 11px 11px; }
.ccard-name {
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; line-height: 1.35;
  margin: 0 0 4px; color: var(--text);
}
.ccard-desc {
  font-size: 11px; line-height: 1.45; color: var(--text-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0 0 16px; padding: 9px 0; border-bottom: 2px solid var(--border);
}
.filter-bar .fb-label {
  font-family: var(--font-display); font-size: 9px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .06em; margin-right: 3px;
}
.chip {
  font-family: var(--font-display); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .04em; padding: 5px 9px; border-radius: var(--r-xs);
  border: 2px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; font-weight: 700;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip[aria-pressed="true"], .chip.is-active {
  background: var(--accent); border-color: var(--border); color: var(--accent-ink);
}
.chip .n { opacity: .65; margin-left: 4px; }

.list-rows { display: grid; gap: 6px; }
.list-row {
  display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 10px;
  align-items: start; padding: 9px 11px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-hard);
}
.list-row:hover { border-color: var(--accent); }
.lr-icon {
  width: 30px; height: 30px; border-radius: var(--r-xs);
  background: var(--bg-deep); border: 2px solid var(--border);
  display: grid; place-items: center; font-size: 14px; color: var(--accent);
}
.lr-title {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .02em; color: var(--text);
  line-height: 1.35;
}
.lr-title:hover { color: var(--accent); }
.lr-sum { font-size: var(--t-sm); color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.lr-meta {
  font-size: 10px; color: var(--text-dim); white-space: nowrap; padding-top: 2px;
  text-transform: uppercase; letter-spacing: .05em; text-align: right;
}
.empty-state {
  padding: 30px 18px; text-align: center; color: var(--text-dim);
  border: 3px dashed var(--border-soft); border-radius: var(--r-lg); font-size: var(--t-md);
}

/* ---------------------------------------------------------------- search */
.search-overlay {
  position: fixed; inset: 0; z-index: 90; display: grid;
  align-items: start; justify-items: center; padding-top: 10vh;
  background: rgba(7,9,12,.8);
}
.search-panel {
  width: min(640px, 93vw); background: var(--surface);
  border: 3px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.search-field {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px; border-bottom: 2px solid var(--border);
}
.search-field svg { width: 15px; height: 15px; color: var(--accent); flex: 0 0 auto; }
.search-field input {
  flex: 1 1 auto; background: none; border: 0; outline: none;
  color: var(--text); font-family: inherit; font-size: var(--t-lg);
}
.search-field input::placeholder { color: var(--text-dim); }
.search-field kbd {
  font-family: var(--font-mono); font-size: 9.5px; border: 1px solid var(--border-soft);
  border-radius: 3px; padding: 1px 5px; color: var(--text-dim);
}
.search-results { max-height: min(56vh, 460px); overflow-y: auto; padding: 5px; }
.sr-row {
  display: block; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text); cursor: pointer; border: 1px solid transparent;
}
.sr-row .sr-title { font-size: var(--t-md); font-weight: 650; }
.sr-row .sr-title mark {
  background: var(--accent); color: var(--accent-ink); border-radius: 2px; padding: 0 2px;
}
.sr-row .sr-crumb {
  font-family: var(--font-display); font-size: 9px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .05em; margin-top: 2px;
}
.sr-row .sr-ex { font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.sr-row[aria-selected="true"] { background: var(--hover); border-color: var(--border-soft); }
.search-status {
  padding: 9px 13px; font-size: 10px; color: var(--text-dim);
  border-top: 2px solid var(--border); text-transform: uppercase; letter-spacing: .05em;
}
.search-empty { padding: 22px 13px; text-align: center; font-size: var(--t-sm); color: var(--text-dim); }

/* ---------------------------------------------------------------- footer */
.site-foot {
  max-width: var(--max-width); margin: 0 auto; padding: 18px 16px 40px;
  border-top: 3px solid var(--border); color: var(--text-dim); font-size: var(--t-sm);
  display: flex; flex-wrap: wrap; gap: 7px 16px; align-items: center;
}
.site-foot a { color: var(--text-muted); }
.site-foot a:hover { color: var(--accent); }
.site-foot .foot-sep { opacity: .4; }
.site-foot .spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .helpers { display: none; }
  .shell.no-helpers { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell, .shell.no-helpers { grid-template-columns: minmax(0, 1fr); padding: 16px 13px 60px; }
  .sidebar {
    position: fixed; inset: var(--header-h) auto 0 0; width: min(300px, 86vw);
    z-index: 70; transform: translateX(-102%);
    transition: transform var(--motion) var(--ease); max-height: none;
    border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: var(--shadow-pop);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after {
    content: ""; position: fixed; inset: var(--header-h) 0 0; z-index: 65;
    background: rgba(7,9,12,.65);
  }
  .nav-toggle { display: grid; }
  .header-nav { display: none; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { min-width: 0; }
  .infobox { float: none; width: 100%; margin: 0 0 16px; }
  .tile-grid, .cover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  :root { --header-h: 52px; }
  .brand-sub { display: none; }
  .page-head h1 { font-size: 24px; }
  h1.page-title { font-size: 23px; }
  .tile-grid, .cover-grid { grid-template-columns: 1fr; }
  .pagenav { grid-template-columns: 1fr; }
  .pagenav .next { grid-column: 1; text-align: left; }
  .list-row { grid-template-columns: 26px minmax(0,1fr); }
  .list-row .lr-meta { display: none; }
  .slider-slide img { max-height: 34vh; }
  .mentioned .m-cat { flex: 0 0 62px; }
}

/* ---------------------------------------------------------------- print */
@media print {
  :root {
    --bg:#fff; --surface:#fff; --surface-alt:#f4f4f4; --text:#000; --text-body:#111;
    --text-muted:#333; --border:#999; --border-soft:#ccc;
  }
  .site-header, .sidebar, .helpers, .pagenav, .search-overlay,
  .slider-nav, .slider-dots, .site-foot { display: none !important; }
  * { box-shadow: none !important; }
  .shell { display: block; padding: 0; max-width: none; }
  .article { max-width: none; }
  .infobox { float: none; width: 100%; }
  .faq details { break-inside: avoid; }
  .faq details > .faq-a { display: block !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8px; color: #555; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Grouped listing: a large category is browsed by pack, not as one long wall. */
.group-head {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 13px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text); margin: 26px 0 9px;
  padding-bottom: 7px; border-bottom: 2px solid var(--border);
}
.group-head:first-of-type { margin-top: 6px; }
.group-count {
  font-family: var(--font-body); font-size: 9.5px; color: var(--accent-ink);
  background: var(--accent); border-radius: var(--r-xs); padding: 1px 6px;
  font-weight: 800;
}
.group-more {
  font-size: var(--t-sm); color: var(--text-dim); margin: 8px 0 0 2px;
}
