/* ============================================================
   AiWma Docs — Base Stylesheet
   Shared by all documentation pages.
   Design reference: Linear.app docs + AiWma brand tokens
   ============================================================ */

:root {
  /* Brand */
  --brand-orange:       #E8703A;
  --brand-orange-light: #F08555;
  --brand-orange-dark:  #CC5A27;
  --brand-navy:         #1B3A5C;
  --brand-navy-light:   #2A5580;

  /* Dark ground */
  --ink-900: #07101C;
  --ink-800: #0B1726;
  --ink-700: #122334;
  --ink-600: #1C3148;
  --ink-500: #2A4360;

  /* Text on dark */
  --text-d-1: #F4F6FA;
  --text-d-2: rgba(244, 246, 250, 0.72);
  --text-d-3: rgba(244, 246, 250, 0.46);
  --text-d-4: rgba(244, 246, 250, 0.26);
  --line-d:   rgba(244, 246, 250, 0.10);
  --line-d2:  rgba(244, 246, 250, 0.06);

  /* Typography */
  --font-sans: 'Inter Tight', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Dimensions */
  --sidebar-w: 260px;
  --topbar-h:  56px;
  --content-max: 720px;

  /* Easing */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Surface tokens — used by interactive doc components */
  --surface-1: rgba(244,246,250,0.04);
  --surface-2: rgba(244,246,250,0.08);
  --border:    rgba(244,246,250,0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }

body {
  font-family: var(--font-sans);
  background: var(--ink-900);
  color: var(--text-d-1);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-d-1); }
::selection { background: var(--brand-orange); color: #fff; }

/* ── Layout ──────────────────────────────────────────────── */

.docs-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 200;
  display: flex; align-items: center;
  padding: 0 24px;
  background: rgba(7, 16, 28, 0.90);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--line-d);
}

.docs-topbar-inner {
  display: flex; align-items: center; gap: 20px; width: 100%;
}

.docs-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15.5px; letter-spacing: -0.01em;
  color: var(--text-d-1); flex-shrink: 0;
}

.docs-logo-mark {
  width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, #E8703A 0%, #CC5A27 100%);
  display: grid; place-items: center; flex-shrink: 0;
}

.docs-logo-mark svg { width: 14px; height: 14px; }

.docs-logo-sep {
  width: 1px; height: 16px; background: var(--line-d);
  margin: 0 2px;
}

.docs-logo-label {
  font-size: 13px; font-weight: 500;
  color: var(--text-d-3); letter-spacing: 0.04em;
  font-family: var(--font-mono);
}

.docs-version {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(232,112,58,0.12);
  color: var(--brand-orange-light);
  border: 1px solid rgba(232,112,58,0.22);
}

.docs-topbar-right {
  margin-left: auto; display: flex; align-items: center; gap: 16px;
}

.docs-home-link {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-d-3); letter-spacing: 0.04em;
  transition: color 160ms;
}
.docs-home-link:hover { color: var(--brand-orange); }

.docs-hamburger {
  display: none; padding: 6px;
  background: none; border: none; color: var(--text-d-2); cursor: pointer;
  border-radius: 6px; transition: background 160ms;
}
.docs-hamburger:hover { background: var(--line-d); }
.docs-hamburger svg { width: 18px; height: 18px; display: block; }

/* Main layout */

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

/* ── Sidebar ──────────────────────────────────────────────── */

.docs-sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 0 40px;
  border-right: 1px solid var(--line-d);
  background: var(--ink-900);
  scrollbar-width: thin;
  scrollbar-color: var(--line-d) transparent;
  z-index: 100;
  transition: transform 280ms var(--ease);
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--line-d); border-radius: 2px; }

.docs-nav-group { margin-bottom: 28px; }

.docs-nav-group-label {
  display: block;
  padding: 0 20px 8px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-d-4); font-weight: 500;
}

.docs-nav-links { list-style: none; }

.docs-nav-links a {
  display: flex; align-items: center;
  padding: 7px 20px; gap: 9px;
  font-size: 13.5px; color: var(--text-d-3);
  border-radius: 0;
  transition: color 140ms, background 140ms;
  position: relative; line-height: 1.3;
}

.docs-nav-links a:hover {
  color: var(--text-d-1);
  background: var(--line-d2);
}

.docs-nav-links a.active {
  color: var(--text-d-1);
  background: rgba(232,112,58,0.08);
  font-weight: 500;
}

