/*
 * MARL-BGs website: tokens, type and every shared component.
 * Look: the Moonlit Runefield. Night ink, moonlight silver, carved Cinzel titles,
 * rune rules with a lozenge, flagstone floors. Dark only, on purpose: the world is a night.
 * Color is meaning: Team A azure, Team B crimson (red means Team B and nothing else),
 * one color per class, crest gold only for ornament. Chrome stays silver and gray.
 * Contract: SPEC.md section 4. Page-author cheat sheet: shots/shell/HELPERS.md.
 */

/* Layout concept: a sticky night-glass header over a three-column docs grid
   (sidebar 250 / reading column / On This Page 210) or a full-bleed game band. */
:root {
  color-scheme: dark;
  /* Night layers (store tokens, research/brand.md 1.1) */
  --ink: #0A0D14;
  --ink-2: #0C111B;
  --panel: #0F1624;
  --panel-2: #131B2C;
  --panel-3: #19233A;
  --line: #243049;
  --line-2: #34425F;
  --text: #E6EAF2;
  --muted: #8C97AD;
  --dim: #66718A;
  --moon: #C9D4E8;
  --moon-2: #DCE6FF;
  --warn: #FFB547;
  /* Teams (1.3): color is meaning */
  --team-a: #3D8BFF;
  --team-b: #EF4B4B;
  --team-a-light: #A9CBFF;
  --team-b-light: #FFB3AE;
  --team-a-field: #11264A;
  --team-b-field: #3B141B;
  /* Classes (1.4) */
  --mage: #B99CFF;
  --warrior: #D8904F;
  --hunter: #8CC84B;
  --rogue: #3FD0A0;
  --priest: #F5C95A;
  /* World (1.2, 1.5, 1.7) */
  --crest: #E79515;
  --starcore: #F3EEFF;
  --ward: #9AA6BC;
  --ash: #6B7385;
  --life: #F1E7DA;
  --cinder: #FF8F5A;
  --grave-bone: #D8CCB4;
  --flag: #172133;
  --pool: #1D2A42;
  --seam: #2A3A56;
  --stone: #333C4F;
  --night: #111827;
  /* Store aliases the engine skins read */
  --accent: var(--moon);
  --accent-2: var(--moon-2);
  --accent-wash: rgb(201 212 232 / 9%);
  --accent-line: rgb(201 212 232 / 36%);
  --good: var(--moon);
  --bad: var(--warn);
  /* Type (4.2) */
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, Menlo, Consolas, monospace;
  /* Shape and rhythm */
  --radius: 10px;
  --radius-lg: 14px;
  --header-h: 62px;
  --gutter: 28px;
  --read: 72ch;
  --flow: 1.5rem;
  --glass: rgb(8 12 22 / 84%);
  --panel-grad: linear-gradient(180deg, rgb(19 27 44 / 94%), rgb(15 22 36 / 94%));
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 18px);
  scrollbar-color: #34425F var(--ink);
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1000px 520px at 30% -160px, rgb(220 230 255 / 7%), transparent 70%),
    var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--moon-2); }
::selection { background: rgb(201 212 232 / 28%); color: var(--starcore); }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
/* A deep link (#page~section) focuses its heading for screen readers; no ring around it. */
:is(h1, h2, h3)[tabindex="-1"]:focus { outline: none; }
/* The brand keeps its mixed case inside capitalized labels (SPEC 0.4); site.js wraps it. */
.brand-word { text-transform: none; letter-spacing: normal; }
code, kbd, pre, samp { font-family: var(--mono); }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
#app { flex: 1 0 auto; outline: none; }
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--moon-2); color: var(--ink); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 10px); }

/* Shared vertical flow for block components (utilities below may override it). */
.code, .tabs, .callout, .cards, .facts, .table-wrap, .steps, .fig, .fold, .demo, .next-links, .rune-rule { margin-block: var(--flow); }

/* ------------------------------------------------------------------ */
/* Utilities for page authors                                           */
/* ------------------------------------------------------------------ */

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow {
  margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--moon);
}
.lede { font-size: 18.5px; line-height: 1.55; color: #C3CCDD; max-width: 62ch; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; }
.supertitle { display: flex; flex-direction: column; gap: 4px; }
.supertitle > span:first-child {
  font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--moon);
}
.center .supertitle, .supertitle.center { align-items: center; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.grid-2, .grid-3, .grid-4, .grid-5 { display: grid; gap: 16px 20px; margin-block: var(--flow); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
:is(.grid-2, .grid-3, .grid-4, .grid-5) > * { margin-block: 0; min-width: 0; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--panel-grad); padding: 18px 20px;
}
.flagstone {
  background-color: var(--flag);
  background-image:
    linear-gradient(rgb(42 58 86 / 70%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 58 86 / 70%) 1px, transparent 1px),
    linear-gradient(rgb(42 58 86 / 40%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 58 86 / 40%) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
}
.band { padding-block: 64px; border-top: 1px solid var(--line); position: relative; }
.band-flag { position: relative; isolation: isolate; }
.band-flag::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgb(42 58 86 / 45%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 58 86 / 45%) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
/* Class and team accents: set --c, then use var(--c). */
.c-mage { --c: var(--mage); }
.c-warrior { --c: var(--warrior); }
.c-hunter { --c: var(--hunter); }
.c-rogue { --c: var(--rogue); }
.c-priest { --c: var(--priest); }
.c-team-a { --c: var(--team-a); }
.c-team-b { --c: var(--team-b); }
.accent-text { color: var(--c, var(--moon)); }
.team-a { color: var(--team-a-light); }
.team-b { color: var(--team-b-light); }

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid rgb(36 48 73 / 85%);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 4%, rgb(201 212 232 / 42%) 30%, rgb(201 212 232 / 10%) 62%, transparent 92%);
}
.hdr {
  max-width: 1520px; margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 8px 18px; padding-inline: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; border-radius: 10px; }
