/* Symvibe docs: layout, glass surfaces and components for every page under /docs.
   Source file, edit it here. The HTML pages next to it are generated by
   tools/build_docs.py; build-static publishes this folder as /docs.
   Palette and glass rim follow web.md section 6 and the home page. */

:root {
  --bg: #0A0908;
  --ink: #F1E9DD;
  --ink-soft: #CDC2B3;
  --muted: #8B7E72;
  --faint: #5E554C;
  --accent: #FF6B3D;
  --accent-soft: #FFB37A;
  --btn: #FF8038;
  --ok: #7B9F6A;
  --warn: #D4A964;
  --danger: #FF5C5C;
  --rule: rgba(241,233,221,0.07);
  --line: rgba(241,233,221,0.10);
  --glass: rgba(24,20,17,0.72);
  --glass-hi: rgba(30,25,21,0.78);
  --side-w: 284px;
  --toc-w: 216px;
  --gap: 14px;
  --spring: linear(0, 0.0027 0.9%, 0.0509 4.7%, 0.1912 9.4%, 0.4204 14.7%, 0.6741 20%, 0.8862 25.3%, 1.0087 30.1%, 1.0554 34.6%, 1.0632 38.7%, 1.0479 44.2%, 1.0157 52.1%, 0.9982 60.4%, 0.9942 70.1%, 1.0003 84.5%, 1);
  --spring-fast: linear(0, 0.1042 5.5%, 0.4633 13.9%, 0.8092 21.4%, 1.0056 28.1%, 1.0704 34%, 1.0629 41%, 1.0209 50.4%, 0.9977 61.3%, 0.9993 79.6%, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { overflow-x: clip; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font-family: 'Geist', system-ui, sans-serif; font-size: 15px; letter-spacing: -0.011em;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; }
img, video { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; border-radius: 6px; }

/* Stage: the near-black backdrop with the brand's faint warm pools, and the
   dot grid of the board fading out below the top of the page. Static, fixed. */
.stage { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.stage::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(52% 38% at 22% -4%, rgba(255,146,62,0.13), transparent 70%),
    radial-gradient(40% 34% at 96% 8%, rgba(235,70,50,0.08), transparent 72%),
    radial-gradient(46% 30% at 58% 108%, rgba(255,214,150,0.045), transparent 70%);
}
.stage::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(241,233,221,0.11) 1px, transparent 1.5px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(75% 55% at 50% 0%, #000 0%, rgba(0,0,0,0.35) 45%, transparent 78%);
          mask-image: radial-gradient(75% 55% at 50% 0%, #000 0%, rgba(0,0,0,0.35) 45%, transparent 78%);
}

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px;
  background: var(--btn); color: #fff; text-decoration: none; font-weight: 550; }
.skip:focus { top: 12px; }

/* Glass: one conic rim, white and brightest at the top, with a single short
   warm-to-cool glint low on the right (never a full rainbow edge), plus a soft
   sheen on the upper face. --tilt turns the rim; docs.js sets it per panel. */
.g {
  position: relative; isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
          backdrop-filter: blur(22px) saturate(135%);
  border-radius: var(--r, 16px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 24px 60px -32px rgba(0,0,0,0.9);
}
.g::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--tilt, 0deg) at 50% 50%,
    rgba(255,255,255,0.50) 0deg, rgba(255,255,255,0.18) 34deg, rgba(255,255,255,0.05) 86deg,
    rgba(255,196,150,0.36) 120deg, rgba(206,216,240,0.30) 138deg, rgba(255,255,255,0.04) 152deg,
    rgba(255,255,255,0.04) 262deg, rgba(255,255,255,0.18) 326deg, rgba(255,255,255,0.50) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; z-index: 3;
}
.g::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background:
    radial-gradient(240px circle at var(--mx, 50%) var(--my, -40%), rgba(255,214,170,var(--glow, 0)), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0) 42%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .g { background: rgba(20,17,14,0.96); }
}
/* Registered so the pointer light fades in and out instead of switching. */
@property --glow { syntax: '<number>'; inherits: true; initial-value: 0; }

/* ───────── Sidebar ───────── */
.side {
  --r: 20px;
  position: fixed; z-index: 40; top: var(--gap); bottom: var(--gap); left: var(--gap);
  width: var(--side-w);
  display: flex; flex-direction: column;
  background: rgba(20,17,14,0.80);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 16px 10px 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.brand-name { font-weight: 600; font-size: 15.5px; letter-spacing: -0.02em; }
.brand-sub { font-size: 13px; color: var(--muted); padding-left: 9px; margin-left: 1px; border-left: 1px solid var(--line); line-height: 1; }
.icon-btn.side-close { display: none; }

.search-btn {
  margin: 4px 14px 10px; height: 40px; padding: 0 8px 0 12px;
  display: flex; align-items: center; gap: 9px; width: calc(100% - 28px);
  border-radius: 11px; border: 1px solid var(--line);
  background: rgba(241,233,221,0.035); color: var(--muted);
  font: inherit; font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color .3s var(--spring-fast), background .3s var(--spring-fast), color .3s var(--spring-fast);
}
.search-btn:hover { border-color: rgba(241,233,221,0.18); background: rgba(241,233,221,0.06); color: var(--ink-soft); }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn .label { flex: 1; }
.search-btn .keys { display: inline-flex; gap: 3px; }

.side-nav { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 10px 18px;
  scrollbar-width: thin; scrollbar-color: rgba(241,233,221,0.12) transparent;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 8px, #000 calc(100% - 18px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 8px, #000 calc(100% - 18px), transparent 100%); }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(241,233,221,0.12); border-radius: 3px; }
.side-group { margin-top: 18px; }
.side-label { margin: 0 0 6px; padding: 0 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: -0.005em; }
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-link {
  position: relative; display: block; padding: 6.5px 10px 6.5px 22px; border-radius: 9px;
  color: rgba(205,194,179,0.86); text-decoration: none; font-size: 14px; line-height: 1.35;
  transition: background .25s var(--spring-fast), color .25s var(--spring-fast);
}
.side-link::before {
  content: ''; position: absolute; left: 10px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%;
  background: rgba(241,233,221,0.16); transition: background .3s var(--spring-fast), box-shadow .3s var(--spring-fast), transform .4s var(--spring);
}
.side-link:hover { background: rgba(241,233,221,0.045); color: var(--ink); }
.side-link[aria-current="page"] {
  color: var(--ink); background: linear-gradient(90deg, rgba(255,107,61,0.13), rgba(255,107,61,0.03));
  box-shadow: inset 0 0 0 1px rgba(255,107,61,0.20);
}
.side-link[aria-current="page"]::before { background: var(--accent); box-shadow: 0 0 10px 1px rgba(255,107,61,0.65); transform: scale(1.2); }
.side-top { margin-top: 2px; }

.side-foot { display: flex; gap: 8px; padding: 12px 14px 14px; border-top: 1px solid var(--rule); }
.btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 12px;
  border-radius: 10px; text-decoration: none; font-size: 13.5px; font-weight: 550; white-space: nowrap;
  transition: filter .25s var(--spring-fast), background .25s var(--spring-fast), border-color .25s var(--spring-fast);
}
.btn-solid { background: var(--btn); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14), 0 2px 8px -2px rgba(0,0,0,0.55); }
.btn-solid:hover { filter: brightness(1.07); }
.btn-quiet { color: var(--ink); background: rgba(241,233,221,0.05); box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:hover { background: rgba(241,233,221,0.09); }

/* ───────── Top bar (narrow screens) ───────── */
.topbar { display: none; }
.icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 0; border-radius: 10px; background: rgba(241,233,221,0.05); color: var(--ink); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.icon-btn:hover { background: rgba(241,233,221,0.09); }
.icon-btn svg { width: 18px; height: 18px; }
.scrim { display: none; }

/* ───────── Main column ───────── */
.main {
  margin-left: calc(var(--side-w) + var(--gap) * 2);
  padding: 34px 40px 0;
  display: grid; grid-template-columns: minmax(0, 760px) var(--toc-w); gap: 64px; justify-content: center;
}
.doc { min-width: 0; padding-top: 22px; }

.crumbs { margin: 0 0 22px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .2s; }
.crumbs a:hover { color: var(--ink); }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--faint); }
.crumbs li[aria-current] { color: var(--ink-soft); }

