@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-w: 280px;
  --header-h: 64px;

  /* ── Fallback defaults (dark) applied before JS sets data-theme ── */
  --bg: #090d16;
  --surface: #0f1422;
  --surface-2: #161c30;
  --surface-3: #1f2742;
  --border: #1e2640;
  --border-light: #161c30;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.2);
  --header-bg: rgba(15, 20, 34, 0.95);
  --sidebar-bg: #0f1422;
  --code-bg: #06080f;
  --code-text: #e2e8f0;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --badge-bg: rgba(99, 102, 241, 0.15);
  --badge-text: #818cf8;
  --badge-border: rgba(99, 102, 241, 0.3);
}

[data-theme="light"] {
  --bg: #f0f2f7;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --surface-3: #e2e6f0;
  --border: #d1d9e6;
  --border-light: #e8ecf4;
  --text: #0d1117;
  --text-muted: #3d4966;
  --text-faint: #7b8ab8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.1);
  --header-bg: rgba(255, 255, 255, 0.97);
  --sidebar-bg: #f7f8fc;
  --code-bg: #0f172a;
  --code-text: #f8fafc;
  --card-shadow: 0 2px 12px rgba(13, 17, 40, 0.08), 0 1px 3px rgba(13, 17, 40, 0.05);
  --badge-bg: #eef2ff;
  --badge-text: #4f46e5;
  --badge-border: #c7d2fe;
}

[data-theme="dark"] {
  --bg: #090d16;
  --surface: #0f1422;
  --surface-2: #161c30;
  --surface-3: #1f2742;
  --border: #1e2640;
  --border-light: #161c30;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.2);
  --header-bg: rgba(15, 20, 34, 0.95);
  --sidebar-bg: #0f1422;
  --code-bg: #06080f;
  --code-text: #e2e8f0;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --badge-bg: rgba(99, 102, 241, 0.15);
  --badge-text: #818cf8;
  --badge-border: rgba(99, 102, 241, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); color: var(--text); }
a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); text-decoration: none; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ─── 1. TOP FULL-WIDTH HEADER ─── */
.doc-header {
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.brand-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand-badge {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  padding: 3px 8px;
  border-radius: 999px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.search-trigger:hover {
  border-color: var(--primary);
  color: var(--text);
}
.search-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-faint);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-btn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
}
.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.nav-btn.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
}
.nav-btn.cta {
  background: var(--primary);
  color: #ffffff;
}
.nav-btn.cta:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ─── 2. TWO-COLUMN LAYOUT CONTAINER ─── */
.doc-container {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

/* ─── 3. LEFT NAVIGATION SIDEBAR ─── */
.doc-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
  overflow-y: auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-group-title {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  padding: 8px 12px 4px;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}
.sidebar-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke-width: 2;
  color: var(--text-faint);
}
.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.sidebar-link:hover svg {
  color: var(--primary);
}
.sidebar-link.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
}
.sidebar-link.active svg {
  color: var(--primary);
}

/* ─── 4. MAIN ARTICLE CONTENT ─── */
.doc-content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  /* Full-width hero gradient anchored to the top-left of the content pane */
  background-image:
    radial-gradient(ellipse 70% 420px at -5% -40px, var(--primary-glow), transparent 65%),
    radial-gradient(ellipse 40% 280px at 105% 0px, var(--primary-glow), transparent 70%);
  background-color: var(--bg);
}

/* Lighter wash in light mode */
[data-theme="light"] .doc-content {
  background-image:
    radial-gradient(ellipse 80% 480px at -5% -40px, rgba(79, 70, 229, 0.06), transparent 65%),
    radial-gradient(ellipse 45% 300px at 105% 0px, rgba(99, 102, 241, 0.04), transparent 70%);
}
.doc-article {
  max-width: 920px;
  margin: 0 auto;
}

