/* ============================================================
   KYROS FIVEM DOCS — Dark Grey & White Documentation Theme
   ============================================================ */

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

/* ===== CSS VARIABLES ===== */
:root {
  --sidebar-width: 268px;
  --topbar-h: 54px;
  --toc-width: 240px;
  --radius: 8px;
  --trans: 0.18s ease;
  --trans-slow: 0.28s ease;
}

/* ===== DARK THEME (default) — Dark Grey & White ===== */
[data-theme="dark"] {
  --bg:            #151515;
  --bg-sidebar:    #111111;
  --bg-elevated:   #1e1e1e;
  --bg-hover:      rgba(255,255,255,0.04);
  --bg-active:     rgba(255,255,255,0.07);
  --bg-code:       #0f0f0f;
  --bg-search:     #1a1a1a;

  --text:          #f0f0f0;
  --text-muted:    #888888;
  --text-faint:    #444444;

  --accent:        #e8e8e8;
  --accent-hover:  #ffffff;
  --accent-glow:   rgba(255,255,255,0.06);

  --border:        #252525;
  --border-faint:  #1a1a1a;

  --shadow:        0 8px 40px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.4);
  --scrollbar:     #2e2e2e;

  --topbar-bg:     rgba(21,21,21,0.78);
  --topbar-ring:   rgba(255,255,255,0.04);

  --inline-code:   #d4d4d4;

  --callout-info-bg:      rgba(255,255,255,0.04);
  --callout-info-border:  rgba(255,255,255,0.12);
  --callout-warn-bg:      rgba(255,200,50,0.06);
  --callout-warn-border:  rgba(255,200,50,0.2);
  --callout-tip-bg:       rgba(100,220,120,0.05);
  --callout-tip-border:   rgba(100,220,120,0.18);
  --callout-danger-bg:    rgba(220,80,80,0.07);
  --callout-danger-border: rgba(220,80,80,0.22);
}

/* ===== LIGHT THEME — White & Dark Grey ===== */
[data-theme="light"] {
  --bg:            #f9f9f9;
  --bg-sidebar:    #ffffff;
  --bg-elevated:   #f0f0f0;
  --bg-hover:      rgba(0,0,0,0.04);
  --bg-active:     rgba(0,0,0,0.06);
  --bg-code:       #ebebeb;
  --bg-search:     #ffffff;

  --text:          #111111;
  --text-muted:    #666666;
  --text-faint:    #aaaaaa;

  --accent:        #111111;
  --accent-hover:  #000000;
  --accent-glow:   rgba(0,0,0,0.04);

  --border:        #e0e0e0;
  --border-faint:  #ebebeb;

  --shadow:        0 8px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.08);
  --scrollbar:     #cccccc;

  --topbar-bg:     rgba(249,249,249,0.82);
  --topbar-ring:   rgba(0,0,0,0.03);

  --inline-code:   #333333;

  --callout-info-bg:      rgba(0,0,0,0.03);
  --callout-info-border:  rgba(0,0,0,0.1);
  --callout-warn-bg:      rgba(180,120,0,0.06);
  --callout-warn-border:  rgba(180,120,0,0.18);
  --callout-tip-bg:       rgba(30,160,60,0.05);
  --callout-tip-border:   rgba(30,160,60,0.16);
  --callout-danger-bg:    rgba(180,40,40,0.05);
  --callout-danger-border: rgba(180,40,40,0.16);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background var(--trans), color var(--trans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ===== LAYOUT SHELL ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--trans-slow), background var(--trans);
}

.layout {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--trans-slow);
}

/* ===== SIDEBAR TOP ===== */
.sidebar-top {
  position: relative;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-top::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--border-faint) 20%,
    var(--border) 50%,
    var(--border-faint) 80%,
    transparent 100%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius);
  transition: background var(--trans);
  margin: -7px -8px 14px;
  text-decoration: none;
}
.brand:hover { background: var(--bg-hover); text-decoration: none; }


/* Logo image in sidebar */
.brand-logo {
  max-width: 150px; max-height: 50px;
  width: auto; height: auto;
  display: block; object-fit: contain;
}
[data-theme="light"] .brand-logo { filter: brightness(0.1); }
.brand-name {
  font-size: 14px; font-weight: 700;
  color: var(--text); line-height: 1.2;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px; color: var(--text-muted);
  line-height: 1.2; font-weight: 400;
}

/* Search button */
.sidebar-search-btn {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px; font-family: inherit;
  cursor: pointer;
  transition: all var(--trans);
  text-align: left;
}
.sidebar-search-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--bg-hover);
}
.sidebar-search-btn span { flex: 1; }

