/* === DESIGN TOKENS === */
:root {
  /* Type Scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Fonts */
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-display: 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --sidebar-width: 280px;
  --content-max: 860px;
  --header-height: 56px;
}

/* === LIGHT MODE (default) === */
:root,
[data-theme='light'] {
  --color-bg: #ffffff;
  --color-surface: #f8f9fb;
  --color-surface-2: #f1f3f6;
  --color-surface-offset: #eef0f4;
  --color-border: #e2e5ea;
  --color-divider: #eaecf0;

  --color-text: #1a1a2e;
  --color-text-muted: #5c5f6e;
  --color-text-faint: #9ca0ad;

  --color-primary: #6C3FC5;
  --color-primary-hover: #5a32a8;
  --color-primary-active: #4b2990;
  --color-primary-light: #f0ebfa;
  --color-primary-lighter: #f7f4fd;

  --color-code-bg: #282c34;
  --color-code-text: #abb2bf;
  --color-inline-code-bg: #f0ebfa;
  --color-inline-code-text: #6C3FC5;

  --color-success: #16a34a;
  --color-warning: #d97706;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
}

/* === DARK MODE === */
[data-theme='dark'] {
  --color-bg: #0f1117;
  --color-surface: #161822;
  --color-surface-2: #1c1e2c;
  --color-surface-offset: #1a1c28;
  --color-border: #2a2d3a;
  --color-divider: #222435;

  --color-text: #e1e2e8;
  --color-text-muted: #9395a5;
  --color-text-faint: #5d5f70;

  --color-primary: #9b7ae0;
  --color-primary-hover: #b194f0;
  --color-primary-active: #c5aef8;
  --color-primary-light: #1e1a30;
  --color-primary-lighter: #16142a;

  --color-code-bg: #1a1c2a;
  --color-code-text: #abb2bf;
  --color-inline-code-bg: #1e1a30;
  --color-inline-code-text: #b194f0;

  --color-success: #4ade80;
  --color-warning: #fbbf24;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1117;
    --color-surface: #161822;
    --color-surface-2: #1c1e2c;
    --color-surface-offset: #1a1c28;
    --color-border: #2a2d3a;
    --color-divider: #222435;
    --color-text: #e1e2e8;
    --color-text-muted: #9395a5;
    --color-text-faint: #5d5f70;
    --color-primary: #9b7ae0;
    --color-primary-hover: #b194f0;
    --color-primary-active: #c5aef8;
    --color-primary-light: #1e1a30;
    --color-primary-lighter: #16142a;
    --color-code-bg: #1a1c2a;
    --color-code-text: #abb2bf;
    --color-inline-code-bg: #1e1a30;
    --color-inline-code-text: #b194f0;
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
  }
}

/* === BASE RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-8));
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.2; }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

a, button, [role='button'], input, textarea, select {
  transition: color var(--transition-interactive), background var(--transition-interactive), border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: rgba(108, 63, 197, 0.2);
  color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === LAYOUT SHELL === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo .logo-icon svg {
  width: 16px;
  height: 16px;
}

.header-version {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 400;
  background: var(--color-surface);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.header-search {
  flex: 1;
  max-width: 400px;
  margin-left: var(--space-8);
}

.header-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  padding-left: var(--space-10);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
}

.header-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 63, 197, 0.1);
}

.header-search-input::placeholder {
  color: var(--color-text-faint);
}

.header-search {
  position: relative;
}

.header-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

.header-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.header-link:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
}

.mobile-menu-btn:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  padding: var(--space-6) 0;
  z-index: 90;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.sidebar-section { margin-bottom: var(--space-6); }

.sidebar-heading {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  padding: 0 var(--space-6) var(--space-2);
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
  display: block;
  padding: var(--space-1) var(--space-6);
  padding-left: var(--space-8);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  line-height: 1.7;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.sidebar-nav a.active {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  background: var(--color-primary-lighter);
  font-weight: 500;
}

/* === MAIN CONTENT === */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100dvh - var(--header-height));
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  max-width: var(--content-max);
  width: 100%;
  padding: var(--space-10) var(--space-8);
  flex: 1;
}

/* === CONTENT TYPOGRAPHY === */
.content-wrapper h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.content-wrapper h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
}

.content-wrapper h3 {
  font-size: calc(var(--text-base) * 1.05);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.content-wrapper h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.content-wrapper p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
  line-height: 1.75;
}

.content-wrapper ul, .content-wrapper ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.content-wrapper li {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  line-height: 1.7;
}

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

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

.content-wrapper strong {
  color: var(--color-text);
  font-weight: 600;
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-faint);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

/* Inline code */
.content-wrapper code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-inline-code-bg);
  color: var(--color-inline-code-text);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* === CODE BLOCKS === */
