/* ThePredict docs · the landing's pixel look, tuned for reading. Light and dark themes, no network.
   Fonts are vendored in assets/fonts (SIL OFL 1.1, see CREDITS.md). */

@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/pixelify-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/pixelify-sans-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-opsz-normal.woff2") format("woff2-variations"),
       url("fonts/inter-latin-opsz-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

/* ------------------------------------------------------------------ tokens */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-px: "Pixelify Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar-h: 56px;
  --sidebar-w: 264px;
  --toc-w: 224px;
  --measure: 50rem;
  --gutter: 16px;

  color-scheme: light;
  --bg: #f6f2ea;
  --bg-2: #eee8dc;
  --panel: #fffdf8;
  --panel-2: #f1ebe0;
  --ink: #1d1a16;
  --ink-2: #3b352d;
  --muted: #655d52;
  --faint: #8a8276;
  --line: #e0d7c7;
  --line-2: #cbbfab;
  --link: #8a4800;
  --link-hover: #b23a00;
  --accent: #9b6400;
  --accent-2: #c42a36;
  --brand-ink: #1d1a16;
  --code-inline-bg: #ebe3d4;
  --code-inline-ink: #3d2808;
  --bevel-l: #ffffff;
  --bevel-d: #c7bba7;
  --focus: #006f86;
  --note: #006f86;   --note-bg: #e6f3f5;
  --tip: #1f7a4d;    --tip-bg: #e8f4ec;
  --warn: #9b5a00;   --warn-bg: #fbf0dc;
  --danger: #b4232f; --danger-bg: #fbe6e6;
  --soon: #94500a;   --soon-bg: #fdf0d6; --soon-line: #e0a64e;
  --mark: rgba(255, 196, 64, 0.45);
  --target: rgba(255, 196, 64, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0a09;
    --bg-2: #100f0d;
    --panel: #151311;
    --panel-2: #1c1916;
    --ink: #f1ece4;
    --ink-2: #d3ccc1;
    --muted: #a0988c;
    --faint: #6f675d;
    --line: #2a2622;
    --line-2: #3b352f;
    --link: #ffd25a;
    --link-hover: #ffe697;
    --accent: #ffd25a;
    --accent-2: #ff4a58;
    --brand-ink: #f4efe6;
    --code-inline-bg: #241f1a;
    --code-inline-ink: #ffe0a0;
    --bevel-l: #4a433b;
    --bevel-d: #050403;
    --focus: #5ff0ff;
    --note: #5fd8f0;   --note-bg: #0e1f23;
    --tip: #4fe3a1;    --tip-bg: #0f1f17;
    --warn: #ffb648;   --warn-bg: #241a0b;
    --danger: #ff6b76; --danger-bg: #2a1013;
    --soon: #ffb648;   --soon-bg: #231909; --soon-line: #7d5520;
    --mark: rgba(255, 210, 90, 0.32);
    --target: rgba(255, 210, 90, 0.10);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0a09;
  --bg-2: #100f0d;
  --panel: #151311;
  --panel-2: #1c1916;
  --ink: #f1ece4;
  --ink-2: #d3ccc1;
  --muted: #a0988c;
  --faint: #6f675d;
  --line: #2a2622;
  --line-2: #3b352f;
  --link: #ffd25a;
  --link-hover: #ffe697;
  --accent: #ffd25a;
  --accent-2: #ff4a58;
  --brand-ink: #f4efe6;
  --code-inline-bg: #241f1a;
  --code-inline-ink: #ffe0a0;
  --bevel-l: #4a433b;
  --bevel-d: #050403;
  --focus: #5ff0ff;
  --note: #5fd8f0;   --note-bg: #0e1f23;
  --tip: #4fe3a1;    --tip-bg: #0f1f17;
  --warn: #ffb648;   --warn-bg: #241a0b;
  --danger: #ff6b76; --danger-bg: #2a1013;
  --soon: #ffb648;   --soon-bg: #231909; --soon-line: #7d5520;
  --mark: rgba(255, 210, 90, 0.32);
  --target: rgba(255, 210, 90, 0.10);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.68;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code, kbd, pre { font-family: var(--font-mono); }
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
.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 { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--panel); border-bottom: 2px solid var(--line-2);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--brand-ink); text-decoration: none; flex: none; }
.brand:hover { color: var(--brand-ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-name { font-family: var(--font-px); font-size: 1.28rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1; }
.brand-tag {
  font-family: var(--font-px); font-size: 0.82rem; line-height: 1; padding: 3px 6px 4px;
  color: var(--accent); border: 2px solid var(--line-2); background: var(--panel-2);
}
.b-bg { fill: #1f2228; } .b-trim { fill: #7a5530; } .b-eye { fill: #5ff0ff; } .b-core { fill: #ff6a2a; }
.version {
  flex: none; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted);
  border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 2px; white-space: nowrap;
}
.icon-btn {
  flex: none; width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer;
  background: var(--panel-2); border: 2px solid var(--line-2);
  box-shadow: inset 2px 2px 0 var(--bevel-l), inset -2px -2px 0 var(--bevel-d);
}
.icon-btn svg { width: 16px; height: 16px; fill: var(--ink); }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn:active { box-shadow: inset -2px -2px 0 var(--bevel-l), inset 2px 2px 0 var(--bevel-d); }
.menu-btn { display: none; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; }
}

/* search */
.search { position: relative; flex: 1 1 auto; max-width: 440px; margin-left: auto; min-width: 0; }
.search-input {
  width: 100%; height: 38px; padding: 0 34px 0 12px; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--bg); border: 2px solid var(--line-2); border-radius: 0; outline: none;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.06);
  -webkit-appearance: none; appearance: none;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { border-color: var(--focus); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-key {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 0.72rem; color: var(--muted); border: 1px solid var(--line-2); padding: 0 5px; line-height: 1.4;
  background: var(--panel-2); pointer-events: none;
}
.search-input:focus + .search-key { display: none; }
.search-results {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(560px, calc(100vw - 32px));
  max-height: min(70vh, 560px); overflow-y: auto; z-index: 60;
  background: var(--panel); border: 2px solid var(--line-2);
  box-shadow: inset 2px 2px 0 var(--bevel-l), inset -2px -2px 0 var(--bevel-d), 0 18px 40px rgba(0, 0, 0, 0.25);
}
.search-results[hidden] { display: none; }
.sr-item { display: block; padding: 10px 14px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover, .sr-item.is-active { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.sr-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.sr-title { display: flex; gap: 8px; align-items: baseline; font-weight: 600; font-size: 0.95rem; line-height: 1.35; }
.sr-title .sr-name { overflow-wrap: anywhere; }
.sr-kind { flex: none; font-family: var(--font-px); font-size: 0.72rem; font-weight: 400; color: var(--accent); text-transform: uppercase; letter-spacing: 0.04em; }
.sr-page { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 1px; }
.sr-snip { display: block; font-size: 0.84rem; color: var(--ink-2); margin-top: 3px; line-height: 1.45; overflow-wrap: anywhere; }
.sr-item mark { background: var(--mark); color: inherit; padding: 0 1px; }
.sr-empty { padding: 14px; color: var(--muted); font-size: 0.92rem; margin: 0; }
.sr-head { padding: 7px 14px; font-size: 0.76rem; color: var(--muted); border-bottom: 1px solid var(--line); margin: 0; }

/* ------------------------------------------------------------------ layout */
.layout {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: calc(100vh - var(--topbar-h));
}
body.no-toc .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 22px 14px 40px 18px; border-right: 2px solid var(--line); background: var(--bg-2);
  scrollbar-width: thin;
}
.nav-group + .nav-group { margin-top: 18px; }
.nav-title { margin: 0 0 6px 8px; font-family: var(--font-px); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block; padding: 5px 10px 5px 10px; font-size: 0.93rem; line-height: 1.4; color: var(--ink-2);
  text-decoration: none; border-left: 3px solid transparent;
}
.sidebar li a:hover { color: var(--ink); background: var(--panel-2); }
.sidebar li a.is-current { color: var(--ink); font-weight: 600; background: var(--panel); border-left-color: var(--accent); }
.nav-soon { color: var(--soon); font-size: 0.6rem; vertical-align: 2px; margin-left: 2px; }
.scrim { display: none; }

.main { min-width: 0; padding: 34px 48px 40px; outline: none; }
.doc { max-width: var(--measure); margin: 0 auto; }
.toc {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 34px 18px 40px 6px; font-size: 0.84rem; scrollbar-width: thin;
}
.toc-title { margin: 0 0 8px; font-family: var(--font-px); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 3px 10px; color: var(--muted); text-decoration: none; line-height: 1.35; border-left: 2px solid transparent; margin-left: -2px; }
.toc li.toc-l3 a { padding-left: 22px; font-size: 0.8rem; }
.toc li a:hover { color: var(--ink); }
.toc li a.is-active { color: var(--ink); border-left-color: var(--accent); }
.toc code { font-size: 0.92em; background: none; padding: 0; color: inherit; }

/* ------------------------------------------------------------------ article */
.eyebrow { margin: 0 0 6px; font-family: var(--font-px); font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.doc h1 {
  margin: 0 0 10px; font-family: var(--font-px); font-weight: 700; font-size: clamp(2rem, 1.5rem + 2vw, 2.6rem);
  line-height: 1.1; letter-spacing: 0.01em; color: var(--ink);
}
.lead { font-size: 1.14rem; line-height: 1.6; color: var(--ink-2); margin: 10px 0 26px; }
.doc h2, .doc h3, .doc h4 { position: relative; color: var(--ink); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.doc h2 {
  margin: 2.6em 0 0.7em; padding-top: 0.75em; font-family: var(--font-px); font-weight: 600;
  font-size: 1.62rem; line-height: 1.2; letter-spacing: 0.01em; border-top: 2px dashed var(--line-2);
}
.doc h3 { margin: 2em 0 0.55em; font-size: 1.18rem; font-weight: 700; line-height: 1.3; }
.doc h4 { margin: 1.6em 0 0.5em; font-size: 1.02rem; font-weight: 700; }
.doc h2 code, .doc h3 code, .doc h4 code { font-size: 0.86em; }
.h-anchor {
  position: absolute; left: -1.05em; top: auto; width: 1em; text-align: center; color: var(--faint);
  text-decoration: none; opacity: 0; font-family: var(--font-mono); font-weight: 400;
}
.doc h2 .h-anchor { top: 0.75em; }
.doc h2:hover .h-anchor, .doc h3:hover .h-anchor, .doc h4:hover .h-anchor, .h-anchor:focus { opacity: 1; }
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin: 0 0 1em; }
.doc strong { color: var(--ink); font-weight: 650; }
.doc em { font-style: italic; }
.doc ul, .doc ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.doc li { margin: 0.28em 0; }
.doc li > ul, .doc li > ol { margin: 0.3em 0 0.4em; }
.doc li::marker { color: var(--faint); }
.doc ol > li::marker { font-family: var(--font-px); color: var(--accent); }
.doc :not(pre) > code, .doc td code, .doc dd code {
  font-size: 0.86em; padding: 0.1em 0.36em; border-radius: 3px;
  background: var(--code-inline-bg); color: var(--code-inline-ink); overflow-wrap: anywhere;
}
.doc a code { color: inherit; }
.doc td code:not(.long), .doc th code:not(.long) { white-space: nowrap; overflow-wrap: normal; }
.doc a.ref-link { text-decoration: none; }
.doc a.ref-link code { box-shadow: inset 0 -1px 0 var(--link); }
.doc a.ref-link:hover code { box-shadow: inset 0 -2px 0 var(--link-hover); }
.doc a.ext::after { content: "↗"; font-size: 0.8em; margin-left: 1px; }
kbd {
  font-size: 0.8em; padding: 0.05em 0.4em; border: 1px solid var(--line-2); border-bottom-width: 2px;
  background: var(--panel); color: var(--ink);
}
.doc hr { border: 0; border-top: 2px dashed var(--line-2); margin: 2em 0; }

/* tables */
.table-wrap { margin: 1.1em 0 1.4em; overflow-x: auto; border: 2px solid var(--line); background: var(--panel); }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.doc th, .doc td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 650; color: var(--ink); background: var(--panel-2); white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.doc td { color: var(--ink-2); }
.doc table.enum td:first-child { white-space: nowrap; }
.doc tr:target td { background: var(--target); }

/* callouts */
.callout {
  margin: 1.3em 0; padding: 12px 16px 2px; border: 2px solid var(--line); border-left-width: 5px;
  background: var(--panel);
}
.callout-title { margin: 0 0 6px !important; font-weight: 650; color: var(--ink) !important; line-height: 1.45; }
.callout-badge {
  display: inline-block; margin-right: 6px; padding: 1px 7px 2px; font-family: var(--font-px); font-size: 0.78rem;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; vertical-align: 1px;
  border: 2px solid currentColor;
}
.callout > :last-child { margin-bottom: 12px; }
.callout-note { border-color: var(--line); border-left-color: var(--note); background: var(--note-bg); }
.callout-note .callout-badge { color: var(--note); }
.callout-info { border-left-color: var(--note); }
.callout-info .callout-badge { color: var(--note); }
.callout-tip { border-left-color: var(--tip); background: var(--tip-bg); }
.callout-tip .callout-badge { color: var(--tip); }
.callout-warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout-warn .callout-badge { color: var(--warn); }
.callout-danger { border-left-color: var(--danger); background: var(--danger-bg); }
.callout-danger .callout-badge { color: var(--danger); }
.callout-soon { border-color: var(--soon-line); border-left-color: var(--soon); background: var(--soon-bg); border-style: dashed; border-left-style: solid; }
.callout-soon .callout-badge { color: var(--soon); }

.badge {
  display: inline-block; font-family: var(--font-px); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0 6px 1px; border: 2px solid currentColor; line-height: 1.5; white-space: nowrap;
}
.badge-soon { color: var(--soon); background: var(--soon-bg); }
.badge-inert { color: var(--muted); background: var(--panel-2); }
.ref-inert { border-left: 3px solid var(--line-2); padding-left: 8px; }
.page-badge { margin: 0 0 6px; }

/* code blocks: a dark pixel panel in both themes */
.code {
  margin: 1.2em 0 1.5em; background: #12100e; color: #e9e3d9; border: 2px solid #050403;
  box-shadow: inset 2px 2px 0 #3a342d, inset -2px -2px 0 #000;
}
.code-head {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 6px 4px 14px;
  border-bottom: 2px solid #050403; background: #1a1714;
}
.code-title { font-family: var(--font-px); font-size: 0.86rem; color: #ffd25a; overflow-wrap: anywhere; min-width: 0; }
.code-lang { margin-left: auto; font-family: var(--font-px); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: #8f877b; }
.copy-btn {
  flex: none; height: 26px; padding: 0 10px; font-family: var(--font-px); font-size: 0.8rem; cursor: pointer;
  color: #f1ece4; background: #3a332c; border: 2px solid #0a0806;
  box-shadow: inset 2px 2px 0 #7c7368, inset -2px -2px 0 #1a1612;
}
.copy-btn:hover { background: #4b433a; }
.copy-btn:active { box-shadow: inset -2px -2px 0 #7c7368, inset 2px 2px 0 #1a1612; }
.copy-btn.is-done { background: #1f6b46; }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font-size: 0.84rem; line-height: 1.62; tab-size: 2; scrollbar-width: thin; scrollbar-color: #3a332c transparent; }
.code pre code { font-size: inherit; background: none; padding: 0; color: inherit; white-space: pre; }
.t-com { color: #8a8174; }
.t-key { color: #7fd4ff; }
.t-str { color: #b4e486; }
.t-num { color: #d1b2ff; }
.t-bool { color: #ffa07a; }
.t-punc { color: #8f877b; }
.t-fn { color: #ffd25a; }
.t-attr { color: #ffbfa8; }
.t-tgt { color: #ff92a8; }
.t-trg { color: #5ff0ff; }
.t-cond { color: #ffb648; }
.t-ph { color: #4fe3a1; }
.t-sig { color: #ff7d9b; }
.t-var { color: #ffb648; }
.t-val { color: #e9e3d9; }

/* reference entries */
.refs { margin: 0.6em 0 1.6em; border-top: 2px solid var(--line); }
.ref { padding: 14px 0 12px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.ref:target { background: var(--target); box-shadow: -10px 0 0 var(--target), 10px 0 0 var(--target); }
.ref-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.ref-key { text-decoration: none; }
.doc .ref-key code { font-size: 0.95rem; font-weight: 700; background: none; padding: 0; color: var(--ink); overflow-wrap: anywhere; }
.ref-key:hover code { color: var(--link-hover); }
.voc-kind { font-family: var(--font-px); font-size: 0.76rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.ref-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.ref-m { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 8px; border: 1px solid var(--line-2); background: var(--panel); font-size: 0.82rem; line-height: 1.5; max-width: 100%; }
.ref-m dt { color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ref-m dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.doc .ref-m dd code { font-size: 0.92em; padding: 0 0.25em; }
.ref-desc > :last-child { margin-bottom: 0; }
.ref-desc p { margin: 0.3em 0 0.6em; }
.ref-note { font-size: 0.9rem; color: var(--muted) !important; }
.ref-desc .code { margin: 0.6em 0 0.4em; }
.voc-example { margin: 4px 0 2px; }
.voc-example code { display: inline-block; max-width: 100%; }
.sig-list { line-height: 2; }

/* diagrams (inline SVG, theme aware) */
.diagram { margin: 1.2em 0 1.5em; padding: 14px 14px 10px; border: 2px solid var(--line); background: var(--panel); }
.diagram svg { display: block; width: 100%; height: auto; max-width: 760px; margin: 0 auto; }
.diagram figcaption { margin-top: 8px; font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.d-melee { fill: var(--danger-bg); stroke: var(--danger); stroke-width: 2; }
.d-ranged { fill: var(--note-bg); stroke: var(--note); stroke-width: 2; }
.d-beyond { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 6 4; }
.d-band { fill: var(--tip-bg); stroke: var(--tip); stroke-width: 2; }
.d-label { font-family: var(--font-px); font-size: 16px; font-weight: 600; fill: var(--ink); letter-spacing: 0.04em; }
.d-small { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.d-axis, .d-tick { stroke: var(--ink-2); stroke-width: 2; }
.d-num { font-family: var(--font-mono); font-size: 15px; font-weight: 600; fill: var(--ink); }
.d-name { font-family: var(--font); font-size: 13px; fill: var(--muted); }

/* details */
.doc details { margin: 1em 0; border: 2px solid var(--line); background: var(--panel); }
.doc summary { cursor: pointer; padding: 10px 14px; font-weight: 650; color: var(--ink); }
.doc details > :not(summary) { margin-left: 14px; margin-right: 14px; }

/* cards on the overview */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 1.2em 0 1.6em; }
.card {
  display: block; padding: 14px 16px; text-decoration: none; color: var(--ink-2); background: var(--panel);
  border: 2px solid var(--line-2); box-shadow: inset 2px 2px 0 var(--bevel-l), inset -2px -2px 0 var(--bevel-d);
}
.card:hover { color: var(--ink-2); background: var(--panel-2); text-decoration: none; }
.card-title { display: block; font-family: var(--font-px); font-size: 1.05rem; color: var(--accent); margin-bottom: 4px; }
.card-text { display: block; font-size: 0.9rem; line-height: 1.5; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 1.2em 0 1.6em; border: 2px solid var(--line-2); background: var(--panel); }
.flow-step { padding: 12px 14px; border-right: 2px dashed var(--line); }
.flow-step:last-child { border-right: 0; }
.flow-n { display: block; font-family: var(--font-px); color: var(--accent); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }
.flow-t { display: block; font-weight: 650; color: var(--ink); margin: 2px 0 2px; }
.flow-d { display: block; font-size: 0.86rem; color: var(--muted); line-height: 1.45; }

/* pager and footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: var(--measure); margin: 56px auto 0; }
.pager a {
  display: block; padding: 12px 16px; text-decoration: none; color: var(--ink); background: var(--panel);
  border: 2px solid var(--line-2); box-shadow: inset 2px 2px 0 var(--bevel-l), inset -2px -2px 0 var(--bevel-d);
}
.pager a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.pager-next { text-align: right; grid-column: 2; }
.pager-dir { display: block; font-family: var(--font-px); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.pager-title { display: block; font-weight: 650; }
.footer { max-width: var(--measure); margin: 40px auto 0; padding-top: 18px; border-top: 2px dashed var(--line-2); font-size: 0.82rem; color: var(--muted); }
.footer p { margin: 0 0 6px; color: var(--muted); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .layout, body.no-toc .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
  .main { padding: 30px 36px 40px; }
}
@media (max-width: 900px) {
  .layout, body.no-toc .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 var(--gutter); gap: 8px; }
  .sidebar {
    position: fixed; z-index: 45; top: var(--topbar-h); left: 0; bottom: 0; height: auto;
    width: min(86vw, 320px); transform: translateX(-102%); visibility: hidden;
    transition: transform 0.18s ease-out, visibility 0s linear 0.18s; border-right: 2px solid var(--line-2);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
  }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.18s ease-out; }
  .scrim { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 44; background: rgba(0, 0, 0, 0.45); }
  body.nav-open .scrim { display: block; }
  .main { padding: 24px var(--gutter) 32px; }
  .h-anchor { display: none; }
}
@media (max-width: 640px) {
  .brand-tag, .version { display: none; }
  .search-key { display: none; }
  .search-results { position: fixed; left: 8px; right: 8px; top: calc(var(--topbar-h) + 4px); width: auto; }
  .doc h2 { font-size: 1.42rem; }
  .lead { font-size: 1.06rem; }
  .doc th, .doc td { padding: 7px 9px; }
  .doc table { min-width: 32rem; font-size: 0.88rem; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
  .code pre { font-size: 0.8rem; padding: 12px 12px 14px; }
}
@media (max-width: 400px) {
  .brand-name { display: none; }
  .topbar { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .sidebar, .toc, .pager, .scrim, .copy-btn { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
  .code { box-shadow: none; }
}
