:root, :root[data-theme="dark"] { --bg:#0b0e13; --bg-2:#0f1319; --surface:#13171e; --surface-2:#1a1f28; --ink:#e9edf3; --ink-2:#b4bccb; --muted:#858fa0;
  --line:#242a35; --line-2:#2e3542; --accent:#34c37a; --accent-ink:#05140c; --accent-soft:rgba(52,195,122,.12); --accent-line:rgba(52,195,122,.35);
  --glow:rgba(52,195,122,.16); --code-bg:#080a0e; --code-ink:#c9d1dc; --warn:#e3b341; --warn-soft:rgba(227,179,65,.1); color-scheme: dark; }
:root[data-theme="light"] { --bg:#f6f7f9; --bg-2:#eef1f4; --surface:#fff; --surface-2:#f1f3f6; --ink:#111722; --ink-2:#3c4657; --muted:#667085;
  --line:#e1e5eb; --line-2:#d3d9e1; --accent:#0e8a4a; --accent-ink:#fff; --accent-soft:#e3f4ea; --accent-line:rgba(14,138,74,.35);
  --glow:rgba(14,138,74,.1); --code-bg:#0b0e13; --code-ink:#c9d1dc; --warn:#9a5b00; --warn-soft:#fff3dc; color-scheme: light; }
:root { --sans: Inter, "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", Inter, "Inter Variable", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 62px;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.05rem/1 var(--display); letter-spacing: -0.02em; }
.brand a { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-height: 40px; }
.brand .brand-help { color: var(--muted); font-weight: 600; }
.brand a:hover { color: var(--accent); }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.search { position: relative; margin-left: auto; width: min(440px, 50vw); }
.search input { width: 100%; font: 400 .95rem/1 var(--sans); padding: .7em .95em; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 24px 48px -18px rgba(0,0,0,.45); max-height: 60vh; overflow: auto; padding: 6px; }
.results a { display: block; padding: 9px 11px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.results a:hover, .results a.on { background: var(--surface-2); }
.results small { display: block; color: var(--muted); font-size: .8rem; }
.results .none { padding: 10px; color: var(--muted); font-size: .9rem; }
.theme-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; padding: 0; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; } .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; } :root[data-theme="dark"] .theme-btn .moon { display: none; }
.back { color: var(--ink-2); font-size: .9rem; text-decoration: none; white-space: nowrap; } .back:hover { color: var(--accent); }
.layout { display: grid; grid-template-columns: 250px minmax(0, 760px) 200px; gap: 44px; max-width: 1320px; margin: 0 auto; padding: 36px 20px 80px; }
.nav { position: sticky; top: 86px; align-self: start; max-height: calc(100vh - 104px); overflow: auto; font-size: .92rem; padding-right: 4px; }
.nav h4 { margin: 20px 0 6px 10px; font: 700 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav h4:first-child { margin-top: 0; }
.nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; border-left-color: var(--accent); border-radius: 0 8px 8px 0; }
.toc { position: sticky; top: 86px; align-self: start; font-size: .85rem; border-left: 1px solid var(--line); padding-left: 16px; }
.toc b { display: block; margin-bottom: 8px; color: var(--muted); font: 700 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.toc a { display: block; padding: 4px 0; color: var(--ink-2); text-decoration: none; } .toc a:hover { color: var(--accent); }
article h1 { font: 800 clamp(1.9rem, 3.5vw, 2.5rem)/1.12 var(--display); letter-spacing: -0.03em; margin: 0 0 8px; }
article .crumb { display: flex; gap: 8px; align-items: center; color: var(--accent); font: 700 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
article .crumb a { color: var(--muted); text-decoration: none; }
article .crumb a:hover { color: var(--accent); }
article .crumb [aria-hidden] { color: var(--muted); }
picture { display: contents; }
article h2 { font: 700 1.38rem/1.3 var(--display); letter-spacing: -0.015em; margin: 42px 0 10px; padding-top: 6px; }
article h3 { font: 700 1.08rem/1.35 var(--display); margin: 28px 0 8px; }
article h2, article h3 { scroll-margin-top: 80px; }
article .anchor { float: left; margin-left: -1.1em; width: 1.1em; color: var(--muted); text-decoration: none; opacity: 0; }
article h2:hover .anchor, article h3:hover .anchor { opacity: 1; }
article p, article li { color: var(--ink-2); } article strong { color: var(--ink); }
article ul, article ol { padding-left: 1.3em; } article li { margin: 5px 0; } article li::marker { color: var(--accent); }
article code { font: 500 .86em/1.4 var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: .1em .38em; border-radius: 6px; color: var(--ink); }
article pre { background: var(--code-bg); color: var(--code-ink); padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); overflow-x: auto; font: 500 .86rem/1.65 var(--mono); }
article pre code { background: none; border: 0; padding: 0; color: inherit; font: inherit; }
article figure { margin: 24px 0; }
article .shot { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #0b0e13; box-shadow: 0 18px 40px -22px rgba(0,0,0,.5); cursor: zoom-in; }
article .shot:hover { border-color: var(--accent-line); }
article .shot > img, article .shot > picture > img { max-width: 100%; height: auto; display: block; }
article .shot > picture { display: block; }
article figure.narrow .shot { max-width: 320px; margin: 0 auto; border-radius: 28px; }
article figcaption { margin-top: 8px; font-size: .82rem; color: var(--muted); text-align: center; }
article figcaption a { color: var(--muted); } article figcaption a:hover { color: var(--accent); }
.crop { position: relative; overflow: hidden; aspect-ratio: var(--w) / var(--h); }
.crop.tall { max-width: 520px; margin: 0 auto; }
.crop img { position: absolute; max-width: none; height: auto; width: calc(2160 / var(--w) * 100%); left: calc(var(--x) / var(--w) * -100%); top: calc(var(--y) / var(--h) * -100%); }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } tr:last-child td { border-bottom: 0; }
th { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.callout { border: 1px solid var(--accent-line); border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 4px 16px; border-radius: 10px; margin: 18px 0; }
.callout.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); border-left-color: var(--warn); background: var(--warn-soft); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--line); }
.pager a { display: block; max-width: 48%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 600; }
.pager a:hover { border-color: var(--accent-line); }
.pager small { display: block; color: var(--muted); font-weight: 400; } .pager .next { margin-left: auto; text-align: right; }
.foot { color: var(--muted); font-size: .85rem; text-align: center; padding: 30px 20px; border-top: 1px solid var(--line); }
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; opacity: .45; -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 70% 90% at 50% 0%, #000 10%, transparent 75%); }
.hero::after { content: ""; position: absolute; top: -220px; left: 50%; width: 900px; height: 480px; transform: translateX(-50%); background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.hero-in { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 64px 20px 44px; }
.hero .eyebrow { font: 700 .74rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font: 800 clamp(2.1rem, 4.6vw, 3.2rem)/1.08 var(--display); letter-spacing: -0.03em; margin: 12px 0 12px; }
.hero p { color: var(--ink-2); font-size: 1.1rem; margin: 0; max-width: 60ch; }
.cards { max-width: 1100px; margin: 0 auto; padding: 32px 20px 72px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; transition: border-color .2s ease; }
.card:hover { border-color: var(--accent-line); }
.card h2 { font: 700 .74rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.card a { display: block; padding: 5px 0; text-decoration: none; color: var(--ink); }
.card a:hover { color: var(--accent); }
@media (max-width: 1100px) { .layout { grid-template-columns: 230px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; padding-top: 22px; } .nav { position: static; max-height: none; order: 2; border-top: 1px solid var(--line); padding-top: 14px; }
  .top { padding: 0 16px; gap: 10px; } .brand .brand-help, .back { display: none; } .search { width: auto; flex: 1; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
