/* ============================================================
   VMSC Documentation — Dark Neon Theme
   Inspired by VMSC app aesthetics + PiShock docs layout
   ============================================================ */

/* ----- CSS Variables --------------------------------------- */
:root {
  --bg-root: #0b0b16;
  --bg-surface: #10101e;
  --bg-elevated: #161628;
  --bg-sidebar: #0d0d1a;
  --bg-header: rgba(11, 11, 22, 0.92);
  --bg-hover: rgba(139, 92, 246, 0.06);
  --bg-active: rgba(139, 92, 246, 0.10);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(139, 92, 246, 0.25);
  --border-active: #8b5cf6;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;
  --text-link: #8b5cf6;
  --text-link-hover: #c4b5fd;

  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.15);
  --pink: #ec4899;
  --pink-dim: rgba(236, 72, 153, 0.15);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.15);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;

  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;

  --header-h: 56px;
  --sidebar-w: 272px;
  --toc-w: 220px;
  --content-max: 880px;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ----- Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-root);
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.4); }
::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: var(--bg-header);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: var(--sidebar-w);
  padding-right: 16px;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }

.logo-icon {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #a855f7, #c084fc);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: 8px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.logo-dim {
  font-weight: 400;
  color: var(--text-muted);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 480px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 8px 80px 8px 36px;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  background: rgba(255, 255, 255, 0.06);
}
.search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  pointer-events: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1001;
}
.search-dropdown.visible { display: block; animation: slideDown 0.15s ease; }

.search-result {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--bg-hover); text-decoration: none; }
.search-result-title { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
.search-result-category { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.search-result-snippet { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }
.search-result-snippet mark { background: rgba(139, 92, 246, 0.3); color: var(--text-primary); border-radius: 2px; padding: 0 2px; }
.search-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.header-btn:hover { color: var(--text-primary); background: var(--bg-hover); border-color: var(--border-hover); text-decoration: none; }

.version-pill {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-dim);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  white-space: nowrap;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  padding: 12px 0 24px;
  transition: transform 0.25s ease;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.15); border-radius: 2px; }

.sidebar-category { margin-bottom: 2px; }

.sidebar-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s;
}
.sidebar-category-header:hover { color: var(--text-secondary); }
.sidebar-category-header svg:first-child { color: var(--text-muted); flex-shrink: 0; opacity: 0.7; }

.chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
  opacity: 0.5;
  flex-shrink: 0;
}
.sidebar-category.expanded .chevron { transform: rotate(90deg); }

.sidebar-links {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.sidebar-category.expanded .sidebar-links { max-height: 500px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 42px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.sidebar-link.active {
  color: var(--text-accent);
  background: var(--bg-active);
  border-left-color: var(--purple);
  font-weight: 500;
}

.sidebar-standalone {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-standalone .sidebar-link {
  padding-left: 16px;
  gap: 8px;
}
.sidebar-standalone .sidebar-link svg { opacity: 0.6; flex-shrink: 0; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 899;
}
.sidebar-backdrop.visible { display: block; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  animation: fadeIn 0.3s ease;
}

.content-wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 48px 80px;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Hide sidebar on landing, make content full-width */
body.is-landing .sidebar,
body.is-landing .sidebar-backdrop { display: none; }
body.is-landing .main-content { margin-left: 0; }
body.is-landing .content-wrapper { max-width: 1080px; }
body.is-landing .header-left { min-width: auto; }

.hero {
  text-align: center;
  padding: 72px 0 56px;
}

.hero-badge {
  display: inline-block;
  padding: 5px 16px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple);
  background: var(--purple-dim);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  background: none;
  -webkit-text-fill-color: unset;
}

.gradient-text {
  background: linear-gradient(135deg, #8b5cf6, #a855f7, #c084fc, #e879f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-accent);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-link-hover);
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 16px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.2s ease;
}
.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.08);
}

.feature-card-icon {
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 16px;
}
.feature-card-icon.purple { background: var(--purple-dim); color: var(--purple); }
.feature-card-icon.pink { background: var(--pink-dim); color: var(--pink); }
.feature-card-icon.blue { background: var(--blue-dim); color: var(--blue); }
.feature-card-icon.green { background: var(--green-dim); color: var(--green); }
.feature-card-icon.orange { background: var(--orange-dim); color: var(--orange); }
.feature-card-icon.cyan { background: var(--cyan-dim); color: var(--cyan); }

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  margin-top: 0;
}
.feature-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ============================================================
   TYPOGRAPHY (doc pages)
   ============================================================ */
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  background: none;
  -webkit-text-fill-color: unset;
}

.subtitle, .doc-page > p:first-of-type {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 24px;
  margin-bottom: 8px;
}

p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

a { color: var(--text-link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--text-link-hover); text-decoration: underline; }

strong { color: var(--text-primary); font-weight: 600; }

ul, ol { margin-bottom: 16px; padding-left: 24px; }
ul li, ol li { line-height: 1.7; color: var(--text-secondary); margin-bottom: 4px; font-size: 0.95rem; }
ul li::marker { color: var(--purple); }
ol li::marker { color: var(--text-accent); }

blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--purple);
  background: var(--purple-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
blockquote p { margin-bottom: 0; color: var(--text-secondary); }

hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* ============================================================
   CODE
   ============================================================ */
pre[class*="language-"],
pre {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px !important;
  margin: 16px 0 24px !important;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.7;
  position: relative;
}

code[class*="language-"],
pre code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  background: transparent !important;
  color: var(--text-primary);
  text-shadow: none !important;
}

