:root {
  /* Surfaces */
  --bg-deep: #07070c;
  --bg-base: #0c0c14;
  --bg-raised: #12121c;
  --bg-hover: #1a1a28;
  --bg-sidebar: #0a0a12;
  --bg-code: #0e0e18;

  /* Borders */
  --border: #1e1e2e;
  --border-strong: #2a2a3d;

  /* Text */
  --text: #e4e4ef;
  --text-muted: #9a9ab0;
  --text-dim: #6b6b80;

  /* Team accents */
  --red: #ef4444;
  --red-dim: #7f1d1d;
  --red-glow: rgba(239, 68, 68, 0.15);
  --blue: #3b82f6;
  --blue-dim: #1e3a5f;
  --blue-glow: rgba(59, 130, 246, 0.15);
  --purple: #a855f7;
  --purple-dim: #4c1d95;
  --purple-glow: rgba(168, 85, 247, 0.18);

  /* Semantic */
  --accent: var(--purple);
  --accent-2: var(--blue);
  --danger: var(--red);
  --link: #7dd3fc;
  --link-hover: #bae6fd;

  /* Layout */
  --sidebar-w: 280px;
  --topbar-h: 56px;
  --content-max: 860px;
  --radius: 10px;
  --radius-sm: 6px;

  /* Fonts */
  --font-display: "Capture It", "Black Ops One", system-ui, sans-serif;
  --font-logo: "Allerta Stencil", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle grid noise */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Top bar ─────────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}
.topbar-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.topbar-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.topbar-brand .name {
  font-family: var(--font-logo);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.topbar-brand .name span {
  display: block;
  color: var(--purple);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 560;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none !important;
}

.btn-ghost {
  background: var(--bg-raised);
  border-color: var(--border-strong);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--text-dim);
}

.btn-primary {
  background: var(--bg-raised);
  border-color: var(--purple);
  color: #e9d5ff;
}
.btn-primary:hover {
  background: var(--bg-hover);
  border-color: #c084fc;
  color: #f3e8ff;
}

.btn-blue {
  background: var(--bg-raised);
  border-color: var(--blue);
  color: #bfdbfe;
}
.btn-blue:hover {
  background: var(--bg-hover);
  border-color: #60a5fa;
  color: #dbeafe;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
}

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

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

/* Full-screen dim behind the mobile drawer.
   Must stay BELOW .sidebar (z-index 90) so taps hit the panel. */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--topbar-h);
  background: rgba(0, 0, 0, 0.55);
  z-index: 80;
  pointer-events: auto;
}
.sidebar-overlay.show {
  display: block;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
/* Sibling of overlay (not inside .shell) so z-index always wins. */

.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.25rem 0 2rem;
  z-index: 90; /* > overlay 80, < topbar 100 */
  pointer-events: auto;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.nav-section {
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  padding: 0 0.6rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: background 0.12s, color 0.12s;
  border-left: 2px solid transparent;
  margin-bottom: 2px;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-link.active {
  background: var(--purple-glow);
  color: #e9d5ff;
  border-left-color: var(--purple);
}

.nav-link .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.nav-link.active .dot {
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
}
.nav-link.red .dot { background: var(--red); }
.nav-link.blue .dot { background: var(--blue); }

/* ── Main content ────────────────────────────────────────────────── */

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem 4rem;
}

.content {
  max-width: var(--content-max);
}

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--purple), var(--blue));
  border-radius: 2px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d8b4fe;
  background: transparent;
  border: 1px solid rgba(168, 85, 247, 0.5);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero h1 .accent-red { color: var(--red); }
.hero h1 .accent-purple { color: var(--purple); }

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 38rem;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

h2 {
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  margin: 2.25rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

h2::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--purple);
}

h2.sec-red::after { background: var(--red); }
h2.sec-blue::after { background: var(--blue); }

h3 {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text);
  margin: 1.5rem 0 0.6rem;
}

p {
  margin-bottom: 0.9rem;
  color: var(--text-muted);
}

strong {
  color: var(--text);
  font-weight: 650;
}

ul, ol {
  margin: 0 0 1rem 1.25rem;
  color: var(--text-muted);
}
li {
  margin-bottom: 0.35rem;
}
li::marker {
  color: var(--purple);
}

/* ── Cards / feature grid ────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

.feature-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  transition: border-color 0.15s;
}
.feature-card:hover {
  border-color: var(--border-strong);
}
.feature-card.red {
  border-top: 2px solid var(--red);
}
.feature-card.blue {
  border-top: 2px solid var(--blue);
}
.feature-card.purple {
  border-top: 2px solid var(--purple);
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.feature-card p {
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.55;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.tag-red {
  background: transparent;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
}
.tag-blue {
  background: transparent;
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
}
.tag-purple {
  background: transparent;
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

/* ── Code blocks ─────────────────────────────────────────────────── */

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
  color: #c4b5fd;
}