.search-kbd {
  font-size: 10px; padding: 1px 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-faint); font-family: inherit; line-height: 1.6;
}

/* ===== SIDEBAR NAV ===== */
.sidebar-nav {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 10px 8px 8px;
}

/* Standalone nav item */
.nav-standalone {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13.5px; color: var(--text-muted);
  cursor: pointer; text-decoration: none;
  width: 100%; text-align: left; font-family: inherit;
  border: none; background: none;
  transition: all var(--trans); margin-bottom: 2px;
}
.nav-standalone:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.nav-standalone.active {
  color: var(--text); background: var(--bg-active);
  font-weight: 500;
}
.nav-icon { font-size: 14px; flex-shrink: 0; line-height: 1; }

/* Section groups */
.nav-section { margin-bottom: 2px; }

.nav-section-btn {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 6px 10px;
  background: none; border: none; font-family: inherit;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-faint);
  cursor: pointer; border-radius: var(--radius);
  transition: all var(--trans); text-align: left; user-select: none;
}
.nav-section-btn:hover { color: var(--text-muted); background: var(--bg-hover); }
.nav-section-icon { font-size: 13px; }

.nav-chevron {
  margin-left: auto; transition: transform 0.2s ease;
  flex-shrink: 0; color: var(--text-faint);
}
.nav-section.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-section.collapsed .nav-section-items { display: none; }

.nav-section-items {
  padding: 2px 0 6px;
  display: flex; flex-direction: column; gap: 1px;
}

/* Nav child items */
.nav-item {
  display: flex; align-items: center;
  padding: 5px 10px 5px 22px;
  font-size: 13.5px; color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  width: 100%; text-align: left; font-family: inherit;
  border: none; background: none;
  transition: all var(--trans); position: relative;
}
.nav-item::before {
  content: '';
  position: absolute; left: 11px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-faint); transition: background var(--trans);
}
.nav-item:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.nav-item:hover::before { background: var(--text-muted); }
.nav-item.active { color: var(--text); background: var(--bg-active); font-weight: 500; }
.nav-item.active::before { background: var(--text); }

/* ===== SIDEBAR BOTTOM ===== */
.sidebar-bottom {
  padding: 10px 8px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 1px; flex-shrink: 0;
}

.ext-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius);
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: all var(--trans);
}
.ext-link:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.ext-icon { margin-left: auto; opacity: 0.35; }

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px 0 18px;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  position: sticky; top: 0; z-index: 50;
  transition: background var(--trans), border-color var(--trans), box-shadow var(--trans);
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 var(--topbar-ring),
    inset 0 -1px 0 var(--border-faint);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--border) 30%,
    var(--border) 70%,
    transparent 100%);
  pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topbar { background: var(--bg); }
}

.menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius);
  transition: all var(--trans); flex-shrink: 0;
}
.menu-toggle:hover { background: var(--bg-hover); color: var(--text); }

.breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-muted);
  overflow: hidden; min-width: 0;
}
.breadcrumb::before {
  content: "";
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin-right: 4px;
  opacity: 0.55;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 9.5 12 3l9 6.5V20a2 2 0 0 1-2 2h-4v-7h-6v7H5a2 2 0 0 1-2-2Z'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 9.5 12 3l9 6.5V20a2 2 0 0 1-2 2h-4v-7h-6v7H5a2 2 0 0 1-2-2Z'/></svg>");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain;   mask-size: contain;
  transition: opacity var(--trans), color var(--trans);
}
.breadcrumb:hover::before { opacity: 0.9; color: var(--text); }

.bc-sep {
  opacity: 0.3;
  font-size: 12px;
  flex-shrink: 0;
  padding: 0 2px;
  color: var(--text-faint);
}
.bc-item {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background var(--trans), color var(--trans);
}
.bc-item:not(.current):hover {
  color: var(--text);
  background: var(--bg-hover);
}
.bc-item.current {
  color: var(--text); font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-faint);
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.topbar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Vertical divider between icon buttons and action pills */
.topbar-actions .topbar-pill:first-of-type {
  position: relative;
  margin-left: 12px;
}
.topbar-actions .topbar-pill:first-of-type::before {
  content: "";
  position: absolute;
  left: -7px; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 20px;
  background: var(--border);
  pointer-events: none;
}

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; cursor: pointer;
  color: var(--text-muted); border-radius: var(--radius);
  transition: all var(--trans); text-decoration: none;
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border-faint);
  text-decoration: none;
}
.icon-btn:active { transform: scale(0.96); }

/* Theme icons */
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* ===== TOPBAR PILL BUTTONS (Discord / Store) ===== */
.topbar-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  border-radius: 100px;
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  transition: all var(--trans);
  white-space: nowrap;
  border: 1px solid transparent;
}
.topbar-pill:hover { text-decoration: none; transform: translateY(-1px); }