code:not([class*="language-"]):not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 2px 7px;
  background: var(--purple-dim);
  color: var(--text-accent);
  border-radius: 4px;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  z-index: 5;
}
.copy-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }
.copy-btn.copied { color: var(--green); border-color: rgba(34, 197, 94, 0.3); }

/* Prism token colors — VMSC neon palette */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #64748b; }
.token.punctuation { color: #94a3b8; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #c4b5fd; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #4ade80; }
.token.operator, .token.entity, .token.url { color: #fbbf24; }
.token.atrule, .token.attr-value, .token.keyword { color: #a78bfa; }
.token.function { color: #60a5fa; }
.token.regex, .token.important, .token.variable { color: #f87171; }

/* ============================================================
   CALLOUT BOXES
   ============================================================ */
.callout {
  position: relative;
  margin: 20px 0;
  padding: 16px 18px 16px 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout::before {
  position: absolute;
  left: 16px; top: 16px;
  font-size: 1.05rem;
}
.callout-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; }
.callout p { font-size: 0.85rem; line-height: 1.65; margin-bottom: 0; }

.callout-info { border-left-color: var(--blue); }
.callout-info::before { content: "\2139\FE0F"; }
.callout-info .callout-title { color: var(--blue); }

.callout-warning { border-left-color: var(--orange); }
.callout-warning::before { content: "\26A0\FE0F"; }
.callout-warning .callout-title { color: var(--orange); }

.callout-tip { border-left-color: var(--green); }
.callout-tip::before { content: "\1F4A1"; }
.callout-tip .callout-title { color: var(--green); }

.callout-danger { border-left-color: var(--red); }
.callout-danger::before { content: "\1F6A8"; }
.callout-danger .callout-title { color: var(--red); }

/* ============================================================
   API ENDPOINT BLOCKS
   ============================================================ */
.api-endpoint {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  overflow: hidden;
}
.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}
.api-method {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 5px;
  flex-shrink: 0;
}
.api-method.get { background: var(--green-dim); color: var(--green); }
.api-method.post { background: var(--blue-dim); color: var(--blue); }
.api-method.put { background: var(--orange-dim); color: var(--orange); }
.api-method.delete { background: var(--red-dim); color: var(--red); }
.api-method.patch { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.api-path { font-family: var(--font-mono); font-size: 0.88rem; color: var(--text-primary); }
.api-endpoint-body { padding: 16px; }
.api-endpoint-body h4 {
  margin-top: 16px; margin-bottom: 8px;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.api-endpoint-body h4:first-child { margin-top: 0; }

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

.params-table { font-size: 0.84rem; }
.params-table .param-name { font-family: var(--font-mono); color: var(--text-accent); font-size: 0.8rem; }
.params-table .param-required { color: var(--red); font-size: 0.7rem; font-weight: 600; }
.params-table .param-optional { color: var(--text-muted); font-size: 0.7rem; }

/* ============================================================
   TABLE OF CONTENTS (right sidebar)
   ============================================================ */
.table-of-contents {
  position: fixed;
  right: 0;
  top: var(--header-h);
  width: var(--toc-w);
  height: calc(100vh - var(--header-h));
  padding: 24px 16px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  z-index: 50;
}
.toc-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.table-of-contents ul { list-style: none; padding: 0; margin: 0; }
.table-of-contents li { margin-bottom: 2px; }
.table-of-contents li a {
  display: block;
  padding: 4px 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}
.table-of-contents li a:hover { color: var(--text-secondary); background: var(--bg-hover); }
.table-of-contents li a.active {
  color: var(--text-accent);
  border-left-color: var(--purple);
}
.table-of-contents .toc-h3 a { padding-left: 20px; font-size: 0.75rem; }

/* Adjust main content when TOC is visible */
@media (min-width: 1280px) {
  .main-content.has-toc { margin-right: var(--toc-w); }
}

/* ============================================================
   PAGE NAVIGATION FOOTER
   ============================================================ */
.page-footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.page-nav-link {
  font-size: 0.85rem;
  color: var(--text-link);
  text-decoration: none;
  transition: color 0.15s;
}
.page-nav-link:hover { color: var(--text-link-hover); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pageSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#page-content { animation: pageSlide 0.25s ease; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 260px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .header-left { min-width: auto; padding-right: 0; }
  .table-of-contents { display: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .content-wrapper { padding: 32px 32px 60px; }
}

@media (max-width: 768px) {
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .hero { padding: 48px 0 32px; }
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1rem; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.05rem; }
  .content-wrapper { padding: 24px 20px 60px; }
  .header-btn span { display: none; }
  .search-shortcut { display: none; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .site-header { padding: 0 12px; }
  .hero-title { font-size: 1.8rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .content-wrapper { padding: 20px 16px 48px; }
  pre[class*="language-"], pre { font-size: 0.8rem; padding: 12px !important; border-radius: 6px; }
  .search-box { display: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .sidebar, .sidebar-backdrop, .table-of-contents, .copy-btn { display: none !important; }
  body { background: #fff; color: #111; }
  .main-content { margin: 0; }
  .content-wrapper { padding: 0; max-width: 100%; }
  h1, h2, h3 { color: #111; -webkit-text-fill-color: #111; background: none; }
  p, li, td { color: #333; }
  a { color: #7c3aed; text-decoration: underline; }
  pre { background: #f5f5f5 !important; border: 1px solid #ddd; }
  code:not([class*="language-"]):not(pre code) { background: #f0f0f0; color: #555; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
