:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-2: #0f0f11;
  --panel: #131316;
  --panel-2: #18181c;
  --line: #24242a;
  --line-2: #2f2f37;
  --text: #ededef;
  --muted: #9b9ba6;
  --faint: #6e6e78;
  --accent: #7c8cff;
  --accent-2: #a78bfa;
  --green: #3fd68f;
  --amber: #f5b14c;
  --red: #ff6b6b;
  --blue: #5cb2ff;
  --radius: 12px;
  --radius-sm: 8px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: color .15s var(--ease); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--panel-2); border: 1px solid var(--line); padding: .1em .38em; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 650; }
h2 { font-size: 1.35rem; font-weight: 600; margin-top: 2em; }
h3 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 6px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; backdrop-filter: saturate(160%) blur(12px); background: rgba(10, 10, 11, .78); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand-sub { color: var(--muted); font-weight: 500; }
.logo-mark { width: 22px; height: 22px; color: var(--accent); vertical-align: middle; }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); }
.nav-auth { display: inline-flex; align-items: center; gap: 16px; }
.site-nav .btn { color: #0b0b0d; }
.nav-toggle { display: none; margin-left: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--text); color: #0b0b0d; border: 1px solid var(--text); border-radius: 9px; padding: 10px 18px; font: 600 .92rem var(--sans); text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), background .15s var(--ease), opacity .15s; }
.btn:hover { color: #0b0b0d; background: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-small { padding: 6px 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(255, 107, 107, .35); }
.btn-danger:hover { background: rgba(255, 107, 107, .1); color: var(--red); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 88px 0 56px; border-bottom: 1px solid var(--line); background: radial-gradient(900px 400px at 15% -10%, rgba(124, 140, 255, .18), transparent 60%), radial-gradient(700px 360px at 95% 10%, rgba(167, 139, 250, .12), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--muted); font-size: .84rem; font-weight: 500; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(63, 214, 143, .15); }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.stats { display: flex; flex-wrap: wrap; gap: 36px; margin: 30px 0 0; }
.stats dt { font-size: 1.6rem; font-weight: 650; }
.stats dd { margin: 0; color: var(--muted); font-size: .85rem; }
.terminal { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8); overflow: hidden; min-width: 0; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.terminal-bar em { margin-left: 8px; color: var(--faint); font-style: normal; font-size: .8rem; }
.terminal pre { margin: 0; padding: 18px; overflow-x: auto; color: #cfd2ff; line-height: 1.55; }

/* Sections & cards */
.section { padding: 56px 0; }
.page-head { padding-bottom: 20px; }
.section-head { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head p { color: var(--muted); max-width: 60ch; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.api-card { display: flex; flex-direction: column; text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease); }
.api-card:hover { border-color: var(--line-2); background: var(--panel-2); transform: translateY(-2px); color: var(--text); }
.api-card p { color: var(--muted); font-size: .9rem; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.num { color: var(--faint); font: .8rem var(--mono); }
.card-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--accent); }
.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 28px; height: 28px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-top: 0; }
.features p { color: var(--muted); }
.features a { font-size: .9rem; }

/* Badges & endpoints */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-vercel { color: var(--green); border-color: rgba(63, 214, 143, .3); background: rgba(63, 214, 143, .08); }
.badge-hybrid { color: var(--blue); border-color: rgba(92, 178, 255, .3); background: rgba(92, 178, 255, .08); }
.badge-worker { color: var(--amber); border-color: rgba(245, 177, 76, .3); background: rgba(245, 177, 76, .08); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; }
code.endpoint { background: none; border: 0; padding: 0; color: var(--muted); font-size: .82rem; word-break: break-all; }
code.endpoint b { font-weight: 700; margin-right: 6px; }
code.endpoint.big { font-size: .95rem; color: var(--text); }
.m-get { color: var(--green); }
.m-post { color: var(--blue); }
.m-delete { color: var(--red); }
.m-patch { color: var(--amber); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--faint); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .015); }
.num-cell { font-family: var(--mono); text-align: right; }
.type { color: var(--accent-2); font: .82rem var(--mono); }
.req { color: var(--amber); font-size: .8rem; font-weight: 600; }

