:root {
  color-scheme: light dark;
  --bg: #f1f4f6;
  --panel: #fff;
  --surface: #e7edf0;
  --line: #c7d1d7;
  --text: #17232b;
  --muted: #60717b;
  --accent: #087ea4;
  --accent-strong: #05617f;
  --code: #101a20;
  --code-text: #e7f7fb;
  font: 15px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1519; --panel:#141e24; --surface:#19262d; --line:#34464f; --text:#e5eef2; --muted:#9eb0ba; --accent:#45bfe3; --accent-strong:#80d7ef; --code:#080d10; --code-text:#e0f7fc; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.docs-top { position: sticky; z-index: 10; top: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; border-bottom: 1px solid #2c3d46; background: #101a20; color: #dcebf0; }
.docs-top a { color: inherit; text-decoration: none; }
.docs-brand { font-weight: 780; letter-spacing: .02em; }
.docs-frame { display: grid; grid-template-columns: 220px minmax(0, 780px) 210px; justify-content: center; min-height: calc(100vh - 44px); }
.docs-sidebar, .docs-toc { position: sticky; top: 44px; align-self: start; max-height: calc(100vh - 44px); overflow-y: auto; padding: 1.25rem 1rem; }
.docs-sidebar { border-right: 1px solid var(--line); }
.docs-toc { border-left: 1px solid var(--line); }
.docs-sidebar nav, .docs-toc nav { display: grid; gap: .08rem; }
.docs-sidebar a, .docs-toc a { padding: .28rem .45rem; color: var(--muted); text-decoration: none; }
.docs-sidebar a:hover, .docs-sidebar a.is-active, .docs-toc a:hover { background: var(--surface); color: var(--text); }
.docs-sidebar a.is-active { border-left: 2px solid var(--accent); color: var(--accent-strong); font-weight: 700; }
.docs-kicker { display: block; margin-bottom: .5rem; color: var(--muted); font: 700 .73rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .09em; text-transform: uppercase; }
.docs-content { min-width: 0; padding: 2rem clamp(1rem, 4vw, 3rem) 5rem; background: var(--panel); }
.docs-content > header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.docs-content h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -.03em; }
.docs-article h1:first-child { display: none; }
.docs-article h2 { margin: 2rem 0 .55rem; padding-top: .5rem; border-top: 1px solid var(--line); font-size: 1.35rem; line-height: 1.3; }
.docs-article h3 { margin: 1.5rem 0 .4rem; font-size: 1.08rem; }
.docs-article p, .docs-article ul, .docs-article ol { margin: .65rem 0 1rem; }
.docs-article li + li { margin-top: .3rem; }
.docs-article code { padding: .08rem .22rem; background: var(--surface); font: .88em/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.docs-article pre { overflow: auto; padding: 1rem; border: 1px solid #2d4049; background: var(--code); color: var(--code-text); }
.docs-article pre code { padding: 0; background: transparent; color: inherit; }
.docs-article blockquote { margin: 1rem 0; padding: .2rem 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.docs-article table { width: 100%; border-collapse: collapse; }
.docs-article th, .docs-article td { padding: .5rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-article th { background: var(--surface); }

.landing { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 8vw, 7rem) 0 3rem; }
.landing-hero { max-width: 760px; }
.landing h1 { margin: 0; font-size: clamp(3rem, 10vw, 6.8rem); line-height: .92; letter-spacing: -.065em; }
.landing-hero > p { max-width: 680px; margin: 1.4rem 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.landing-actions { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.docs-button { display: inline-flex; min-height: 40px; align-items: center; padding: .5rem .8rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 750; text-decoration: none; }
.docs-button:hover { background: var(--accent-strong); color: #fff; }
.landing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: clamp(3rem, 8vw, 7rem); border: 1px solid var(--line); background: var(--line); }
.landing-grid article { min-height: 210px; padding: 1.2rem; background: var(--panel); }
.landing-grid h2 { margin: 0; font-size: 1.1rem; }
.landing-grid p { color: var(--muted); }
.landing footer { margin-top: 2rem; color: var(--muted); font: .8rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.docs-error { width: min(680px, calc(100% - 2rem)); margin: 10vh auto; padding: 1.2rem; border: 1px solid var(--line); background: var(--panel); }
@media (max-width: 1050px) { .docs-frame { grid-template-columns: 210px minmax(0, 780px); } .docs-toc { display: none; } }
@media (max-width: 720px) { .docs-frame { display: block; } .docs-sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); } .docs-sidebar nav { display: flex; overflow-x: auto; } .docs-sidebar a { white-space: nowrap; } .docs-content { padding-top: 1.3rem; } .landing-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
