/* ============================================================
   FERALVOICE OS — DESIGN SYSTEM
   Custom-built design tokens, themes, and base styles
   ============================================================ */

/* ---------- 1. DESIGN TOKENS ---------- */
:root {
  /* Brand */
  --fv-violet: #8b5cf6;
  --fv-violet-bright: #a78bfa;
  --fv-violet-deep: #6d28d9;
  --fv-violet-glow: rgba(139, 92, 246, 0.35);

  /* Accent spectrum */
  --fv-cyan: #06b6d4;
  --fv-emerald: #10b981;
  --fv-amber: #f59e0b;
  --fv-rose: #f43f5e;
  --fv-blue: #3b82f6;
  --fv-pink: #ec4899;
  --fv-indigo: #6366f1;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Spacing scale */
  --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;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 150ms var(--ease-out);
  --t-base: 220ms var(--ease-out);
  --t-slow: 360ms var(--ease-out);
}

/* ---------- 2. DARK THEME (default) ---------- */
[data-theme="dark"] {
  --bg-base: #0a0d14;
  --bg-surface: #11141d;
  --bg-surface-2: #161a25;
  --bg-elevated: #1c2030;
  --bg-hover: #232838;
  --bg-input: #0f121b;

  --border-subtle: #1f2330;
  --border: #262b3a;
  --border-strong: #353b4d;
  --border-focus: var(--fv-violet);

  --text-primary: #f1f5f9;
  --text-secondary: #a5adbe;
  --text-muted: #6b7280;
  --text-inverse: #0a0d14;

  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45), 0 4px 8px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 0 3px var(--fv-violet-glow);

  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --gradient-brand-hover: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --gradient-surface: linear-gradient(180deg, rgba(139, 92, 246, 0.04) 0%, transparent 100%);
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.18), transparent);

  --scrollbar-track: #11141d;
  --scrollbar-thumb: #2a2f3e;
}

/* ---------- 3. LIGHT THEME ---------- */
[data-theme="light"] {
  --bg-base: #f6f7fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-input: #ffffff;

  --border-subtle: #edf0f5;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: var(--fv-violet);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-color: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 3px rgba(139, 92, 246, 0.18);

  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --gradient-brand-hover: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  --gradient-surface: linear-gradient(180deg, rgba(139, 92, 246, 0.03) 0%, transparent 100%);
  --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.08), transparent);

  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
}

/* ---------- 4. RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color var(--t-base), color var(--t-base);
}
img { display: block; max-width: 100%; }
svg { display: inline-block; max-width: 100%; vertical-align: -0.125em; fill: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); border: 2px solid var(--scrollbar-track); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Selection */
::selection { background: var(--fv-violet-glow); color: var(--text-primary); }

/* ---------- 5. TYPOGRAPHY ---------- */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: 28px; line-height: 1.2; font-weight: 700; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 18px; line-height: 1.3; }
h4 { font-size: 16px; line-height: 1.4; }
h5 { font-size: 14px; line-height: 1.4; font-weight: 600; }
h6 { font-size: 12px; line-height: 1.4; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
p { color: var(--text-secondary); }
small { font-size: 12px; }
strong { font-weight: 600; color: var(--text-primary); }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-elevated); padding: 2px 6px; border-radius: var(--radius-sm); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 6. UTILITY CLASSES ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.grid { display: grid; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer; }
.user-select-none { user-select: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 7. ANIMATIONS ---------- */
@keyframes fv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fv-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fv-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes fv-slide-right { from { transform: translateX(-12px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fv-pulse-glow { 0%, 100% { box-shadow: 0 0 0 0 var(--fv-violet-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes fv-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes fv-spin { to { transform: rotate(360deg); } }
@keyframes fv-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.animate-fade-in { animation: fv-fade-in var(--t-base) both; }
.animate-fade-up { animation: fv-fade-up var(--t-slow) both; }
.animate-scale-in { animation: fv-scale-in var(--t-base) both; }
.animate-slide-right { animation: fv-slide-right var(--t-base) both; }
.animate-spin { animation: fv-spin 1s linear infinite; }
.animate-float { animation: fv-float 3s ease-in-out infinite; }

/* Stagger helpers */
.stagger > * { animation: fv-fade-up var(--t-slow) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 50ms; }
.stagger > *:nth-child(3) { animation-delay: 100ms; }
.stagger > *:nth-child(4) { animation-delay: 150ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 250ms; }
.stagger > *:nth-child(7) { animation-delay: 300ms; }
.stagger > *:nth-child(8) { animation-delay: 350ms; }

/* ---------- 8. BRAND LOGO ---------- */
.fv-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.fv-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px var(--fv-violet-glow), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}
.fv-logo-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
}
.fv-logo-mark-sm { width: 24px; height: 24px; border-radius: 7px; font-size: 12px; }
.fv-logo-mark-lg { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }

/* ---------- 9. SCROLLBAR GLOW ACCENT ---------- */
.fv-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* ---------- 10. PRINT ---------- */
@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
}
