*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b1120;
  --bg-sidebar: #0f172a;
  --bg-content: #111827;
  --bg-card: #1e293b;
  --bg-code: #1e293b;
  --bg-code-inline: rgba(96, 165, 250, 0.1);
  --border: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #60a5fa;
  --accent-hover: #93bbfd;
  --sidebar-hover: rgba(255, 255, 255, 0.04);
  --sidebar-active: rgba(255, 255, 255, 0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header img {
  width: 28px;
  height: 28px;
}

.sidebar-header span {
  font-weight: 600;
  font-size: 1rem;
  color: #f9fafb;
  letter-spacing: -0.02em;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0 16px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-category {
  padding: 16px 20px 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.nav-link {
  display: block;
  padding: 8px 20px 8px 28px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-radius: 6px;
  margin: 1px 12px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--sidebar-active);
  color: #f1f5f9;
  font-weight: 600;
}


/* ── Mobile toggle ── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ── Main content ── */
.main {
  margin-left: 280px;
  flex: 1;
  min-width: 0;
}

.content {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

/* ── Typography ── */
h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  color: #f8fafc;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  color: #f1f5f9;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  color: #e2e8f0;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: #cbd5e1;
}

p { margin-bottom: 16px; }

/* ── Lists ── */
ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

li > ul, li > ol {
  margin-top: 6px;
  margin-bottom: 0;
}

/* ── Code ── */
code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

:not(pre) > code {
  background: var(--bg-code-inline);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
  line-height: 1.6;
}

pre code {
  background: none;
  color: #e2e8f0;
  padding: 0;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-weight: 600;
  color: #cbd5e1;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Blockquotes ── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(96, 165, 250, 0.05);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}

blockquote p:last-child { margin-bottom: 0; }

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Strong/Bold ── */
strong { color: #f1f5f9; font-weight: 600; }

/* ── Landing page ── */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.hero .subtitle {
  max-width: 540px;
  margin: 0 auto 48px;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.15s;
  display: block;
}

.doc-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.doc-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #f1f5f9;
}

.doc-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.doc-card .category {
  display: inline-block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: flex;
  }

  .overlay.open {
    display: block;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 64px 20px 60px;
  }

  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.75rem; }

  .docs-grid {
    grid-template-columns: 1fr;
  }
}