.doc-article h1 {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}
.doc-lead {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.doc-article h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 44px 0 16px;
  padding-top: 16px;
  scroll-margin-top: 80px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-article h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 28px 0 10px;
  scroll-margin-top: 80px;
}
.doc-article p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.75;
}
.doc-article ul, .doc-article ol {
  margin: 0 0 20px 24px;
  color: var(--text-muted);
}
.doc-article li {
  margin-bottom: 6px;
  line-height: 1.65;
}
.doc-article li strong {
  color: var(--text);
}

/* ─── 5. UI BROWSER FRAMES & MOCKUPS ─── */
.browser-frame {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  margin: 24px 0 32px;
}
.browser-bar {
  background: var(--surface-2);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.browser-dot.red { background: #ff5f57; }
.browser-dot.amber { background: #febc2e; }
.browser-dot.green { background: #28c840; }
.browser-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  margin-left: auto;
  background: var(--surface);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.mock-content {
  padding: 24px;
}

/* ─── 6. CALLOUT ALERTS & CARDS ─── */
.docs-alert {
  border-radius: 12px;
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.6;
}
.docs-alert.info {
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--text);
}
.docs-alert.tip {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--text);
}
.docs-alert.warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--text);
}
.docs-alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── 7. STEP-BY-STEP CARDS ─── */
.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  position: relative;
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-glow);
  border: 1px solid var(--badge-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}
.step-card:hover .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.step-title {
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.step-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ─── 8. SEARCH MODAL ─── */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.search-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.search-modal {
  background: var(--surface);
  width: 100%;
  max-width: 580px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.search-modal-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
}
.search-results-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 10px;
}
.search-res-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.search-res-item:hover {
  background: var(--surface-2);
}
.search-res-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
}
.search-res-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── 9. TABLES & UI ELEMENTS ─── */
.doc-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 20px 0 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.doc-table th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
}
.doc-table tr:last-child td {
  border-bottom: none;
}
.doc-table tr:hover td {
  background: var(--surface-2);
  color: var(--text);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-badge.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.pill-badge.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.pill-badge.amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.pill-badge.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* ─── 10. MOBILE OVERLAY & HAMBURGER ─── */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── 12. INTRO PAGE HERO BANNER ─── */
.intro-hero {
  position: relative;
  padding: 36px 0 32px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* No ::before needed – gradient lives on .doc-content */

.intro-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.intro-breadcrumb svg { color: var(--primary); flex-shrink: 0; }
.intro-sep { color: var(--border); }

.intro-status-row { margin-bottom: 16px; }
.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 4px 12px;
  border-radius: 999px;
}
.intro-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: heroDotPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes heroDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.8); }
}

.intro-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 16px;
}
.intro-title-accent {
  display: block;
  background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: heroGradientShift 5s linear infinite alternate;
}
@keyframes heroGradientShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.intro-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 660px;
  margin: 0 0 28px;
}

.intro-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.intro-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 18px var(--primary-glow);
}
.intro-cta-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--primary-glow);
}
.intro-cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}
.intro-cta-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-1px);
}

.intro-stats {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  width: fit-content;
  box-shadow: var(--card-shadow);
}
.intro-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
}
.intro-stat:first-child { padding-left: 4px; }
.intro-stat:last-child  { padding-right: 4px; }
.intro-stat-val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--primary);
  line-height: 1;
}
.intro-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.intro-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .intro-title { font-size: 30px; }
  .intro-stats  { gap: 8px; padding: 12px 14px; }
  .intro-stat   { padding: 0 12px; }
  .intro-stat-val { font-size: 18px; }
}

/* ─── 11. RESPONSIVE MEDIA QUERIES ─── */
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex; }
  .doc-sidebar {
    position: fixed;
    left: 0;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    z-index: 45;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .doc-sidebar.open {
    transform: translateX(0);
  }
  .header-nav { display: none; }
  .doc-content { padding: 24px 20px; }
  .search-kbd { display: none; }
}

@media (max-width: 640px) {
  .doc-header { padding: 0 16px; }
  .brand-badge { display: none; }
  .doc-article h1 { font-size: 28px; }
  .doc-article h2 { font-size: 19px; }
}
