:root {
  --bg: #0b0e14;
  --bg-soft: #131822;
  --bg-card: #182030;
  --border: #232b3d;
  --text: #e6ecf2;
  --text-muted: #9aa5b5;
  --accent: #ff5e5b;
  --accent-soft: #ffb3b1;
  --link: #7fb8ff;
  --code-bg: #0f1320;
  --code-text: #e6ecf2;
  --max-w: 1200px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.5em 0 0.5em; font-weight: 600; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }

code {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1em 0 1.5em;
  font-size: 0.9rem;
  line-height: 1.55;
}
pre code { padding: 0; background: transparent; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0 1.5em;
  font-size: 0.93rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--bg-soft); font-weight: 600; }

blockquote {
  border-left: 3px solid var(--accent);
  margin: 1em 0;
  padding: 0.4em 1em;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 0 4px 4px 0;
}

.admonition {
  border-left: 3px solid var(--link);
  background: var(--bg-soft);
  padding: 0.8em 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
}
.admonition.note { border-color: var(--link); }
.admonition.warning { border-color: #ffb454; }
.admonition.tip { border-color: #5cd6a4; }
.admonition-title { font-weight: 600; margin-bottom: 0.3em; text-transform: uppercase; font-size: 0.8em; letter-spacing: 0.05em; }

ul, ol { padding-left: 1.5em; margin: 0 0 1em; }
li { margin-bottom: 0.25em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11,14,20,0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.primary-nav { display: flex; gap: 1.5rem; }
.primary-nav a { color: var(--text-muted); font-size: 0.95rem; }
.primary-nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 5rem 0 3rem; }
.hero-inner h1 {
  font-size: 3.2rem; margin: 0 0 1rem; letter-spacing: -0.02em;
  font-weight: 700;
}
.hero-inner h1 .accent { color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 640px; margin: 0 0 2rem; }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.05s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text); }

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
}
.feature h3 { margin: 0 0 0.4em; color: var(--accent-soft); font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.quickstart { padding: 2rem 0 5rem; }
.quickstart h2 { border: 0; margin-top: 0; }

/* Docs layout */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 3rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
  align-items: start;
}
.sidebar {
  position: sticky; top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 0.93rem;
}
.sidebar section { margin-bottom: 1.5rem; }
.sidebar h4 {
  margin: 0 0 0.5em; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: 0.3rem 0.6rem;
  color: var(--text-muted);
  border-radius: 4px;
  border-left: 2px solid transparent;
}
.sidebar a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.sidebar a.active {
  color: var(--accent-soft);
  background: var(--bg-soft);
  border-left-color: var(--accent);
}

.doc-content { min-width: 0; max-width: 760px; }
.breadcrumb { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.4em; }
.doc-content h1 { margin-top: 0; }
.page-description { font-size: 1.1rem; color: var(--text-muted); margin: -0.4em 0 1.5em; }
.markdown-body img { max-width: 100%; height: auto; border-radius: 4px; }

.page-nav {
  display: flex; justify-content: space-between;
  margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}
.page-nav .next { margin-left: auto; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* Pygments — codehilite (dark theme) */
.highlight .hll { background-color: #2a3548 }
.highlight .c, .highlight .ch, .highlight .cm, .highlight .c1, .highlight .cs { color: #6c7a89; font-style: italic }
.highlight .err { color: #ff6b6b }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #c792ea }
.highlight .o, .highlight .ow { color: #89ddff }
.highlight .nb { color: #82aaff }
.highlight .nc, .highlight .nf, .highlight .nn { color: #ffcb6b }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr { color: #c3e88d }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .mo, .highlight .il { color: #f78c6c }
.highlight .nt { color: #ff5e5b }
.highlight .na { color: #ffcb6b }
.highlight .gd { color: #ff6b6b }
.highlight .gi { color: #c3e88d }
.highlight .gh, .highlight .gu { color: #82aaff; font-weight: bold }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .sidebar { position: static; max-height: none; }
  .hero-inner h1 { font-size: 2.2rem; }
  .hero { padding: 3rem 0 2rem; }
}