.discord-pill {
  background: rgba(88, 101, 242, 0.15);
  color: #7289da;
  border-color: rgba(88, 101, 242, 0.25);
}
.discord-pill:hover { background: rgba(88, 101, 242, 0.25); color: #8fa0ff; border-color: rgba(88,101,242,0.5); }

.store-pill {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}
.store-pill:hover { border-color: var(--text-muted); background: var(--bg-hover); }

@media (max-width: 560px) {
  .topbar-pill span { display: none; }
  .topbar-pill { padding: 6px 8px; border-radius: 8px; }
}

/* ===== 3-LEVEL NAV: GROUPS ===== */
.nav-group {
  margin: 2px 0 4px;
}
.nav-group-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 5px 10px 5px 14px;
  background: none; border: none; font-family: inherit;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-faint);
  cursor: pointer; border-radius: var(--radius);
  transition: all var(--trans); text-align: left; user-select: none;
}
.nav-group-btn:hover { color: var(--text-muted); background: var(--bg-hover); }
.nav-group-icon { font-size: 12px; opacity: 0.7; }
.nav-group-chevron {
  margin-left: auto; transition: transform 0.2s ease;
  flex-shrink: 0; color: var(--text-faint);
}
.nav-group.collapsed .nav-group-chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-group-items { padding: 1px 0 2px; display: flex; flex-direction: column; gap: 1px; }

/* Items inside groups indent more */
.nav-group .nav-item { padding-left: 26px; }
.nav-group .nav-item::before { left: 15px; }

/* ===== 4TH LEVEL: SCRIPT TYPE ===== */
.nav-script { margin: 1px 0; }

.nav-script-row {
  display: flex; align-items: center;
  border-radius: var(--radius);
}

.nav-script-name {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 6px 6px 6px 26px;
  font-size: 13.5px; color: var(--text-muted);
  text-decoration: none;
  transition: color var(--trans), background var(--trans);
  border-radius: var(--radius) 0 0 var(--radius);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-script-name:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.nav-script-name.active { color: var(--text); font-weight: 500; }

.nav-script-toggle {
  padding: 6px 10px 6px 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-faint);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: all var(--trans); flex-shrink: 0;
  display: flex; align-items: center;
}
.nav-script-toggle:hover { color: var(--text-muted); background: var(--bg-hover); }

.nav-script-chev { display: flex; transition: transform 0.2s ease; }
.nav-script.collapsed .nav-script-chev { transform: rotate(-90deg); }
.nav-script.collapsed .nav-script-subs { display: none; }

.nav-script-subs {
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 0 4px;
}

/* Sub-page items (5th level leaves) */
.nav-sub {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 42px;
  font-size: 13px; color: var(--text-faint);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--trans);
}
.nav-sub:hover { color: var(--text-muted); background: var(--bg-hover); text-decoration: none; }
.nav-sub.active { color: var(--accent); background: var(--bg-active); font-weight: 500; }
.nav-sub-icon { opacity: 0.5; flex-shrink: 0; display: flex; }
.nav-sub.active .nav-sub-icon { opacity: 1; }

/* ===== PRODUCT IMAGE GRID (Home page) ===== */
.product-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 14px 0 28px;
}

.pic-card {
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none; color: var(--text);
  transition: all var(--trans);
  overflow: hidden;
}
.pic-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text);
}

.pic-thumb {
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-code);
}
.pic-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.3s ease;
}
.pic-card:hover .pic-thumb img { transform: scale(1.03); }

/* Placeholder when no image */
.pic-no-img {
  display: flex; align-items: center; justify-content: center;
}
.pic-no-img > span {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-faint);
  font-size: 12px; font-weight: 500;
}
.pic-no-img > span svg { width: 28px; height: 28px; opacity: 0.4; }