.doc h1 { margin: 0; font-size: clamp(34px, 3.6vw, 46px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.06; text-wrap: balance; }
.doc h1 em, .hero h1 em, .doc h2 em {
  font-family: 'Fraunces', 'Times New Roman', serif; font-style: normal; font-weight: 450;
  font-size: 1.02em; letter-spacing: -0.025em;
}
.lead { margin: 18px 0 0; max-width: 64ch; color: var(--ink-soft); font-size: 18px; line-height: 1.6; text-wrap: pretty; }
.meta { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta span + span::before { content: '·'; margin-right: 14px; color: var(--faint); }

/* On this page, inline (narrow screens) */
.toc-inline { display: none; margin: 26px 0 0; --r: 14px; }
.toc-inline summary { cursor: pointer; list-style: none; padding: 13px 16px; font-size: 14px; font-weight: 550; display: flex; justify-content: space-between; align-items: center; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: '+'; color: var(--muted); font-size: 18px; line-height: 1; }
.toc-inline[open] summary::after { content: '\2013'; }
.toc-inline ul { list-style: none; margin: 0; padding: 0 16px 14px; }
.toc-inline li { margin: 0; }
.toc-inline a { display: block; padding: 5px 0; color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.toc-inline .sub a { padding-left: 14px; color: var(--muted); }

/* ───────── Prose ───────── */
.prose { margin-top: 10px; }
.prose > section { padding-top: 40px; }
.prose h2 {
  position: relative; margin: 0; padding-top: 26px;
  font-size: clamp(23px, 2.2vw, 28px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; text-wrap: balance;
}
.prose h2::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(241,233,221,0.14), rgba(241,233,221,0.04) 60%, transparent); }
.prose h3 { position: relative; margin: 30px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.anchor { margin-left: 10px; color: var(--faint); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .2s, color .2s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--accent); }
.prose p, .prose li { color: var(--ink-soft); font-size: 16px; line-height: 1.72; }
.prose p { margin: 14px 0 0; max-width: 68ch; text-wrap: pretty; }
.prose ul, .prose ol { margin: 14px 0 0; padding-left: 22px; max-width: 68ch; }
.prose li { margin: 7px 0; padding-left: 2px; }
.prose li::marker { color: var(--accent); }
.prose ol > li::marker { font-variant-numeric: tabular-nums; font-weight: 500; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a:not(.card):not(.btn):not(.anchor) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(255,107,61,0.45); transition: text-decoration-color .2s; }
.prose a:not(.card):not(.btn):not(.anchor):hover { text-decoration-color: var(--accent); }
.ui { color: var(--ink); font-weight: 550; }
.ui .sep { margin: 0 0.32em; color: var(--muted); font-weight: 400; }
code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.86em; color: var(--ink);
  background: rgba(241,233,221,0.065); padding: 2px 6px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(241,233,221,0.06); word-break: break-word;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; font-weight: 500; line-height: 1; color: var(--ink);
  border-radius: 6px; vertical-align: 0.08em;
  background: linear-gradient(180deg, rgba(241,233,221,0.11), rgba(241,233,221,0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), inset 0 -1px 0 rgba(0,0,0,0.45), 0 0 0 1px rgba(241,233,221,0.09), 0 2px 4px -2px rgba(0,0,0,0.6);
}
kbd + kbd { margin-left: 3px; }

.code { position: relative; margin: 18px 0 0; max-width: 68ch; --r: 13px; background: rgba(10,9,8,0.72); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.code pre code { background: none; box-shadow: none; padding: 0; font-size: 13px; line-height: 1.7; color: var(--ink-soft); word-break: normal; }
.code pre code b { color: var(--ink); font-weight: 500; }
.code pre code i { font-style: normal; color: var(--muted); }
.copy {
  position: absolute; top: 9px; right: 9px; z-index: 4; height: 28px; padding: 0 10px; border: 0; border-radius: 8px;
  font: inherit; font-size: 12.5px; color: var(--ink-soft); background: rgba(241,233,221,0.07); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line); opacity: 0; transition: opacity .2s, background .2s;
}
.code:hover .copy, .copy:focus-visible, .copy.done { opacity: 1; }
.copy:hover { background: rgba(241,233,221,0.12); }
@media (hover: none) { .copy { opacity: 1; } .search-btn .keys, .hero-search .keys { display: none; } }

/* Callouts: a glass panel with a lit left edge. No icons, the title says it. */
.callout { margin: 22px 0 0; max-width: 68ch; padding: 16px 20px 17px 22px; --r: 14px; --edge: var(--accent); }
.callout::before {
  background:
    linear-gradient(180deg, var(--edge), color-mix(in srgb, var(--edge) 10%, transparent)) left 0 top 14px / 2px calc(100% - 28px) no-repeat,
    linear-gradient(90deg, color-mix(in srgb, var(--edge) 9%, transparent), transparent 60%);
}
.callout.tip { --edge: var(--ok); }
.callout.warn { --edge: var(--warn); }
.callout.danger { --edge: var(--danger); }
.callout.note { --edge: var(--accent-soft); }
.callout-t { display: block; margin: 0 0 4px; color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -0.015em; }
.callout p { margin: 6px 0 0; font-size: 15px; line-height: 1.65; }
.callout p:first-of-type { margin-top: 0; }
.callout ul { margin-top: 8px; }
.callout li { font-size: 15px; }

/* Steps: numbered nodes strung on one wire, the way the orchestrator wires its groups. */
.steps { list-style: none; counter-reset: step; margin: 24px 0 0; padding: 0; max-width: 68ch; position: relative; }
.steps > li { position: relative; counter-increment: step; margin: 0; padding: 0 0 26px 52px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; z-index: 1;
  font-size: 14px; font-weight: 500; color: var(--accent-soft); font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgba(48,38,31,0.95), rgba(26,22,18,0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 0 0 1px rgba(255,107,61,0.30), 0 6px 16px -8px rgba(255,107,61,0.55);
}
.steps > li::after {
  content: ''; position: absolute; left: 15.5px; top: 32px; bottom: 2px; width: 1.5px; border-radius: 1px;
  background: linear-gradient(180deg, rgba(255,107,61,0.55), rgba(255,107,61,0.08));
}
.steps > li:last-child { padding-bottom: 4px; }
.steps > li:last-child::after { display: none; }
.step-t { display: block; color: var(--ink); font-weight: 600; font-size: 16.5px; letter-spacing: -0.02em; line-height: 1.5; }
.steps p { margin: 6px 0 0; }
.steps .code, .steps .callout, .steps .shot { margin-top: 12px; }

/* Tables */
.tbl { margin: 20px 0 0; --r: 14px; overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--rule); line-height: 1.55; color: var(--ink-soft); }
.tbl th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: rgba(241,233,221,0.025); letter-spacing: -0.005em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--ink); font-weight: 500; }
.tbl td.keys, .tbl td .keys { white-space: nowrap; }
.tbl code { word-break: normal; overflow-wrap: normal; }
.keys { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; vertical-align: 0.08em; }
.keys kbd + kbd { margin-left: 0; }
.tbl.compact td, .tbl.compact th { padding: 10px 14px; }
.tbl .logo { display: inline-flex; align-items: center; gap: 10px; }
.tbl .logo img { width: 20px; height: 20px; object-fit: contain; border-radius: 5px; flex: none; }