.brand-mark { display: block; width: 34px; height: 34px; flex: none; }
.brand-mark img { display: block; width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgb(0 0 0 / 55%)); }
.brand-name { font-weight: 700; font-size: 18.5px; letter-spacing: 0.01em; }
.brand:hover .brand-name { color: var(--moon-2); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 10px; }
.nav-item { position: relative; }
.nav-link, .nav-btn {
  position: relative; display: inline-flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: none;
  color: var(--muted); font-weight: 700; font-size: 14.5px; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.nav-link:hover, .nav-btn:hover, .nav-item.is-open > .nav-btn { color: var(--text); background: rgb(201 212 232 / 6%); }
.nav-chev { opacity: 0.7; transition: transform 0.2s; }
.nav-item.is-open .nav-chev { transform: rotate(180deg); }
.nav-item.is-current > :is(.nav-link, .nav-btn) { color: var(--moon-2); }
.nav-item.is-current > :is(.nav-link, .nav-btn)::after {
  content: ""; position: absolute; left: 50%; bottom: -12px; width: 7px; height: 7px;
  background: var(--moon); transform: translate(-50%, 50%) rotate(45deg);
  box-shadow: 0 0 10px rgb(220 230 255 / 65%);
}

/* Mega menus */
.mega {
  position: absolute; top: calc(100% + 14px); left: 0; z-index: 60;
  width: max-content; max-width: calc(100vw - 24px);
  padding: 12px; border: 1px solid var(--line-2); border-radius: 16px;
  background: linear-gradient(180deg, #151E31, #0E1522);
  box-shadow: 0 30px 80px rgb(0 0 0 / 58%), inset 0 1px 0 rgb(220 230 255 / 6%);
  animation: megaIn 0.16s ease-out;
}
.mega::before {
  content: ""; position: absolute; top: -6px; left: var(--notch, 40px); width: 11px; height: 11px;
  background: #151E31; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
  transform: translateX(-50%) rotate(45deg);
}
.mega::after { content: ""; position: absolute; left: 0; right: 0; top: -20px; height: 20px; }
.mega a { text-decoration: none; color: var(--text); }
.mega-hub {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 10px; border-radius: 11px; color: var(--moon);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgb(220 230 255 / 9%), transparent 60%),
    linear-gradient(rgb(42 58 86 / 35%) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgb(42 58 86 / 35%) 1px, transparent 1px) 0 0 / 24px 24px,
    #111A2B;
}
.mega-hub .mega-t { color: var(--text); }
.mega-hub:hover { border-color: var(--line-2); }
.mega-hub-go { color: var(--dim); transition: transform 0.15s, color 0.15s; }
.mega-hub:hover .mega-hub-go { color: var(--moon); transform: translateX(3px); }
.mega-t { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.mega-s {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; line-height: 1.45; color: var(--muted); font-weight: 400;
}
.mega-game { width: 720px; }
.mega-game.is-narrow { width: 380px; }
.mega-cols { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 6px 10px; }
.mega-col { display: grid; align-content: start; gap: 2px; }
.mega-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 9px 10px; border-radius: 11px; transition: background 0.15s;
}
.mega-item:hover, .mega-item:focus-visible { background: rgb(201 212 232 / 7%); }
.mega-ic {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px;
  color: var(--moon); background: rgb(10 13 20 / 55%); border: 1px solid var(--line);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mega-item:hover .mega-ic { border-color: var(--moon); box-shadow: 0 0 16px rgb(220 230 255 / 16%); }
.mega-classes { padding: 0 0 6px; border-radius: 12px; background: rgb(10 13 20 / 30%); border: 1px solid rgb(36 48 73 / 70%); margin-bottom: 6px; }
.mega-champs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 2px 8px 4px; }
.mega-champ {
  display: grid; justify-items: center; gap: 4px; padding: 8px 2px 6px; border-radius: 10px;
  font-size: 12px; font-weight: 700; color: var(--muted); transition: background 0.15s, color 0.15s;
}
.mega-champ:hover { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.mega-champ.off { opacity: 0.45; }
.mega-watch { width: 600px; }
.mega-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mega-tile {
  display: grid; align-content: start; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgb(10 13 20 / 35%); transition: border-color 0.15s, background 0.15s;
}
.mega-tile:hover { border-color: var(--moon); background: rgb(201 212 232 / 5%); }
.mega-tile-art {
  height: 86px; display: grid; place-items: center; border-radius: 9px; margin-bottom: 4px; color: var(--moon-2);
  background:
    radial-gradient(circle at 50% 120%, rgb(220 230 255 / 16%), transparent 60%),
    linear-gradient(rgb(42 58 86 / 60%) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgb(42 58 86 / 60%) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--flag);
}
.mega-guides { width: min(940px, calc(100vw - 24px)); }
.mega-list { width: 400px; }
.mega-list.is-wide { width: 640px; }
.mega-list.is-wide .mega-list-col { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 6px; }
.mega-list-col { display: grid; }
.mega-ext { margin-top: 10px; padding: 12px 4px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; }
.mega-ext .mega-group-t { grid-column: 1 / -1; margin: 0 6px 4px; color: var(--dim); }
.mega-ext .mega-ic { border-style: dashed; }
.mega-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; padding: 4px 6px 6px; }
.mega-group-t {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--moon);
}
.mega-count {
  font-family: var(--mono); letter-spacing: 0; font-size: 11px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 0 6px;
}
.mega-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.mega-group a {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; margin-left: -8px;
  border-radius: 7px; color: var(--muted); font-size: 14px;
}
.mega-group a:hover { color: var(--text); background: rgb(201 212 232 / 6%); }
.mega-group .more a { color: var(--moon); font-weight: 700; font-size: 13px; }
.mega a.is-here, .mega-group a.is-here { color: var(--moon-2); }
@keyframes megaIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Header tools */
.hdr-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.search-btn, .hdr-btn, .menu-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: rgb(19 27 44 / 70%);
  color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.search-btn { min-width: 176px; }
.search-btn .kbd { margin-left: auto; }
.search-btn:hover, .hdr-btn:hover, .menu-btn:hover, .menu-btn[aria-expanded="true"] {
  color: var(--text); border-color: var(--line-2); background: rgb(25 35 58 / 80%);
}
.hdr-btn { text-decoration: none; background: none; border-color: transparent; padding: 0 10px; }
.hdr-btn.is-here { color: var(--moon-2); border-color: var(--line); }
.menu-btn { display: none; }