.code-block-wrapper {
  position: relative;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.code-block-lang {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(171,178,191,0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(171,178,191,0.5);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.copy-btn:hover {
  color: rgba(171,178,191,0.9);
  background: rgba(255,255,255,0.05);
}

.copy-btn.copied {
  color: var(--color-success);
}

.code-block-wrapper pre {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.code-block-wrapper pre::-webkit-scrollbar { height: 4px; }
.code-block-wrapper pre::-webkit-scrollbar-track { background: transparent; }
.code-block-wrapper pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.code-block-wrapper code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-code-text);
  background: none;
  padding: 0;
}

/* === ONE DARK SYNTAX THEME === */
.token-keyword { color: #c678dd; }
.token-string { color: #98c379; }
.token-number { color: #d19a66; }
.token-comment { color: #5c6370; font-style: italic; }
.token-function { color: #61afef; }
.token-class { color: #e5c07b; }
.token-operator { color: #56b6c2; }
.token-decorator { color: #e06c75; }
.token-builtin { color: #e5c07b; }
.token-param { color: #e06c75; }
.token-bool { color: #d19a66; }
.token-self { color: #e06c75; }
.token-property { color: #e06c75; }
.token-punctuation { color: #abb2bf; }

/* Bash syntax */
.token-command { color: #61afef; }
.token-flag { color: #56b6c2; }
.token-bash-comment { color: #5c6370; font-style: italic; }

/* === TABLES === */
.content-wrapper table {
  margin-bottom: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.content-wrapper thead {
  background: var(--color-surface);
}

.content-wrapper th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.content-wrapper td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-divider);
  vertical-align: top;
}

.content-wrapper tbody tr:last-child td {
  border-bottom: none;
}

.content-wrapper tbody tr:hover {
  background: var(--color-surface);
}

/* === CALLOUT BOXES === */
.callout {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  border-left: 3px solid;
}

.callout p { margin-bottom: var(--space-2); }
.callout p:last-child { margin-bottom: 0; }

.callout-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.callout-info {
  background: var(--color-primary-lighter);
  border-color: var(--color-primary);
}
.callout-info .callout-title { color: var(--color-primary); }
.callout-info p { color: var(--color-text-muted); }

.callout-warning {
  background: rgba(217,119,6,0.06);
  border-color: var(--color-warning);
}
.callout-warning .callout-title { color: var(--color-warning); }

.callout-tip {
  background: rgba(22,163,74,0.06);
  border-color: var(--color-success);
}
.callout-tip .callout-title { color: var(--color-success); }

/* === HERO (index only) === */
.hero {
  padding: var(--space-16) var(--space-8) var(--space-12);
  text-align: center;
  background: linear-gradient(180deg, var(--color-primary-lighter) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-divider);
}

.hero-logo {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.04em;
  margin-bottom: var(--space-3);
}

.hero-tagline {
  font-size: var(--text-lg);
  color: var(--color-text);
  font-weight: 500;
  margin-bottom: var(--space-3);
}

.hero-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-code-bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
}

.hero-install code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-code-text);
}

.hero-install .copy-btn {
  color: rgba(171,178,191,0.5);
}

.hero-install .copy-btn:hover {
  color: rgba(171,178,191,0.9);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.hero-badge a {
  display: inline-block;
}

.hero-badge img {
  display: inline-block;
  height: 22px;
}

.hero-buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-interactive);
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* === FEATURES GRID === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.feature-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-interactive);
}

.feature-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--color-primary);
  font-size: 1.2rem;
}

.feature-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.feature-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* === FRAMEWORK LOGOS === */
.frameworks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-8);
  padding: var(--space-6) 0;
}

.framework-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-8) var(--space-8);
  text-align: center;
}

.footer-content {
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-credit {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer-credit a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-credit a:hover {
  color: var(--color-primary);
}

/* === PREV/NEXT NAV === */
.page-nav {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.page-nav-item {
  flex: 1;
  text-decoration: none;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-interactive);
}

.page-nav-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-lighter);
}

.page-nav-item.next { text-align: right; }

.page-nav-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.page-nav-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
}

/* === EDIT ON GITHUB === */
.edit-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-decoration: none;
  margin-top: var(--space-8);
}

.edit-link:hover { color: var(--color-primary); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 300ms ease;
    z-index: 200;
    background: var(--color-bg);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .mobile-menu-btn { display: flex; }

  .main-content { margin-left: 0; }

  .header-search { display: none; }

  .hero {
    padding: var(--space-10) var(--space-4) var(--space-8);
  }

  .hero-logo { font-size: var(--text-xl); }

  .content-wrapper {
    padding: var(--space-6) var(--space-4);
  }

  .page-nav {
    flex-direction: column;
  }

  .page-nav-item.next { text-align: left; }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .hero-install {
    flex-direction: row;
    font-size: var(--text-xs);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 260px;
  }
}

/* === STATE DIAGRAM === */
.state-diagram {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}

.state-diagram pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
}

/* === MISC === */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-divider);
  margin: var(--space-8) 0;
}

/* Badge styling for params */
.badge {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge-type {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.badge-default {
  background: var(--color-surface-2);
  color: var(--color-text-faint);
}

/* Config reference table */
.config-table td:first-child code {
  white-space: nowrap;
}

/* Anchor heading links */
.heading-anchor {
  color: var(--color-text-faint);
  text-decoration: none;
  margin-left: var(--space-2);
  opacity: 0;
  transition: opacity var(--transition-interactive);
}

h2:hover .heading-anchor,
h3:hover .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--color-primary);
}
