/* Bernstein Docs — Stylesheet
   Design system: Decision-Grade Quiet Command
   Inspired by Linear, Vercel, and Stripe's restraint. */

/* ================================================================
   Custom Properties
   ================================================================ */
:root {
  /* --- Palette: Light --- */
  --bg:              #fafaf9;
  --bg-2:            #f0f0ee;
  --bg-card:         #ffffff;
  --bg-card-border:  rgba(0, 0, 0, 0.06);
  --text:            #171717;
  --text-2:          #3c3c43;
  --text-3:          #6e6e76;
  --text-4:          #a0a0a8;
  --accent:          #4f46e5;
  --accent-subtle:   #6366f1;
  --accent-bg:       rgba(79, 70, 229, 0.06);
  --accent-hover:    #4338ca;
  --code-bg:         #f4f4f2;
  --term-bg:         #0a0a0b;
  --term-text:       #d4d4d8;
  --nav-bg:          rgba(250, 250, 249, 0.82);
  --border:          rgba(0, 0, 0, 0.08);
  --border-strong:   rgba(0, 0, 0, 0.12);
  --shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow:          0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-lg:       0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);

  /* --- Spacing (8px grid) --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* --- Radii --- */
  --radius:    8px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  /* --- Typography --- */
  --font-sans: "Geist Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", "Fira Code", "Cascadia Code", Menlo, Consolas, monospace;
  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 0.9375rem;
  --text-lg:   1.0625rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --leading:   1.6;

  /* --- Motion --- */
  --ease:       cubic-bezier(0.2, 0, 0, 1);
  --dur-fast:   150ms;
  --dur-normal: 250ms;
}

/* --- Dark mode: auto --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:              #0a0a0b;
    --bg-2:            #141416;
    --bg-card:         #111113;
    --bg-card-border:  rgba(255, 255, 255, 0.06);
    --text:            #ececef;
    --text-2:          #b0b0b8;
    --text-3:          #75757e;
    --text-4:          #4a4a52;
    --accent:          #818cf8;
    --accent-subtle:   #a5b4fc;
    --accent-bg:       rgba(129, 140, 248, 0.08);
    --accent-hover:    #a5b4fc;
    --code-bg:         #18181b;
    --term-bg:         #050506;
    --term-text:       #c8c8ce;
    --nav-bg:          rgba(10, 10, 11, 0.82);
    --border:          rgba(255, 255, 255, 0.07);
    --border-strong:   rgba(255, 255, 255, 0.10);
    --shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow:          0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-lg:       0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  }
}

/* --- Dark mode: explicit toggle --- */
[data-theme="dark"] {
  --bg:              #0a0a0b;
  --bg-2:            #141416;
  --bg-card:         #111113;
  --bg-card-border:  rgba(255, 255, 255, 0.06);
  --text:            #ececef;
  --text-2:          #b0b0b8;
  --text-3:          #75757e;
  --text-4:          #4a4a52;
  --accent:          #818cf8;
  --accent-subtle:   #a5b4fc;
  --accent-bg:       rgba(129, 140, 248, 0.08);
  --accent-hover:    #a5b4fc;
  --code-bg:         #18181b;
  --term-bg:         #050506;
  --term-text:       #c8c8ce;
  --nav-bg:          rgba(10, 10, 11, 0.82);
  --border:          rgba(255, 255, 255, 0.07);
  --border-strong:   rgba(255, 255, 255, 0.10);
  --shadow-sm:       0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow:          0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-lg:       0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  overflow-x: hidden;
  transition: background var(--dur-normal) var(--ease),
              color var(--dur-normal) var(--ease);
}