.docs-nav-links a.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 60%; min-height: 16px;
  background: var(--brand-orange);
  border-radius: 0 2px 2px 0;
}

.docs-nav-links a.soon {
  opacity: 0.4; cursor: default; pointer-events: none;
}

.docs-nav-links a.soon::after {
  content: 'soon';
  font-family: var(--font-mono); font-size: 9px;
  letter-spacing: 0.06em; color: var(--text-d-4);
  background: var(--line-d); border-radius: 3px;
  padding: 1px 5px; margin-left: auto;
}

.docs-nav-links .nav-indent {
  padding-left: 36px;
  font-size: 13px;
}

/* Sidebar icons */
.nav-icon {
  width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5;
}
.docs-nav-links a.active .nav-icon { opacity: 1; }
.docs-nav-links a:hover .nav-icon { opacity: 0.8; }

/* ── Content area ─────────────────────────────────────────── */

.docs-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--topbar-h));
  padding: 52px 48px 96px;
  display: flex;
  justify-content: flex-start;
}

.docs-article {
  width: 100%;
  max-width: var(--content-max);
}

/* Breadcrumb */
.docs-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-d-4); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 28px;
}
.docs-breadcrumb a { color: var(--text-d-3); transition: color 140ms; }
.docs-breadcrumb a:hover { color: var(--brand-orange); }
.docs-breadcrumb-sep { color: var(--line-d); }

/* ── Prose Typography ─────────────────────────────────────── */

.docs-article h1 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.026em;
  color: var(--text-d-1); margin-bottom: 16px;
}

.docs-article .page-subtitle {
  font-size: 16px; line-height: 1.65;
  color: var(--text-d-2); margin-bottom: 40px;
  max-width: 580px;
}

.docs-article h2 {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.016em; line-height: 1.3;
  color: var(--text-d-1);
  margin: 48px 0 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line-d);
}

.docs-article h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }

.docs-article h3 {
  font-size: 15.5px; font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--text-d-1); margin: 28px 0 10px;
}

.docs-article p {
  font-size: 14.5px; line-height: 1.80; color: var(--text-d-2);
  margin-bottom: 16px;
}

.docs-article strong { color: var(--text-d-1); font-weight: 600; }
.docs-article em { font-style: italic; }

.docs-article ul, .docs-article ol {
  padding-left: 20px; margin-bottom: 16px;
}

.docs-article li {
  font-size: 14.5px; line-height: 1.75; color: var(--text-d-2); margin-bottom: 5px;
}

.docs-article hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-d), transparent);
  margin: 40px 0;
}

/* Inline code */
.docs-article code {
  font-family: var(--font-mono); font-size: 13px;
  background: rgba(244,246,250,0.07); border: 1px solid var(--line-d);
  border-radius: 5px; padding: 1px 6px;
  color: var(--brand-orange-light);
}

/* Code blocks */
.docs-article pre {
  background: var(--ink-800); border: 1px solid var(--line-d);
  border-radius: 10px; overflow-x: auto; margin: 20px 0 28px;
  position: relative;
}

.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line-d);
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-d-4); letter-spacing: 0.06em; text-transform: uppercase;
}

.code-lang { color: var(--brand-orange); }

.docs-article pre code {
  display: block;
  background: none; border: none; padding: 18px 20px;
  font-size: 13px; line-height: 1.7; color: var(--text-d-2);
  border-radius: 0;
}

/* ── Callout boxes ────────────────────────────────────────── */

.callout {
  display: flex; gap: 14px;
  padding: 16px 18px; border-radius: 8px;
  margin: 20px 0; font-size: 14px; line-height: 1.65;
}

.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.callout.info {
  background: rgba(27,58,92,0.30); border: 1px solid rgba(42,85,128,0.35);
  color: #9CCEF5;
}
.callout.tip {
  background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.20);
  color: #6EE7B7;
}
.callout.warning {
  background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.25);
  color: #FCD34D;
}
.callout.danger {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.20);
  color: #FCA5A5;
}

.callout p { margin: 0; font-size: inherit; color: inherit; }
.callout strong { color: inherit; }

/* ── Tables ───────────────────────────────────────────────── */

.docs-table-wrap { overflow-x: auto; margin: 20px 0 28px; border-radius: 10px; }

.docs-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  background: var(--ink-800); border: 1px solid var(--line-d);
  border-radius: 10px; overflow: hidden;
}