pre.blue { border-left-color: var(--blue); color: #93c5fd; }
pre.red { border-left-color: var(--red); color: #fca5a5; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(168, 85, 247, 0.12);
  color: #e9d5ff;
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ── Callouts ────────────────────────────────────────────────────── */

.callout {
  border-radius: var(--radius);
  padding: 0.95rem 1.15rem;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--border-strong);
  background: var(--bg-base);
  font-size: 0.92rem;
}
.callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
}
.callout.purple {
  border-color: rgba(168, 85, 247, 0.35);
  border-left-color: var(--purple);
  background: rgba(168, 85, 247, 0.06);
}
.callout.purple .callout-title { color: #e9d5ff; }
.callout.blue {
  border-color: rgba(59, 130, 246, 0.35);
  border-left-color: var(--blue);
  background: rgba(59, 130, 246, 0.06);
}
.callout.blue .callout-title { color: #bfdbfe; }
.callout.red {
  border-color: rgba(239, 68, 68, 0.35);
  border-left-color: var(--red);
  background: rgba(239, 68, 68, 0.06);
}
.callout.red .callout-title { color: #fecaca; }

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

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th {
  text-align: left;
  padding: 0.65rem 1rem;
  background: var(--bg-raised);
  color: var(--text);
  font-weight: 650;
  border-bottom: 1px solid var(--border-strong);
}
td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(168, 85, 247, 0.04); }

/* ── Steps ───────────────────────────────────────────────────────── */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.75rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--purple-dim);
  border: 1px solid var(--purple);
  color: #e9d5ff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover {
  color: var(--purple);
}

/* Stripe callouts - solid accent bar, light fill */
.callout.callout-stripe {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  background: var(--bg-raised);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
}
.callout.callout-stripe.blue {
  border-left-color: var(--blue);
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.05);
}
.callout.callout-stripe.blue .callout-title {
  color: #93c5fd;
}
.callout.callout-stripe.red {
  border-left-color: var(--red);
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.05);
}
.callout.callout-stripe.red .callout-title {
  color: #fca5a5;
}
.callout.callout-stripe.purple {
  border-left-color: var(--purple);
  border-color: rgba(168, 85, 247, 0.25);
  background: rgba(168, 85, 247, 0.05);
}
.callout.callout-stripe.purple .callout-title {
  color: #d8b4fe;
}
.tabs-primary > .tabs-list {
  margin-bottom: 1.1rem;
}

.tabs-primary > .tabs-list .tab {
  font-size: 0.95rem;
  padding: 0.55rem 1.15rem;
}

.tabs-nested {
  margin-top: 0.5rem;
}

.tabs-nested > .tabs-list .tab {
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
}

/* ── Tabs (install methods) ──────────────────────────────────────── */

.tabs {
  margin: 0.75rem 0 1.25rem;
}

.tabs-list {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
}

.tab {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: #e9d5ff;
  background: var(--bg-raised);
  border-color: var(--border);
  border-bottom-color: var(--bg-raised);
  box-shadow: inset 0 2px 0 var(--purple);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.tab-panel pre {
  margin-top: 0;
}

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

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }
  .main {
    margin-left: 0;
    padding: 1.5rem 1.15rem 3rem;
  }
  .topbar-actions .btn-ghost {
    display: none;
  }
}

/* ── Utility ─────────────────────────────────────────────────────── */

.sep {
  height: 1px;
  background: linear-gradient(90deg, var(--red), var(--purple), var(--blue), transparent);
  margin: 2rem 0;
  opacity: 0.6;
}
/* ── Language switcher ───────────────────────────────────────────── */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-raised);
}

.lang-switch .lang-btn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.lang-switch .lang-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.lang-switch .lang-btn.active {
  background: var(--purple-glow);
  color: #e9d5ff;
}

.lang-switch .lang-btn + .lang-btn {
  border-left: 1px solid var(--border);
}

/* Hide inactive language blocks */
.lang-block[hidden] {
  display: none !important;
}

/* Page hero variant for docs/flags */
.page-hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  border-radius: 2px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}
.page-hero .lead {
  color: var(--text-muted);
  max-width: 40rem;
  font-size: 1.05rem;
}

/* Flag table extras */
.flag-table td:first-child {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #c4b5fd;
}
.flag-group {
  margin-top: 2rem;
}
.flag-group h3 {
  margin-top: 0;
}

/* Note callout at end of overview */
.callout.note-aura {
  margin-top: 2rem;
}

/* ── Terminal output (docs: scanner example) ─────────────────────── */

pre.term {
  --amber: #fbbf24;
  background: var(--bg-deep);
  border-left-color: var(--red);
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: visible;
  box-shadow: inset 0 0 0 1px var(--red-glow);
}
pre.term b { color: var(--text); font-weight: 700; }
.term .t-p { color: var(--red); font-weight: 700; }
.term .t-ps { color: var(--purple); font-weight: 700; }
.term .t-cmd { color: var(--text); }
.term .t-in { color: var(--text); font-weight: 700; }
.term .t-dim { color: var(--text-dim); }
.term .t-loc { color: var(--link); }
.term .t-hl { color: #fca5a5; font-weight: 700; }
.term .t-rule-r { color: var(--red); }
.term .t-rule-a { color: var(--amber); }
.term .t-h-r { color: var(--red); font-weight: 700; }
.term .t-h-a { color: var(--amber); font-weight: 700; }

/* term variants for regular (non-alert) output */
pre.term.term-blue { border-left-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue-glow); }
.term .t-ok { color: #4ade80; font-weight: 700; }
.term .t-w { color: #fbbf24; font-weight: 700; }
.term .t-tag { color: var(--link); }