img { max-width: 100%; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { text-decoration: underline; text-underline-offset: 2px; }

::selection {
  background: var(--accent);
  color: #fff;
}

/* ================================================================
   Typography
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 650; }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-lg); margin-bottom: var(--space-3); }

p {
  color: var(--text-2);
  margin-bottom: var(--space-4);
  max-width: 65ch;
}
p:last-child { margin-bottom: 0; }

ul, ol {
  padding-left: var(--space-6);
  color: var(--text-2);
}
li { margin-bottom: var(--space-1); }

/* Tabular figures for numbers in data contexts */
.tabular-nums,
td,
.flow-num,
.term-body {
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   Layout
   ================================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

section {
  position: relative;
  padding: var(--space-16) 0;
}

/* ================================================================
   Navigation
   ================================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-logo {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  text-decoration: none;
  font-family: var(--font-mono);
}
.nav-logo:hover { text-decoration: none; color: var(--text); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 450;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  text-decoration: none;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-2);
  text-decoration: none;
}
.nav-link.active {
  color: var(--text);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ================================================================
   Mobile menu
   ================================================================ */
.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-3);
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  line-height: 1;
  flex-shrink: 0;
}
.nav-toggle:hover { color: var(--text); background: var(--bg-2); }

.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-3) var(--space-6);
  gap: var(--space-1);
  z-index: 99;
}

/* ================================================================
   Buttons
   ================================================================ */
.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-3);
  font-size: 0.875rem;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  line-height: 1;
}
.btn-icon:hover { color: var(--text); background: var(--bg-2); }
.btn-icon:active { transform: scale(0.98); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: var(--accent);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: transparent;
  color: var(--text) !important;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}
.btn-secondary:hover {
  background: var(--bg-2);
  text-decoration: none;
}
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ================================================================
   Orbs — intentionally suppressed
   The orbs remain structurally present in HTML but are hidden.
   Premium silence: no floating decorations.
   ================================================================ */
.orb {
  display: none;
}
.orb-1, .orb-2 { display: none; }

/* ================================================================
   Hero
   ================================================================ */
.hero {
  padding-top: 104px;
  padding-bottom: var(--space-16);
  overflow: hidden;
}
.hero > .container { position: relative; z-index: 1; }

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-bottom: var(--space-5);
}
[data-theme="dark"] .hero-badge {
  border-color: rgba(129, 140, 248, 0.12);
}

.hero h1 {
  margin-bottom: var(--space-5);
  color: var(--text);
  /* No gradient text — let the type speak plainly */
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--text-3);
  margin-bottom: var(--space-8);
  line-height: 1.6;
  max-width: 50ch;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Entry animation — single controlled reveal */
.hero-enter {
  animation: hero-enter 0.5s var(--ease) both;
}
.hero-enter-late {
  animation: hero-enter 0.5s 0.1s var(--ease) both;
}
@keyframes hero-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   Terminal
   ================================================================ */
.terminal {
  background: var(--term-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.55;
}

.term-bar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: var(--space-3);
}