/* Definition list: term on the left, meaning on the right */
.defs { margin: 20px 0 0; max-width: 68ch; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule); }
.defs dt, .defs dd { margin: 0; padding: 13px 0; }
.defs dt { color: var(--ink); font-weight: 600; font-size: 15px; padding-bottom: 0; }
.defs dd { color: var(--ink-soft); font-size: 15.5px; line-height: 1.65; border-bottom: 1px solid var(--rule); padding-top: 4px; }
@media (min-width: 720px) {
  .defs { grid-template-columns: 190px 1fr; }
  .defs dt { padding: 13px 20px 13px 0; border-bottom: 1px solid var(--rule); }
  .defs dd { padding-top: 13px; }
}

/* Real recordings of the app in a glass frame */
.shot { margin: 26px 0 0; --r: 16px; padding: 6px; }
.shot .frame { position: relative; overflow: hidden; border-radius: 11px; background: #000; aspect-ratio: 16 / 9; }
.shot video, .shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot video { transform: scale(var(--zoom, 1)); transform-origin: var(--focus, 50% 50%); }
.shot figcaption { padding: 10px 8px 4px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.shot figcaption b { color: var(--ink-soft); font-weight: 550; }
.play {
  position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 34px; height: 34px; border: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
  background: rgba(14,12,10,0.66); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(241,233,221,0.14); opacity: 0.0; transition: opacity .25s;
}
.play svg { width: 14px; height: 14px; }
.play .i-play { display: none; }
.play[data-state="paused"] .i-play { display: block; }
.play[data-state="paused"] .i-pause { display: none; }
.shot:hover .play, .play:focus-visible, .play[data-state="paused"] { opacity: 1; }
@media (hover: none) { .play { opacity: 1; } }

/* Cards */
.cards { margin: 22px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  --r: 15px; display: flex; flex-direction: column; gap: 6px; padding: 17px 18px 18px; text-decoration: none; color: var(--ink);
  transition: transform .45s var(--spring), background .3s var(--spring-fast), --glow .4s var(--spring-fast);
}
.topic, .pagenav a, .hero-search { transition: transform .45s var(--spring), background .3s var(--spring-fast), --glow .4s var(--spring-fast); }
.card:hover { transform: translateY(-2px); background: var(--glass-hi); }
.card b { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; }
.card span { font-size: 14px; line-height: 1.5; color: var(--muted); }
.card .go { margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--accent-soft); }

/* Previous / next */
.pagenav { margin: 64px 0 0; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.pagenav a { --r: 15px; display: block; padding: 15px 18px; text-decoration: none; }
.pagenav a:hover { transform: translateY(-2px); background: var(--glass-hi); }
.pagenav small { display: block; font-size: 12.5px; color: var(--muted); }
.pagenav b { display: block; margin-top: 3px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.pagenav .next { text-align: right; grid-column: 2; }

.doc-foot { margin: 40px 0 0; padding: 18px 0 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); line-height: 1.6; }
.doc-foot a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(241,233,221,0.25); }

/* ───────── On this page ───────── */
.toc { position: sticky; top: 30px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 22px 0 20px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc-t { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.toc-list { position: relative; }
.toc-list::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 1px; background: var(--line); }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.4; transition: color .25s var(--spring-fast); }
.toc .sub a { padding-left: 12px; font-size: 13px; }
.toc a:hover { color: var(--ink-soft); }
.toc a.on { color: var(--ink); }
.toc-bar { position: absolute; left: -0.5px; top: 0; width: 2px; height: 0; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 10px rgba(255,107,61,0.7); opacity: 0;
  transition: transform .5s var(--spring), height .5s var(--spring), opacity .3s; }
.toc-help { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 13px; line-height: 1.55; color: var(--muted); }
.toc-help a { color: var(--ink-soft); }

/* ───────── Footer ───────── */
.site-foot { margin-left: calc(var(--side-w) + var(--gap) * 2); padding: 70px 40px 36px; }
.site-foot .in { max-width: calc(760px + 64px + var(--toc-w)); margin: 0 auto; border-top: 1px solid var(--rule); padding-top: 24px; }
.foot-row { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-marks { margin: 16px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--faint); max-width: 80ch; }

/* ───────── Docs home ───────── */
.home .main { grid-template-columns: minmax(0, 1040px); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; padding: 30px 0 6px; }
@media (min-width: 1240px) { .hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 48px; } }
.hero h1 { margin: 0; font-size: clamp(38px, 4.4vw, 58px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance; }
.hero .lead { font-size: 18.5px; }
.hero-search {
  --r: 14px; margin-top: 28px; width: 100%; max-width: 480px; height: 52px; padding: 0 10px 0 16px;
  display: flex; align-items: center; gap: 11px; border: 0; font: inherit; font-size: 15.5px; color: var(--muted); cursor: pointer; text-align: left;
}
.hero-search:hover { color: var(--ink-soft); }
.hero-search svg { width: 18px; height: 18px; flex: none; }
.hero-search .label { flex: 1; }
.hero-art { position: relative; perspective: 1400px; }
.hero-art::before { content: ''; position: absolute; inset: 8% 4% -6% 10%; z-index: -1; border-radius: 40%;
  background: radial-gradient(closest-side, rgba(255,107,61,0.22), rgba(235,70,50,0.08) 55%, transparent); filter: blur(30px); }
.hero-art .shot { margin: 0; transition: transform .9s var(--spring); }
@media (min-width: 1240px) {
  .hero-art .shot { transform: rotateY(-9deg) rotateX(3deg); transform-origin: 30% 50%; }
  .hero-art:hover .shot { transform: rotateY(-4deg) rotateX(1deg); }
}
.home-sec { margin-top: 64px; }
.home-sec > h2 { margin: 0; font-size: clamp(23px, 2.2vw, 28px); font-weight: 600; letter-spacing: -0.03em; }
.home-sec > p { margin: 8px 0 0; color: var(--muted); font-size: 15.5px; }
.start-cards { margin-top: 20px; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.start-cards .card { padding: 20px 20px 18px; min-height: 150px; }
.start-cards .card b { font-size: 17px; }
.topics { margin-top: 20px; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topic { --r: 18px; display: grid; grid-template-rows: auto 1fr; overflow: hidden; }
.topic .pic { position: relative; display: block; aspect-ratio: 16 / 7; overflow: hidden; border-radius: 17px 17px 0 0; }
.topic .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(var(--zoom, 1.06)); transform-origin: var(--focus, 50% 50%);
  transition: transform 1.2s var(--spring); filter: saturate(0.92); }
.topic .pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,9,8,0) 40%, rgba(16,13,11,0.92)); }
.topic:hover .pic img { transform: scale(calc(var(--zoom, 1.06) + 0.04)); }
.topic .body { position: relative; z-index: 4; padding: 0 20px 18px; margin-top: -26px; }
.topic h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.025em; }
.topic h3 a { text-decoration: none; }
.topic p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.topic ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.topic li a { display: inline-block; padding: 5px 10px; border-radius: 8px; font-size: 13.5px; text-decoration: none; color: var(--ink-soft);
  background: rgba(241,233,221,0.05); box-shadow: inset 0 0 0 1px var(--rule); transition: background .2s, color .2s; }
