/* NatureGL docs theme.
   Twilight-navy base (the sky just after sunset, the colour every product in
   the series renders in), one product accent per site (--accent / --accent-ink),
   Schibsted Grotesk for text and JetBrains Mono for code. */

/* ---------------------------------------------------------------- tokens */
:root {
  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #f7f8fb;
  --bg-2: #f0f3f8;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --line: #dde3ec;
  --line-2: #c9d2df;
  --text: #131a29;
  --text-2: #3b475d;
  --muted: #5f6c85;
  --code-bg: #f4f6fa;
  --code-line: #e3e8f0;
  --hl-bg: color-mix(in oklab, var(--accent-ink) 10%, transparent);
  --link: var(--accent-ink);
  --tint: color-mix(in oklab, var(--accent-ink) 9%, var(--surface));
  --ring: color-mix(in oklab, var(--accent-ink) 55%, transparent);
  --shadow: 0 1px 2px rgb(19 26 41 / .06), 0 8px 24px -12px rgb(19 26 41 / .18);
  --c-note: #3d6fb6; --c-tip: #1f8a52; --c-warning: #a86400; --c-danger: #c23a3a; --c-perf: var(--accent-ink); --c-new: var(--accent-ink);

  --hdr-h: 60px;
  --side-w: 272px;
  --toc-w: 232px;
  --measure: 72ch;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

/* dark tokens: same block twice (explicit toggle + OS preference) */
:root[data-theme="dark"] {
  --bg: #0d1422; --bg-2: #0f1727; --surface: #141e31; --surface-2: #1a263d; --line: #243149; --line-2: #33425f;
  --text: #e7ecf5; --text-2: #b7c1d4; --muted: #8391ab; --code-bg: #111a2b; --code-line: #1f2b42;
  --hl-bg: color-mix(in oklab, var(--accent) 12%, transparent); --link: var(--accent);
  --tint: color-mix(in oklab, var(--accent) 9%, var(--surface)); --ring: color-mix(in oklab, var(--accent) 60%, transparent);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
  --c-note: #8ab4f0; --c-tip: #6fd69c; --c-warning: #f2b45a; --c-danger: #ff8a8a; --c-perf: var(--accent); --c-new: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1422; --bg-2: #0f1727; --surface: #141e31; --surface-2: #1a263d; --line: #243149; --line-2: #33425f;
    --text: #e7ecf5; --text-2: #b7c1d4; --muted: #8391ab; --code-bg: #111a2b; --code-line: #1f2b42;
    --hl-bg: color-mix(in oklab, var(--accent) 12%, transparent); --link: var(--accent);
    --tint: color-mix(in oklab, var(--accent) 9%, var(--surface)); --ring: color-mix(in oklab, var(--accent) 60%, transparent);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 32px -16px rgb(0 0 0 / .6);
    --c-note: #8ab4f0; --c-tip: #6fd69c; --c-warning: #f2b45a; --c-danger: #ff8a8a; --c-perf: var(--accent); --c-new: var(--accent);
  }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + 20px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16.5px/1.65 var(--font); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
code, kbd, pre { font-family: var(--mono); font-feature-settings: 'calt' 0; }
::selection { background: color-mix(in oklab, var(--accent) 35%, transparent); }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--surface); border-radius: var(--r-s); }
.skip:focus { top: 12px; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 28px; height: 28px; }
.ico-inline { width: 1.1em; height: 1.1em; vertical-align: -0.18em; }