.docs-table th {
  padding: 10px 16px; text-align: left;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-d-4); background: rgba(244,246,250,0.03);
  border-bottom: 1px solid var(--line-d);
}

.docs-table td {
  padding: 10px 16px; color: var(--text-d-2);
  border-bottom: 1px solid var(--line-d2);
  vertical-align: top; line-height: 1.55;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table td code {
  font-size: 12px; padding: 1px 5px;
}

/* ── Cards (for landing page) ────────────────────────────── */

.doc-card-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin: 24px 0;
}

.doc-card {
  background: var(--ink-800); border: 1px solid var(--line-d);
  border-radius: 10px; padding: 20px;
  text-decoration: none; color: inherit;
  transition: border-color 200ms, transform 200ms;
  display: block;
}

.doc-card:hover { border-color: rgba(232,112,58,0.35); transform: translateY(-1px); }

.doc-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(232,112,58,0.12); border: 1px solid rgba(232,112,58,0.22);
  display: grid; place-items: center; margin-bottom: 12px;
  font-size: 16px;
}

.doc-card h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
  color: var(--text-d-1); letter-spacing: -0.006em;
}

.doc-card p { font-size: 13px; line-height: 1.6; color: var(--text-d-3); margin: 0; }

/* Quick-start steps */
.quickstart-steps { counter-reset: step; display: flex; flex-direction: column; gap: 0; }

.qs-step {
  display: flex; gap: 16px; position: relative;
  padding-bottom: 28px;
}

.qs-step:last-child { padding-bottom: 0; }

.qs-step:not(:last-child)::before {
  content: '';
  position: absolute; left: 15px; top: 32px; bottom: 0; width: 1px;
  background: var(--line-d);
}

.qs-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-800); border: 1px solid var(--line-d);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--brand-orange); counter-increment: step; z-index: 1;
}

.qs-body { flex: 1; padding-top: 5px; }
.qs-body h3 { font-size: 15px; font-weight: 600; color: var(--text-d-1); margin-bottom: 8px; }
.qs-body p { font-size: 14px; color: var(--text-d-2); margin-bottom: 10px; }
.qs-body pre { margin-top: 10px; }

/* Status badge */
.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.badge-green { background: rgba(16,185,129,0.12); color: #6EE7B7; border: 1px solid rgba(16,185,129,0.25); }
.badge-orange { background: rgba(232,112,58,0.12); color: var(--brand-orange-light); border: 1px solid rgba(232,112,58,0.25); }
.badge-blue { background: rgba(27,58,92,0.40); color: #7BBCE8; border: 1px solid rgba(42,85,128,0.35); }
.badge-mute { background: rgba(244,246,250,0.06); color: var(--text-d-3); border: 1px solid var(--line-d); }

/* On-this-page nav (right side) */
.docs-on-page {
  position: fixed;
  top: calc(var(--topbar-h) + 48px);
  right: 32px;
  width: 200px;
  font-size: 12.5px;
}

.docs-on-page-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-d-4); margin-bottom: 10px; display: block;
}

.docs-on-page ul { list-style: none; }
.docs-on-page a {
  display: block; padding: 4px 0; color: var(--text-d-4);
  transition: color 140ms; border-left: 1.5px solid transparent;
  padding-left: 12px; margin-left: -12px;
}
.docs-on-page a:hover { color: var(--text-d-2); }
.docs-on-page a.active { color: var(--brand-orange); border-left-color: var(--brand-orange); }

/* ── Footer ───────────────────────────────────────────────── */

.docs-footer {
  border-top: 1px solid var(--line-d);
  margin-top: 64px; padding-top: 32px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}

.docs-footer-nav { display: flex; gap: 8px; }

.docs-footer-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--ink-800); border: 1px solid var(--line-d);
  font-size: 13px; color: var(--text-d-2);
  transition: border-color 180ms, color 180ms;
  text-decoration: none;
}
.docs-footer-btn:hover { border-color: rgba(232,112,58,0.35); color: var(--text-d-1); }
.docs-footer-btn .dir { font-family: var(--font-mono); opacity: 0.5; }
.docs-footer-btn .lbl { font-size: 12.5px; }
.docs-footer-btn .ttl { font-weight: 500; color: var(--text-d-1); font-size: 13px; }

.docs-footer-copy {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-d-4); letter-spacing: 0.04em;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1100px) {
  .docs-on-page { display: none; }
}

