/* ==========================================================================
   SynaptikDocs Theme — style.css
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  --accent:        #4fa75c;
  --accent-dark:   #3a8a46;
  --accent-light:  #61ce70;
  --accent-subtle: rgba(79,167,92,.1);
  --accent-glow:   rgba(79,167,92,.2);
  --accent-border: rgba(79,167,92,.3);
  --bg:            #0d0d11;
  --bg-surface:    #131318;
  --bg-elevated:   #18181f;
  --bg-hover:      rgba(255,255,255,.04);
  --bg-code:       #0f0f16;
  --border:        rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --text:          #e4e4ec;
  --text-muted:    #a8a8bc;
  --text-faint:    #62627a;
  --text-code:     #a8ffb8;
  --sidebar-w:     268px;
  --toc-w:         224px;
  --topbar-h:      58px;
  --content-max:   800px;
  --font:          'Inter', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', 'Fira Mono', monospace;
  --ease:          cubic-bezier(.4,0,.2,1);
  --ease-spring:   cubic-bezier(.34,1.56,.64,1);

  /* Search Palette */
  --search-bg-darker: #161815;
  --search-bg-accent: #3c433a;
  --search-bg-main: #191d18;
  --search-primary: #4fa75c;
  --search-primary-dark: #3a8a46;
  --search-primary-light: #61Ce70;
  --search-result-heading: #777;
  --search-text-main: #eee;
  --search-secondary: #4f8aa7;
  --border-radius-sm: 4px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-light); }
img { max-width: 100%; height: auto; display: block; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.docs-fade-in { animation: fadeIn .35s var(--ease) both; }

/* ==========================================================================
   Layout
   ========================================================================== */

.docs-main {margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .3s var(--ease);}

/* ==========================================================================
   Topbar — fixed, full width, above sidebar
   ========================================================================== */

.docs-topbar {position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: var(--topbar-h); background: rgba(13,13,17,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; flex-shrink: 0;}
.topbar-logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: .9rem; flex-shrink: 0; }
.topbar-logo:hover { color: var(--text); }
.topbar-logo-mark { width: 26px; height: 26px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; box-shadow: 0 2px 8px var(--accent-glow); }
.topbar-logo-mark img { width: 26px; height: 26px; object-fit: contain; border-radius: 4px; border: none; margin: 0; }
.topbar-logo-mark:has(img) { background: none; box-shadow: none; }

.topbar-nav { flex: 1; overflow: visible; }
.topbar-nav > ul { list-style: none; display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; overflow-x: clip; scrollbar-width: none; }
.topbar-nav > ul::-webkit-scrollbar { display: none; }
.topbar-nav > ul > li { position: relative; }
.topbar-nav > ul > li > a { display: block; padding: 6px 10px; font-size: .83rem; color: var(--text-muted); border-radius: 6px; white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease); }
.topbar-nav > ul > li > a:hover { background: var(--bg-hover); color: var(--text); }
.topbar-nav li.has-submenu > ul { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 8px 32px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transition: all .2s var(--ease); z-index: 200; list-style: none; }
.topbar-nav li.has-submenu:hover > ul { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.topbar-nav li.has-submenu > ul li a { display: block; padding: 7px 10px; font-size: .82rem; color: var(--text-muted); border-radius: 6px; transition: background .12s var(--ease), color .12s var(--ease); }
.topbar-nav li.has-submenu > ul li a:hover { background: var(--bg-hover); color: var(--text); }
.topbar-nav li.has-submenu > a::after { content: ' ▾'; font-size: .65em; opacity: .5; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.topbar-search-btn { display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); font-size: .8rem; font-family: var(--font); cursor: pointer; white-space: nowrap; transition: border-color .15s var(--ease), color .15s var(--ease); }
.topbar-search-btn:hover { border-color: var(--accent); color: var(--text); }
.topbar-search-btn kbd { display: inline-block; padding: 1px 5px; background: var(--bg-hover); border: 1px solid var(--border-strong); border-radius: 4px; font-size: .7rem; font-family: var(--font); opacity: .7; }

.topbar-github { display: flex; align-items: center; color: var(--text-muted); padding: 6px; border-radius: 6px; transition: color .15s var(--ease), background .15s var(--ease); }
.topbar-github:hover { color: var(--text); background: var(--bg-hover); }

.search-icon-wrap { list-style: none; }

/* ==========================================================================
   Sidebar — starts below the topbar
   ========================================================================== */

.docs-sidebar {
  position: fixed;
  top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .3s var(--ease);
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 14px 10px 16px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

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

.sidebar-list li a { display: block; padding: 6px 10px; border-radius: 6px; font-size: .855rem; color: var(--text-muted); transition: background .15s var(--ease), color .15s var(--ease); line-height: 1.45; position: relative; }
.sidebar-list li a::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%) scaleY(0); width: 2px; height: 14px; background: var(--accent); border-radius: 1px; transition: transform .2s var(--ease); }
.sidebar-list li a:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-list li a.active { background: var(--accent-subtle); color: var(--accent-light); font-weight: 500; }
.sidebar-list li a.active::before { transform: translateY(-50%) scaleY(1); }

