/* ============================================================
   AtomicHost Docs — Main Stylesheet
   Same dark theme + design tokens as atomichost.co.za and
   servers.atomichost.co.za — Bebas Neue / DM Sans / Space Mono,
   blue/purple/green brand accents.
   ============================================================ */

/* ─── SELF-HOSTED BRAND FONTS ─────────────────────────────────
   Previously loaded from fonts.googleapis.com/fonts.gstatic.com.
   Self-hosted so no visitor IP goes to Google on every page load,
   matching the other two AtomicHost properties. Latin-subset only.
   DM Sans is a genuine variable font on Google's end (confirmed by
   requesting it directly — weights 300–600 really do resolve to
   one file), so one file covers the whole range via
   `font-weight: 300 600`. ── */
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/bebas-neue-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/fonts/dm-sans-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/dm-sans-300italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-mono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-mono-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ─── DESIGN TOKENS — shared with the rest of AtomicHost ──── */
:root {
  /* Backgrounds — same bg/surface/surface2 tiers as the main site,
     extended with two more for this site's deeper nesting (sidebar
     hover states, nav search field, etc.) */
  --bg:           #0a0e1a;
  --bg-2:         #0f1525;
  --bg-3:         #141929;
  --bg-4:         #1a2036;
  --bg-hover:     #182036;

  /* Borders — blue-tinted, matching the main site's --border token */
  --border:       rgba(79, 142, 255, 0.14);
  --border-2:     rgba(79, 142, 255, 0.28);

  /* Accent — AtomicHost brand blue */
  --accent:       #4f8eff;
  --accent-2:     #7aa8ff;
  --accent-3:     #a8c4ff;
  --accent-dim:   rgba(79, 142, 255, 0.10);
  --accent-glow:  rgba(79, 142, 255, 0.18);
  --accent-glow2: rgba(79, 142, 255, 0.30);

  /* Text — matches --text/--muted on the main site, plus a dimmer
     tertiary tier this site needs for placeholder/meta text */
  --text:         #e2e8f0;
  --text-2:       #64748b;
  --text-3:       #475569;

  /* Status — success/tip use the brand's accent-green exactly;
     warning reuses the "ore-notch" amber already used elsewhere
     in the AtomicHost ecosystem for consistency */
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #4f8eff;
  --tip:          #22c55e;

  /* Discord brand — Discord's own color, kept as-is intentionally */
  --discord:      #5865f2;
  --discord-2:    #4752c4;

  /* Code */
  --code-bg:      #070a12;
  --code-text:    #c7d3ea;
  --code-border:  #171e30;

  /* Layout */
  --nav-h:        62px;
  --sidebar-w:    268px;
  --content-max:  900px;
  --radius:       8px;
  --radius-lg:    12px;
}

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ─── TOP NAV ─────────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(7, 8, 15, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-nav__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px 0 20px;
}
.top-nav__left  { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.top-nav__center{ flex: 1; max-width: 480px; margin: 0 auto; }
.top-nav__right { display: flex; align-items: center; flex-shrink: 0; }

/* Hamburger */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.hamburger:hover { background: var(--bg-3); border-color: var(--border-2); color: var(--text); }

/* Logo */
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo__img { height: 28px; width: auto; object-fit: contain; }
.nav-logo__fallback {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}
.nav-logo__badge {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent-2);
  border: 1px solid rgba(64,128,255,0.2);
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Nav search bar */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-3);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-input {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 36px 0 36px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
  user-select: none;
}
.search-input::placeholder { color: var(--text-3); }
.search-input:hover { border-color: var(--border-2); background: var(--bg-4); }
.search-kbd {
  position: absolute;
  right: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

/* Discord nav button */
.discord-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 36px;
  background: var(--discord);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.discord-nav-btn:hover { background: var(--discord-2); text-decoration: none; transform: translateY(-1px); }
.discord-nav-btn:active { transform: translateY(0); }

/* ─── LAYOUT ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
}

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar__inner { padding: 20px 0 40px; }
.sidebar__nav   { padding: 0; }
.sidebar__divider {
  height: 1px;
  background: var(--border);
  margin: 10px 16px;
}

/* Home link */
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  margin: 0 8px 4px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-home-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.sidebar-home-link.is-active { background: var(--accent-dim); color: var(--accent-2); }
.sidebar-home-link svg { flex-shrink: 0; opacity: 0.7; }

/* Nav tree */
.nav-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-tree--nested { padding-left: 8px; }

/* Folder button */
.nav-folder {
  display: flex;
  align-items: center;
  gap: 7px;
  width: calc(100% - 16px);
  margin: 1px 8px;
  padding: 7px 8px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}
.nav-folder:hover { background: var(--bg-hover); color: var(--text); }
.nav-folder .chevron {
  flex-shrink: 0;
  transition: transform 0.18s ease;
  opacity: 0.5;
}
.nav-folder.is-open .chevron { transform: rotate(90deg); }
.nav-folder.is-open { color: var(--text); }

/* Subtree */
.nav-subtree {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.nav-subtree.is-open { max-height: 2000px; }

/* Page links */
.nav-link {
  display: block;
  padding: 6px 12px 6px 28px;
  margin: 1px 8px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  line-height: 1.4;
  border-left: 2px solid transparent;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; border-left-color: var(--border-2); }
.nav-link.is-active {
  background: var(--accent-dim);
  color: var(--accent-2);
  font-weight: 500;
  border-left-color: var(--accent);
}

/* Sidebar backdrop (mobile overlay) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 49;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.is-visible { display: block; }

/* ─── MAIN CONTENT ────────────────────────────────────────── */
.content {
  min-height: calc(100vh - var(--nav-h));
  background: var(--bg);
}

/* ─── HOME PAGE ───────────────────────────────────────────── */
.home-page { max-width: 900px; margin: 0 auto; padding: 60px 40px 80px; }

.home-hero {
  text-align: center;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--border);
}
.home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--success);
  background: rgba(15, 217, 122, 0.08);
  border: 1px solid rgba(15, 217, 122, 0.2);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 24px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.home-hero__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 16px;
}
.home-hero__sub {
  font-size: 16px;
  color: var(--text-2);
  max-width: 540px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* Home search input (just triggers the modal) */
.home-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.home-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: flex;
}
.home-search-input {
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 20px 0 48px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text-3);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  text-align: left;
  letter-spacing: 0;
}
.home-search-input:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Category section */
.home-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 48px 0 18px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.category-card:hover {
  background: var(--bg-3);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 8px 24px rgba(0,0,0,0.3);
  transform: translateY(-2px);
  text-decoration: none;
}
.category-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--accent-dim);
  border: 1px solid rgba(64,128,255,0.15);
  border-radius: var(--radius);
  color: var(--accent-2);
  flex-shrink: 0;
}
.category-card__body { flex: 1; min-width: 0; }
.category-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-card__count { font-size: 12px; color: var(--text-3); }
.category-card__arrow { color: var(--text-3); flex-shrink: 0; transition: color 0.15s, transform 0.15s; }
.category-card:hover .category-card__arrow { color: var(--accent-2); transform: translateX(3px); }

