/* ============================================================
   NeuroSploit — docs styles (docs.strix.ai-style layout)
   ============================================================ */

:root {
  --bg:            #06060a;
  --bg-2:          #0a0a12;
  --bg-3:          #0e0e18;
  --surface:       rgba(255, 255, 255, 0.025);
  --surface-2:     rgba(255, 255, 255, 0.05);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text:          #e9e9f2;
  --text-dim:      #a7a7bd;
  --text-faint:    #6b6b85;
  --violet:        #8b5cf6;
  --violet-2:      #a855f7;
  --violet-soft:   #c4b5fd;
  --cyan:          #22d3ee;
  --magenta:       #e879f9;
  --low:           #4ade80;
  --med:           #ffd43b;
  --high:          #ff9f45;
  --crit:          #ff5c7a;
  --grad:          linear-gradient(120deg, var(--violet) 0%, var(--violet-2) 40%, var(--cyan) 100%);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar-w: 288px;
  --toc-w: 232px;
  --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 20px); }
body {
  font-family: var(--sans); background: var(--bg); color: var(--text);
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(139, 92, 246, 0.35); color: #fff; }
svg { display: block; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(900px 500px at 85% -10%, rgba(139,92,246,.1), transparent 60%),
              radial-gradient(700px 500px at 0% 0%, rgba(34,211,238,.05), transparent 55%);
  pointer-events: none;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 22px;
  background: rgba(8,8,14,.82); backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--text); }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand .logo { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: radial-gradient(circle at 30% 25%, rgba(139,92,246,.4), rgba(34,211,238,.18)); border: 1px solid var(--border-strong); }
.topbar .brand .logo svg { width: 18px; height: 18px; }
.topbar .brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar .brand .doctag { font-family: var(--mono); font-size: 11px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right a { font-size: 13.5px; color: var(--text-dim); }
.topbar-right a:hover { color: var(--text); text-decoration: none; }
.topbar-right .gh { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 12px; font-family: var(--mono); font-size: 12.5px; }
.topbar-right .gh svg { width: 14px; height: 14px; }
.topbar .site-link { display: inline-flex; align-items: center; gap: 6px; }

/* search */
.doc-search { position: relative; }
.doc-search input {
  width: 210px; background: var(--bg-3); border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); font-family: var(--sans); font-size: 13.5px; padding: 8px 12px 8px 32px;
  transition: border-color .2s, width .2s;
}
.doc-search input:focus { outline: none; border-color: var(--violet); width: 240px; }
.doc-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-faint); }

.burger { display: none; background: none; border: 0; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); max-width: 1440px; margin: 0 auto; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 28px 16px 60px 22px; border-right: 1px solid var(--border);
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.nav-group { margin-bottom: 26px; }
.nav-group > .grp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .13em; color: var(--text-faint); font-weight: 700; margin: 0 0 10px 10px; display: flex; align-items: center; gap: 8px; }
.nav-group > .grp-title svg { width: 14px; height: 14px; color: var(--violet-soft); }
.sidebar a {
  display: block; font-size: 14px; color: var(--text-dim); padding: 7px 10px; border-radius: 8px;
  border-left: 2px solid transparent; transition: color .18s, background .18s, border-color .18s;
}
.sidebar a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.sidebar a.active { color: var(--text); background: var(--surface-2); border-left-color: var(--violet); font-weight: 600; }

/* ---------- content ---------- */
.content { padding: 44px 56px 120px; min-width: 0; }
.content section { scroll-margin-top: calc(var(--topbar-h) + 20px); margin-bottom: 20px; }
.doc-hero { padding-bottom: 30px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.doc-hero .kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--violet-soft); margin-bottom: 14px; }
.doc-hero h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; margin-bottom: 16px; }
.doc-hero p { font-size: 18px; color: var(--text-dim); max-width: 640px; }

.content h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 56px 0 18px; padding-top: 10px; }
.content h2:first-of-type { margin-top: 10px; }
.content h3 { font-size: 20px; font-weight: 700; margin: 34px 0 12px; }
.content h4 { font-size: 16px; font-weight: 700; margin: 24px 0 10px; color: var(--violet-soft); }
.content p { color: var(--text-dim); margin-bottom: 16px; font-size: 15.5px; }
.content ul, .content ol { color: var(--text-dim); margin: 0 0 18px 22px; font-size: 15.5px; }
.content li { margin-bottom: 8px; }
.content strong { color: var(--text); font-weight: 600; }
.content em { color: var(--violet-soft); font-style: normal; }
.content a { border-bottom: 1px solid transparent; }
.content a:hover { border-bottom-color: var(--cyan); text-decoration: none; }