.topic li a:hover { background: rgba(255,107,61,0.12); color: var(--ink); }
.ref-row { margin-top: 20px; display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ───────── Search ───────── */
.search {
  --r: 18px; width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 120px)); margin: 12vh auto auto; padding: 0;
  border: 0; color: var(--ink); background: rgba(22,19,16,0.90); overflow: hidden;
}
.search[open] { display: flex; flex-direction: column; animation: pop .45s var(--spring); }
.search::backdrop { background: rgba(6,5,4,0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.search-field { position: relative; z-index: 4; display: flex; align-items: center; gap: 11px; padding: 0 14px 0 18px; height: 58px; border-bottom: 1px solid var(--rule); flex: none; }
.search-field svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 16.5px; letter-spacing: -0.015em; }
.search-field input::placeholder { color: var(--faint); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-esc { border: 0; background: none; padding: 0; cursor: pointer; }
.search-list { position: relative; z-index: 4; flex: 1; overflow-y: auto; padding: 8px; margin: 0; list-style: none; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(241,233,221,0.12) transparent; }
.search-list li { margin: 0; }
.search-list a { display: block; padding: 10px 12px; border-radius: 11px; text-decoration: none; color: var(--ink-soft); }
.search-list a[aria-selected="true"] { background: rgba(255,107,61,0.12); box-shadow: inset 0 0 0 1px rgba(255,107,61,0.24); }
.search-list .r-t { display: block; font-size: 14.5px; font-weight: 550; color: var(--ink); }
.search-list .r-s { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.search-list .r-x { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-list mark { background: none; color: var(--accent-soft); font-weight: 600; }
.search-group { padding: 10px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.search-empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14.5px; }
.search-foot { position: relative; z-index: 4; display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); flex: none; }
.search-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ───────── Responsive ───────── */
@media (max-width: 1279px) {
  .main { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
  .toc-inline { display: block; }
  .ref-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  :root { --gap: 10px; }
  .topbar {
    --r: 16px; position: sticky; top: 10px; z-index: 30; margin: 10px 10px 0; height: 56px; padding: 0 9px;
    display: flex; align-items: center; gap: 10px; background: rgba(20,17,14,0.82);
  }
  .topbar .brand { flex: 1; justify-content: center; }
  .side {
    top: 10px; bottom: 10px; left: 10px; width: min(320px, calc(100vw - 48px));
    transform: translateX(calc(-100% - 24px)); visibility: hidden;
    transition: transform .55s var(--spring), visibility 0s linear .55s;
    background: rgba(20,17,14,0.96); z-index: 60;
  }
  .nav-open .side { transform: none; visibility: visible; transition: transform .55s var(--spring), visibility 0s; }
  .icon-btn.side-close { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(6,5,4,0.55); opacity: 0; pointer-events: none; transition: opacity .35s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-open body, html.nav-open { overflow: hidden; }
  .main, .site-foot { margin-left: 0; }
  .main { padding: 8px 22px 0; }
  .site-foot { padding: 60px 22px 30px; }
  .start-cards { grid-template-columns: minmax(0, 1fr); }
  .start-cards .card { min-height: 0; }
  .topics { grid-template-columns: minmax(0, 1fr); }
  .hero-art .shot { transform: none; }
}
@media (max-width: 560px) {
  .main { padding: 4px 16px 0; }
  .site-foot { padding: 50px 16px 28px; }
  .doc { padding-top: 14px; }
  .lead { font-size: 17px; }
  .prose p, .prose li { font-size: 15.5px; }
  .pagenav { grid-template-columns: 1fr; }
  .pagenav .next { grid-column: 1; }
  .steps > li { padding-left: 46px; }
  .ref-row { grid-template-columns: minmax(0, 1fr); }
  .search { margin-top: 8vh; }
  .search-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .hero-art .shot { transform: none; }
}