/* ---------------------------------------------------------------- header */
.hdr {
  position: sticky; top: 0; z-index: 40; height: var(--hdr-h);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.home .hdr { position: fixed; inset: 0 0 auto; background: linear-gradient(to bottom, rgb(6 10 18 / .55), transparent); border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #eef2f9; transition: background .25s, border-color .25s; }
.home .hdr.scrolled { background: color-mix(in oklab, var(--bg) 84%, transparent); border-color: var(--line); color: var(--text); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.hdr-in { height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 20px; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #0d1422; background: var(--accent); flex: none; }
.brand-mark .ico { width: 20px; height: 20px; stroke-width: 1.8; }
.brand-name { font-size: 17px; }
.brand-ver { font: 500 11.5px/1 var(--mono); color: var(--muted); padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; }
.home .hdr:not(.scrolled) .brand-ver { color: rgb(238 242 249 / .75); border-color: rgb(238 242 249 / .25); }
.hdr-space { flex: 1; }
.hdr-nav { display: flex; gap: 2px; }
.hdr-link { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14.5px; font-weight: 500; opacity: .86; }
.hdr-link:hover { opacity: 1; background: color-mix(in oklab, currentColor 8%, transparent); }
.hdr-link.on { opacity: 1; }
.hdr-link .ico { width: 18px; height: 18px; }
.theme-btn, .nav-toggle { display: grid; place-items: center; width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; }
.theme-btn:hover, .nav-toggle:hover { background: color-mix(in oklab, currentColor 8%, transparent); }
.theme-btn .ico-dark { display: none; }
:root[data-theme="dark"] .theme-btn .ico-dark { display: block; } :root[data-theme="dark"] .theme-btn .ico-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .ico-dark { display: block; } :root:not([data-theme="light"]) .theme-btn .ico-light { display: none; } }
.nav-toggle { display: none; }

.search-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 11px; min-width: 200px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in oklab, var(--surface) 70%, transparent); color: var(--muted); font-size: 14px; }
.home .hdr:not(.scrolled) .search-btn { color: rgb(238 242 249 / .8); border-color: rgb(238 242 249 / .22); background: rgb(10 16 28 / .35); }
.search-btn:hover { border-color: var(--line-2); color: var(--text); }
.search-btn span { flex: 1; text-align: left; }
.search-btn .ico { width: 17px; height: 17px; }
.search-btn kbd, .search-close kbd { font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: none; box-shadow: none; color: inherit; }

.switcher { position: relative; margin-left: 6px; }
.switcher-btn { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: none; font-size: 14px; font-weight: 500; }
.home .hdr:not(.scrolled) .switcher-btn { border-color: rgb(238 242 249 / .22); }
.switcher-btn .ico { width: 17px; height: 17px; }
.switcher-btn:hover { border-color: var(--line-2); }
.switcher-menu { position: absolute; top: calc(100% + 8px); left: 0; width: min(440px, calc(100vw - 32px)); padding: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.switcher-menu[hidden] { display: none; }
.switcher-menu a { display: flex; gap: 10px; align-items: flex-start; padding: 9px; border-radius: 9px; color: inherit; text-decoration: none; }
.switcher-menu a:hover, .switcher-menu a.current { background: var(--surface-2); }
.switcher-menu strong { display: block; font-size: 14px; }
.switcher-menu a span span { display: block; font-size: 12.5px; line-height: 1.35; color: var(--muted); margin-top: 1px; }
.sw-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--p-ink); background: color-mix(in oklab, var(--p-ink) 12%, transparent); }
:root[data-theme="dark"] .sw-icon { color: var(--p); background: color-mix(in oklab, var(--p) 14%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sw-icon { color: var(--p); background: color-mix(in oklab, var(--p) 14%, transparent); } }
.sw-icon .ico { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); max-width: 1600px; margin: 0 auto; }
.side { border-right: 1px solid var(--line); }
.side-in { position: sticky; top: var(--hdr-h); max-height: calc(100vh - var(--hdr-h)); overflow-y: auto; padding: 26px 14px 40px 20px; scrollbar-width: thin; }
.side-group + .side-group { margin-top: 22px; }
.side-title { margin: 0 0 6px 10px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 15px; line-height: 1.35; }
.side a .ico { width: 18px; height: 18px; color: var(--muted); }
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a[aria-current="page"] { background: var(--tint); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--link); }
.side a[aria-current="page"] .ico { color: var(--link); }
.side .badge { margin-left: auto; }

.main { min-width: 0; padding: 40px clamp(20px, 4vw, 64px) 64px; }
.toc-in { position: sticky; top: var(--hdr-h); padding: 32px 20px 40px 8px; max-height: calc(100vh - var(--hdr-h)); overflow-y: auto; scrollbar-width: thin; }
.toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 13.5px; line-height: 1.4; }
.toc li.d3 a { padding-left: 26px; font-size: 13px; }
.toc li a code { font-size: 12px; background: none; padding: 0; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--link); border-left-color: var(--link); }