/* Drawer (narrow screens) */
.drawer {
  border-top: 1px solid var(--line);
  max-height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px));
  overflow-y: auto; background: #0B101B;
}
.drawer-inner { max-width: 720px; margin: 0 auto; padding: 10px 16px 24px; display: grid; gap: 2px; }
.drawer a { color: var(--text); text-decoration: none; }
.drawer-top, .drawer-sec > summary {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px;
  font-weight: 700; font-size: 16px; border-bottom: 1px solid rgb(36 48 73 / 60%); color: var(--text);
}
.drawer-top .glyph { color: var(--moon); }
.drawer-sec > summary { list-style: none; cursor: pointer; justify-content: space-between; }
.drawer-sec > summary::-webkit-details-marker { display: none; }
.drawer-sum { display: inline-flex; align-items: center; gap: 10px; }
.drawer-sum .glyph { color: var(--moon); }
.drawer-sec[open] > summary .drawer-chev { transform: rotate(180deg); }
.drawer-list { display: grid; padding: 6px 0 12px 12px; }
.drawer-list a { padding: 8px 10px; border-radius: 8px; color: var(--muted); }
.drawer-list a:hover, .drawer-list a.is-here { color: var(--moon-2); background: rgb(201 212 232 / 6%); }
.drawer-group { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.drawer-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 8px 0; }
.drawer-tools .btn { min-height: 42px; font-size: 15px; }
.drawer-anon { display: flex; gap: 10px; align-items: center; margin: 14px 8px 0; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Heroes                                                              */
/* ------------------------------------------------------------------ */

.hero-eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--moon);
}
.hero-eyebrow-lz {
  flex: none; width: 7px; height: 7px; background: var(--moon); transform: rotate(45deg);
  box-shadow: 0 0 10px rgb(220 230 255 / 55%); animation: lozGlint 1.4s 0.2s ease-out both;
}
.hero-title {
  margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: 0.012em;
  font-size: clamp(34px, 4.1vw, 52px); line-height: 1.06;
  color: var(--moon-2);
  background: linear-gradient(180deg, #F3EEFF 8%, #D6DFEF 52%, #97A3BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgb(0 0 0 / 45%));
  outline: none;
}
.hero-title.is-brand { font-family: var(--font); letter-spacing: -0.01em; }
.hero-rule { display: flex; align-items: center; height: 10px; margin: 18px 0 16px; max-width: 440px; }
.hero-rule span {
  flex: none; width: 9px; height: 9px; transform: rotate(45deg);
  border: 1.5px solid var(--moon); background: var(--ink); box-shadow: 0 0 10px rgb(220 230 255 / 30%);
}
.hero-rule::before { content: ""; flex: none; width: 26px; height: 1px; margin-right: 8px; background: rgb(154 166 188 / 70%); }
.hero-rule::after {
  content: ""; flex: 1; height: 1px; margin-left: 8px;
  background: linear-gradient(90deg, rgb(154 166 188 / 70%), transparent);
  transform-origin: left; animation: ruleGrow 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-lede { margin: 0; font-size: 19px; line-height: 1.55; color: #C3CCDD; max-width: 62ch; }
.hero-lede + .hero-actions, .hero-rule + .hero-actions { margin-top: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-docs { padding: 6px 0 30px; }
.hero-docs .hero-aside { margin-top: 20px; }

/* Full-bleed band hero (wide and full layouts) */
.hero-band {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 76px 24px 70px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0A0F1C 0%, #0B101C 60%, var(--ink) 100%);
}
.hero-band.is-game { padding-bottom: 104px; }
.band-sky { position: absolute; inset: 0; z-index: -3; pointer-events: none; }
.band-stars {
  position: absolute; inset: 0; opacity: 0.7;
  background-image:
    radial-gradient(1.2px 1.2px at 22px 34px, #DCE6FF, transparent 70%),
    radial-gradient(1px 1px at 132px 88px, #C9D4E8, transparent 70%),
    radial-gradient(1.4px 1.4px at 196px 22px, #F3EEFF, transparent 70%),
    radial-gradient(1px 1px at 72px 150px, #C9D4E8, transparent 70%),
    radial-gradient(1px 1px at 250px 130px, #DCE6FF, transparent 70%),
    radial-gradient(1.2px 1.2px at 300px 60px, #C9D4E8, transparent 70%),
    radial-gradient(0.9px 0.9px at 40px 210px, #DCE6FF, transparent 70%),
    radial-gradient(1px 1px at 178px 196px, #C9D4E8, transparent 70%);
  background-size: 330px 240px;
  -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 10%, transparent 78%);
}
.band-stars::after {
  content: ""; position: absolute; inset: 0; opacity: 0.6;
  background-image:
    radial-gradient(1px 1px at 60px 40px, #F3EEFF, transparent 70%),
    radial-gradient(0.8px 0.8px at 190px 110px, #DCE6FF, transparent 70%),
    radial-gradient(1.1px 1.1px at 330px 170px, #C9D4E8, transparent 70%);
  background-size: 410px 260px; background-position: 90px 30px;
}
.band-moon {
  position: absolute; left: 12%; top: 22px; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #F3EEFF 0%, #E3EAFA 38%, #B9C5DC 78%, #9AA6BC 100%);
  box-shadow: 0 0 46px 12px rgb(220 230 255 / 16%), 0 0 180px 70px rgb(220 230 255 / 7%);
  opacity: 0.94;
}
.band-moon::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgb(154 166 188 / 45%) 0 7%, transparent 8%),
    radial-gradient(circle at 40% 64%, rgb(154 166 188 / 40%) 0 10%, transparent 11%),
    radial-gradient(circle at 70% 70%, rgb(154 166 188 / 30%) 0 5%, transparent 6%),
    radial-gradient(circle at 30% 30%, rgb(154 166 188 / 25%) 0 4%, transparent 5%);
}
.band-floor {
  position: absolute; left: -30%; right: -30%; bottom: -2px; height: 66%; z-index: -2; pointer-events: none;
  background-color: #111A2B;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 1px), rgb(74 94 128 / 70%) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(90deg, transparent 36.4%, rgb(216 204 180 / 30%) 36.4% 36.55%, transparent 36.55% 63.45%, rgb(216 204 180 / 30%) 63.45% 63.6%, transparent 63.6%),
    linear-gradient(90deg, rgb(107 115 133 / 9%) 0 36.4%, transparent 36.4% 63.6%, rgb(107 115 133 / 9%) 63.6%),
    linear-gradient(rgb(52 70 104 / 95%) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgb(52 70 104 / 95%) 1.5px, transparent 1.5px),
    linear-gradient(rgb(42 58 86 / 70%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 58 86 / 70%) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 240px 240px, 240px 240px, 48px 48px, 48px 48px;
  background-position: center bottom;
  transform: perspective(480px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / 55%) 40%, #000 80%);
  mask-image: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / 55%) 40%, #000 80%);
}
.band-floor::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 90% at 50% 100%, rgb(29 42 66 / 55%), transparent 70%),
    linear-gradient(90deg, var(--ink) 0%, transparent 30%, transparent 70%, var(--ink) 100%);
}
.band-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.band-inner { position: relative; max-width: 1240px; margin: 0 auto; }
.align-center .band-inner { text-align: center; }
.align-center .hero-eyebrow { justify-content: center; }
.align-center .hero-title { font-size: clamp(40px, 5.2vw, 68px); }
.align-center .hero-rule { margin-inline: auto; max-width: 520px; }
.align-center .hero-rule::before {
  flex: 1; width: auto; background: linear-gradient(270deg, rgb(154 166 188 / 70%), transparent);
  transform-origin: right; animation: ruleGrow 0.9s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.align-center .hero-lede { margin-inline: auto; }
.align-center .hero-actions { justify-content: center; }
.has-aside .band-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.band-text, .band-aside { min-width: 0; }

/* ------------------------------------------------------------------ */
/* Layouts                                                             */
/* ------------------------------------------------------------------ */

/* Docs: sidebar / reading column / On This Page */
.layout-docs { position: relative; overflow-x: clip; }
.docs-atmos {
  position: absolute; left: 0; right: 0; top: 0; height: 460px; z-index: 0; pointer-events: none;
  background: radial-gradient(760px 360px at 38% -40px, rgb(220 230 255 / 7%), transparent 72%);
}
.docs-atmos::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(42 58 86 / 42%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(42 58 86 / 42%) 1px, transparent 1px);
  background-size: 44px 44px; background-position: center top;
  -webkit-mask-image: radial-gradient(640px 300px at 42% 0%, rgb(0 0 0 / 70%), transparent 75%);
  mask-image: radial-gradient(640px 300px at 42% 0%, rgb(0 0 0 / 70%), transparent 75%);
  opacity: 0.55;
}
.layout-docs.is-game .docs-atmos::before { opacity: 0.85; }
/* A faint ward circle (the sight-ring motif) behind the top of every docs page. */
.docs-atmos::after {
  content: ""; position: absolute; top: -170px; left: calc(50% + 30px); width: 440px; height: 440px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 440 440' fill='none' stroke='%23C9D4E8'%3E%3Ccircle cx='220' cy='220' r='210' stroke-opacity='.10' stroke-width='1'/%3E%3Ccircle cx='220' cy='220' r='176' stroke-opacity='.08' stroke-width='1' stroke-dasharray='2 7'/%3E%3Ccircle cx='220' cy='220' r='120' stroke-opacity='.06' stroke-width='1'/%3E%3Cpath d='M220.0 32.0L220.0 14.0M254.0 27.0L255.8 17.1M287.0 35.8L290.5 26.4M314.0 57.2L323.0 41.6M346.0 69.9L352.4 62.2M370.1 94.0L377.8 87.6M382.8 126.0L398.4 117.0M404.2 153.0L413.6 149.5M413.0 186.0L422.9 184.2M408.0 220.0L426.0 220.0M413.0 254.0L422.9 255.8M404.2 287.0L413.6 290.5M382.8 314.0L398.4 323.0M370.1 346.0L377.8 352.4M346.0 370.1L352.4 377.8M314.0 382.8L323.0 398.4M287.0 404.2L290.5 413.6M254.0 413.0L255.8 422.9M220.0 408.0L220.0 426.0M186.0 413.0L184.2 422.9M153.0 404.2L149.5 413.6M126.0 382.8L117.0 398.4M94.0 370.1L87.6 377.8M69.9 346.0L62.2 352.4M57.2 314.0L41.6 323.0M35.8 287.0L26.4 290.5M27.0 254.0L17.1 255.8M32.0 220.0L14.0 220.0M27.0 186.0L17.1 184.2M35.8 153.0L26.4 149.5M57.2 126.0L41.6 117.0M69.9 94.0L62.2 87.6M94.0 69.9L87.6 62.2M126.0 57.2L117.0 41.6M153.0 35.8L149.5 26.4M186.0 27.0L184.2 17.1' stroke-opacity='.12' stroke-width='1'/%3E%3Cpath d='M220 2 228 10 220 18 212 10Z' fill='%23C9D4E8' fill-opacity='.18' stroke='none'/%3E%3Cpath d='M220 100 340 220 220 340 100 220Z' stroke-opacity='.05' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.9;
}
.docs-grid {
  position: relative; z-index: 1;
  max-width: 1480px; margin: 0 auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 0 48px;
}
.layout-docs.no-side .docs-grid { grid-template-columns: minmax(0, 1fr) 210px; max-width: 1140px; }
.doc { min-width: 0; max-width: 800px; width: 100%; padding: 44px 0 80px; justify-self: center; }
.layout-docs.no-side .doc { justify-self: start; }

.sidebar {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); align-self: start;
  height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0px));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 40px 6px 48px 0;
}
.sidebar::after {
  content: ""; position: fixed; pointer-events: none;
}
.side-home {
  display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 10px 12px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--panel-grad);
  color: var(--text); font-weight: 700; font-size: 15px; text-decoration: none;
}
.side-home .glyph { color: var(--moon); flex: none; }
a.side-home:hover, a.side-home.is-active { border-color: var(--line-2); color: var(--moon-2); }
.side-group { margin-bottom: 18px; }
.side-group-t {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px 2px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim);
}
.side-group-t::before { content: ""; width: 5px; height: 5px; transform: rotate(45deg); background: var(--line-2); flex: none; }
.side-group.has-active .side-group-t { color: var(--moon); }
.side-group.has-active .side-group-t::before { background: var(--moon); }
.side-group ul { list-style: none; margin: 0 0 0 4px; padding: 0; border-left: 1px solid var(--line); }
.side-group li a {
  display: block; margin-left: -1px; padding: 5px 10px 5px 14px; border-left: 2px solid transparent;
  color: var(--muted); font-size: 14.5px; line-height: 1.38; text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
}
.side-group li a:hover { color: var(--text); border-left-color: var(--line-2); }
.side-group li a.is-active {
  color: var(--moon-2); font-weight: 700; border-left-color: var(--moon);
  background: linear-gradient(90deg, rgb(201 212 232 / 10%), transparent 85%);
}
.side-extra a { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.side-extra-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim);
  border: 1px dashed var(--line-2); border-radius: 999px; padding: 0 6px; white-space: nowrap;
}

.toc { min-width: 0; }
.toc-inner {
  position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  max-height: calc(100vh - var(--header-h)); overflow-y: auto; scrollbar-width: thin;
  padding: 48px 0 40px;
}
.toc-t {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim);
}
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc-list a {
  position: relative; display: block; margin-left: -1px; padding: 4px 0 4px 14px;
  border-left: 1px solid transparent; color: var(--muted); font-size: 13.5px; line-height: 1.4; text-decoration: none;
  transition: color 0.12s;
}
.toc-l3 a { padding-left: 26px; font-size: 13px; color: var(--dim); }
.toc-list a:hover { color: var(--text); }
.toc-list a.is-active { color: var(--moon-2); border-left-color: var(--moon); }
.toc-list a.is-active::before {
  content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px;
  transform: translateY(-50%) rotate(45deg); background: var(--moon); box-shadow: 0 0 8px rgb(220 230 255 / 60%);
}
.side-mobile, .toc-mobile { display: none; }
.side-mobile > summary, .toc-mobile > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer;
  min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel-grad); font-weight: 700; font-size: 14.5px; color: var(--text);
}
.side-mobile > summary::-webkit-details-marker, .toc-mobile > summary::-webkit-details-marker { display: none; }
.side-mobile-here { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 13.5px; }
.side-mobile-body { padding: 14px 4px 4px; max-height: 60vh; overflow-y: auto; }
.toc-mobile { margin: 0 0 20px; }
.toc-mobile .toc-list { margin: 12px 0 4px 6px; }

/* Wide and full */
.wide-wrap { max-width: 1240px; margin: 0 auto; padding: 52px var(--gutter) 88px; }
.layout-full .full-body { min-width: 0; }

/* Page entrance: one quiet moment */
#app.is-entering .doc, #app.is-entering .wide-wrap, #app.is-entering .band-inner { animation: pageIn 0.34s ease-out both; }
@keyframes pageIn { from { opacity: 0.4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ruleGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lozGlint {
  0% { box-shadow: 0 0 0 rgb(220 230 255 / 0%); }
  45% { box-shadow: 0 0 20px 2px rgb(220 230 255 / 85%); }
  100% { box-shadow: 0 0 10px rgb(220 230 255 / 55%); }
}

/* ------------------------------------------------------------------ */
/* Prose                                                               */
/* ------------------------------------------------------------------ */

.prose { font-size: 16px; line-height: 1.65; color: #D4DBE8; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose :is(p, li) { max-width: var(--read); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--moon); }
.prose ul > li { list-style: none; position: relative; }
.prose ul > li::before {
  content: ""; position: absolute; left: -1.05em; top: 0.68em; width: 5px; height: 5px;
  transform: rotate(45deg); background: var(--moon); opacity: 0.8;
}
.prose ul.plain > li::before { display: none; }
.prose strong, .prose b { color: var(--text); }
.prose a { color: var(--moon-2); text-decoration: underline; text-decoration-color: rgb(201 212 232 / 38%); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--moon-2); }
.prose h2 {
  position: relative; margin: 3rem 0 1rem; padding-bottom: 0.45rem;
  font-family: var(--display); font-weight: 700; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2;
  letter-spacing: 0.012em; color: var(--moon-2);
}
.prose h2::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-2), rgb(52 66 95 / 30%) 60%, transparent);
}
.prose h2.supertitle::after, .prose h2.no-rule::after { display: none; }
.prose h3 { margin: 2.1rem 0 0.6rem; font-size: 19px; line-height: 1.35; font-weight: 700; color: var(--text); }
.prose h4 { margin: 1.6rem 0 0.4rem; font-size: 16px; font-weight: 700; color: var(--text); }
.prose h2 + :is(p, ul, ol), .prose h3 + :is(p, ul, ol) { margin-top: 0; }
.prose :not(pre) > code, .inline-code {
  font-size: 0.87em; padding: 0.08em 0.38em; border-radius: 5px;
  background: var(--panel-3); border: 1px solid rgb(52 66 95 / 60%); color: #DCE6FF;
  overflow-wrap: anywhere;
}
.prose a code { color: inherit; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }
.prose blockquote {
  margin: 1.5rem 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--moon); color: #C3CCDD;
}
.prose img { border-radius: 12px; border: 1px solid var(--line); display: block; }
.prose > table { display: block; max-width: 100%; overflow-x: auto; }
.h-anchor {
  display: inline-flex; vertical-align: middle; margin-left: 10px; color: var(--line-2);
  opacity: 0; text-decoration: none !important; transition: opacity 0.15s, color 0.15s;
}
:is(h2, h3):hover > .h-anchor, .h-anchor:focus-visible { opacity: 1; }
.h-anchor:hover { color: var(--moon); }
[id] { scroll-margin-top: calc(var(--header-h) + 18px); }
.layout-wide .prose h2 { font-size: clamp(26px, 2.8vw, 36px); }