/* Docs */
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 40px 0 80px; }
.doc-nav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 100px); overflow-y: auto; }
.doc-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 7px; font-size: .88rem; }
.doc-nav a:hover { background: var(--panel); color: var(--text); }
.doc-nav a[aria-current] { background: var(--panel-2); color: var(--text); }
.doc { min-width: 0; max-width: 820px; }
.doc h2 { scroll-margin-top: 80px; }
.endpoint-box { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 20px 0; }
.callout { border: 1px solid var(--line-2); border-left-width: 3px; border-radius: var(--radius-sm); padding: 12px 16px; color: var(--muted); background: var(--panel); }
.callout strong { color: var(--text); }
.callout-vercel { border-left-color: var(--green); }
.callout-hybrid { border-left-color: var(--blue); }
.callout-worker { border-left-color: var(--amber); }
pre.code { position: relative; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; line-height: 1.55; margin: 12px 0; max-height: 560px; }
pre.code code { color: #d6d8f5; white-space: pre; }
.copy { position: absolute; top: 10px; right: 10px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; font: .76rem var(--sans); padding: 3px 9px; cursor: pointer; }
.copy:hover { color: var(--text); }
.related { list-style: none; padding: 0; display: grid; gap: 8px; }
.related li { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.related span { color: var(--muted); font-size: .9rem; }
.bullets { padding-left: 1.2em; color: var(--muted); }
.bullets li { margin: .35em 0; }
.steps { padding-left: 1.3em; }
.steps li { margin: .4em 0; }

/* Forms */
label { display: grid; gap: 6px; font-size: .86rem; color: var(--muted); font-weight: 500; }
input, select, textarea { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; font: .92rem var(--sans); transition: border-color .15s, box-shadow .15s; }
textarea { font-family: var(--mono); font-size: .84rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 140, 255, .18); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin: 0; }
legend { color: var(--muted); font-size: .84rem; padding: 0 6px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.form-error { color: var(--red); background: rgba(255, 107, 107, .08); border: 1px solid rgba(255, 107, 107, .25); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }
.auth-wrap { display: grid; place-items: center; padding: 64px 16px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 16px; padding: 30px; }
.auth-card h1 { font-size: 1.5rem; margin: 6px 0 0; }
.inline-form { display: grid; gap: 14px; margin: 16px 0; max-width: 720px; }
.secret-box { border-color: rgba(63, 214, 143, .35); margin: 16px 0; }

/* Playground */
.playground { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; padding-bottom: 80px; align-items: start; }
.pg-form { display: grid; gap: 14px; }
.pg-endpoint { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.pg-result { position: sticky; top: 80px; }
.pg-result pre { max-height: 70vh; }
.pg-result img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-bottom: 12px; }
.pg-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.status-pill { font: 600 .8rem var(--mono); padding: 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); }
.status-pill.ok { color: var(--green); border-color: rgba(63, 214, 143, .35); }
.status-pill.err { color: var(--red); border-color: rgba(255, 107, 107, .35); }

/* Dashboard */
.dash { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; padding: 40px 0 80px; }
.dash-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; align-self: start; }
.dash-nav a { color: var(--muted); text-decoration: none; padding: 7px 10px; border-radius: 7px; font-size: .9rem; }
.dash-nav a:hover { background: var(--panel); color: var(--text); }
.dash-nav a[aria-current] { background: var(--panel-2); color: var(--text); }
.dash-main { min-width: 0; }
.dash-main h1 { font-size: 1.7rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { display: grid; gap: 4px; }
.stat b { font-size: 1.55rem; font-weight: 650; }
.stat span { color: var(--muted); font-size: .84rem; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bars div { flex: 1; min-width: 4px; background: linear-gradient(180deg, var(--accent), rgba(124, 140, 255, .35)); border-radius: 3px 3px 0 0; transition: opacity .15s; }
.bars div:hover { opacity: .75; }
.notes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .88rem; }
.notes li { border-bottom: 1px solid var(--line); padding-bottom: 8px; overflow-wrap: anywhere; }
.notes li:last-child { border-bottom: 0; }
.state { font: 600 .78rem var(--mono); }
.state-ok { color: var(--green); }
.state-warn { color: var(--amber); }
.state-bad { color: var(--red); }

/* Changelog & footer */
.change { margin: 16px 0; }
.change-head { display: flex; justify-content: space-between; align-items: baseline; }
.change-head h2 { margin: 0; }
.change time { color: var(--muted); font: .85rem var(--mono); }
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--faint); font-size: .86rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer .logo-mark { width: 16px; height: 16px; }

@media (max-width: 960px) {
  .hero-grid, .playground, .features { grid-template-columns: 1fr; }
  .doc-layout, .dash { grid-template-columns: 1fr; gap: 20px; }
  .doc-nav, .dash-nav { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pg-result { position: static; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; }
  .nav-auth { flex-direction: column; align-items: stretch; gap: 8px; }
  .hero { padding-top: 56px; }
  .stats { gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
