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

:root {
  --bg: #0a0f1e;
  --bg2: #111827;
  --card: #1a2236;
  --border: #1f2d47;
  --green: #10b981;
  --green-glow: rgba(16,185,129,0.15);
  --red: #ef4444;
  --yellow: #f59e0b;
  --purple: #c084fc;
  --blue: #60a5fa;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --sidebar-w: 260px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

/* TOP NAV */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10,15,30,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 200;
}
.topnav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: var(--text);
}
.topnav-logo .icon {
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.topnav-links {
  margin-left: auto;
  display: flex;
  gap: 24px;
  align-items: center;
}
.topnav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.topnav-links a:hover { color: var(--text); }
.topnav-links .gh {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text);
}
.topnav-links .gh:hover { border-color: var(--green); }

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 100;
}
.sidebar-section {
  padding: 0 16px;
  margin-bottom: 20px;
}
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--dim);
  padding: 8px 12px;
}
.sidebar a {
  display: block;
  padding: 6px 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.15s;
}
.sidebar a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.sidebar a.active {
  color: var(--green);
  background: var(--green-glow);
  font-weight: 600;
}

/* MAIN */
.main {
  margin-left: var(--sidebar-w);
  margin-top: 56px;
  padding: 40px 48px 80px;
  max-width: 860px;
}

/* TYPOGRAPHY */
h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
h1 .accent { color: var(--green); }
.subtitle {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 40px;
}
h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}
p { margin-bottom: 16px; color: var(--muted); }
ul, ol { margin-bottom: 16px; padding-left: 24px; color: var(--muted); }
li { margin-bottom: 6px; }
strong { color: var(--text); }
a { color: var(--green); }

/* CODE */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--card);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--green);
}
pre {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
  line-height: 1.8;
}
pre code {
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
}
.kw { color: var(--purple); }
.fn { color: var(--blue); }
.str { color: #34d399; }
.cm { color: var(--dim); }
.ty { color: var(--yellow); }
.num { color: #f97316; }

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
th {
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
td { color: var(--muted); }
td code { font-size: 12px; }

/* CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.card h4 { font-size: 15px; margin-bottom: 6px; color: var(--text); }
.card p { font-size: 13px; margin: 0; }

/* CALLOUT */
.callout {
  border-left: 3px solid var(--green);
  background: var(--green-glow);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}
.callout p { color: var(--text); margin: 0; font-size: 14px; }
.callout.warn { border-color: var(--yellow); background: rgba(245,158,11,0.1); }
.callout.danger { border-color: var(--red); background: rgba(239,68,68,0.1); }

/* BADGE */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: var(--green-glow); color: var(--green); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-blue { background: rgba(96,165,250,0.15); color: var(--blue); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 24px 20px 60px; }
}