/* ------------------------------------------------------------------ */
/* Code blocks and tabs                                                */
/* ------------------------------------------------------------------ */

.code {
  position: relative;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #19233A, #151F33);
  box-shadow: 0 14px 36px rgb(0 0 0 / 28%);
  min-width: 0;
}
.code::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(201 212 232 / 40%) 25%, rgb(201 212 232 / 10%) 70%, transparent);
}
.code-head {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 6px 0 14px;
  background: #121A2A; border-bottom: 1px solid var(--line);
}
.code-lang {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim);
}
.code-lang::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid var(--moon); opacity: 0.8; }
.code-title { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.copy-btn {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted);
  font-size: 12.5px; font-weight: 700; cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--text); background: var(--panel-3); border-color: var(--line-2); }
.copy-btn.is-done { color: var(--moon-2); border-color: var(--accent-line); }
.copy-btn.is-manual { color: var(--warn); }
.code-body { position: relative; }
.code-body pre {
  position: relative; z-index: 1; margin: 0; padding: 16px 18px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.65; color: #D5DCEA; background: transparent; tab-size: 4;
  scrollbar-width: thin;
}
.code-body pre code { font-family: var(--mono); font-size: inherit; background: none; border: 0; padding: 0; color: inherit; white-space: pre; }
.code-bands { position: absolute; left: 0; right: 0; top: 16px; z-index: 0; pointer-events: none; font-size: 13.5px; line-height: 1.65; }
.code-bands span { display: block; height: 1.65em; }
.code-bands span.on { background: linear-gradient(90deg, rgb(201 212 232 / 13%), rgb(201 212 232 / 5%)); box-shadow: inset 3px 0 0 var(--moon); }
.code-out { border-top: 1px dashed var(--line-2); background: #0E1522; }
.code-out-label {
  padding: 9px 18px 0; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--dim);
}
.code-out pre { margin: 0; padding: 6px 18px 14px; overflow-x: auto; font-size: 13px; line-height: 1.6; color: #AEB9CE; }
.tabs-head { padding-left: 4px; gap: 6px; }
/* Beside tabs, the title gives way first: tab names stay whole. */
.tabs-head .code-title { flex: 1 1 0; }
.tablist { display: flex; align-items: stretch; align-self: stretch; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tablist [role="tab"] {
  position: relative; display: inline-flex; align-items: center; padding: 0 14px; min-height: 40px;
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-size: 13.5px; font-weight: 700; color: var(--muted); transition: color 0.15s;
}
.tablist [role="tab"]:hover { color: var(--text); }
.tablist [role="tab"][aria-selected="true"] { color: var(--moon-2); }
.tablist [role="tab"][aria-selected="true"]::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--moon);
  box-shadow: 0 0 10px rgb(220 230 255 / 60%);
}
/* Non-code tabs */
.tabs:not(.code) { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-grad); overflow: hidden; }
.tabs:not(.code) .tabs-head { background: rgb(10 13 20 / 40%); }
.tab-html { padding: 18px 20px; }
.tab-html > :last-child { margin-bottom: 0; }