.pic-info {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.pic-title {
  font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pic-tags { display: flex; flex-wrap: wrap; gap: 4px; }

@media (max-width: 600px) {
  .product-img-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ===== PAGE LAYOUT ===== */
.page-layout {
  flex: 1; display: flex;
  width: 100%; max-width: 1280px;
  margin: 0 auto; padding: 0 0 0 48px;
}

.article {
  flex: 1; min-width: 0;
  max-width: 800px;
  padding: 52px 48px 40px 0;
}

/* ===== TOC SIDEBAR ===== */
.toc-sidebar {
  width: var(--toc-width); flex-shrink: 0;
  padding: 52px 16px 40px 32px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overflow-x: hidden;
}

.toc-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 10px; padding-left: 8px;
}

.toc-nav { display: flex; flex-direction: column; }

.toc-link {
  display: block; font-size: 12.5px; color: var(--text-muted);
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all var(--trans); line-height: 1.5; text-decoration: none;
}
.toc-link:hover {
  color: var(--text); border-left-color: var(--border);
  background: var(--bg-hover); text-decoration: none;
}
.toc-link.active {
  color: var(--text); border-left-color: var(--accent);
  background: var(--bg-active); font-weight: 500;
}
.toc-h3 { padding-left: 20px; font-size: 12px; }

/* ===== ARTICLE CONTENT ===== */
.article-inner { min-height: 200px; }

/* -- Typography -- */
.article-inner h1 {
  font-size: 2.1rem; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.2;
  color: var(--text); margin-bottom: 20px;
}
.article-inner h2 {
  font-size: 1.4rem; font-weight: 600;
  letter-spacing: -0.015em; line-height: 1.3;
  color: var(--text); margin: 48px 0 16px;
  padding-top: 20px; border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.article-inner h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.article-inner h3 {
  font-size: 1.1rem; font-weight: 600; line-height: 1.4;
  color: var(--text); margin: 28px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}
.article-inner h4 {
  font-size: 0.95rem; font-weight: 600;
  color: var(--text); margin: 20px 0 8px;
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

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

.article-inner ul, .article-inner ol {
  margin: 0 0 16px; padding-left: 24px;
}
.article-inner li { margin-bottom: 6px; color: var(--text); }
.article-inner li p { margin-bottom: 4px; }
.article-inner li:last-child { margin-bottom: 0; }

.article-inner strong { font-weight: 600; }
.article-inner em { font-style: italic; }

.article-inner hr {
  border: none; border-top: 1px solid var(--border); margin: 36px 0;
}

/* Inline code */
.article-inner code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.84em;
  background: var(--bg-code);
  color: var(--inline-code);
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border);
}

/* Code blocks */
.article-inner pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 24px;
  overflow-x: auto; margin: 20px 0;
}
.article-inner pre code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem; background: none;
  color: var(--text); padding: 0; border: none; line-height: 1.65;
}

/* Blockquote */
.article-inner blockquote {
  border-left: 3px solid var(--border);
  padding: 12px 20px; margin: 20px 0;
  background: var(--bg-elevated);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted); font-style: italic;
}

/* Links */
.article-inner a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--trans), color var(--trans);
}
.article-inner a:hover {
  border-bottom-color: var(--text);
  color: var(--text); text-decoration: none;
}

/* Tables */
.article-inner table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px;
}
.article-inner th {
  text-align: left; padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); font-weight: 600;
}
.article-inner td { padding: 10px 16px; border: 1px solid var(--border); }
.article-inner tr:nth-child(even) td { background: var(--bg-hover); }

/* ===== DEPENDENCIES BLOCK ===== */
.deps-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 28px;
  background: var(--bg-elevated);
}

.deps-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg-code);
  border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}

.deps-body { padding: 0; }

.deps-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-faint);
}
.deps-row:last-child { border-bottom: none; }
.deps-row-cards { flex-direction: column; gap: 8px; }

.deps-row-label {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  min-width: 100px; flex-shrink: 0; padding-top: 2px;
}