.sidebar-group { margin-top: 18px; }
.sidebar-group-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; background: none; border: none; cursor: pointer; color: var(--text-faint); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font); transition: color .15s var(--ease); border-radius: 4px; }
.sidebar-group-btn:hover { color: var(--text-muted); background: var(--bg-hover); }
.sidebar-group-chevron { flex-shrink: 0; transition: transform .25s var(--ease); opacity: .5; }
.sidebar-group-btn[aria-expanded="false"] .sidebar-group-chevron { transform: rotate(-90deg); }
.sidebar-group .sidebar-list { overflow: hidden; transition: max-height .3s var(--ease), opacity .25s var(--ease); max-height: 2000px; opacity: 1; }
.sidebar-group .sidebar-list.is-collapsed { max-height: 0; opacity: 0; }

/* ── Collapse button ── */
.sidebar-collapse-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px 18px; background: none; border: none; border-top: 1px solid var(--border); cursor: pointer; color: var(--text); transition: color .15s var(--ease), background .15s var(--ease); flex-shrink: 0; }
.sidebar-collapse-btn:hover { color: #fff; background: var(--bg-hover); }
.sidebar-collapse-btn svg { transition: transform .3s var(--ease); width: 18px; height: 18px; }

/* ── Collapsed state ── */
body.sidebar-collapsed .docs-sidebar { transform: translateX(calc(-1 * var(--sidebar-w) + 40px)); }
body.sidebar-collapsed .docs-main { margin-left: 40px; }
body.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
body.sidebar-collapsed .docs-sidebar .sidebar-collapse-btn { position: absolute; bottom: 0; right: 0; width: 40px; padding: 0; height: 48px; border-left: 1px solid var(--border-strong); border-top: 1px solid var(--border-strong); background: var(--bg-elevated); color: #fff; }
body.sidebar-collapsed .docs-sidebar .sidebar-collapse-btn svg { width: 22px !important; height: 22px !important; stroke-width: 3; }
body.sidebar-collapsed .sidebar-group-chevron { visibility: hidden; }

/* ==========================================================================
   Main — offset by topbar height
   ========================================================================== */

.docs-main { padding-top: var(--topbar-h); }

/* ==========================================================================
   Burger + overlay
   ========================================================================== */

.docs-burger { display: none; position: fixed; top: 12px; right: 16px; z-index: 400; width: 38px; height: 38px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 7px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; transition: border-color .15s var(--ease); }
.docs-burger:hover { border-color: var(--accent); }
.docs-burger span { display: block; width: 16px; height: 1.5px; background: var(--text-muted); border-radius: 1px; transition: transform .22s var(--ease), opacity .22s var(--ease), width .22s var(--ease); transform-origin: center; }
.docs-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.docs-burger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.docs-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 190; backdrop-filter: blur(3px); }
.sidebar-overlay.is-visible { display: block; }

/* ==========================================================================
   Content
   ========================================================================== */

.docs-content { flex: 1; padding: 44px 44px 80px; }
.docs-page-layout { display: flex; gap: 52px; max-width: calc(var(--content-max) + var(--toc-w) + 52px); margin: 0 auto; }
.docs-article { flex: 1; min-width: 0; max-width: var(--content-max); }

/* ── Article header ── */
.docs-article-header { margin-bottom: 32px; }
.docs-article-category { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 10px; }
.docs-article-category:hover { color: var(--accent-light); }
.docs-page-title { font-size: 1.95rem; font-weight: 700; letter-spacing: -.025em; color: var(--text); line-height: 1.22; margin-bottom: 10px; }
.docs-page-lead { font-size: 1.05rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 28px; max-width: 640px; }
.docs-article-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--text-faint); padding-top: 16px; border-top: 1px solid var(--border); margin-top: 16px; }
.docs-article-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.docs-tag { padding: 2px 8px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 20px; font-size: .72rem; color: var(--text-muted); transition: border-color .15s var(--ease), color .15s var(--ease); }
.docs-tag:hover { border-color: var(--accent); color: var(--accent-light); }
.docs-meta { font-size: .8rem; color: var(--text-faint); margin-bottom: 24px; }
.docs-featured-image { margin: 0 0 32px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.docs-featured-image img { width: 100%; max-height: 440px; object-fit: cover; }

/* ── Body typography ── */
.docs-body { font-size: .9375rem; line-height: 1.75; }
.docs-body > * + * { margin-top: 1em; }
.docs-body h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; color: var(--text); margin: 44px 0 14px; padding-top: 10px; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--topbar-h) + 24px); line-height: 1.3; }
.docs-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.docs-body h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin: 30px 0 10px; scroll-margin-top: calc(var(--topbar-h) + 24px); line-height: 1.4; }
.docs-body h4 { font-size: .9rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 8px; }
.docs-body p { margin-bottom: 14px; }
.docs-body ul, .docs-body ol { padding-left: 22px; margin-bottom: 14px; }
.docs-body ul { list-style: disc; }
.docs-body ol { list-style: decimal; }
.docs-body li { margin-bottom: 5px; }
.docs-body li > ul, .docs-body li > ol { margin: 6px 0 0; }
.docs-body strong { font-weight: 600; color: var(--text); }
.docs-body em { font-style: italic; }
.docs-body hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.docs-body code { font-family: var(--font-mono); font-size: .82em; background: var(--bg-code); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; color: var(--text-code); }
.docs-body pre { background: var(--bg-code) !important; border: 1px solid var(--border); border-radius: 4px; padding: 0; margin: 20px 0; overflow: hidden; position: relative; }
.docs-body pre code { display: block; padding: 18px 20px; overflow-x: auto; font-size: .82rem; line-height: 1.65; background: none !important; border: none; border-radius: 0; color: inherit; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.docs-body pre code::-webkit-scrollbar { height: 4px; }
.docs-body pre code::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.docs-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .875rem; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.docs-body th { background: var(--bg-elevated); color: var(--text-muted); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--border-strong); }
.docs-body td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; line-height: 1.55; }
.docs-body tr:last-child td { border-bottom: none; }
.docs-body tr:hover td { background: var(--bg-hover); }
.docs-body td code { font-size: .8em; }
.sc-callout-body {color: #eee;}
.docs-body blockquote { border-left: 3px solid var(--accent); padding: 14px 18px; margin: 22px 0; background: var(--accent-subtle); border-radius: 0 4px 4px 0; color: #eee; }
.docs-body .sc-callout { border-radius: 4px; padding: 14px 18px; margin: 20px 0; font-size: .9rem; border: 1px solid; }
.docs-body .sc-callout-info    { background: rgba(59, 130, 246, 0.26); border-color: rgba(59,130,246,.3); }
.docs-body .sc-callout-warning { background: rgba(245, 158, 11, 0.249); border-color: rgba(245,158,11,.3); }
.docs-body .sc-callout-danger  { background: rgba(239, 68, 68, 0.236);  border-color: rgba(239,68,68,.3); }
.docs-body .sc-callout-tip     { background: var(--accent-subtle); border-color: var(--accent-border); }
.docs-body img { border-radius: 8px; border: 1px solid var(--border); margin: 20px 0; }

/* ==========================================================================
   TOC
   ========================================================================== */

.docs-toc { width: var(--toc-w); flex-shrink: 0; position: sticky; top: calc(var(--topbar-h) + 28px); max-height: calc(100vh - var(--topbar-h) - 56px); overflow-y: auto; align-self: flex-start; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.toc-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin-bottom: 12px; padding-left: 4px; }
.toc-list { list-style: none; border-left: 1px solid var(--border); padding-left: 14px; }
.toc-list li a { display: block; padding: 4px 6px; font-size: .79rem; color: var(--text-muted); border-radius: 4px; line-height: 1.45; transition: color .15s var(--ease); }
.toc-list li a:hover, .toc-list li a.toc-active { color: var(--accent-light); }
.toc-h3 { padding-left: 12px; }
.toc-h3 a { font-size: .76rem; }
.toc-h4 { padding-left: 24px; }
.toc-h4 a { font-size: .73rem; color: var(--text-faint); }

/* ==========================================================================
   Pagination
   ========================================================================== */

.docs-pagination { display: flex; gap: 14px; margin-top: 60px; padding-top: 26px; border-top: 1px solid var(--border); }
.docs-pagination-prev, .docs-pagination-next { display: flex; flex-direction: column; gap: 5px; padding: 16px 20px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; flex: 1; transition: border-color .18s var(--ease), background .18s var(--ease); color: inherit; }
.docs-pagination-prev { align-items: flex-start; }
.docs-pagination-next { align-items: flex-end; }
.docs-pagination-prev:hover, .docs-pagination-next:hover { border-color: var(--accent); background: var(--accent-subtle); color: inherit; }
.pagination-label { font-size: .72rem; color: var(--text-faint); font-weight: 500; }
.pagination-title { font-size: .88rem; color: var(--text); font-weight: 500; line-height: 1.4; }

/* ==========================================================================
   Homepage
   ========================================================================== */

.docs-home { max-width: calc(var(--content-max) + 40px); margin: 0 auto; }
.docs-hero { padding: 56px 0 52px; border-bottom: 1px solid var(--border); margin-bottom: 52px; }
.docs-hero-badge { display: inline-flex; align-items: center; padding: 4px 12px; background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: 20px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-light); margin-bottom: 18px; }
.docs-hero-title { font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 800; letter-spacing: -.04em; color: var(--text); line-height: 1.1; margin-bottom: 16px; }
.docs-hero-lead { font-size: 1.08rem; color: var(--text-muted); line-height: 1.65; max-width: 600px; margin-bottom: 32px; }
.docs-hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.docs-btn-primary { display: inline-flex; align-items: center; padding: 10px 22px; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; font-size: .9rem; transition: background .15s var(--ease), box-shadow .15s var(--ease); }
.docs-btn-primary:hover { background: var(--accent-dark); color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }
.docs-btn-ghost { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); font-size: .9rem; transition: border-color .15s var(--ease), color .15s var(--ease); }
.docs-btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }

.docs-home-section { margin-bottom: 52px; }
.docs-home-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin-bottom: 18px; border: none !important; padding: 0 !important; margin-top: 0 !important; }

.docs-home-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 12px; }
.docs-home-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; color: inherit; transition: border-color .18s var(--ease), background .18s var(--ease); }
.docs-home-card:hover { border-color: var(--accent); background: var(--bg-elevated); color: inherit; }
.docs-home-card-icon { width: 36px; height: 36px; background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; transition: background .18s var(--ease); }
.docs-home-card:hover .docs-home-card-icon { background: var(--accent); color: #fff; }
.docs-home-card-body { flex: 1; min-width: 0; }
.docs-home-card-title { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 4px; line-height: 1.35; }
.docs-home-card-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.docs-home-card-arrow { color: var(--accent); font-size: .9rem; flex-shrink: 0; margin-top: 2px; transition: transform .15s var(--ease); }
.docs-home-card:hover .docs-home-card-arrow { transform: translateX(4px); }

.docs-home-articles { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.docs-home-article-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--border); color: inherit; transition: background .15s var(--ease); }
.docs-home-article-row:last-child { border-bottom: none; }
.docs-home-article-row:hover { background: var(--bg-hover); }
.docs-home-article-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.docs-home-article-title { font-size: .875rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-home-article-cat { display: inline-block; padding: 2px 8px; background: var(--accent-subtle); border-radius: 20px; font-size: .68rem; color: var(--accent-light); white-space: nowrap; flex-shrink: 0; }
.docs-home-article-date { font-size: .75rem; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; }

/* ==========================================================================
   Article list + Project cards
   ========================================================================== */

.docs-article-list { display: flex; flex-direction: column; gap: 12px; }
.docs-article-list-item { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; color: inherit; transition: border-color .15s var(--ease); }
.docs-article-list-item:hover { border-color: var(--accent); color: inherit; }
.docs-article-list-thumb { width: 80px; height: 60px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.docs-article-list-thumb img { width: 100%; height: 100%; object-fit: cover; margin: 0; border: none; border-radius: 0; }
.docs-article-list-body { flex: 1; min-width: 0; }
.docs-article-list-title { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.docs-article-list-excerpt { font-size: .8rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.docs-article-list-meta { font-size: .75rem; color: var(--text-faint); margin-top: 6px; }
.docs-article-list-arrow { color: var(--accent); font-size: .9rem; transition: transform .15s var(--ease); }
.docs-article-list-item:hover .docs-article-list-arrow { transform: translateX(4px); }

.docs-project-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 16px; margin-top: 32px; }
.docs-project-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; color: inherit; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); display: flex; flex-direction: column; }
.docs-project-card:hover { border-color: var(--accent); box-shadow: 0 8px 32px rgba(0,0,0,.3); color: inherit; }
.docs-project-card-img { aspect-ratio: 16/9; overflow: hidden; }
.docs-project-card-img img { width: 100%; height: 100%; object-fit: cover; margin: 0; border: none; border-radius: 0; transition: transform .3s var(--ease); }
.docs-project-card:hover .docs-project-card-img img { transform: scale(1.04); }
.docs-project-card-placeholder { aspect-ratio: 16/9; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.docs-project-card-body { padding: 16px; flex: 1; }
.docs-project-card-title { font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.35; }
.docs-project-card-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   Footer
   ========================================================================== */

.docs-footer { margin-top: auto; background: var(--bg-surface); border-top: 1px solid var(--border); }
.docs-footer-inner { display: flex; gap: 48px; padding: 48px 44px 40px; max-width: calc(var(--content-max) + var(--toc-w) + 52px + 88px); margin: 0 auto; flex-wrap: wrap; }
.docs-footer-brand { min-width: 220px; flex-shrink: 0; }
.footer-logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.footer-logo:hover { color: var(--text); }
.footer-logo-mark { width: 28px; height: 28px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.footer-logo-mark img { width: 28px; height: 28px; object-fit: contain; border-radius: 5px; border: none; margin: 0; }
.footer-logo-mark:has(img) { background: none; box-shadow: none; }
.footer-tagline { font-size: .82rem; color: var(--text-faint); line-height: 1.6; max-width: 240px; margin-top: 8px; }
.footer-social { display: flex; gap: 8px; margin-top: 14px; }
.footer-social-link { display: flex; align-items: center; width: 32px; height: 32px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 7px; color: var(--text-muted); transition: border-color .15s var(--ease), color .15s var(--ease); justify-content: center; }
.footer-social-link:hover { border-color: var(--accent); color: var(--accent-light); }
.docs-footer-nav { flex: 1; display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col { min-width: 130px; }
.footer-col-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: .82rem; color: var(--text-muted); transition: color .15s var(--ease); }
.footer-col ul li a:hover { color: var(--text); }
.docs-footer-bottom { padding: 18px 44px; border-top: 1px solid var(--border); font-size: .75rem; color: var(--text-faint); text-align: center; }
.docs-footer-bottom a { color: var(--text-muted); }
.docs-footer-bottom a:hover { color: var(--accent-light); }

/* ==========================================================================
   Misc
   ========================================================================== */

.docs-404 { padding: 60px 0; }
.docs-404-code { font-size: 5rem; font-weight: 800; letter-spacing: -.05em; color: var(--border-strong); line-height: 1; margin-bottom: 16px; }
.docs-404-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.docs-404-desc { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }

.docs-landing { max-width: var(--content-max); margin: 0 auto; }
.docs-landing-title { font-size: 2rem; font-weight: 700; letter-spacing: -.025em; margin-bottom: 24px; }
.docs-landing-hero { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 32px; }
.docs-landing-hero img { width: 100%; max-height: 500px; object-fit: cover; }

.docs-contact-block { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--border); }
.docs-empty { color: var(--text-muted); font-size: .9rem; font-style: italic; padding: 32px 0; }

/* Contact form dark overrides */
.contact-form input, .contact-form textarea { background: var(--bg-elevated) !important; border: 1px solid var(--border) !important; color: var(--text) !important; border-radius: 7px !important; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent) !important; outline: none !important; box-shadow: 0 0 0 3px var(--accent-subtle) !important; }
.contact-form label { color: var(--text-muted) !important; font-size: .85rem !important; }
.contact-form button[type="submit"] { background: var(--accent) !important; color: #fff !important; border: none !important; border-radius: 8px !important; padding: 10px 22px !important; font-weight: 600 !important; cursor: pointer !important; transition: background .15s var(--ease) !important; }
.contact-form button[type="submit"]:hover { background: var(--accent-dark) !important; }

/* Progress bar */
.docs-progress { position: fixed; bottom: 0; left: 0; right: 0; height: 2px; background: var(--border); z-index: 500; opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
.docs-progress.is-visible { opacity: 1; }
.docs-progress-fill { position: absolute; top: 0; left: 0; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-light)); transition: width .08s linear; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Search overlay */
.search-overlay { background: rgba(0,0,0,.75) !important; backdrop-filter: blur(12px); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1300px) {
  .docs-toc { display: none; }
  .docs-page-layout { max-width: var(--content-max); }
}

@media (max-width: 960px) {
  .docs-main { margin-left: 0 !important; }
  .docs-sidebar { transform: translateX(-100%); box-shadow: none; }
  .docs-sidebar.is-open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,.6); }
  .sidebar-collapse-btn { display: none; }
  body.sidebar-collapsed .docs-sidebar { transform: translateX(-100%); }
  body.sidebar-collapsed .docs-main { margin-left: 0; }
  .docs-burger { display: flex; }
  .docs-content { padding: 28px 20px 60px; }
  .topbar-logo-name { display: none; }
  .docs-footer-inner { padding: 36px 20px 28px; gap: 32px; }
  .docs-footer-bottom { padding: 16px 20px; }
}

@media (max-width: 640px) {
  .docs-page-title { font-size: 1.55rem; }
  .docs-hero-title { font-size: 1.8rem; }
  .docs-home-grid, .docs-project-grid { grid-template-columns: 1fr; }
  .docs-pagination { flex-direction: column; }
  .docs-topbar { padding: 0 16px; }
  .topbar-nav { display: none; }
  .search-btn-label { display: none; }
  .docs-footer-nav { gap: 24px; }
}