/* Home Discord banner */
.home-discord {
  margin-top: 52px;
  background: linear-gradient(135deg, rgba(88,101,242,0.12) 0%, rgba(64,128,255,0.08) 100%);
  border: 1px solid rgba(88,101,242,0.25);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}
.home-discord__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.home-discord__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px; font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.home-discord__text { font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ─── DOC PAGE ────────────────────────────────────────────── */
.doc-page { max-width: var(--content-max); margin: 0 auto; padding: 36px 44px 80px; }

/* Breadcrumbs */
.breadcrumb { margin-bottom: 28px; }
.breadcrumb__list { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; list-style: none; padding: 0; }
.breadcrumb__item { display: flex; align-items: center; gap: 2px; }
.breadcrumb__link { font-size: 13px; color: var(--text-3); text-decoration: none; transition: color 0.12s; }
.breadcrumb__link:hover { color: var(--text-2); }
.breadcrumb__sep { color: var(--text-3); display: flex; align-items: center; }
.breadcrumb__item--active { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* Last updated */
.doc-updated { margin-top: 32px; font-size: 12px; color: var(--text-3); }

/* ─── MARKDOWN CONTENT ────────────────────────────────────── */
.doc-article { line-height: 1.75; }

.doc-article h1, .doc-article h2, .doc-article h3,
.doc-article h4, .doc-article h5, .doc-article h6 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text);
  position: relative;
}
.doc-article h1 { font-size: 2.1em;  margin: 0 0 28px;     padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.doc-article h2 { font-size: 1.5em;  margin: 44px 0 18px; padding-top: 4px; }
.doc-article h3 { font-size: 1.2em;  margin: 32px 0 14px; }
.doc-article h4 { font-size: 1.05em; margin: 24px 0 12px; }
.doc-article h5, .doc-article h6 { font-size: 0.95em; margin: 20px 0 10px; color: var(--text-2); }

/* Heading anchor links — parser.js adds these directly inside h1–h6,
   there's no wrapping .doc-heading element, so the hover trigger has
   to target the heading tags themselves. */
.anchor-link {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  color: var(--text-3);
  text-decoration: none;
  opacity: 0;
  vertical-align: middle;
  transition: opacity 0.15s, color 0.15s;
}
.doc-article :is(h1, h2, h3, h4, h5, h6):hover .anchor-link { opacity: 1; }
.anchor-link:hover { color: var(--accent); }

.doc-article p  { margin: 0 0 18px; }
.doc-article ul, .doc-article ol { margin: 0 0 18px; padding-left: 28px; }
.doc-article li { margin-bottom: 6px; }
.doc-article li > ul, .doc-article li > ol { margin-top: 6px; margin-bottom: 0; }
.doc-article hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* Links */
.doc-article a { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(102,153,255,0.4); text-underline-offset: 2px; }
.doc-article a:hover { color: var(--accent-3); text-decoration-color: var(--accent-2); }

/* Inline code */
.doc-article :not(pre) > code {
  font-family: 'Space Mono', 'Cascadia Code', monospace;
  font-size: 0.855em;
  background: var(--code-bg);
  color: var(--accent-3);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--code-border);
}

