:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --border: #1a1a1a;
  --text: #fafafa;
  --text-dim: #666;
  --text-mid: #999;
  --accent: #6C63FF;
  --green: #4ade80;
  --red: #f87171;
  --orange: #fb923c;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'DM Sans', -apple-system, sans-serif;
}

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

/* ── Scrollbar ───────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

/* ── Nav ──────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
}

nav .logo img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

nav a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

nav a:hover { color: var(--text); }
nav a.active { color: var(--accent); }

/* ── Layout ───────────────────────────────────── */

.layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 4rem;
}

.sidebar {
  position: sticky;
  top: 5rem;
  width: 220px;
  height: fit-content;
  padding: 2rem 0 2rem 2rem;
  flex-shrink: 0;
}

.sidebar a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.sidebar a:hover { color: var(--text); }
.sidebar a.active { color: var(--accent); }

.sidebar .group {
  margin-bottom: 1.5rem;
}

.sidebar .group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

/* ── Content ──────────────────────────────────── */

.content {
  flex: 1;
  padding: 3rem 2rem 6rem 3rem;
  max-width: 700px;
  line-height: 1.7;
}

.content h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.content h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.content p {
  color: var(--text-mid);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.content a {
  color: var(--accent);
  text-decoration: none;
}

.content a:hover { text-decoration: underline; }

.content ul, .content ol {
  color: var(--text-mid);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  font-size: 0.95rem;
}

.content li { margin-bottom: 0.4rem; }

.content code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
}

.content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-mid);
}

.content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.callout {
  background: rgba(108, 99, 255, 0.06);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.callout p {
  color: var(--text);
  margin: 0;
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-family: var(--mono);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag.green { background: #1a2e1a; color: var(--green); }
.tag.purple { background: rgba(108, 99, 255, 0.15); color: var(--accent); }
.tag.orange { background: #2e2a1a; color: var(--orange); }

/* ── Responsive ───────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .content { padding: 2rem 1.25rem 4rem; }
}