/* ---------------------------------------------------------------- prose */
.prose { max-width: var(--measure); margin: 0 auto; }
.prose.prose-home { max-width: 1120px; }
.page-head { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--link); font-size: 14px; font-weight: 600; }
.crumb .ico { width: 18px; height: 18px; }
.page-head .lead { margin-top: 18px; }
.prose h1 { font-size: clamp(2.1rem, 1.6rem + 1.6vw, 2.75rem); line-height: 1.08; letter-spacing: -.028em; font-weight: 750; margin: 0; text-wrap: balance; }
.lead { font-size: 1.2rem; line-height: 1.55; color: var(--text-2); margin: 14px 0 0; text-wrap: pretty; }
.prose h2 { font-size: 1.62rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 2.6em 0 .7em; text-wrap: balance; }
.prose h3 { font-size: 1.2rem; line-height: 1.3; letter-spacing: -.01em; font-weight: 650; margin: 2em 0 .5em; }
.prose h4 { font-size: 1rem; font-weight: 650; margin: 1.6em 0 .4em; }
.prose h2, .prose h3, .prose h4 { position: relative; }
.prose h2 code, .prose h3 code { font-size: .86em; }
.anchor { position: absolute; left: -1em; width: 1em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
:is(h2, h3, h4, .api-sig):hover > .anchor, .anchor:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; text-wrap: pretty; }
.prose li { margin: .28em 0; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 650; }
.prose hr, .rule { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
.prose blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--line-2); color: var(--text-2); }
.prose :not(pre) > code { font-size: .86em; padding: .12em .38em; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.prose a code { color: inherit; }
.ext { font-size: .8em; margin-left: 2px; opacity: .7; }
.prose > :first-child { margin-top: 0; }

kbd { display: inline-block; min-width: 1.7em; padding: .08em .45em; font-size: .8em; font-weight: 500; line-height: 1.5; text-align: center; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; }
.kbd-plus { margin: 0 .2em; color: var(--muted); }
.badge { display: inline-block; padding: .1em .5em; font: 600 11.5px/1.5 var(--mono); border-radius: 5px; color: var(--link); background: var(--tint); border: 1px solid color-mix(in oklab, var(--link) 30%, transparent); vertical-align: .1em; white-space: nowrap; }
.badge-warn { color: var(--c-warning); background: color-mix(in oklab, var(--c-warning) 10%, transparent); border-color: color-mix(in oklab, var(--c-warning) 30%, transparent); }
.badge-muted { color: var(--muted); background: var(--surface-2); border-color: var(--line); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0 1.6em; border: 1px solid var(--line); border-radius: var(--r-m); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); background: var(--bg-2); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose td { padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose tr:first-child td { border-top: 0; }
.prose td:first-child code { white-space: nowrap; }
.prose td:first-child code { color: var(--text); }

/* ---------------------------------------------------------------- code */
.code { margin: 1.3em 0 1.6em; border: 1px solid var(--code-line); border-radius: var(--r-m); background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--code-line); font-size: 12.5px; color: var(--muted); }
.code-title { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.code-lang { font-family: var(--mono); font-size: 11.5px; }
.copy { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: none; font-size: 12.5px; color: var(--muted); }
.copy:hover { color: var(--text); border-color: var(--line); background: var(--surface); }
.copy.done { color: var(--c-tip); }
.code pre { margin: 0; padding: 14px 0; overflow-x: auto; font-size: 13.6px; line-height: 1.65; tab-size: 2; background: none !important; }
.code pre code { display: block; min-width: max-content; }
.code .line { display: inline-block; width: 100%; padding: 0 18px; }
.code .line.hl { background: var(--hl-bg); box-shadow: inset 2px 0 0 var(--link); }
.shiki span { color: var(--shiki-light); }
:root[data-theme="dark"] .shiki span { color: var(--shiki-dark); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shiki span { color: var(--shiki-dark); } }
.code[data-lang="bash"] .line:not(:empty)::before { content: '$ '; color: var(--muted); user-select: none; }
.code[data-lang="bash"] .line:has(> span:first-child:only-child[style*="--shiki-light:#6A737D"])::before { content: ''; }

.tree pre { padding: 14px 18px; font-size: 13.4px; line-height: 1.75; }
.tree-row { display: flex; align-items: center; white-space: pre; }
.tree-guide { color: var(--line-2); }
.tree-row .ico-tree { width: 15px; height: 15px; margin-right: 7px; color: var(--muted); }
.tree-name { color: var(--text); }
.tree-name.dir { color: var(--link); font-weight: 500; }
.tree-row:has(.tree-name.dir) .ico-tree { color: var(--link); }
.tree-note { margin-left: auto; padding-left: 28px; color: var(--muted); font-family: var(--font); font-size: 13px; white-space: nowrap; }

/* ---------------------------------------------------------------- callouts */
.callout { --c: var(--c-note); margin: 1.5em 0; padding: 14px 18px 4px; border: 1px solid color-mix(in oklab, var(--c) 28%, var(--line)); border-left: 3px solid var(--c); border-radius: var(--r-m); background: color-mix(in oklab, var(--c) 6%, var(--surface)); }
.callout-tip { --c: var(--c-tip); } .callout-warning { --c: var(--c-warning); } .callout-danger { --c: var(--c-danger); } .callout-perf { --c: var(--c-perf); } .callout-new { --c: var(--c-new); }
.callout-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 650; color: var(--c); font-size: 15px; }
.callout-head .ico { width: 19px; height: 19px; }
.callout-body { font-size: 15.5px; }
.callout-body > :last-child { margin-bottom: 10px; }
.callout .code { background: var(--surface); }

/* ---------------------------------------------------------------- tabs */
.tabs { margin: 1.3em 0 1.6em; }
.tab-list { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: -1px; overflow-x: auto; scrollbar-width: none; }
.tab-list button { position: relative; padding: 8px 14px 10px; border: 0; background: none; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.tab-list button:hover { color: var(--text); }
.tab-list button[aria-selected="true"] { color: var(--text); }
.tab-list button[aria-selected="true"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--link); }
.tabs [role="tabpanel"] { padding-top: 14px; }
.tabs [role="tabpanel"] > :first-child { margin-top: 0; }
.tabs [role="tabpanel"] > .code:first-child { margin-top: 4px; }

/* ---------------------------------------------------------------- steps (a real sequence) */
.steps { counter-reset: step; margin: 1.6em 0 2em; padding-left: 46px; position: relative; }
.steps > h3 { counter-increment: step; margin: 1.8em 0 .5em; font-size: 1.1rem; }
.steps > h3:first-child { margin-top: 0; }
.steps > h3::before { content: counter(step); position: absolute; left: -46px; width: 30px; height: 30px; margin-top: -3px; display: grid; place-items: center; border-radius: 50%; font: 600 13px/1 var(--mono); color: var(--link); background: var(--tint); border: 1px solid color-mix(in oklab, var(--link) 35%, transparent); }
.steps::before { content: ''; position: absolute; left: 15px; top: 34px; bottom: 8px; width: 1px; background: var(--line); }
.steps > h3 .anchor { display: none; }

/* ---------------------------------------------------------------- cards + features */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 1.5em 0 2em; }
.card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
a.card:hover { border-color: color-mix(in oklab, var(--link) 50%, var(--line)); background: var(--tint); }
.card-icon { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 9px; color: var(--link); background: var(--tint); }
.card-title { font-weight: 650; font-size: 15.5px; }
.card-text { font-size: 14px; line-height: 1.5; color: var(--muted); }
.card-go { position: absolute; top: 16px; right: 14px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
a.card:hover .card-go { opacity: 1; transform: none; color: var(--link); }

.features { list-style: none; padding: 0; margin: 1.6em 0 2.2em; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px 36px; }
.features li { display: flex; gap: 14px; margin: 0; }
.feature-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--link); border: 1px solid color-mix(in oklab, var(--link) 30%, var(--line)); background: var(--tint); }
.features strong { display: block; font-size: 16px; margin: 1px 0 3px; }
.features p { margin: 0; font-size: 14.8px; line-height: 1.55; color: var(--text-2); }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.details { margin: 1.2em 0; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.details summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary .ico { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.details[open] summary .ico { transform: rotate(90deg); }
.details-body { padding: 0 16px 6px; }

/* stats: numbers that actually matter (measured fps, blade counts) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; margin: 1.8em 0 2.2em; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats div { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column-reverse; }
.stats dd { margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stats dt { font-size: 13.5px; color: var(--muted); line-height: 1.4; margin-top: 4px; }

/* ---------------------------------------------------------------- api blocks */
.api { margin: 2.2em 0; padding-top: 1.4em; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--hdr-h) + 20px); }
.api-sig { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.prose .api-sig code { font-size: 15.5px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; background: none; border: 0; padding: 0; }
.sig-obj { color: var(--muted); }
.sig-fn { color: var(--link); font-weight: 600; }
.sig-kw { color: var(--muted); }
.sig-type { color: var(--c-warning); }
.api-kind { font-size: 12.5px; color: var(--muted); padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; }
.api-body > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- media */
.video, .figure, .compare, .live { margin: 1.8em 0 2em; }
.wide { margin-left: clamp(-120px, -6vw, 0px); margin-right: clamp(-120px, -6vw, 0px); }
figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.video-frame, .compare-frame, .live-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0a0f1a; box-shadow: 0 0 0 1px var(--line), var(--shadow); isolation: isolate; }
.video-frame video, .live-frame img, .live-frame iframe, .compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video-play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #0d1422; background: rgb(255 255 255 / .92); box-shadow: 0 10px 30px rgb(0 0 0 / .35); transition: transform .15s; }
.video-play .ico { width: 30px; height: 30px; margin-left: 4px; }
.video-play:hover { transform: scale(1.06); }
.video.playing .video-play { display: none; }
.video-ui { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 26px 12px 10px; background: linear-gradient(transparent, rgb(0 0 0 / .55)); color: #fff; opacity: 0; transition: opacity .2s; }
.video.playing .video-frame:hover .video-ui, .video.playing .video-ui:focus-within { opacity: 1; }
.video-ui button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: rgb(255 255 255 / .12); color: #fff; }
.video-ui button:hover { background: rgb(255 255 255 / .24); }
.video-ui .ico { width: 16px; height: 16px; }
.video-bar { flex: 1; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .25); overflow: hidden; }
.video-bar span { display: block; height: 100%; width: 0; background: var(--accent); }

