/* ============================================================
   TOKENS — fonte única de verdade do design system
   Nenhum valor "mágico" deve existir fora deste arquivo.
   ============================================================ */

:root {
  /* ---------- Cor: paleta bruta ---------- */
  --violet-400: #b49bff;
  --violet-500: #7c5cff;
  --violet-600: #5b3df5;

  /* ---------- Cor: tema escuro (padrão) ---------- */
  --bg: #08080a;
  --bg-soft: #0b0b0f;
  --surface: #0e0e12;
  --elev: #16161c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f2f5;
  --text-muted: #8a8a96;
  --text-faint: #55555f;
  --accent: var(--violet-500);
  --accent-hover: var(--violet-400);
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-glow: rgba(124, 92, 255, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 80px -32px rgba(0, 0, 0, 0.85);
  --grid-line: rgba(255, 255, 255, 0.035);
  --noise-opacity: 0.035;
  --selection-bg: rgba(124, 92, 255, 0.3);

  color-scheme: dark;
}

/* ---------- Cor: tema claro ---------- */
[data-theme="light"] {
  --bg: #fbfbfd;
  --bg-soft: #f6f6f9;
  --surface: #ffffff;
  --elev: #f4f4f7;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --text: #0a0a0c;
  --text-muted: #63636e;
  --text-faint: #9a9aa4;
  --accent: var(--violet-600);
  --accent-hover: var(--violet-500);
  --accent-soft: rgba(91, 61, 245, 0.09);
  --accent-glow: rgba(91, 61, 245, 0.2);
  --shadow-sm: 0 1px 2px rgba(16, 16, 30, 0.06);
  --shadow-md: 0 12px 32px -12px rgba(16, 16, 30, 0.16);
  --shadow-lg: 0 40px 80px -32px rgba(16, 16, 30, 0.24);
  --grid-line: rgba(0, 0, 0, 0.04);
  --noise-opacity: 0.02;
  --selection-bg: rgba(91, 61, 245, 0.18);

  color-scheme: light;
}

:root {
  /* ---------- Tipografia ---------- */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Escala fluida — min em 360px, max em 1440px */
  --fs-xs: clamp(0.6875rem, 0.66rem + 0.12vw, 0.75rem);
  --fs-sm: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --fs-base: clamp(0.9375rem, 0.9rem + 0.18vw, 1.0625rem);
  --fs-md: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-lg: clamp(1.25rem, 1.1rem + 0.7vw, 1.75rem);
  --fs-xl: clamp(1.75rem, 1.4rem + 1.6vw, 3rem);
  --fs-2xl: clamp(2.25rem, 1.6rem + 3vw, 4.5rem);
  --fs-display: clamp(3rem, 1rem + 9vw, 8.5rem);

  --lh-tight: 0.92;
  --lh-snug: 1.15;
  --lh-normal: 1.5;
  --lh-relaxed: 1.72;

  --ls-display: -0.045em;
  --ls-title: -0.03em;
  --ls-label: 0.18em;

  /* ---------- Espaçamento (base 4px) ---------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;
  --sp-40: 10rem;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --container: 1280px;
  --container-narrow: 860px;
  --section-y: clamp(5.5rem, 13vh, 10rem);
  --header-h: 72px;

  /* ---------- Raios ---------- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-full: 999px;

  /* ---------- Movimento ---------- */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.4, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 480ms;
  --dur-slow: 900ms;

  /* ---------- Camadas ---------- */
  --z-bg: 0;
  --z-content: 1;
  --z-header: 50;
  --z-menu: 60;
  --z-cursor: 90;
  --z-preloader: 100;
}

/* Acessibilidade: quem pede menos movimento, recebe zero movimento. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur: 1ms;
    --dur-slow: 1ms;
  }
}