@media (max-width: 860px) {
  .docs-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .docs-content { margin-left: 0; padding: 36px 24px 80px; }
  .docs-hamburger { display: flex; align-items: center; }
  .doc-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .docs-content { padding: 28px 16px 72px; }
  .docs-topbar { padding: 0 16px; }
}

/* ─────────────────────────────────────────────────────────────
   PROSE ALIAS: .docs-content-inner mirrors .docs-article
   All doc pages use .docs-content-inner as the inner wrapper;
   these rules mirror every .docs-article rule exactly.
   ───────────────────────────────────────────────────────────── */

.docs-content-inner {
  width: 100%;
  max-width: var(--content-max);
}

.docs-content-inner h1 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700; line-height: 1.15; letter-spacing: -0.026em;
  color: var(--text-d-1); margin-bottom: 16px;
}

.docs-content-inner .docs-lead,
.docs-content-inner .page-subtitle {
  font-size: 16px; line-height: 1.65;
  color: var(--text-d-2); margin-bottom: 40px;
  max-width: 580px;
}

.docs-content-inner h2 {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.016em; line-height: 1.3;
  color: var(--text-d-1);
  margin: 48px 0 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line-d);
}

.docs-content-inner h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }

.docs-content-inner h3 {
  font-size: 15.5px; font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--text-d-1); margin: 28px 0 10px;
}

.docs-content-inner p {
  font-size: 14.5px; line-height: 1.80; color: var(--text-d-2);
  margin-bottom: 16px;
}

.docs-content-inner strong { color: var(--text-d-1); font-weight: 600; }
.docs-content-inner em { font-style: italic; }

.docs-content-inner ul,
.docs-content-inner ol {
  padding-left: 20px; margin-bottom: 16px;
}

.docs-content-inner li {
  font-size: 14.5px; line-height: 1.75; color: var(--text-d-2); margin-bottom: 5px;
}

.docs-content-inner hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-d), transparent);
  margin: 40px 0;
}

.docs-content-inner code {
  font-family: var(--font-mono); font-size: 13px;
  background: rgba(244,246,250,0.07); border: 1px solid var(--line-d);
  border-radius: 5px; padding: 1px 6px;
  color: var(--brand-orange-light);
}

.docs-content-inner pre {
  background: var(--ink-800); border: 1px solid var(--line-d);
  border-radius: 10px; overflow-x: auto; margin: 20px 0 28px;
  position: relative;
}

.docs-content-inner pre code {
  display: block;
  background: none; border: none; padding: 18px 20px;
  font-size: 13px; line-height: 1.7; color: var(--text-d-2);
  border-radius: 0;
}

.docs-content-inner a {
  color: var(--brand-orange-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.docs-content-inner a:hover { color: var(--brand-orange); }

/* ─────────────────────────────────────────────────────────────
   STANDALONE ALIASES — classes used in pages but not in the
   original .docs-article context.
   ───────────────────────────────────────────────────────────── */

/* Lead / subtitle text */
.docs-lead {
  font-size: 16px; line-height: 1.65;
  color: var(--text-d-2); margin-bottom: 40px;
  max-width: 580px;
}

/* On-page TOC — title label variant */
.docs-on-page-title {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-d-4); margin-bottom: 10px; display: block;
}

/* Quickstart steps as <ol> with <li> containing .step-num  */
.quickstart-steps {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 28px;
}

.quickstart-steps li {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 28px;
  font-size: 14.5px;
  color: var(--text-d-2);
  line-height: 1.75;
}

.quickstart-steps li:last-child { padding-bottom: 0; }

.quickstart-steps li:not(:last-child)::before {
  content: '';
  position: absolute; left: 15px; top: 32px; bottom: 0; width: 1px;
  background: var(--line-d);
}

.step-num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-800); border: 1px solid var(--line-d);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: var(--brand-orange); z-index: 1;
}

.quickstart-steps li > div { flex: 1; padding-top: 5px; }
.quickstart-steps li > div strong { color: var(--text-d-1); font-weight: 600; display: block; margin-bottom: 4px; }

/* Footer navigation — .docs-footer-btns wraps prev/next buttons */
.docs-footer-btns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line-d);
}

.docs-footer-btns .docs-footer-btn.prev { margin-right: auto; }
.docs-footer-btns .docs-footer-btn.next { margin-left: auto; }