.anchor-h { display: inline-flex; align-items: center; gap: 10px; }
.anchor-h .hash { opacity: 0; font-size: .7em; color: var(--text-faint); transition: opacity .15s; }
.content h2:hover .hash, .content h3:hover .hash { opacity: 1; }

code:not(pre code) {
  font-family: var(--mono); font-size: .86em; color: var(--violet-soft);
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px;
}

/* code blocks */
.codeblock { position: relative; background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; margin: 0 0 22px; }
.codeblock .cb-bar { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.015); }
.codeblock .cb-bar .lang { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); letter-spacing: .04em; }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.75; }
.codeblock pre code { color: #d6d6e7; background: none; border: 0; padding: 0; font-size: 13px; }
.copy-btn { font-family: var(--mono); font-size: 11px; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: .2s; }
.copy-btn:hover { color: var(--text); border-color: var(--violet); }
.tok-comment { color: #6b6b85; font-style: italic; }
.tok-cmd { color: #22d3ee; }
.tok-flag { color: #c4b5fd; }
.tok-str { color: #4ade80; }
.tok-kw { color: #e879f9; }
.tok-num { color: #ff9f45; }
.tok-key { color: #38bdf8; }

/* callouts */
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; margin: 0 0 22px; border: 1px solid; font-size: 14.5px; }
.callout .ic { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.callout p { margin: 0; color: var(--text); }
.callout.warn { background: rgba(255,159,69,.07); border-color: rgba(255,159,69,.3); }
.callout.warn .ic { color: var(--high); }
.callout.tip { background: rgba(34,211,238,.06); border-color: rgba(34,211,238,.28); }
.callout.tip .ic { color: var(--cyan); }
.callout.note { background: rgba(139,92,246,.07); border-color: rgba(139,92,246,.3); }
.callout.note .ic { color: var(--violet-soft); }

/* tables */
.doc-table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 14px; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); }
.doc-table th, .doc-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table thead th { background: var(--bg-3); color: var(--text); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table tbody tr:hover { background: var(--surface); }
.doc-table code { font-size: 12.5px; }
.doc-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

/* pills / mode grid in docs */
.mode-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 24px; }
.mode-pills .mp { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.mode-pills .mp b { display: block; margin-bottom: 4px; }
.mode-pills .mp span { font-family: var(--mono); font-size: 12px; color: var(--cyan); }

/* step list */
.steps { counter-reset: step; list-style: none; margin-left: 0; }
.steps li { position: relative; padding-left: 44px; margin-bottom: 18px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: #0a0712;
  background: var(--grad);
}

/* ---------- right TOC ---------- */
.toc {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 44px 22px 60px 10px;
}
.toc .toc-title { font-size: 11px; text-transform: uppercase; letter-spacing: .13em; color: var(--text-faint); font-weight: 700; margin-bottom: 14px; }
.toc a { display: block; font-size: 13px; color: var(--text-faint); padding: 5px 0 5px 12px; border-left: 2px solid var(--border); transition: color .18s, border-color .18s; }
.toc a:hover { color: var(--text-dim); text-decoration: none; }
.toc a.active { color: var(--text); border-left-color: var(--violet); }
.toc a.sub { padding-left: 24px; font-size: 12.5px; }

/* prev/next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager a { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; color: var(--text-dim); transition: border-color .2s, background .2s; }
.pager a:hover { border-color: var(--violet); background: var(--surface); text-decoration: none; }
.pager .dir { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); }
.pager .ttl { color: var(--text); font-weight: 600; margin-top: 4px; }
.pager .next { text-align: right; }

/* scrim for mobile sidebar */
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
  .toc { display: none; }
}
@media (max-width: 920px) {
  .content { padding: 36px 28px 100px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .burger { display: flex; }
  .doc-search { display: none; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: 300px; z-index: 45;
    background: var(--bg-2); transform: translateX(-104%); transition: transform .28s ease;
    height: calc(100vh - var(--topbar-h));
  }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; }
  .content { padding: 30px 20px 90px; }
  .pager { grid-template-columns: 1fr; }
  .mode-pills { grid-template-columns: 1fr; }
  .topbar-right .label-hide { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