.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 14px; overflow: hidden; }
.figure img { width: 100%; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.gallery { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px; margin: 1.6em 0 2em; }
.gallery figure { margin: 0; }
.gallery .zoom, .preset .zoom { border-radius: 10px; box-shadow: 0 0 0 1px var(--line); aspect-ratio: 16 / 9; }
.gallery img, .preset img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { margin-top: 7px; font-size: 13.5px; }

.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); z-index: 1; }
.compare-handle { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgb(0 0 0 / .4); pointer-events: none; }
.compare-handle span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #0d1422; box-shadow: 0 4px 14px rgb(0 0 0 / .35); }
.compare-handle .ico { width: 20px; height: 20px; }
.compare-label { position: absolute; z-index: 3; top: 12px; padding: 3px 9px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgb(8 12 20 / .6); border-radius: 6px; backdrop-filter: blur(6px); pointer-events: none; }
.compare-label.l { left: 12px; } .compare-label.r { right: 12px; }
.compare input { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input:focus-visible ~ .compare-handle span, .compare-frame:has(input:focus-visible) .compare-handle span { outline: 3px solid var(--ring); }

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 16px; margin: 1.6em 0 2.4em; }
.preset { margin: 0; scroll-margin-top: calc(var(--hdr-h) + 20px); }
.preset .zoom { position: relative; }
.preset video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.preset figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 9px; }
.preset-name { font-weight: 650; color: var(--text); font-size: 15px; }
.preset code { font-size: 12px !important; }
.preset-text { flex-basis: 100%; font-size: 13.5px; }