.deps-row-value {
  flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.deps-cards-list { flex-direction: column; gap: 6px; width: 100%; }

/* Framework badges */
.fw-badges { gap: 5px; }
.fw-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600;
}
.fw-standalone { background: rgba(79,142,247,0.1);  color: #5a9af7; border: 1px solid rgba(79,142,247,0.2); }
.fw-qb         { background: rgba(34,197,94,0.1);   color: #22c55e; border: 1px solid rgba(34,197,94,0.2);  }
.fw-esx        { background: rgba(234,179,8,0.1);   color: #ca8a04; border: 1px solid rgba(234,179,8,0.2);  }
.fw-qbox       { background: rgba(168,85,247,0.1);  color: #a855f7; border: 1px solid rgba(168,85,247,0.2); }
[data-theme="light"] .fw-qb  { color: #16a34a; }
[data-theme="light"] .fw-esx { color: #a16207; }

/* FiveM build tag */
.dep-build {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: 5px;
  background: var(--bg-code); color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Dependency link cards (GitHub style) */
.dep-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none; color: var(--text);
  transition: all var(--trans);
}
.dep-card:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
  text-decoration: none; color: var(--text);
}
.dep-card-icon {
  color: var(--text-faint); flex-shrink: 0;
  transition: color var(--trans);
}
.dep-card:hover .dep-card-icon { color: var(--text-muted); }
.dep-card-body { flex: 1; min-width: 0; }
.dep-card-name { font-size: 13px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.dep-card-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-card-badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 100px; flex-shrink: 0;
  background: rgba(79,142,247,0.1); color: #5a9af7;
  border: 1px solid rgba(79,142,247,0.2);
}
.dep-optional .dep-card-badge {
  background: rgba(255,255,255,0.05); color: var(--text-muted);
  border: 1px dashed var(--border);
}
[data-theme="light"] .dep-optional .dep-card-badge { background: rgba(0,0,0,0.03); }

/* ===== BADGE ROW ===== */
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 20px; }
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.badge.blue   { background: rgba(79,142,247,0.12); color: #5a9af7; border: 1px solid rgba(79,142,247,0.2); }
.badge.green  { background: rgba(34,197,94,0.10);  color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.badge.yellow { background: rgba(234,179,8,0.10);  color: #ca8a04; border: 1px solid rgba(234,179,8,0.2); }
.badge.purple { background: rgba(168,85,247,0.10); color: #a855f7; border: 1px solid rgba(168,85,247,0.2); }
[data-theme="light"] .badge.blue   { color: #2563eb; }
[data-theme="light"] .badge.green  { color: #16a34a; }
[data-theme="light"] .badge.yellow { color: #b45309; }
[data-theme="light"] .badge.purple { color: #7c3aed; }

/* ===== PAGE THUMBNAILS ===== */
.page-thumbnail {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0 0 32px;
  background: var(--bg-elevated);
}
.page-thumbnail img {
  width: 100%; height: auto;
  display: block;
}

/* ===== NAV ITEM ICONS ===== */
.nav-item {
  gap: 7px;
  padding-left: 14px;
}
.nav-item::before { display: none; }
.nav-item-icon {
  display: flex; align-items: center; flex-shrink: 0;
  opacity: 0.5; transition: opacity var(--trans);
}
.nav-item:hover .nav-item-icon { opacity: 0.75; }
.nav-item.active .nav-item-icon { opacity: 1; }

/* ===== CODE BLOCKS (GitBook-style) ===== */
.code-block {
  margin: 20px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-code);
}

.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  min-height: 38px;
}

.code-label {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
}
.code-label svg { opacity: 0.6; flex-shrink: 0; }

.code-copy-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  font-family: inherit;
  transition: all var(--trans);
  flex-shrink: 0;
  white-space: nowrap;
}
.code-copy-btn:hover { border-color: var(--text-muted); color: var(--text); }
.code-copy-btn.copied { border-color: #5a9; color: #5a9; }

/* Override .article-inner pre for code blocks */
.article-inner .code-block .code-pre {
  background: var(--bg-code) !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 18px 22px !important;
  overflow-x: auto;
}
.article-inner .code-block .code-pre code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  background: none !important;
  color: var(--text);
  padding: 0 !important;
  border: none !important;
  line-height: 1.7;
  tab-size: 2;
}

/* ── Syntax token colours (muted, works on dark grey) ── */
.cm { color: #505050; font-style: italic; }          /* comment */
.ck { color: #d0d0d0; font-weight: 600; }            /* keyword */
.cs { color: #9aaa94; }                              /* string  */
.cn { color: #a8a0be; }                              /* number  */
.cb { color: #c8c0b4; }                              /* builtin */

/* Light theme token colours */
[data-theme="light"] .cm { color: #888; }
[data-theme="light"] .ck { color: #1a1a1a; font-weight: 600; }
[data-theme="light"] .cs { color: #3a6e3a; }
[data-theme="light"] .cn { color: #5050a8; }
[data-theme="light"] .cb { color: #444; }

/* ===== CALLOUT BOXES ===== */
.callout {
  display: flex; gap: 12px;
  padding: 14px 18px; border-radius: 10px;
  margin: 20px 0; font-size: 14px; line-height: 1.6;
  border: 1px solid;
}
.callout.info    { background: var(--callout-info-bg);   border-color: var(--callout-info-border); }
.callout.warning { background: var(--callout-warn-bg);   border-color: var(--callout-warn-border); }
.callout.tip     { background: var(--callout-tip-bg);    border-color: var(--callout-tip-border); }
.callout.danger  { background: var(--callout-danger-bg); border-color: var(--callout-danger-border); }
.callout-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; line-height: 1.4; }
.callout-body { flex: 1; min-width: 0; }
.callout-body p { margin: 0; color: var(--text); }
.callout-body p + p { margin-top: 8px; }
.callout-body strong { font-weight: 600; }

/* ===== LINK CARDS ===== */
.link-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none;
  margin: 10px 0; transition: all var(--trans);
  color: var(--text);
}
.link-card:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text);
}
.link-card-icon { font-size: 22px; flex-shrink: 0; }
.link-card-body { flex: 1; min-width: 0; }
.link-card-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.link-card-url { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card-arrow { color: var(--text-faint); transition: transform var(--trans), color var(--trans); flex-shrink: 0; }
.link-card:hover .link-card-arrow { transform: translateX(3px); color: var(--text-muted); }

/* Card grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; margin: 20px 0;
}
.card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none;
  color: var(--text); transition: all var(--trans);
}
.card:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text);
}
.card-icon { font-size: 24px; }
.card-title { font-weight: 600; font-size: 14px; }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ===== HOME PAGE ===== */

/* ── Full-VIEWPORT home page background ── */

/* Background image fixed to viewport — content scrolls over it */
body.home-page {
  background-color: var(--bg);
}

#home-bg {
  display: none; /* JS shows/hides */
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('../img/bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0.04;
  mix-blend-mode: luminosity;
}
[data-theme="light"] #home-bg { opacity: 0.03; mix-blend-mode: luminosity; }

/* All page chrome must sit above the fixed background */
.sidebar        { z-index: 100; }
.layout         { position: relative; z-index: 1; }
.search-overlay { z-index: 300; }


/* ── Hero (borderless, full-width, background comes from body/fixed overlay) ── */
.home-hero {
  position: relative; z-index: 1;
  padding: 60px 0 0;
  margin-bottom: 56px;
}
.home-hero-bg { display: none; }

.home-hero-content { position: relative; z-index: 1; max-width: 680px; }

.home-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); opacity: 0.7;
  margin-bottom: 16px;
}

.home-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}
.home-hero-accent {
  background: linear-gradient(135deg, #e8e8e8 0%, #888 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .home-hero-accent {
  background: linear-gradient(135deg, #111 0%, #555 100%);
  -webkit-background-clip: text; background-clip: text;
}

.home-hero-desc {
  font-size: 15px; color: var(--text-muted);
  line-height: 1.7; margin-bottom: 28px;
  max-width: 520px;
}

.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }

.home-hero-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  text-decoration: none; transition: all var(--trans);
  border: 1px solid transparent;
}
.home-hero-btn:hover { text-decoration: none; transform: translateY(-1px); }
.home-hero-btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.home-hero-btn.primary:hover { opacity: 0.88; }
.home-hero-btn.discord { background: rgba(88,101,242,0.12); color: #7289da; border-color: rgba(88,101,242,0.3); }
.home-hero-btn.discord:hover { background: rgba(88,101,242,0.22); }
.home-hero-btn.ghost { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border); }
.home-hero-btn.ghost:hover { color: var(--text); border-color: var(--text-muted); }

/* Stats bar */
.home-hero-stats {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  border-top: 1px solid var(--border);
  margin: 0;
  padding: 0;
}
.home-stat {
  display: flex; flex-direction: column;
  padding: 18px 32px 18px 0;
  gap: 2px;
}
.home-stat:first-child { padding-left: 0; }
.home-stat-num {
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text);
  line-height: 1.2;
}
.home-stat-label { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.home-stat-divider {
  width: 1px; height: 36px;
  background: var(--border);
  margin: 0 32px 0 0;
  flex-shrink: 0;
}

/* ── Section headers ── */
.home-section { margin-bottom: 48px; }

.home-section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}

.home-section-label-wrap { display: flex; flex-direction: column; gap: 4px; }

.home-section-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint);
}

.home-section-title {
  font-size: 1.3rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  color: var(--text) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.home-section-more {
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--trans);
  padding-bottom: 2px;
}
.home-section-more:hover { color: var(--text); text-decoration: none; }

@media (max-width: 600px) {
  .home-hero { padding: 36px 0 0; }
  #article[data-page="home"]::before, #article[data-page="home"]::after { display: none; }
  .home-hero-stats { flex-wrap: wrap; }
  .home-stat { padding: 14px 20px 14px 0; }
  .home-hero-title { font-size: 1.8rem; }
  .home-section-header { flex-direction: column; align-items: flex-start; }
}

/* Product grid (home page) */
.product-grid {
  display: flex; flex-direction: column; gap: 2px;
  margin: 12px 0 24px;
}
.product-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none; color: var(--text);
  transition: all var(--trans);
}
.product-card + .product-card { border-radius: 0; border-top: none; }
.product-card:first-child { border-radius: 10px 10px 0 0; }
.product-card:last-child  { border-radius: 0 0 10px 10px; }
.product-card:only-child  { border-radius: 10px; }
.product-card:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; z-index: 1; position: relative; border-color: var(--text-faint); }
.pc-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted);
}
.pc-info { flex: 1; min-width: 0; }
.pc-title { font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.pc-desc  { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-arrow { color: var(--text-faint); flex-shrink: 0; }
.product-card:hover .pc-arrow { color: var(--text-muted); }
.pc-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 100px; flex-shrink: 0;
}
.pc-badge.new { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }

/* ===== HERO BANNER ===== */
.hero-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px 32px; margin-bottom: 36px;
  position: relative; overflow: hidden;
}
.hero-banner::after {
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--text-faint), transparent);
  opacity: 0.3;
}
.hero-banner h2 {
  font-size: 1.25rem !important; font-weight: 700 !important;
  margin: 0 0 8px !important; padding: 0 !important;
  border: none !important; color: var(--text) !important;
  letter-spacing: -0.01em;
}
.hero-banner p { color: var(--text-muted); margin: 0; font-size: 14.5px; line-height: 1.6; }

/* ===== STEPS ===== */
.steps { margin: 24px 0; display: flex; flex-direction: column; }

.step { display: flex; gap: 16px; padding-bottom: 24px; position: relative; }
.step:not(:last-child)::after {
  content: '';
  position: absolute; left: 15px; top: 36px; bottom: 0;
  width: 2px; background: var(--border);
}
.step-num {
  width: 32px; height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--text-muted); flex-shrink: 0; z-index: 1;
}
.step-body { flex: 1; padding-top: 4px; }
.step-title { font-weight: 600; margin-bottom: 5px; color: var(--text); }
.step-body p { font-size: 14px; color: var(--text-muted); margin: 0; }
.step-body code {
  font-family: 'JetBrains Mono', monospace; font-size: 0.83em;
  background: var(--bg-code); color: var(--inline-code);
  padding: 2px 5px; border-radius: 4px; border: 1px solid var(--border);
}

/* ===== PAGE NAV ===== */
.page-nav { display: flex; gap: 14px; margin: 48px 0 36px; }
.page-nav-btn {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none;
  color: var(--text); transition: all var(--trans);
}
.page-nav-btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
  text-decoration: none; color: var(--text);
}
.page-nav-btn.prev { flex-direction: row-reverse; text-align: right; }
.page-nav-btn-icon { color: var(--text-faint); transition: all var(--trans); flex-shrink: 0; }
.page-nav-btn:hover .page-nav-btn-icon { color: var(--text-muted); }
.page-nav-btn.prev:hover .page-nav-btn-icon { transform: translateX(-3px); }
.page-nav-btn.next:hover .page-nav-btn-icon { transform: translateX(3px); }
.page-nav-btn-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; margin-bottom: 2px; }
.page-nav-btn-title { font-size: 14px; font-weight: 600; }

/* ===== ARTICLE FOOTER ===== */
.article-footer {
  padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; margin-top: 4px;
}
.footer-links { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-faint); }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color var(--trans); }
.footer-links a:hover { color: var(--text); }
.footer-sep { opacity: 0.3; }
.footer-copy { font-size: 12px; color: var(--text-faint); }
.footer-brand {
  font-size: 12px; color: var(--text-faint);
  display: flex; align-items: center; gap: 4px;
}
.footer-brand a { color: var(--text-muted); transition: color var(--trans); }
.footer-brand a:hover { color: var(--text); text-decoration: none; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 72px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease;
}
.search-overlay.open { opacity: 1; pointer-events: all; }

