:root {
  --bg: #0b0d12; --panel: #11141b; --panel-2: #161a23; --border: #232937; --text: #e8ebf2; --muted: #98a1b3;
  --accent: #5b9cff; --accent-2: #8b5cf6; --ok: #34d399; --code: #0e1117;
  --radius: 14px; --max: 1120px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #fbfbfd; --panel: #fff; --panel-2: #f4f6fa; --border: #e3e7ee; --text: #151a24; --muted: #5b6577; --code: #f3f5f9; color-scheme: light; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: .9em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--border); }
.top .wrap { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand img { width: 26px; height: 26px; }
.top nav { display: flex; gap: 18px; margin-left: auto; font-size: .95rem; }
.top nav a { color: var(--muted); }
.top nav a:hover, .top nav a.on { color: var(--text); text-decoration: none; }
.gh { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text) !important; font-size: .9rem; }
.gh:hover { background: var(--panel-2); text-decoration: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--text); background: var(--panel); }
.btn:hover { text-decoration: none; background: var(--panel-2); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* hero */
.hero { padding: 84px 0 40px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -30% 0 auto; height: 520px; background: radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%); pointer-events: none; }
.pill { display: inline-block; padding: 5px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .85rem; background: var(--panel); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: -.035em; margin: 22px auto 18px; max-width: 880px; }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 720px; margin: 0 auto 30px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.shot { margin: 54px auto 0; max-width: 1000px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--panel); box-shadow: 0 40px 90px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.03) inset; }
.shot .bar { display: flex; gap: 7px; padding: 12px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.shot .bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4152; }
.shot img { display: block; width: 100%; }

/* sections */
section { padding: 70px 0; }
section h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -.025em; line-height: 1.15; margin: 0 0 12px; text-align: center; }
section .sub { color: var(--muted); text-align: center; max-width: 680px; margin: 0 auto 40px; font-size: 1.08rem; }
.alt { background: var(--panel); border-block: 1px solid var(--border); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.alt .card { background: var(--bg); }
.card h3 { margin: 12px 0 6px; font-size: 1.08rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
.ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; background: color-mix(in srgb, var(--accent) 16%, transparent); }

.pair { display: grid; gap: 40px; grid-template-columns: 1fr 1.15fr; align-items: center; margin: 30px 0 64px; }
.pair.flip { grid-template-columns: 1.15fr 1fr; }
.pair.flip .txt { order: 2; }
.pair h3 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 10px; line-height: 1.2; }
.pair p { color: var(--muted); margin: 0 0 14px; }
.pair ul { padding-left: 18px; color: var(--muted); margin: 0; }
.pair li { margin: 6px 0; }
.frame { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); box-shadow: 0 30px 70px -30px rgba(0,0,0,.55); }
.frame img { display: block; width: 100%; }
@media (max-width: 860px) { .pair, .pair.flip { grid-template-columns: 1fr; } .pair.flip .txt { order: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 900px; margin: 0 auto; }
.chip { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); font-size: .92rem; }
.chip b { color: var(--accent); font-weight: 600; margin-right: 4px; }

pre { background: var(--code); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; padding: 0; border: 0; }
code { background: var(--code); border: 1px solid var(--border); padding: .12em .4em; border-radius: 6px; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: .1em .45em; background: var(--panel-2); }
.tabs-note { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 14px; }

.final { text-align: center; }
footer { border-top: 1px solid var(--border); padding: 34px 0 50px; color: var(--muted); font-size: .92rem; }
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer a { color: var(--muted); }
footer .sp { margin-left: auto; }

/* docs layout */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 44px; padding: 40px 24px 80px; max-width: 1320px; margin: 0 auto; }
.side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.side h4 { margin: 0 0 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side a { display: block; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: .95rem; }
.side a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-weight: 600; }
.article { min-width: 0; }
.article h1 { font-size: 2.3rem; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 8px; }
.article .desc { color: var(--muted); font-size: 1.12rem; margin: 0 0 26px; }
.article h2 { font-size: 1.55rem; letter-spacing: -.02em; margin: 2.4em 0 .5em; padding-top: .4em; border-top: 1px solid var(--border); text-align: left; }
.article h2:first-of-type { border-top: 0; }
.article h3 { font-size: 1.18rem; margin: 1.8em 0 .4em; }
.article p, .article li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.article a.ext::after { content: " ↗"; font-size: .8em; opacity: .6; }
.article .headerlink { opacity: 0; margin-left: 8px; color: var(--muted); }
.article h2:hover .headerlink, .article h3:hover .headerlink { opacity: 1; }
.article table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.article th, .article td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.article th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; background: var(--panel); }
.article blockquote { margin: 1.3em 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; color: var(--muted); }
.article blockquote p { margin: .3em 0; }
.article img { border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; }
.toc { position: sticky; top: 84px; align-self: start; font-size: .88rem; max-height: calc(100vh - 100px); overflow: auto; }
.toc h4 { margin: 0 0 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 14px; }
.toc a { display: block; padding: 4px 0; color: var(--muted); }
.toc a:hover { color: var(--text); text-decoration: none; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 60px; }
.pn a { display: block; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); font-weight: 600; }
.pn a:hover { border-color: var(--accent); text-decoration: none; }
.pn a small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.pn .next { text-align: right; grid-column: 2; }
.edit { margin-top: 30px; color: var(--muted); font-size: .9rem; }
@media (max-width: 1100px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 780px) { .docs { grid-template-columns: 1fr; gap: 20px; } .side { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; } .side h4 { width: 100%; } .top nav a:not(.gh) { display: none; } }