/* Blockquote — admonitions never reach here as <blockquote>; parser.js
   replaces the whole element with an .admonition <div> before this
   selector would ever apply, so no exclusion class is needed. */
.doc-article blockquote {
  margin: 24px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-2);
}
.doc-article blockquote p:last-child { margin-bottom: 0; }

/* ─── TABLES ──────────────────────────────────────────────── */
/* parser.js wraps every table in this div so wide tables scroll
   instead of overflowing the content column on mobile. */
.table-wrapper { overflow-x: auto; margin: 24px 0; }
.doc-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.doc-article thead { background: var(--bg-3); }
.doc-article thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.doc-article tbody tr { border-bottom: 1px solid var(--border); }
.doc-article tbody tr:last-child { border-bottom: none; }
.doc-article tbody tr:nth-child(odd)  { background: var(--bg);   }
.doc-article tbody tr:nth-child(even) { background: var(--bg-2); }
.doc-article tbody tr:hover { background: var(--bg-hover); }
.doc-article tbody td { padding: 10px 16px; color: var(--text); }

/* ─── CODE BLOCKS ─────────────────────────────────────────── */
.code-block {
  margin: 24px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.code-block pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.7;
}
.code-block pre code {
  font-family: 'Space Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: inherit;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--code-text);
}

/* Copy button */
.copy-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.copy-btn:hover { background: var(--bg-4); color: var(--text-2); border-color: var(--border-2); }
.copy-btn.copied { color: var(--success); border-color: rgba(15,217,122,0.4); background: rgba(15,217,122,0.06); }