.search-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
}
[data-theme="light"] .search-backdrop { background: rgba(0,0,0,0.4); }

.search-modal {
  position: relative; width: 100%; max-width: 600px;
  background: var(--bg-search);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); z-index: 1;
  transform: translateY(-8px); transition: transform 0.15s ease;
}
.search-overlay.open .search-modal { transform: translateY(0); }

.search-input-row {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.search-input-row input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 15px; color: var(--text); font-family: inherit;
}
.search-input-row input::placeholder { color: var(--text-muted); }
.search-esc-btn { background: none; border: none; cursor: pointer; color: var(--text-faint); font-family: inherit; }
.search-esc-btn kbd {
  font-size: 11px; padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-faint);
}

.search-body { max-height: 420px; overflow-y: auto; padding: 8px; }

.search-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 44px 20px;
  color: var(--text-muted); font-size: 14px; text-align: center;
}
.search-no-results { padding: 28px; text-align: center; color: var(--text-muted); font-size: 14px; }

.search-result {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--trans);
  margin-bottom: 2px; text-decoration: none; color: inherit;
}
.search-result:hover { background: var(--bg-hover); text-decoration: none; color: inherit; }

.search-result-section {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); opacity: 0.8;
}
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text); }
.search-result-excerpt {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

mark {
  background: rgba(255,255,255,0.15);
  color: var(--text);
  border-radius: 2px; padding: 0 1px;
}
[data-theme="light"] mark {
  background: rgba(0,0,0,0.1);
  color: var(--text);
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .toc-sidebar { display: none; }
  .page-layout { padding: 0 0 0 40px; }
}
@media (max-width: 800px) {
  .page-layout { padding: 0; }
  .article { padding: 36px 20px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar-overlay.open { display: block; }
  .layout { margin-left: 0; }
  .menu-toggle { display: flex; }
  .topbar { padding: 0 16px; }
  .article-inner h1 { font-size: 1.65rem; }
  .page-nav { flex-direction: column; }
  .hero-banner { padding: 22px 20px; }
}
@media (max-width: 480px) {
  .article { padding: 24px 16px; }
  .article-inner h1 { font-size: 1.45rem; }
  .article-inner h2 { font-size: 1.2rem; }
  .search-overlay { padding-top: 0; align-items: flex-end; }
  .search-modal { border-radius: 14px 14px 0 0; max-width: 100%; }
}

/* ===== SITE FOOTER ===== */
.site-footer {
  position: relative;
  background: var(--bg);
  margin-top: auto;
  color: var(--text-muted);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--border) 25%,
    var(--border) 75%,
    transparent 100%);
  pointer-events: none;
}