/* Prism tokens: moonlit, never red (red means Team B) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6E7A93; font-style: italic; }
.token.punctuation { color: #8591AA; }
.token.keyword, .token.important, .token.atrule, .token.rule { color: #B6A9FF; }
.token.builtin, .token.class-name, .token.namespace { color: #8FD3F2; }
.token.function, .token.function-variable { color: #A6C8FF; }
.token.string, .token.char, .token.attr-value, .token.template-string, .token.regex { color: #E6CF98; }
.token.number, .token.boolean, .token.constant, .token.symbol { color: #F2B083; }
.token.operator, .token.entity, .token.url { color: #AEB9CE; }
.token.property, .token.key, .token.attr-name, .token.tag { color: #9CC4FF; }
.token.variable, .token.parameter { color: #DCE6FF; }
.token.decorator, .token.annotation { color: #F2B083; }
.token.triple-quoted-string { color: #C9BE9A; }
.token.shebang, .token.function.bash, .language-bash .token.function { color: #A6C8FF; }
.token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* ------------------------------------------------------------------ */
/* Callouts, placeholder, pending                                      */
/* ------------------------------------------------------------------ */

.callout {
  --co: var(--moon); --co-wash: rgb(201 212 232 / 7%);
  position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px;
  padding: 14px 18px 14px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--co-wash), transparent 70%), rgb(15 22 36 / 80%);
}
.callout::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--co);
}
.callout-icon { color: var(--co); padding-top: 1px; }
.callout-main { min-width: 0; }
.callout-label { margin: 0 0 2px !important; font-size: 11.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--co); }
.callout-title { margin: 0 0 4px !important; font-weight: 700; color: var(--text); }
.callout-text { color: #C6CEDD; font-size: 15px; }
.callout-text > :last-child { margin-bottom: 0; }
.callout-text p { margin: 0 0 0.6rem; }
.callout-tip { --co: var(--moon-2); --co-wash: rgb(220 230 255 / 9%); }
.callout-watch { --co: var(--warn); --co-wash: rgb(255 181 71 / 8%); border-color: rgb(255 181 71 / 28%); }
.callout-truth { --co: var(--ward); --co-wash: rgb(154 166 188 / 7%); background: linear-gradient(90deg, var(--co-wash), transparent 70%), rgb(12 17 27 / 85%); }
.callout-placeholder, .callout-example {
  border: 1.5px dashed var(--co);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--co-wash) 14px 15px),
    rgb(15 22 36 / 80%);
}
.callout-placeholder::before, .callout-example::before { display: none; }
.callout-placeholder { --co: var(--warn); --co-wash: rgb(255 181 71 / 9%); }
.callout-placeholder .callout-label, .callout-example .callout-label {
  display: inline-flex; padding: 1px 9px; border-radius: 999px; background: var(--co); color: var(--ink); letter-spacing: 0.12em;
}
.callout-example { --co: var(--moon); --co-wash: rgb(201 212 232 / 7%); }