.term-dots { display: flex; gap: 6px; }
.term-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.7;
}
.term-dots span:nth-child(1) { background: #ff5f56; }
.term-dots span:nth-child(2) { background: #ffbd2e; }
.term-dots span:nth-child(3) { background: #27c93f; }

.term-title {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.6875rem;
  flex: 1;
  text-align: center;
}

.term-body {
  padding: 14px 18px;
  color: var(--term-text);
  white-space: pre;
  overflow-x: auto;
  font-size: var(--text-xs);
}

.t-prompt  { color: #818cf8; }
.t-cmd     { color: #d4d4d8; }
.t-head    { color: #818cf8; font-weight: 600; }
.t-border  { color: #2a2a2e; }
.t-label   { color: #52525b; }
.t-agent   { color: #4ade80; }
.t-task    { color: #fbbf24; }
.t-done    { color: #22d3ee; }
.t-bar     { color: #818cf8; }
.t-dim     { color: #52525b; }
.t-cursor  {
  display: inline-block;
  width: 6px;
  height: 0.85em;
  background: #818cf8;
  vertical-align: text-bottom;
  animation: blink 1.2s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ================================================================
   Section helpers
   ================================================================ */
.section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  margin-bottom: var(--space-4);
}

.section-sub {
  font-size: var(--text-base);
  color: var(--text-3);
  max-width: 560px;
  margin-bottom: var(--space-12);
  line-height: 1.6;
}

/* ================================================================
   Cards
   ================================================================ */
.card-grid {
  display: grid;
  gap: var(--space-4);
}
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: var(--space-6);
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  display: block;
}

.card h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.card p {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin: 0;
}

.feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: var(--space-4);
  color: var(--accent);
}
.feature-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
}

.persona-who {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-1);
}

/* ================================================================
   Comparison table
   ================================================================ */
.comparison-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: var(--text-sm);
}

.comparison-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.comparison-table th:first-child { color: var(--text); }

.comparison-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
.comparison-table tr:last-child td { border-bottom: none; }

.col-bern { color: var(--text); font-weight: 500; }
.check { color: #16a34a; font-weight: 500; }
.col-bern .check { color: var(--accent); }

.comparison-table tr:hover td {
  background: var(--accent-bg);
}

/* ================================================================
   Code blocks
   ================================================================ */
.code-block {
  margin: var(--space-5) 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.code-block pre {
  margin: 0 !important;
  padding: var(--space-4) var(--space-5) !important;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono) !important;
  font-size: var(--text-sm) !important;
  line-height: 1.6 !important;
  background: none !important;
}

code:not([class]) {
  background: var(--code-bg);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  font-size: 0.875em;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

/* ================================================================
   Flow steps
   ================================================================ */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 480px;
}

.flow-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding-bottom: var(--space-6);
  position: relative;
}
.flow-step:last-child { padding-bottom: 0; }

.flow-step::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.flow-step:last-child::before { display: none; }

.flow-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(79, 70, 229, 0.1);
}
[data-theme="dark"] .flow-num {
  border-color: rgba(129, 140, 248, 0.12);
}

.flow-content h4 {
  margin-bottom: var(--space-1);
  font-size: var(--text-base);
  padding-top: 6px;
}
.flow-content p {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin: 0;
}

/* ================================================================
   Doc pages
   ================================================================ */
.page-hero {
  padding-top: 88px;
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-3);
}
.page-hero p {
  font-size: var(--text-base);
  color: var(--text-3);
  max-width: 600px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-12);
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  align-items: start;
}

.doc-nav { position: sticky; top: 76px; }

.doc-nav-title {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  margin-bottom: var(--space-2);
  padding-left: var(--space-3);
}

.doc-nav ul { list-style: none; padding: 0; }
.doc-nav li { margin-bottom: 1px; }

.doc-nav a {
  display: block;
  padding: 5px var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.doc-nav a:hover {
  color: var(--text);
  background: var(--bg-2);
  text-decoration: none;
}
.doc-nav a.active {
  color: var(--text);
  background: var(--bg-2);
  font-weight: 500;
}

.doc-content { min-width: 0; max-width: 65ch; }

.doc-content h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  scroll-margin-top: 76px;
}
.doc-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.doc-content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  scroll-margin-top: 76px;
}

.doc-content p { margin-bottom: var(--space-4); }
.doc-content ul,
.doc-content ol { margin-bottom: var(--space-4); }

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.doc-content th {
  background: var(--bg-2);
  padding: 8px 14px;
  text-align: left;
  font-weight: 500;
  font-size: var(--text-xs);
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}
.doc-content td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.doc-content tr:last-child td { border-bottom: none; }

/* ================================================================
   Callouts
   ================================================================ */
.callout {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border-left: 2px solid;
  margin: var(--space-5) 0;
  font-size: var(--text-sm);
}
.callout-info {
  background: var(--accent-bg);
  border-color: var(--accent);
}
.callout p {
  color: var(--text-2) !important;
  margin: 0 !important;
}

/* ================================================================
   Endpoint cards
   ================================================================ */
.endpoint {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-4) 0;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.method {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

.method-get  { background: rgba(22, 163, 74, 0.08); color: #16a34a; }
.method-post { background: rgba(37, 99, 235, 0.08); color: #2563eb; }
[data-theme="dark"] .method-get  { background: rgba(74, 222, 128, 0.1); color: #4ade80; }
[data-theme="dark"] .method-post { background: rgba(96, 165, 250, 0.1); color: #60a5fa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .method-get  { background: rgba(74, 222, 128, 0.1); color: #4ade80; }
  :root:not([data-theme="light"]) .method-post { background: rgba(96, 165, 250, 0.1); color: #60a5fa; }
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text);
}

.endpoint-body {
  padding: var(--space-3) 14px;
  font-size: var(--text-sm);
  color: var(--text-3);
}

/* ================================================================
   Section alternating background
   ================================================================ */
.section-alt {
  background: var(--bg-2);
}

/* ================================================================
   Two-column layout
   ================================================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

/* ================================================================
   Section description (used in how-it-works)
   ================================================================ */
.section-desc {
  color: var(--text-3);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

/* ================================================================
   Quiet cards (no hover effects, calmer)
   ================================================================ */
.card-quiet {
  transition: none;
}
.card-quiet:hover {
  border-color: var(--bg-card-border);
  transform: none;
  box-shadow: none;
}

/* ================================================================
   Flow list (simplified numbered steps)
   ================================================================ */
.flow-list {
  list-style: none;
  padding: 0;
  counter-reset: flow-counter;
  max-width: 480px;
}

.flow-list li {
  counter-increment: flow-counter;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-5);
  padding-left: var(--space-8);
  position: relative;
  margin-bottom: 0;
}
.flow-list li:last-child {
  padding-bottom: 0;
}

.flow-list li::before {
  content: counter(flow-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.flow-list li strong {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  display: block;
}

.flow-list li span {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.5;
}

/* ================================================================
   Feature groups (categorized features)
   ================================================================ */
.feature-groups {
  display: grid;
  gap: var(--space-10);
}

.feature-group-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.feature-group-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.feature-item {
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
}

.feature-item h4 {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.feature-item p {
  font-size: var(--text-sm);
  color: var(--text-3);
  margin: 0;
}

/* ================================================================
   Quick start
   ================================================================ */
.quick-start-wrap {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.quick-start-wrap .code-block {
  text-align: left;
}

.quick-start-note {
  margin-top: var(--space-4);
  text-align: center;
  color: var(--text-3);
  font-size: var(--text-sm);
}

/* ================================================================
   CTA
   ================================================================ */
.cta-section {
  text-align: center;
  padding: var(--space-16) 0;
}

.cta-box {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--space-12) var(--space-10);
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
}

.cta-box h2 { margin-bottom: var(--space-4); }
.cta-box p { margin-bottom: var(--space-8); color: var(--text-3); margin-left: auto; margin-right: auto; }

.cta-clean {
  max-width: 520px;
  margin: 0 auto;
}

.cta-clean h2 { margin-bottom: var(--space-3); }
.cta-clean p { margin-bottom: var(--space-6); color: var(--text-3); margin-left: auto; margin-right: auto; }

.cta-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================================
   Footer
   ================================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
  text-align: center;
  color: var(--text-4);
  font-size: var(--text-sm);
}
footer a { color: var(--text-4); }
footer a:hover { color: var(--text-2); }

/* ================================================================
   Scroll animations — reduced and respectful
   ================================================================ */
.animate {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease),
              transform 0.4s var(--ease);
}
.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > *:nth-child(1) { transition-delay: 0.04s; }
.stagger > *:nth-child(2) { transition-delay: 0.08s; }
.stagger > *:nth-child(3) { transition-delay: 0.12s; }
.stagger > *:nth-child(4) { transition-delay: 0.16s; }
.stagger > *:nth-child(5) { transition-delay: 0.20s; }
.stagger > *:nth-child(6) { transition-delay: 0.24s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate { opacity: 1; transform: none; }
}

/* ================================================================
   Focus styles
   ================================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 1024px) {
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { gap: var(--space-8); }
}

@media (max-width: 768px) {
  section { padding: var(--space-12) 0; }
  .hero { padding-top: 80px; padding-bottom: var(--space-10); }
  .hero-inner { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr !important; gap: var(--space-8) !important; }
  .card-grid-2,
  .card-grid-3,
  .card-grid-4 { grid-template-columns: 1fr; }
  .feature-group-items { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-nav { display: none; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .cta-box { padding: var(--space-8) var(--space-6); }
  .orb { display: none; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
  .nav-inner { gap: var(--space-3); }
  .terminal { font-size: 0.625rem; }
}

/* ================================================================
   Print
   ================================================================ */
@media print {
  .nav,
  .orb,
  .nav-toggle,
  .btn-icon,
  .cta-section { display: none; }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .hero { padding-top: 0; }
  .terminal { border: 1px solid #ccc; }

  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
