  /* ── Reset & Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
 
:root {
  --nav-width: 280px;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --accent-mid: #bfdbfe;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --tip-bg: #f0fdf4;
  --tip-border: #86efac;
  --tip-text: #166534;
  --note-bg: #fefce8;
  --note-border: #fde047;
  --note-text: #854d0e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 0.75rem;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-heading: 'Fraunces', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;
}
 
html {
  scroll-behavior: smooth;
  font-size: 16px;
}
 
body {
  font-family: var(--font-body);
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
 
/* ── Sidebar Navigation ───────────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
 
#navbar header {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0 0.5rem 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
 
.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--accent-mid);
  padding: 0.2em 0.55em;
  border-radius: 0.35rem;
  width: fit-content;
}
 
.nav-subtitle {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-top: 0.4rem;
}
 
.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border-left: 2px solid transparent;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.15s ease;
  position: relative;
}
 
.nav-link:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent-mid);
  transform: translateX(2px);
}
 
.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 600;
}
 
/* ── Hamburger Button ─────────────────────────────────────────── */
.nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 300;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  transition: box-shadow 0.2s ease;
}
 
.nav-toggle:hover {
  box-shadow: var(--shadow-md);
}
 
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
 
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
 
/* ── Overlay ──────────────────────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}
 
/* ── Main Content ─────────────────────────────────────────────── */
#main-doc {
  margin-left: var(--nav-width);
  padding: 3rem 3rem 3rem 2.5rem;
  max-width: calc(var(--nav-width) + 860px);
}
 
/* ── Sections ─────────────────────────────────────────────────── */
.main-section {
  margin-bottom: 4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
 
.main-section:hover {
  box-shadow: var(--shadow-md);
}
 
.main-section + .main-section {
  position: relative;
}
 
.main-section header {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.25;
}
 
/* ── Paragraphs ───────────────────────────────────────────────── */
.main-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: #334155;
  margin-bottom: 1rem;
  max-width: 68ch;
}
 
/* ── Lists ────────────────────────────────────────────────────── */
.main-section ul {
  padding-left: 1.25rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
 
.main-section ul li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #334155;
  padding-left: 0.25rem;
}
 
.main-section ul li::marker {
  color: var(--accent);
}
 
/* ── Inline Code ──────────────────────────────────────────────── */
code {
  font-family: var(--font-mono);
  font-size: 0.825em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.15em 0.4em;
  border-radius: 0.3rem;
  border: 1px solid #e2e8f0;
}
 
/* ── Code Blocks ──────────────────────────────────────────────── */
.main-section pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1.25rem 1.5rem;
  border-radius: 0.625rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  font-size: 0.875rem;
  line-height: 1.7;
  position: relative;
}
 
.main-section pre::before {
  content: '';
  display: block;
  position: absolute;
  top: 0.7rem;
  left: 1rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0.875rem 0 0 #f59e0b, 1.75rem 0 0 #22c55e;
  pointer-events: none;
}
 
.main-section pre code {
  font-family: var(--font-mono);
  font-size: 1em;
  background: none;
  padding: 0;
  border: none;
  color: inherit;
}
 
/* Syntax highlighting */
.sel  { color: #7dd3fc; }  /* selectors — sky blue */
.prop { color: #86efac; }  /* properties — green */
.val  { color: #fca5a5; }  /* values — rose */
.str  { color: #fcd34d; }  /* strings — amber */
.attr { color: #c4b5fd; }  /* attributes — purple */
.tag  { color: #fb923c; }  /* html tags — orange */
.cm   { color: #64748b; font-style: italic; } /* comments — slate */
 
/* ── Callouts (Tip / Note) ────────────────────────────────────── */
.callout {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  border-left: 3px solid;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  line-height: 1.65;
}
 
.callout-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
 
.callout.tip {
  background: var(--tip-bg);
  border-color: var(--tip-border);
  color: var(--tip-text);
}
 
.callout.note {
  background: var(--note-bg);
  border-color: var(--note-border);
  color: var(--note-text);
}
 
.callout code {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.1);
}
 
/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }
 
  .nav-overlay {
    display: block;
  }
 
  .nav-overlay.visible {
    opacity: 1;
  }
 
  #navbar {
    transform: translateX(calc(-1 * var(--nav-width) - 10px));
    box-shadow: var(--shadow-md);
  }
 
  #navbar.open {
    transform: translateX(0);
  }
 
  #main-doc {
    margin-left: 0;
    padding: 4.5rem 1.25rem 2rem;
    max-width: 100%;
  }
 
  .main-section {
    padding: 1.25rem 1.25rem;
    border-radius: 0.625rem;
  }
 
  .main-section header {
    font-size: 1.4rem;
  }
 
  .main-section p {
    max-width: 100%;
  }
}
 
@media (max-width: 480px) {
  .main-section pre {
    padding: 1rem 1rem 1rem;
    font-size: 0.8rem;
  }
 
  .main-section pre::before {
    display: none;
  }
}