.ph, .pend {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; vertical-align: baseline;
  padding: 0 9px 0 2px; border-radius: 999px; font-size: 0.9em; line-height: 1.7;
}
.ph { border: 1px dashed rgb(255 181 71 / 65%); background: rgb(255 181 71 / 7%); color: #FFD9A0; }
.pend { border: 1px dashed rgb(201 212 232 / 55%); background: rgb(201 212 232 / 6%); color: #DCE6FF; }
.ph-tag, .pend-tag {
  padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; line-height: 1.75;
}
.ph-tag { background: var(--warn); color: #1A1204; }
.pend-tag { background: var(--moon); color: var(--ink); }

/* ------------------------------------------------------------------ */
/* Cards                                                               */
/* ------------------------------------------------------------------ */

.cards {
  --gap: 14px; --min: 210px;
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--min), calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)))), 1fr));
}
.card {
  --card-accent: var(--moon);
  position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 18px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--panel-grad);
  color: var(--text); text-decoration: none !important;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.25s;
}
.card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; z-index: 1;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card-accent) 80%, transparent), transparent);
  opacity: 0.3; transition: opacity 0.2s;
}
.card::after {
  content: ""; position: absolute; left: -30%; right: -30%; bottom: -70%; height: 110%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--card-accent) 20%, transparent), transparent);
  opacity: 0; transition: opacity 0.25s;
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--card-accent) 60%, var(--line-2));
  box-shadow: 0 22px 46px rgb(0 0 0 / 45%), 0 0 0 1px color-mix(in srgb, var(--card-accent) 18%, transparent);
}
a.card:hover::before, a.card:focus-visible::before, a.card:hover::after, a.card:focus-visible::after { opacity: 1; }
.card-icon {
  width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 6px; flex: none;
  border-radius: 12px; background: rgb(10 13 20 / 60%); border: 1px solid var(--line); color: var(--card-accent);
}
.card.has-accent .card-icon { border-color: color-mix(in srgb, var(--card-accent) 35%, var(--line)); box-shadow: inset 0 0 18px color-mix(in srgb, var(--card-accent) 10%, transparent); }
.card-tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); padding-right: 24px; }
.card.has-accent .card-tag { color: var(--card-accent); }
.card-title { font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--text); padding-right: 24px; }
.card-text { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.card-text code { font-size: 0.86em; }
.card-go { position: absolute; right: 16px; top: 18px; color: var(--dim); transition: transform 0.18s, color 0.18s; }
a.card:hover .card-go { color: var(--card-accent); transform: translateX(3px); }

/* ------------------------------------------------------------------ */
/* Facts, tables, steps, chips                                         */
/* ------------------------------------------------------------------ */

.facts { border: 1px solid var(--line); border-radius: 14px; background: var(--panel-grad); overflow: hidden; min-width: 0; }
.facts-title {
  display: flex; align-items: center; gap: 10px; margin: 0 !important; padding: 12px 16px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--moon);
  border-bottom: 1px solid var(--line); background: rgb(10 13 20 / 40%);
}
.facts-title::before { content: ""; width: 7px; height: 7px; transform: rotate(45deg); background: var(--moon); flex: none; }
.facts dl { margin: 0; }
.facts-row { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 14px; padding: 9px 16px; border-top: 1px solid rgb(36 48 73 / 60%); }
.facts-row:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-family: var(--mono); font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.table-caption { margin: 0 0 8px !important; font-size: 13.5px; color: var(--muted); }
.table-scroll {
  overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgb(15 22 36 / 75%);
  scrollbar-width: thin;
}
.table-scroll table, .prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.table-scroll th, .prose table th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table-scroll tbody th { text-transform: none; letter-spacing: 0; font-size: 14.5px; color: var(--text); background: none; border-bottom: 0; border-top: 1px solid rgb(36 48 73 / 65%); }
.table-scroll td, .prose table td { padding: 10px 14px; border-top: 1px solid rgb(36 48 73 / 65%); vertical-align: top; color: #D2D9E6; }
.table-scroll tbody tr:first-child > * { border-top: 0; }
.table-scroll tbody tr:hover > * { background: rgb(201 212 232 / 3.5%); }
.table-scroll td.num { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.table-scroll td .emblem, .table-scroll th .emblem { vertical-align: -3px; margin-right: 4px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 6px 10px; font-size: 13.5px; }
.table-wrap.compact th { font-size: 11.5px; }

.steps { list-style: none; padding: 0; max-width: none; }
.step { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px; padding-bottom: 28px; max-width: none !important; margin: 0 !important; }
.prose .steps > li::before { display: none; }
.step::after {
  content: ""; position: absolute; left: 22px; top: 46px; bottom: 2px; width: 2px;
  background: linear-gradient(180deg, var(--line-2), rgb(52 66 95 / 15%));
}
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step-n { position: relative; width: 46px; height: 46px; display: grid; place-items: center; }
.step-n::before {
  content: ""; position: absolute; inset: 8px; transform: rotate(45deg); border-radius: 5px;
  border: 1.5px solid var(--moon); background: linear-gradient(135deg, #1D2A42, #0F1624);
  box-shadow: 0 0 18px rgb(220 230 255 / 14%);
}
.step-n span { position: relative; font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--moon-2); }
.step-body { min-width: 0; padding-top: 9px; }
.prose .step-title, .step-title { margin: 0 0 8px !important; font-family: var(--font); font-size: 18px; font-weight: 700; color: var(--text); }
.step-html > :last-child { margin-bottom: 0; }
.step-html > .code:first-child, .step-html > .tabs:first-child { margin-top: 10px; }

.chips { display: inline-flex; flex-wrap: wrap; gap: 8px; vertical-align: middle; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 2px 12px; max-width: 100%;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-3);
  color: #D5DCEA; font-size: 13px; font-weight: 700; line-height: 1.3;
}
.chip.has-accent {
  border-color: color-mix(in srgb, var(--chip-accent) 45%, var(--line));
  background: color-mix(in srgb, var(--chip-accent) 9%, var(--panel-2));
}
.chip-dot { width: 7px; height: 7px; flex: none; transform: rotate(45deg); border-radius: 1px; background: var(--chip-accent); }

.emblem, .crest { display: inline-block; flex: none; vertical-align: -0.22em; }
.emblem { filter: drop-shadow(0 1px 2px rgb(0 0 0 / 50%)); }

/* Terms and the shared tooltip */
.term { border-bottom: 1.5px dotted rgb(201 212 232 / 60%); cursor: help; border-radius: 0; }
.term:hover, .term:focus-visible { border-bottom-color: var(--moon); color: var(--text); }
.tip {
  position: fixed; left: 0; top: 0; z-index: 120; max-width: min(320px, calc(100vw - 24px));
  padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line-2); background: #1A2438;
  color: var(--text); font-size: 14px; line-height: 1.45; pointer-events: none;
  box-shadow: 0 18px 44px rgb(0 0 0 / 55%);
}
.tip::after {
  content: ""; position: absolute; left: var(--tip-x, 50%); bottom: -6px; width: 10px; height: 10px;
  background: #1A2438; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  transform: translateX(-50%) rotate(45deg);
}
.tip.below::after { top: -6px; bottom: auto; transform: translateX(-50%) rotate(225deg); }
.tip code { font-size: 0.88em; background: var(--panel-3); border-radius: 4px; padding: 0 4px; }