.live-cover { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: radial-gradient(ellipse at center, rgb(6 10 18 / .15), rgb(6 10 18 / .6)); }
.live-note { font-size: 13px; color: rgb(255 255 255 / .85); text-shadow: 0 1px 6px rgb(0 0 0 / .6); }
.live-note code { background: rgb(0 0 0 / .35) !important; border-color: transparent !important; color: #fff; }
.live.running .live-cover, .live.running img { display: none; }
.live-pop { position: absolute; z-index: 3; top: 10px; right: 10px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: rgb(8 12 20 / .5); backdrop-filter: blur(6px); }
.live-pop .ico { width: 17px; height: 17px; }

.siblings { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin: 1.4em 0 2em; }
.sibling { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.sibling:hover { border-color: color-mix(in oklab, var(--p-ink) 45%, var(--line)); }
.sibling strong { display: block; font-size: 15px; }
.sibling span span { display: block; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.sibling-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--p-ink); background: color-mix(in oklab, var(--p-ink) 12%, transparent); }
:root[data-theme="dark"] .sibling-icon { color: var(--p); background: color-mix(in oklab, var(--p) 14%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sibling-icon { color: var(--p); background: color-mix(in oklab, var(--p) 14%, transparent); } }

/* ---------------------------------------------------------------- buttons */
.button { display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 20px; border-radius: 11px; font-size: 15.5px; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.button .ico { width: 19px; height: 19px; }
.button.primary { background: var(--accent); color: #0b111d; }
.button.primary:hover { filter: brightness(1.08); text-decoration: none; }
.button.ghost { color: #fff; border-color: rgb(255 255 255 / .35); background: rgb(10 16 28 / .3); backdrop-filter: blur(8px); }
.button.ghost:hover { border-color: rgb(255 255 255 / .7); }
.prose .button.primary { color: #0b111d; }

/* ---------------------------------------------------------------- pager + footer */
.pager { max-width: var(--measure); margin: 56px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: color-mix(in oklab, var(--link) 50%, var(--line)); }
.pager a > span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pager a > span .ico { width: 15px; height: 15px; }
.pager .next { text-align: right; align-items: flex-end; grid-column: 2; }
.pager strong { font-weight: 600; }

.ftr { border-top: 1px solid var(--line); background: var(--bg-2); }
.ftr-in { max-width: 1600px; margin: 0 auto; padding: 36px 20px 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 48px; align-items: start; }
.ftr-brand { display: flex; gap: 14px; max-width: 520px; }
.ftr-brand p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ftr-brand code { font-size: 12.5px; }
.ftr-series { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 6px; }
.ftr-series a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.ftr-series a .ico { width: 17px; height: 17px; color: var(--p-ink); }
:root[data-theme="dark"] .ftr-series a .ico { color: var(--p); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ftr-series a .ico { color: var(--p); } }
.ftr-series a:hover, .ftr-series a[aria-current] { background: var(--surface-2); color: var(--text); }

/* ---------------------------------------------------------------- home */
.hero { position: relative; min-height: min(92vh, 900px); display: flex; align-items: flex-end; color: #f3f6fb; overflow: hidden; background: #0a0f1a; }
.hero-media { position: absolute; inset: 0; }
.hero-video { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 0%, rgb(8 12 22 / .55) 26%, rgb(8 12 22 / .12) 55%, rgb(8 12 22 / .35) 100%), linear-gradient(to right, rgb(8 12 22 / .55), transparent 60%); }
.hero-in { position: relative; z-index: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 140px 20px clamp(48px, 8vh, 96px); }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 14px/1 var(--mono); color: rgb(243 246 251 / .85); }
.hero-ver { color: var(--accent); }
.hero-title { margin: 0; max-width: 12ch; font-size: clamp(3.2rem, 1.6rem + 6.4vw, 7.4rem); line-height: .92; letter-spacing: -.045em; font-weight: 800; text-wrap: balance; text-shadow: 0 2px 40px rgb(0 0 0 / .35); }
.hero-lead { max-width: 58ch; margin: 22px 0 30px; font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); line-height: 1.55; color: rgb(243 246 251 / .9); text-wrap: pretty; text-shadow: 0 1px 20px rgb(0 0 0 / .4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-install { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; padding: 4px 4px 4px 14px; border-radius: 10px; background: rgb(8 12 22 / .55); border: 1px solid rgb(255 255 255 / .14); backdrop-filter: blur(8px); font-size: 13.5px; }
.hero-install code { color: #e8edf6; }
.hero-install .prompt { color: var(--accent); margin-right: 4px; }
.hero-install .copy { color: rgb(232 237 246 / .75); }
.hero-install .copy:hover { background: rgb(255 255 255 / .1); border-color: transparent; color: #fff; }
.hero-credit { position: absolute; right: 20px; bottom: 16px; z-index: 1; margin: 0; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .hero-in > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-in > :nth-child(2) { animation-delay: .06s; } .hero-in > :nth-child(3) { animation-delay: .14s; } .hero-in > :nth-child(4) { animation-delay: .2s; } .hero-in > :nth-child(5) { animation-delay: .26s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.home-main { padding: 28px 20px 88px; }
.home .prose h2 { font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem); letter-spacing: -.028em; margin-top: 2.4em; max-width: 24ch; }
.home .prose h2 + p { font-size: 1.1rem; color: var(--text-2); max-width: 62ch; }
.home .prose > p, .home .prose > ul:not(.features) { max-width: 68ch; }
.hero-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px 48px; align-items: center; margin: 2em 0; }
.hero-split > :first-child { margin-top: 0; }
.hero-split h2 { margin-top: 0 !important; }

/* ---------------------------------------------------------------- dialogs */
dialog { color: var(--text); }
.search { width: min(680px, calc(100vw - 24px)); max-height: min(640px, 80vh); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .55); overflow: hidden; }
.search::backdrop { background: rgb(5 9 16 / .55); backdrop-filter: blur(3px); }
.search[open] { display: flex; flex-direction: column; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.search-box > .ico { color: var(--muted); }
.search-box input { flex: 1; height: 56px; border: 0; outline: 0; background: none; color: var(--text); font: 400 17px var(--font); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-close { border: 0; background: none; color: var(--muted); }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results a { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.search-results a .ico { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.search-results a[aria-selected="true"] { background: var(--tint); }
.search-results a[aria-selected="true"] .ico { color: var(--link); }
.search-results strong { display: block; font-weight: 600; font-size: 15px; }
.search-results small { display: block; font-size: 12.5px; color: var(--muted); }
.search-results p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: color-mix(in oklab, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; }
.search-empty { margin: 0; padding: 22px; color: var(--muted); font-size: 14.5px; }

.lightbox { max-width: 96vw; max-height: 94vh; padding: 0; border: 0; background: none; overflow: visible; }
.lightbox::backdrop { background: rgb(5 8 14 / .9); }
.lightbox img { max-width: 96vw; max-height: 94vh; border-radius: 10px; }
.lightbox-close { position: fixed; top: 16px; right: 16px; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); color: #fff; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: grid; margin-left: -8px; }
  .side { position: fixed; z-index: 45; top: var(--hdr-h); bottom: 0; left: 0; width: min(320px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform .22s ease; border-right: 1px solid var(--line); }
  .side-in { position: static; max-height: 100%; height: 100%; }
  body.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: var(--hdr-h) 0 0; z-index: 44; background: rgb(5 9 16 / .5); }
  .scrim[hidden] { display: none; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .hdr-link span { display: none; }
  .switcher-btn span { display: none; }
  .hero-split { grid-template-columns: 1fr; }
  .ftr-in { grid-template-columns: 1fr; }
  .ftr-series { grid-template-columns: repeat(2, auto); justify-content: start; }
  .wide { margin-left: 0; margin-right: 0; }
  .gallery { grid-template-columns: repeat(min(var(--cols), 2), minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .hdr-in { padding: 0 12px; gap: 4px; }
  .brand-ver { display: none; }
  .switcher { display: none; }
  .main { padding: 28px 16px 48px; }
  .home-main { padding: 20px 16px 64px; }
  .hero-in { padding: 110px 16px 40px; }
  .hero-install { max-width: 100%; }
  .hero-install code { overflow-x: auto; white-space: nowrap; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .gallery { grid-template-columns: 1fr; }
  .anchor { display: none; }
  .steps { padding-left: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  .hdr, .side, .toc, .pager, .ftr, .copy { display: none !important; }
  .shell { display: block; }
}
.api-since { color: var(--link); border-color: color-mix(in oklab, var(--link) 35%, transparent); }
.prose table.headless td:first-child { font-weight: 600; width: 26%; white-space: nowrap; }
/* compare: the "after" image sets the frame size, so any aspect ratio works */
.compare-frame { aspect-ratio: auto; }
.compare-frame > img { position: relative; height: auto; }
.compare-before img { height: 100%; }
