:root,
[data-theme="dark"] {
  --color-bg-primary: #060a14;
  --color-bg-secondary: #0c1220;
  --color-bg-tertiary: #131b2e;
  --color-border: #1a2540;
  --color-text-primary: #f0f4ff;
  --color-text-secondary: #94a3c8;
  --color-text-muted: #586887;
  --color-accent-blue: #2563eb;
  --color-accent-cyan: #06b6d4;
  --color-accent-blue-hover: #1d4ed8;
  --color-gradient-start: #2563eb;
  --color-gradient-end: #06b6d4;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-glass-bg: rgba(12, 18, 32, 0.82);
  --color-glass-border: rgba(37, 99, 235, 0.15);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.14), 0 16px 48px rgba(0, 0, 0, 0.22);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="light"] {
  --color-bg-primary: #f8faff;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #f0f4fb;
  --color-border: #dde4f0;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #7c8db5;
  --color-accent-blue: #1d4ed8;
  --color-accent-cyan: #0891b2;
  --color-accent-blue-hover: #1e40af;
  --color-gradient-start: #1d4ed8;
  --color-gradient-end: #0891b2;
  --color-success: #047857;
  --color-warning: #b45309;
  --color-error: #b91c1c;
  --color-glass-bg: rgba(255, 255, 255, 0.88);
  --color-glass-border: rgba(29, 78, 216, 0.12);
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.06), 0 16px 48px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.05), 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app-shell {
  background: var(--color-bg-primary);
  overflow-x: hidden; /* prevent horizontal scroll on assistant page */
  width: 100%;
  max-width: 100vw;
}

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

/* Fix Safari bug where icons shrink inside flex/grid containers */
.lucide,
[data-lucide] {
  flex-shrink: 0;
  max-width: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3,
h4 {
  margin-top: 0;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p {
  color: var(--color-text-secondary);
}

ul,
ol {
  padding-left: 1.2rem;
}

::selection {
  background: rgba(6, 182, 212, 0.24);
}

:focus-visible {
  outline: 2px solid var(--color-accent-cyan);
  outline-offset: 3px;
}

.page {
  min-height: 100vh;
  padding-top: 76px;
}

.page--centered {
  display: grid;
  place-items: center;
  padding: 96px 20px 40px;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.container--narrow {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 48px 0;
}

.section__eyebrow {
  margin-bottom: 10px;
  color: var(--color-accent-cyan);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section__title {
  margin-bottom: 16px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.section__lead {
  max-width: 640px;
  margin-bottom: 36px;
  color: var(--color-text-secondary);
  font-size: 1.08rem;
  line-height: 1.7;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glass-card {
  background: var(--color-glass-bg);
  border: 1px solid var(--color-glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-scroll {
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
}

.icon--lg {
  width: 28px;
  height: 28px;
}

.icon-bubble {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--color-gradient-start), var(--color-gradient-end));
  border-radius: 14px;
}

.hidden {
  display: none;
}

.muted {
  color: var(--color-text-muted);
}

.disclaimer {
  border-color: rgba(245, 158, 11, 0.35);
  background: color-mix(in srgb, var(--color-warning) 8%, var(--color-glass-bg));
}

.api-page {
  padding: 104px 0 72px;
}

.split-layout {
  display: grid;
  gap: 24px;
}

/* ─── Legal pages (privacy, terms) ─────────────────────────────────────────── */
.legal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.legal-grid .card {
  padding: 32px;
}

.legal-grid .card h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.legal-grid .card p {
  margin-top: 0;
  margin-bottom: 16px;
  line-height: 1.75;
  color: var(--color-text-secondary);
}

.legal-grid .card p:last-child {
  margin-bottom: 0;
}

.legal-grid .card ul {
  margin-top: 14px;
  margin-bottom: 18px;
  padding-left: 24px;
}

.legal-grid .card li {
  margin-bottom: 10px;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.legal-grid .card li:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .container {
    width: min(1200px, calc(100% - 48px));
  }

  .container--narrow {
    width: min(760px, calc(100% - 48px));
  }

  .section {
    padding: 80px 0;
  }

  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}