/* ═══════════════════════════════════════════════════════
   AI Router — Shared Theme Tokens & Base
   Style: dark-first, light-tech, glassmorphism accents
   ═══════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ── Surface palette ── */
  --bg-deep:       #06080f;
  --bg-surface:    rgba(255,255,255,0.03);
  --bg-card:       rgba(255,255,255,0.045);
  --bg-card-solid: #0d1117;
  --bg-hover:      rgba(255,255,255,0.07);
  --bg-input:      rgba(0,0,0,0.25);

  /* ── Border ── */
  --border:        rgba(255,255,255,0.08);
  --border-lit:    rgba(255,255,255,0.14);
  --border-focus:  rgba(129,140,248,0.4);

  /* ── Text ── */
  --text-1:        #e8eaf0;
  --text-2:        #8b90a0;
  --text-3:        #555a6e;

  /* ── Accent (Indigo) ── */
  --accent:        #818cf8;
  --accent-dim:    rgba(129,140,248,0.12);
  --accent-glow:   rgba(129,140,248,0.08);

  /* ── Semantic ── */
  --green:         #34d399;
  --green-dim:     rgba(52,211,153,0.12);
  --red:           #f87171;
  --red-dim:       rgba(248,113,113,0.10);
  --orange:        #fb923c;
  --orange-dim:    rgba(251,146,60,0.08);

  /* ── Sizing ── */
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     16px;
  --radius-xl:     20px;

  /* ── Typography ── */
  --font-display:  'Space Grotesk', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:     'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:          'JetBrains Mono', 'SF Mono', 'Fira Code', Menlo, monospace;

  /* ── Shadows ── */
  --shadow-card:   0 0 0 1px rgba(255,255,255,0.03) inset, 0 4px 24px rgba(0,0,0,0.2);
  --shadow-modal:  0 0 0 1px rgba(255,255,255,0.04) inset, 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 40px rgba(129,140,248,0.06);

  /* ── Transitions ── */
  --ease-out:      cubic-bezier(.16,1,.3,1);
  --duration-fast: 150ms;
  --duration-mid:  300ms;
}

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

html {
  background: var(--bg-deep);
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-1);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

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

/* ── Noise overlay for atmosphere ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Ensure content sits above noise */
body > * {
  position: relative;
  z-index: 1;
}

/* ── Shared keyframes ── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position: 200% center; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
