/* ==========================================================================
   SPIKE Docs — docs.spike.metacorp.cloud
   Self-contained: tokens copied from the main site styles.css (28 Nov 2026).
   styles.css is NEVER edited; this file carries everything the docs need.
   ========================================================================== */

@font-face {
  font-family: 'Mazzard';
  src: url('assets/fonts/MazzardH-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mazzard';
  src: url('assets/fonts/MazzardH-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mazzard';
  src: url('assets/fonts/MazzardH-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mazzard';
  src: url('assets/fonts/MazzardH-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mazzard';
  src: url('assets/fonts/MazzardH-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-canvas: #0b0b0d;
  --bg-deep: #060607;
  --bg-surface: #18181b;
  --bg-surface-head: #242428;
  --bg-field: #141417;
  --bg-hover: #2e2e33;
  --border-rail: rgba(255, 255, 255, 0.08);
  --border-hairline: rgba(255, 255, 255, 0.07);
  --border-node: #3f3f46;
  --text-primary: #f4f4f5;
  --text-secondary: #b4b4bd;
  --text-muted: #94949e;
  --accent-orange: #f35d27;
  --accent-amber: #d77f1c;
  --accent-grad: linear-gradient(135deg, #f35d27 0%, #d77f1c 100%);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-w: 288px;
  --rail-w: 216px;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  color-scheme: dark;
  font-family: 'Mazzard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-orange); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: rgba(243, 93, 39, 0.35); }

/* ------------------------------------------------------------------ header */
.docs-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}
.docs-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.docs-header .brand:hover { text-decoration: none; }
.docs-header .brand img { width: 28px; height: 28px; display: block; }
.docs-header .brand .docs-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--accent-grad);
  border-radius: 6px;
  padding: 2px 7px;
  text-transform: uppercase;
}
.docs-search {
  flex: 1;
  max-width: 420px;
  margin-left: 8px;
}
.docs-search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border-node);
  border-radius: 9px;
  background: var(--bg-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394949e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 16px 16px;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.docs-search input:focus { border-color: var(--accent-orange); }
.docs-search input::placeholder { color: var(--text-muted); }
.header-links { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.header-link:hover { color: var(--text-primary); }
.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 9px;
  border: none;
  background: var(--accent-grad);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-buy:hover { text-decoration: none; filter: brightness(1.07); }
.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-node);
  border-radius: 9px;
  background: var(--bg-field);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ----------------------------------------------------------------- layout */
.docs-shell {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---------------------------------------------------------------- sidebar */
.docs-sidebar {
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  padding: 20px 14px 48px 20px;
  border-right: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
  scrollbar-width: thin;
  scrollbar-color: var(--border-node) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border-node); border-radius: 3px; }
.nav-group { margin: 0 0 22px; }
.nav-group > .nav-label {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a {
  display: block;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.45;
}
.nav-group a:hover { color: var(--text-primary); background: var(--bg-hover); text-decoration: none; }
.nav-group a.active {
  color: var(--text-primary);
  background: rgba(243, 93, 39, 0.1);
  border-left-color: var(--accent-orange);
  font-weight: 600;
}
.nav-group a.is-hidden { display: none; }
.sidebar-foot {
  margin: 8px 10px 0;
  padding: 14px;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  background: var(--bg-surface);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.sidebar-foot strong { color: var(--text-primary); }
.sidebar-foot .btn-buy { width: 100%; margin-top: 10px; }
.search-empty {
  display: none;
  padding: 12px 10px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------------------------------------------------------------- content */
.docs-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  justify-content: center;
}
.docs-content {
  width: 100%;
  max-width: 780px;
  padding: 40px 40px 80px;
}
.docs-content section { scroll-margin-top: 84px; }
.docs-content section + section { margin-top: 8px; }

.docs-content h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.docs-content h1 .accent { color: var(--accent-orange); }
.docs-content .lede {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.docs-content h2 {
  margin: 56px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--border-hairline);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
  scroll-margin-top: 84px;
}
.docs-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.docs-content h3 {
  margin: 30px 0 10px;
  font-size: 18px;
  font-weight: 700;
}
.docs-content p { margin: 0 0 14px; }
.docs-content ul, .docs-content ol { margin: 0 0 16px; padding-left: 24px; }
.docs-content li { margin-bottom: 7px; }
.docs-content li::marker { color: var(--accent-orange); font-weight: 700; }
.docs-content strong { color: var(--text-primary); }

/* numbered steps */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  position: relative;
  counter-increment: step;
  margin: 0 0 18px;
  padding: 16px 16px 16px 60px;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  background: var(--bg-surface);
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.steps > li > strong { display: block; margin-bottom: 2px; font-size: 16px; }
.steps > li p:last-child { margin-bottom: 0; }

/* callouts */
.callout {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--accent-orange);
  background: rgba(243, 93, 39, 0.08);
  font-size: 15px;
}
.callout.warn {
  border-left-color: #f5a623;
  background: rgba(245, 166, 35, 0.08);
}
.callout strong:first-child { display: block; margin-bottom: 2px; }
.callout p:last-child { margin-bottom: 0; }

/* tables */
.docs-content table {
  width: 100%;
  margin: 16px 0 20px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.55;
}
.docs-content th, .docs-content td {
  padding: 10px 12px;
  border: 1px solid var(--border-hairline);
  text-align: left;
  vertical-align: top;
}
.docs-content th { background: var(--bg-surface-head); font-weight: 700; }
.docs-content td:first-child { font-weight: 600; white-space: nowrap; }

/* screenshot placeholders */
.shot { margin: 20px 0 24px; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border-rail);
}
.shot figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.shot figcaption .shot-no {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.shot figcaption strong { color: var(--text-secondary); font-weight: 600; }

/* keyboard keys */
kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border-node);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-field);
  font: 600 13px/1.6 'Mazzard', sans-serif;
  color: var(--text-primary);
}

/* FAQ */
.faq-item {
  margin: 0 0 12px;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  background: var(--bg-surface);
  overflow: hidden;
}
.faq-item summary {
  padding: 15px 18px;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent-orange); }
.faq-item .faq-a { padding: 0 18px 16px; color: var(--text-secondary); }
.faq-item .faq-a p:last-child { margin-bottom: 0; }

/* prev / next */
.page-nav {
  display: flex;
  gap: 12px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
}
.page-nav a {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 14px;
}
.page-nav a:hover { border-color: var(--accent-orange); text-decoration: none; color: var(--text-primary); }
.page-nav a .pn-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.page-nav a .pn-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.page-nav a.next { text-align: right; }
.page-nav a.next:only-child { margin-left: auto; }

/* right rail */
.docs-rail {
  width: var(--rail-w);
  flex: none;
  padding: 44px 24px 40px 0;
}
.docs-rail .rail-inner { position: sticky; top: 96px; }
.docs-rail .rail-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.docs-rail ul { list-style: none; margin: 0; padding: 0; }
.docs-rail a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.45;
}
.docs-rail a:hover { color: var(--text-primary); text-decoration: none; }
.docs-rail a.active { color: var(--accent-orange); border-left-color: var(--accent-orange); }

/* footer */
.docs-footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--border-hairline);
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.docs-footer a { color: var(--text-secondary); }

/* scroll progress */
.scroll-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent-grad);
  z-index: 70;
}

/* overlay for mobile drawer */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 55;
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 1279px) {
  .docs-rail { display: none; }
}
@media (max-width: 899px) {
  .docs-search { display: none; }
  .header-link { display: none; }
  .menu-btn { display: inline-flex; }
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease-out-expo);
    z-index: 58;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }
  body.sidebar-open .docs-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .docs-main { margin-left: 0; }
  .docs-content { padding: 28px 20px 64px; }
  .docs-content h1 { font-size: 28px; }
  .docs-content h2 { font-size: 21px; }
  .page-nav { flex-direction: column; }
  .page-nav a.next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .docs-sidebar { transition: none; }
}