.kbd, kbd {
  display: inline-block; min-width: 1.7em; padding: 0 6px; border-radius: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; line-height: 1.6; text-align: center;
  color: var(--text); background: var(--panel-3); border: 1px solid var(--line-2); border-bottom-width: 2px;
  white-space: nowrap;
}
.kbd + .kbd { margin-left: 3px; }

/* Figures, folds, stats, rune rule */
.fig { margin-inline: 0; min-width: 0; }
.fig-body { border: 1px solid var(--line); border-radius: 14px; background: #0B1120; overflow-x: auto; }
.fig-cap { display: flex; gap: 9px; align-items: baseline; margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.fig-cap::before { content: ""; flex: none; width: 6px; height: 6px; transform: translateY(-1px) rotate(45deg); background: var(--line-2); }

.fold { border: 1px solid var(--line); border-radius: 12px; background: rgb(15 22 36 / 65%); }
.fold > summary {
  list-style: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 12px 16px; cursor: pointer; border-radius: 12px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover .fold-sum { color: var(--moon-2); }
.fold-mark { display: inline-grid; color: var(--moon); transition: transform 0.2s; }
.fold[open] .fold-mark { transform: rotate(90deg); }
.fold-label {
  flex: none; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); line-height: 1.8;
}
.fold-sum { font-weight: 700; color: var(--text); }
.fold-body { padding: 14px 18px 16px 18px; border-top: 1px solid var(--line); }
.fold-body > :last-child { margin-bottom: 0; }

.stat { display: grid; gap: 7px; margin: 0.85rem 0; min-width: 0; }
.stat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stat-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.stat-value { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-unit { color: var(--dim); font-weight: 400; font-size: 13px; }
.stat-track { position: relative; height: 10px; border-radius: 3px; background: var(--ink-2); border: 1px solid var(--line); overflow: hidden; }
.stat-track::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgb(10 13 20 / 80%) calc(25% - 1px) 25%);
}
.stat-fill {
  position: relative; display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--stat-accent) 45%, transparent), var(--stat-accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--stat-accent) 45%, transparent);
}
.stat-fill::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--starcore); opacity: 0.85; }
.stat-note { margin: 0 !important; font-size: 12.5px; color: var(--dim); }

.rune-rule { display: flex; align-items: center; height: 12px; margin-block: 2.75rem; }
.rune-rule::before, .rune-rule::after { content: ""; flex: 1; height: 1px; }
.rune-rule::before { background: linear-gradient(90deg, transparent, rgb(154 166 188 / 60%)); }
.rune-rule::after { background: linear-gradient(270deg, transparent, rgb(154 166 188 / 60%)); }
.rune-lozenge {
  position: relative; flex: none; width: 11px; height: 11px; margin: 0 14px; transform: rotate(45deg);
  border: 1.5px solid var(--moon); box-shadow: 0 0 12px rgb(220 230 255 / 28%);
}
.rune-lozenge::after { content: ""; position: absolute; inset: 2.5px; background: var(--moon); }

