:root {
  --bg: #f5f4f0;
  --bg-2: #ecebe5;
  --card: #ffffff;
  --text: #17151f;
  --muted: #6c6978;
  --line: rgba(23, 21, 31, 0.09);
  --accent: #5b5bf7;
  --accent-ink: #ffffff;
  --code-bg: #1b1a22;
  --code-text: #ece9f7;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(20, 18, 30, 0.04), 0 8px 24px rgba(20, 18, 30, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111016;
    --bg-2: #18171f;
    --card: #1c1b24;
    --text: #f1eff8;
    --muted: #9b98aa;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #8a8aff;
    --accent-ink: #0f0e15;
    --code-bg: #0c0b10;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111016;
  --bg-2: #18171f;
  --card: #1c1b24;
  --text: #f1eff8;
  --muted: #9b98aa;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #8a8aff;
  --accent-ink: #0f0e15;
  --code-bg: #0c0b10;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code, pre, kbd { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
:not(pre) > code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; font-size: 17px; }
.brand bot-avatar { margin: -4px 0; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a, .nav button {
  text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 10px; font: inherit; font-weight: 500;
  background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--bg-2); }
.nav a.active { color: var(--text); }

/* Buttons & segmented controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.small { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }

.seg {
  display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); gap: 2px;
  max-width: 100%; overflow-x: auto;
}
.seg button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 13px;
  padding: 6px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* Hero */
.hero { padding: 72px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1; letter-spacing: -0.045em; margin: 0 0 16px; }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.parade { display: flex; justify-content: center; gap: 4px; margin: 40px auto 8px; flex-wrap: wrap; min-height: 132px; }

/* Controls row */
.controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }

/* Grid of types */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none;
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-2px); }
.card .name { font-weight: 600; font-size: 14px; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: -8px; }

section.doc { padding: 56px 0 8px; }
section.doc h2 { font-size: 28px; letter-spacing: -0.03em; margin: 0 0 8px; }
section.doc > .wrap > p { color: var(--muted); max-width: 720px; margin: 0 0 20px; }

pre.code {
  background: var(--code-bg); color: var(--code-text); padding: 18px 20px; border-radius: 16px; overflow-x: auto;
  margin: 0 0 16px; line-height: 1.6; position: relative;
}
pre.code .c { color: #8b87a3; }
pre.code .k { color: #c7a2ff; }
pre.code .s { color: #9be29b; }
pre.code .t { color: #7ccfff; }

.tabs { display: flex; gap: 6px; margin-bottom: 10px; }

table.props { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
table.props th, table.props td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.props th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-2); }
table.props tr:last-child td { border-bottom: 0; }
table.props td:first-child { white-space: nowrap; font-weight: 600; }
.table-scroll { overflow-x: auto; border-radius: 16px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row .card { flex: 1 1 140px; }

footer { padding: 56px 0 48px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--text); }

@media (max-width: 600px) {
  .hero { padding-top: 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .nav a.hide-sm { display: none; }
}
