/* =============================================================
   TOKENS.CSS — Design system variables.
   Dark is the default surface; [data-theme="light"] overrides.
   ============================================================= */

:root {
  /* ─── Type ─────────────────────────────────────────────── */
  --font-display: "Clash Display", "General Sans", "Helvetica Neue", sans-serif;
  --font-body: "General Sans", "Inter", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --fs-2xs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-xl: clamp(1.6rem, 1.35rem + 1.1vw, 2.25rem);
  --fs-2xl: clamp(2.1rem, 1.7rem + 1.8vw, 3.25rem);
  --fs-3xl: clamp(2.75rem, 2.1rem + 3vw, 4.75rem);
  --fs-hero: clamp(3.2rem, 2rem + 6.2vw, 7.5rem);

  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-normal: 1.55;
  --lh-relaxed: 1.75;

  /* ─── Spacing scale ────────────────────────────────────── */
  --sp-3xs: 0.25rem;
  --sp-2xs: 0.5rem;
  --sp-xs: 0.75rem;
  --sp-sm: 1rem;
  --sp-md: 1.5rem;
  --sp-lg: 2.25rem;
  --sp-xl: 3.5rem;
  --sp-2xl: 5.5rem;
  --sp-3xl: 8.5rem;

  --section-pad: clamp(4.5rem, 3.2rem + 5vw, 8.5rem);
  --container-w: 1280px;
  --container-pad: clamp(1.25rem, 0.6rem + 2.6vw, 3rem);

  /* ─── Radii ────────────────────────────────────────────── */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-full: 999px;

  /* ─── Motion ───────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 620ms;

  /* ─── Z-index scale ────────────────────────────────────── */
  --z-bg: -1;
  --z-base: 1;
  --z-card: 10;
  --z-nav: 900;
  --z-fab: 800;
  --z-cursor: 9999;
  --z-loader: 10000;

  /* ─── Accent palette (shared across themes) ───────────── */
  --hue-cyan: 174;
  --hue-violet: 262;
  --hue-magenta: 320;
  --hue-amber: 38;
}

/* ─── Dark theme (default) ────────────────────────────────── */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #050609;
  --bg-soft: #0a0c14;
  --bg-elevated: #0d1019;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  --text: #f3f4fa;
  --text-dim: #a2a8bd;
  --text-faint: #656b81;

  --accent-cyan: #2af5d0;
  --accent-violet: #9b6bff;
  --accent-magenta: #ff5fc4;
  --accent-amber: #ffb454;

  --glow-strength: 0.4;
  --grain-opacity: 0.05;
  --shadow-color: 0deg 0% 0%;
  --shadow-elevated:
    0 1px 1px hsl(var(--shadow-color) / 0.3),
    0 4px 10px hsl(var(--shadow-color) / 0.35),
    0 20px 45px hsl(var(--shadow-color) / 0.45);
}

/* ─── Light theme ──────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;

  --bg: #f3f4f9;
  --bg-soft: #ffffff;
  --bg-elevated: #ffffff;
  --surface: rgba(15, 18, 35, 0.035);
  --surface-hover: rgba(15, 18, 35, 0.065);
  --surface-strong: rgba(15, 18, 35, 0.08);
  --border: rgba(15, 18, 35, 0.1);
  --border-strong: rgba(15, 18, 35, 0.18);

  --text: #10111c;
  --text-dim: #4c5064;
  --text-faint: #83879b;

  --accent-cyan: #068f82;
  --accent-violet: #6d3ce0;
  --accent-magenta: #c22592;
  --accent-amber: #a06407;

  --glow-strength: 0.16;
  --grain-opacity: 0.025;
  --shadow-color: 222deg 30% 45%;
  --shadow-elevated:
    0 1px 1px hsl(var(--shadow-color) / 0.06),
    0 4px 10px hsl(var(--shadow-color) / 0.08),
    0 20px 45px hsl(var(--shadow-color) / 0.12);
}

:root {
  --gradient-brand: linear-gradient(
    120deg,
    var(--accent-cyan) 0%,
    var(--accent-violet) 52%,
    var(--accent-magenta) 100%
  );
  --gradient-brand-soft: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent-cyan) 60%, transparent) 0%,
    color-mix(in srgb, var(--accent-violet) 60%, transparent) 52%,
    color-mix(in srgb, var(--accent-magenta) 60%, transparent) 100%
  );
}