/* Kept in HTML but visually neutral — no more spotlight blob */
.site-footer-glow { display: none; }

.site-footer-inner {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 52px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 48px 32px;
}

/* Brand column */
.sf-brand { display: flex; flex-direction: column; align-items: flex-start; }

.sf-logo {
  max-width: 130px; max-height: 42px;
  width: auto; height: auto;
  display: block; object-fit: contain;
  margin-bottom: 14px;
}
[data-theme="light"] .sf-logo { filter: brightness(0.1); }

.sf-tagline {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.65; margin: 0 0 18px;
  max-width: 320px;
}

/* Subtle Discord pill that matches the rest of the doc chrome */
.sf-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  background: rgba(88,101,242,0.12);
  border: 1px solid rgba(88,101,242,0.24);
  border-radius: 100px;
  font-size: 12.5px; font-weight: 600;
  color: #8fa0ff;
  text-decoration: none;
  transition: all var(--trans);
  margin-bottom: 16px;
}
.sf-cta:hover {
  color: #a6b2ff;
  background: rgba(88,101,242,0.2);
  border-color: rgba(88,101,242,0.4);
  text-decoration: none;
}
.sf-cta-arrow { transition: transform var(--trans); opacity: 0.85; }
.sf-cta:hover .sf-cta-arrow { transform: translateX(2px); }

