/* Quartz-style dark theme */
:root {
  --bg: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-code: #0f3460;
  --bg-nav: #12122a;
  --accent: #e94560;
  --accent-light: #f5a623;
  --text: #e0e0e0;
  --text-muted: #a0a0b0;
  --text-link: #7eb8f7;
  --border: #2a2a4a;
  --nav-width: 260px;
  --content-max: 800px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
}

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

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

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-light);
  text-decoration: none;
  display: block;
  letter-spacing: 0.5px;
}

.sidebar-tagline {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav-section {
  padding: 16px 0;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 20px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--text-link);
  border-left-color: var(--text-link);
  background: rgba(126,184,247,0.08);
}

.nav-link .nav-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
}

/* ── Mobile toggle ── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

/* ── Main content ── */
.main {
  margin-left: var(--nav-width);
  flex: 1;
  padding: 48px 60px;
  max-width: calc(var(--nav-width) + var(--content-max) + 120px);
}

.content {
  max-width: var(--content-max);
}

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

h1::after {
  content: '';
  display: block;
  height: 3px;
  width: 48px;
  background: var(--accent);
  margin-top: 12px;
  border-radius: 2px;
}

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

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-top: 28px;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
  color: var(--text);
}

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

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin: 0 0 16px 24px;
}

li {
  margin-bottom: 6px;
}

/* ── Code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-code);
  color: #a8d8f0;
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
  position: relative;
}

pre code {
  background: none;
  padding: 0;
  color: #cdd9e5;
  font-size: 0.85rem;
  line-height: 1.8;
}

/* syntax color hints */
.token-key    { color: #79b8ff; }
.token-string { color: #9ecbff; }
.token-url    { color: #85e89d; }
.token-comment{ color: #6a737d; }
.token-method { color: #f97583; }

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

th {
  background: var(--bg-secondary);
  color: var(--accent-light);
  font-weight: 600;
  padding: 10px 16px;
  text-align: left;
  border: 1px solid var(--border);
}

td {
  padding: 9px 16px;
  border: 1px solid var(--border);
  vertical-align: top;
}

tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}

/* ── Callout / Info box ── */
.callout {
  background: rgba(126,184,247,0.08);
  border-left: 4px solid var(--text-link);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  margin: 20px 0;
}

.callout p {
  margin: 0;
  font-size: 0.9rem;
}

/* ── ASCII diagram ── */
.diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #85e89d;
  overflow-x: auto;
  margin: 20px 0;
  white-space: pre;
  line-height: 1.6;
}

/* ── Next steps footer ── */
.next-steps {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.next-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  color: var(--text-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.next-link:hover {
  border-color: var(--text-link);
  background: rgba(126,184,247,0.08);
  text-decoration: none;
}

.next-link::after {
  content: '→';
}

/* ── Page header meta ── */
.page-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  margin-top: 4px;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  font-family: var(--font-mono);
  vertical-align: middle;
}
.badge-post   { background: #28a745; color: #fff; }
.badge-get    { background: #0070f3; color: #fff; }
.badge-put    { background: #f5a623; color: #000; }
.badge-delete { background: #e94560; color: #fff; }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .mobile-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  .main {
    margin-left: 0;
    padding: 48px 20px 40px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