/* Demo frame: the one bracketed box that says "this moves / you can touch this" */
.demo {
  position: relative; margin-inline: 0; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, #16213A, #0B1020 72%);
  box-shadow: 0 26px 64px rgb(0 0 0 / 42%), inset 0 1px 0 rgb(220 230 255 / 5%);
}
.demo-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.demo-tag {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px;
  background: linear-gradient(180deg, #E8EEFB, #C9D4E8); color: var(--ink);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.demo-tag .glyph { fill: var(--ink); stroke: none; }
.demo-title { font-weight: 700; font-size: 15.5px; color: var(--text); }
.demo-body { position: relative; min-width: 0; }
.demo-cap { padding: 10px 16px 12px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.demo-corner { position: absolute; width: 14px; height: 14px; border: 0 solid var(--moon); pointer-events: none; opacity: 0.9; }
.demo-corner.tl { top: -5px; left: -5px; border-width: 2px 0 0 2px; border-top-left-radius: 5px; }
.demo-corner.tr { top: -5px; right: -5px; border-width: 2px 2px 0 0; border-top-right-radius: 5px; }
.demo-corner.bl { bottom: -5px; left: -5px; border-width: 0 0 2px 2px; border-bottom-left-radius: 5px; }
.demo-corner.br { bottom: -5px; right: -5px; border-width: 0 2px 2px 0; border-bottom-right-radius: 5px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px;
  border-radius: 11px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 15.5px; text-decoration: none !important; white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
}
.btn-primary {
  color: var(--ink) !important;
  background: linear-gradient(180deg, #F3EEFF 0%, #D6DFEF 55%, #AEBAD2 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%), 0 10px 28px rgb(0 0 0 / 40%), 0 0 0 1px rgb(220 230 255 / 30%);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 55%), 0 14px 34px rgb(0 0 0 / 45%), 0 0 30px rgb(220 230 255 / 26%); }
.btn-secondary {
  color: var(--text) !important; border-color: var(--line-2);
  background: rgb(19 27 44 / 72%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn-secondary:hover { border-color: var(--moon); background: rgb(25 35 58 / 85%); }
.btn-ghost { color: var(--moon-2) !important; padding-inline: 10px; }
.btn-ghost:hover { color: var(--starcore) !important; background: rgb(201 212 232 / 6%); }
.btn .kbd { margin-left: 4px; }

/* "Using MARL-BGs in a paper? How To Cite" at the foot of every guide page */
.cite-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 3rem; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 15px;
  background: linear-gradient(90deg, rgb(201 212 232 / 6%), transparent 70%), rgb(15 22 36 / 60%);
}
.cite-strip > .glyph { color: var(--moon); }
.cite-strip a { display: inline-flex; align-items: center; gap: 6px; color: var(--moon-2); font-weight: 700; text-decoration: none; }
.cite-strip a:hover { color: var(--starcore); }
.cite-strip + .prevnext { margin-top: 1.5rem; }

/* Next links and previous / next */
.next-links { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.next-eyebrow { color: var(--dim); }
.next-links .cards { margin-block: 0; }
.prevnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.pn {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; background: rgb(15 22 36 / 60%); text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.pn-next { align-items: flex-end; text-align: right; }
.pn:not(.pn-empty):hover { border-color: var(--moon); background: rgb(25 35 58 / 60%); }
.pn-dir { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--dim); }
.pn:hover .pn-dir { color: var(--moon); }
.pn-t { font-weight: 700; font-size: 16.5px; color: var(--text); }
.pn-g { font-size: 13px; color: var(--muted); }
.pn-empty { border: 0; background: none; }

/* ------------------------------------------------------------------ */
/* Search palette                                                      */
/* ------------------------------------------------------------------ */

dialog.search {
  width: min(680px, calc(100vw - 24px)); max-width: none; max-height: none;
  margin: 10vh auto auto; padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible;
}
dialog.search::backdrop { background: rgb(3 6 14 / 74%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.search[open] { animation: megaIn 0.16s ease-out; }
.search-box {
  display: flex; flex-direction: column; max-height: min(640px, 78vh); overflow: hidden;
  border: 1px solid var(--line-2); border-radius: 16px;
  background: linear-gradient(180deg, #151E31, #0E1522);
  box-shadow: 0 40px 120px rgb(0 0 0 / 62%), inset 0 1px 0 rgb(220 230 255 / 6%);
}
.search-field { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); color: var(--moon); }
.search-field:focus-within { border-bottom-color: rgb(201 212 232 / 45%); }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font-size: 18px; }
.search-field input::placeholder { color: var(--dim); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-esc { border: 0; background: none; padding: 6px; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.search-results [role="option"] a {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px; color: var(--text); text-decoration: none;
}
.search-results .is-sel a { background: rgb(201 212 232 / 9%); box-shadow: inset 2px 0 0 var(--moon); }
.sr-ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-3); border: 1px solid var(--line); color: var(--moon); }
.sr-main { min-width: 0; }
.sr-t { display: block; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-c { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-go { color: var(--dim); opacity: 0; }
.is-sel .sr-go { opacity: 1; color: var(--moon); }
.sr-head { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--dim); }
.sr-empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.sr-empty p { margin: 0 0 6px; }
.sr-empty-sub { font-size: 14px; color: var(--dim); }
.search-results mark { background: rgb(220 230 255 / 18%); color: var(--starcore); border-radius: 3px; padding: 0 1px; }
.search-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); }
.search-foot .kbd { font-size: 11px; }

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.site-footer {
  position: relative; margin-top: auto; padding-inline: 24px;
  background: linear-gradient(180deg, #0A0D14, #070A12); border-top: 1px solid var(--line);
}
.foot-rule { position: absolute; left: 50%; top: -6px; width: 11px; height: 11px; transform: translateX(-50%) rotate(45deg); border: 1.5px solid var(--moon); background: var(--ink); box-shadow: 0 0 12px rgb(220 230 255 / 30%); }
.foot-inner { max-width: 1320px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.4fr); gap: 40px; padding: 52px 0 34px; }
.foot-brand { display: flex; gap: 16px; align-items: flex-start; }
.foot-mark img { display: block; width: 56px; height: 56px; filter: drop-shadow(0 4px 12px rgb(0 0 0 / 60%)); }
.foot-title { margin: 2px 0 6px; font-weight: 700; font-size: 18px; color: var(--text); }
.foot-line { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 36ch; }
.foot-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.foot-ext { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; }
.foot-ext-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 700; }
.foot-ext-link .glyph { color: var(--moon); }
.foot-ext-link:hover { color: var(--moon-2); }
.foot-ext-sub { color: var(--muted); font-weight: 400; }
.foot-t { margin: 0 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: var(--moon); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot-col a, .foot-base a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.foot-col a:hover, .foot-base a:hover { color: var(--text); }
.foot-base {
  max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px;
  padding: 18px 0 30px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13.5px;
}
.foot-base p { margin: 0; }
.foot-base-links { display: flex; gap: 18px; }

/* ------------------------------------------------------------------ */
/* 404                                                                 */
/* ------------------------------------------------------------------ */

.lost { max-width: 780px; margin: 0 auto; text-align: center; padding-top: 8px; }
.lost-art { overflow: visible; display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.lost-code { margin: 6px 0 0 !important; font-family: var(--mono); font-weight: 700; letter-spacing: 0.4em; color: var(--dim); max-width: none !important; }
.prose .lost-title {
  margin: 10px auto 12px; padding: 0; font-size: clamp(26px, 3.4vw, 40px);
  background: linear-gradient(180deg, #F3EEFF 8%, #D6DFEF 52%, #97A3BC 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.prose .lost-title::after { display: none; }
.prose .lost-text { margin: 0 auto 0; color: var(--muted); }
.lost-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 26px 0 8px; }
.lost-guess { margin-top: 40px; text-align: left; }
.lost-guess .eyebrow { text-align: center; }

/* Shell demo pages only (window.SITE_SHELL_DEMO) */
.shell-fig { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; padding: 24px; }
.shell-demo-fill { height: 220px; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1480px) {
  .hdr { gap: 8px 14px; }
  .nav-link, .nav-btn { padding: 0 10px; font-size: 14px; }
  .search-btn { min-width: 0; }
  .search-btn .search-word { display: none; }
}
@media (max-width: 1360px) {
  .hdr { padding-inline: 18px; }
  .nav { margin-left: 4px; }
  .nav-link, .nav-btn { padding: 0 8px; }
  .hdr-tools { gap: 4px; }
  .foot-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}
@media (max-width: 1240px) {
  .docs-grid { grid-template-columns: 236px minmax(0, 1fr); gap: 0 44px; }
  .layout-docs.no-side .docs-grid { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
  .toc { display: none; }
  .toc-mobile:not([hidden]) { display: block; }
  .doc { justify-self: start; }
}
@media (max-width: 1240px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .search-btn .search-word { display: inline; }
}
@media (max-width: 1120px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .has-aside .band-inner { grid-template-columns: minmax(0, 1fr); }
  .foot-inner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .side-mobile { display: block; margin: 0 0 22px; }
  .doc { padding-top: 26px; max-width: none; }
  .foot-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hdr-btn span { display: none; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-h: 58px; }
  body { font-size: 16px; }
  .hdr { padding-inline: 16px; gap: 8px; }
  .brand-name { font-size: 17px; }
  .search-btn { padding: 0 10px; }
  .search-btn .search-word, .search-btn .kbd { display: none; }
  .menu-btn span { display: none; }
  #site-cite-btn { display: none; }
  .menu-btn { padding: 0 10px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
  .hero-band { padding: 48px 16px 46px; }
  .hero-band.is-game { padding-bottom: 72px; }
  /* Phones: a smaller moon in the top-right corner, clear of the eyebrow and the title. */
  .band-moon { width: 40px; height: 40px; left: auto; right: 18px; top: 10px; }
  .hero-title { font-size: clamp(30px, 8.4vw, 40px); }
  .align-center .hero-title { font-size: clamp(32px, 9vw, 44px); }
  .hero-lede { font-size: 17px; }
  .wide-wrap { padding: 36px var(--gutter) 64px; }
  .prevnext { grid-template-columns: minmax(0, 1fr); }
  .pn-next { align-items: flex-start; text-align: left; }
  .pn-empty { display: none; }
  .facts-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .site-footer { padding-inline: 16px; }
  .foot-base { flex-direction: column; }
  .code-body pre { padding: 14px; }
  .tabs-head .code-title { display: none; }
  /* Phones: tab names wrap onto a second row instead of hiding past the edge. */
  .tabs-head .tablist { flex-wrap: wrap; overflow: visible; }
  .code-bands { top: 14px; }
  dialog.search { margin-top: 12px; }
  .search-foot { display: none; }
  .prose h2 { margin-top: 2.4rem; }
  .step { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
  .step-n { width: 40px; height: 40px; }
  .step::after { left: 19px; top: 40px; }
}

/* ------------------------------------------------------------------ */
/* Reduced motion: every shell animation has a designed still          */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow-lz, .hero-rule::before, .hero-rule::after, .mega, dialog.search[open],
  #app.is-entering .doc, #app.is-entering .wide-wrap, #app.is-entering .band-inner {
    animation: none !important;
  }
  .card, .btn, .pn, .copy-btn, .fold-mark, .nav-chev, .mega-hub-go, .card-go, .nav-link, .nav-btn, .side-group li a {
    transition: none !important;
  }
  a.card:hover, a.card:focus-visible, .btn-primary:hover { transform: none; }
}

/* Print: the still look, no chrome */
@media print {
  .site-header, .sidebar, .toc, .side-mobile, .toc-mobile, .prevnext, .site-footer, .copy-btn { display: none !important; }
  body { background: #fff; color: #111; }
}