/* ─── HIGHLIGHT.JS THEME (One Dark / AtomicHost) ──────────── */
.hljs            { color: #abb2bf; }
.hljs-comment,
.hljs-quote      { color: #5c6370; font-style: italic; }
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in   { color: #c678dd; }
.hljs-string,
.hljs-attr       { color: #98c379; }
.hljs-number,
.hljs-literal    { color: #d19a66; }
.hljs-title,
.hljs-function   { color: #61afef; }
.hljs-type,
.hljs-class      { color: #e5c07b; }
.hljs-variable,
.hljs-name       { color: #e06c75; }
.hljs-meta       { color: #7f848e; }
.hljs-tag        { color: #e06c75; }
.hljs-selector-id,
.hljs-selector-class { color: #61afef; }
.hljs-params     { color: #abb2bf; }
.hljs-regexp     { color: #56b6c2; }
.hljs-symbol     { color: #56b6c2; }
.hljs-addition   { background: rgba(152,195,121,0.12); color: #98c379; }
.hljs-deletion   { background: rgba(224,108,117,0.12); color: #e06c75; }
.hljs-emphasis   { font-style: italic; }
.hljs-strong     { font-weight: 700; }

/* ─── ADMONITIONS ─────────────────────────────────────────── */
/* Class names here match what parser.js's processAdmonitions()
   actually emits: .admonition.admonition-{note|info|tip|warning|danger},
   .admonition-title, .admonition-body — not the old .callout* names
   these rules used to (mistakenly) target. */
.admonition {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  border-left-width: 4px;
  font-size: 14px;
}
.admonition p:last-child { margin-bottom: 0; }
.admonition-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.admonition-body { color: var(--text-2); line-height: 1.6; }

.admonition-note,
.admonition-info    { background: var(--accent-dim); border-color: rgba(79,142,255,0.35); }
.admonition-note .admonition-title,
.admonition-info .admonition-title { color: var(--accent-2); }
.admonition-tip      { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.35); }
.admonition-tip .admonition-title { color: #4ade80; }
.admonition-warning   { background: rgba(245,158,11,0.07); border-color: rgba(245,158,11,0.4); }
.admonition-warning .admonition-title { color: #fbbf24; }
.admonition-danger    { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.45); }
.admonition-danger .admonition-title { color: #f87171; }

/* ─── DISCORD CTAs ────────────────────────────────────────── */
/* Inline {{DISCORD}} block — class names match parser.js's
   DISCORD_INLINE_BANNER template exactly (discord-inline-*), not the
   discord-cta--inline name these rules used to (mistakenly) target. */
.discord-inline-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 32px 0;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(88,101,242,0.10) 0%, rgba(79,142,255,0.06) 100%);
  border: 1px solid rgba(88,101,242,0.28);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}
.discord-inline-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  background: rgba(88,101,242,0.15);
  border-radius: var(--radius);
  color: #818cf8;
  flex-shrink: 0;
}
.discord-inline-text { flex: 1; min-width: 200px; }
.discord-inline-text strong { font-size: 15px; font-weight: 600; color: var(--text); display: block; margin-bottom: 5px; }
.discord-inline-text p { font-size: 13.5px; color: var(--text-2); line-height: 1.5; margin: 0; }
.discord-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--discord);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.discord-inline-btn:hover {
  background: var(--discord-2);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88,101,242,0.3);
}

.discord-cta__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  background: rgba(88,101,242,0.15);
  border-radius: var(--radius);
  color: #818cf8;
  flex-shrink: 0;
}
.discord-cta__icon--lg { width: 42px; height: 42px; }
.discord-cta__body { flex: 1; min-width: 200px; }
.discord-cta__heading { font-size: 15px; font-weight: 600; color: var(--text); display: block; margin-bottom: 5px; }
.discord-cta__text { font-size: 13.5px; color: var(--text-2); line-height: 1.5; margin: 0; }

/* Footer dead-end CTA */
.discord-cta--footer {
  margin: 48px 0 0;
  padding: 26px 28px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.discord-cta--footer .discord-cta__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.discord-cta--footer .discord-cta__left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

/* Shared CTA button */
.discord-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--discord);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.discord-cta__btn:hover {
  background: var(--discord-2);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88,101,242,0.3);
}
.discord-cta__btn--lg {
  padding: 11px 22px;
  font-size: 14.5px;
}

/* ─── SEARCH OVERLAY ──────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.search-overlay.is-open { display: flex; }
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
}
.search-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 16px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.search-modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.search-modal__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--text);
}
.search-modal__input::placeholder { color: var(--text-3); }
.search-modal__close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
  color: var(--text-3);
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}
.search-modal__close:hover { background: var(--bg-4); }
.search-results { list-style: none; max-height: 420px; overflow-y: auto; padding: 8px; }
.search-result {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result:hover, .search-result.is-selected { background: var(--bg-hover); }
.search-result__title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.search-result__path  { font-size: 12px; color: var(--accent-2); font-family: 'Space Mono', monospace; margin-bottom: 4px; }
.search-result__excerpt { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.search-result__excerpt mark { background: rgba(64,128,255,0.25); color: var(--accent-3); border-radius: 2px; padding: 0 2px; }
.search-empty { padding: 32px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ─── ERROR PAGE ──────────────────────────────────────────── */
.error-page {
  max-width: 560px;
  margin: 80px auto;
  padding: 40px;
  text-align: center;
}
.error-page__code {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 80px;
  font-weight: 800;
  color: var(--border-2);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}
.error-page__title { font-family: 'Bebas Neue', sans-serif; font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.error-page__msg   { font-size: 15px; color: var(--text-2); margin-bottom: 28px; }
.error-page__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.error-page__btn:hover { background: var(--bg-4); border-color: var(--border-2); text-decoration: none; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .doc-page { padding: 28px 28px 60px; }
  .home-page { padding: 40px 24px 60px; }
  .discord-nav-btn span { display: none; }
  .discord-nav-btn { padding: 0 12px; }
  .top-nav__center { max-width: unset; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    height: 100vh;
    padding-top: var(--nav-h);
  }
  .sidebar.is-open { transform: translateX(0); }

  .hamburger { display: flex; }

  .content { min-height: 100vh; }

  .search-wrap { display: none; }

  .discord-nav-btn span { display: inline; }

  .doc-page { padding: 24px 18px 60px; }
  .home-page { padding: 32px 18px 60px; }

  .home-discord__inner { flex-direction: column; align-items: flex-start; }
  .discord-cta--footer .discord-cta__inner { flex-direction: column; align-items: flex-start; }
  .discord-cta--inline { flex-direction: column; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr; }
  .discord-nav-btn span { display: none; }
  .discord-nav-btn { padding: 0 12px; }
  .top-nav__inner { padding: 0 12px; }
}
