:root {
  --bg: #0b0e14;
  --bg-soft: #11151f;
  --panel: #151a26;
  --panel-2: #1b2230;
  --border: #232c3d;
  --fg: #e6e9ef;
  --muted: #99a3b3;
  --faint: #5c6675;
  --accent: #4dd0e1;
  --accent-2: #7c83ff;
  --ok: #6ee7a8;
  --warn: #ffd479;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans);
  line-height: 1.65; font-size: 16px;
  background-image: radial-gradient(900px 500px at 80% -10%, rgba(124,131,255,.10), transparent 60%),
                    radial-gradient(700px 400px at 0% 0%, rgba(77,208,225,.08), transparent 55%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; }

.layout { display: grid; grid-template-columns: 260px 1fr; max-width: 1180px; margin: 0 auto; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 28px 18px; border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent); }
.brand-sub { color: var(--faint); font-size: 12px; margin: 0 0 22px 21px; font-family: var(--mono); }
.nav a { display: block; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14.5px; border-left: 2px solid transparent; }
.nav a:hover { color: var(--fg); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--fg); background: var(--panel-2); border-left-color: var(--accent); }
.nav .grp { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin: 18px 10px 6px; }

/* Content */
main { padding: 0 44px 120px; min-width: 0; }
section { padding-top: 56px; }
section > h2 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.01em; }
section > .lead { color: var(--muted); margin: 0 0 22px; max-width: 760px; }
h3 { font-size: 18px; margin: 26px 0 8px; }
p { max-width: 760px; }

/* Hero */
.hero { padding-top: 64px; }
.hero h1 { font-size: 46px; line-height: 1.05; margin: 14px 0 10px; letter-spacing: -.02em;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 75%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .tag { font-size: 19px; color: var(--muted); max-width: 720px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-family: var(--mono); }
.badge { display: inline-block; background: rgba(77,208,225,.12); border: 1px solid var(--accent); color: var(--accent); padding: 1px 8px; border-radius: 999px; font-size: 11px; font-family: var(--mono); vertical-align: middle; margin-right: 6px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px; border: 1px solid var(--border); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #07101a; border: none; }
.btn.primary:hover { text-decoration: none; filter: brightness(1.07); }
.btn.ghost { background: var(--panel); color: var(--fg); }
.btn.ghost:hover { text-decoration: none; background: var(--panel-2); }

/* Cards */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 18px 0; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h4 { margin: 0 0 6px; font-size: 15.5px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card .ic { color: var(--accent); line-height: 0; }
.card .ic svg { width: 26px; height: 26px; stroke-width: 1.75; }
.btn i, .btn svg { width: 15px; height: 15px; vertical-align: -2px; }

/* Code blocks */
.code { position: relative; margin: 14px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0d1117; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.code .copy { position: absolute; top: 8px; right: 8px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 7px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; font-family: var(--mono); opacity: 0; transition: opacity .15s; }
.code:hover .copy { opacity: 1; }
.code .copy:hover { color: var(--fg); }
.code .copy.done { color: var(--ok); border-color: var(--ok); }
.inline { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--accent); }

/* Tabs */
.tabs { display: flex; gap: 6px; margin: 14px 0 0; }
.tab { padding: 7px 14px; border-radius: 9px 9px 0 0; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; font-size: 13.5px; font-family: var(--mono); }
.tab.active { color: var(--fg); background: #0d1117; border-color: var(--border); border-bottom-color: #0d1117; }
.tabpanes > .pane { display: none; }
.tabpanes > .pane.active { display: block; }
.tabpanes .code { margin-top: 0; border-top-left-radius: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--faint); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; }
td code { color: var(--accent); }

/* Callouts */
.note { border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 16px 0; color: var(--muted); font-size: 14.5px; }
.note.warn { border-left-color: var(--warn); }
.soon { display: inline-block; background: rgba(255,212,121,.14); color: var(--warn); border: 1px solid rgba(255,212,121,.3); border-radius: 999px; font-size: 11px; padding: 1px 8px; font-family: var(--mono); margin-left: 8px; vertical-align: middle; }

footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 30px 0; color: var(--faint); font-size: 14px; display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .nav { display: none; }
  main { padding: 0 22px 80px; }
  .hero h1 { font-size: 34px; }
}

/* Multi-page docs portal: card grid + tab panes (descendant selector covers
   both index's .tabpanes wrapper and the reference pages' direct .pane children) */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 18px 0; }
.tabgroup { margin: 16px 0; }
.tabgroup .pane { display: none; }
.tabgroup .pane.active { display: block; }

/* Live demo nav link — accent it so it stands out */
.nav a.live { color: var(--accent); font-weight: 600; }