.sf-social {
  display: flex; flex-direction: row; gap: 6px;
}

.sf-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--trans);
}
.sf-icon-btn:hover {
  color: var(--text);
  border-color: var(--text-faint);
  background: var(--bg-hover);
  text-decoration: none;
}

/* Link columns */
.sf-col { display: flex; flex-direction: column; gap: 10px; }

.sf-col-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 4px;
}

.sf-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--text-muted);
  text-decoration: none;
  transition: color var(--trans);
  width: fit-content;
}
.sf-link:hover {
  color: var(--text);
  text-decoration: none;
}

.sf-link-external::after {
  content: "↗";
  font-size: 11px;
  opacity: 0;
  transform: translate(-2px, 2px);
  transition: transform var(--trans), opacity var(--trans);
}
.sf-link-external:hover::after {
  opacity: 0.7;
  transform: translate(0, 0);
}

/* Bottom bar */
.site-footer-bottom {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  max-width: 1280px; margin: 0 auto;
  padding: 14px 48px 20px;
  border-top: 1px solid var(--border-faint);
  font-size: 12px; color: var(--text-faint);
}
.site-footer-bottom a { color: var(--text-muted); text-decoration: none; transition: color var(--trans); }
.site-footer-bottom a:hover { color: var(--text); }

.sf-bottom-left {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.sf-dot-sep { opacity: 0.4; }

.sf-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.005em;
}
.sf-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: sfPulse 2.4s ease-in-out infinite;
}
[data-theme="light"] .sf-status-dot { background: #16a34a; box-shadow: 0 0 5px rgba(22,163,74,0.45); }

@keyframes sfPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

@media (max-width: 1000px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; padding: 40px 28px 28px; }
  .sf-brand { grid-column: 1 / -1; max-width: 520px; }
}
@media (max-width: 600px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; padding: 32px 20px 22px; }
  .site-footer-bottom { padding: 14px 20px 18px; flex-direction: column; align-items: flex-start; }
}

/* Remove old article-footer styles (no longer used) */
.article-footer { display: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.article-inner { animation: fadeIn 0.22s ease; }
