/* ═══════════════════════════════════════════════════════════════
   Greeks — shared visual layer (theme.css)
   Loaded AFTER each page's inline <style> so it wins the cascade.
   RULE: paint only — colors, gradients, shadows, transforms.
   Never change layout metrics (heights, paddings, margins, display).
   The dashboard light theme (body.light) overrides via higher
   specificity, so dark-only paint here must stay at low specificity.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #02040a;
  --bg2: #070c18;
  --surface: #0c1322;
  --surface2: #101a2c;
  --border: #1c2845;
  --border2: #2a3a63;
  --accent: #3b82f6;
  --accent2: #6366f1;
  --grad: linear-gradient(135deg, #3b82f6, #6366f1 55%, #8b5cf6);
  --grad-text: linear-gradient(115deg, #60a5fa 0%, #818cf8 45%, #22d3ee 100%);
  --glow: 0 0 40px rgba(59, 130, 246, .16);
  --ring: 0 0 0 3px rgba(59, 130, 246, .25);
}

/* ── Ambient backdrop: aurora washes + faint top grid (pure CSS, no JS) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% -120px, rgba(59, 130, 246, .13), transparent 70%),
    radial-gradient(700px 500px at 88% 12%, rgba(99, 102, 241, .07), transparent 70%),
    radial-gradient(640px 460px at 8% 85%, rgba(34, 211, 238, .045), transparent 70%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(720px 380px at 50% 0, #000 30%, transparent 100%);
  mask-image: radial-gradient(720px 380px at 50% 0, #000 30%, transparent 100%);
}
body.light::before, body.light::after { content: none; }

/* ── Selection / focus / scrollbar ── */
::selection { background: rgba(59, 130, 246, .35); color: #fff; }
:focus-visible { outline: 2px solid rgba(59, 130, 246, .65); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3b4d7e; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Nav: deeper glass + hairline glow ── */
nav {
  background: rgba(3, 6, 14, .7);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid rgba(59, 130, 246, .12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 8px 32px -12px rgba(2, 4, 10, .8);
}
.nav-logo svg { filter: drop-shadow(0 0 8px rgba(59, 130, 246, .55)); }
.nav-tab { transition: color .15s, background .15s, box-shadow .15s; }
.nav-tab:hover { color: var(--text); background: rgba(59, 130, 246, .08); }
.nav-tab.active {
  color: var(--text);
  background: rgba(59, 130, 246, .12);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .22);
}
.nav-cta {
  background: var(--grad);
  box-shadow: 0 2px 16px rgba(59, 130, 246, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.nav-cta:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(59, 130, 246, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}
body.light nav { box-shadow: 0 1px 0 rgba(15, 23, 42, .05); }
body.light .nav-logo svg { filter: none; }
/* Mobile: nav rows were overflowing the viewport — let the nav itself scroll */
@media (max-width: 720px) {
  nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
}

/* ── Primary / ghost buttons (shared across all pages) ── */
.btn-primary, .plan-btn-primary {
  background: var(--grad);
  box-shadow: 0 2px 20px rgba(59, 130, 246, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.btn-primary:hover, .plan-btn-primary:hover {
  opacity: 1;
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 32px rgba(59, 130, 246, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-ghost, .plan-btn-ghost {
  background: rgba(148, 163, 184, .04);
  transition: border-color .18s, color .18s, background .18s, transform .18s;
}
.btn-ghost:hover, .plan-btn-ghost:hover {
  background: rgba(59, 130, 246, .08);
  transform: translateY(-1px);
}

/* ── Marketing cards: top sheen + hover lift ── */
.feature-card, .plan-card, .demo-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 38%),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 1px 2px rgba(0, 0, 0, .4);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.feature-card:hover {
  border-color: rgba(59, 130, 246, .35);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 16px 40px -16px rgba(59, 130, 246, .25);
}
.feature-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, .16), rgba(99, 102, 241, .1));
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, .18);
}
.plan-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.plan-card.featured {
  border-color: rgba(59, 130, 246, .55);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, .07), transparent 45%),
    var(--surface);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, .2), 0 12px 48px -12px rgba(59, 130, 246, .35);
}
.plan-card.featured::before { background: var(--grad); }

/* ── Section headers ── */
.section-label {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.section-title {
  background: linear-gradient(180deg, #f8fafc 30%, #a5b4cf);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
body.light .section-title { background: none; -webkit-text-fill-color: currentColor; color: var(--text); }

/* ── Inputs: accent focus ring (paint only) ── */
input:focus, select:focus, textarea:focus {
  border-color: rgba(59, 130, 246, .6);
  box-shadow: var(--ring);
}

/* ── Footer ── */
footer { background: linear-gradient(180deg, var(--bg2), #03050c); }
.footer-links a:hover { color: var(--accent); }

/* ── Motion safety ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
