/*
 * tokens.css
 * ─────────────────────────────────────────────────────────────
 * Design tokens: type scale, spacing, colors (light + dark),
 * radius, transitions, shadows, and content widths.
 *
 * Every other stylesheet consumes these custom properties.
 * To change the color scheme or scale, only edit this file.
 */

/* ── Fluid type scale ── */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* ── 4px spacing system ── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ── Typography ── */
  --font-display: "Cabinet Grotesk", "Inter", sans-serif;
  --font-body: "General Sans", "Inter", sans-serif;

  /* ── Radius ── */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 180ms var(--ease-out-expo);

  /* ── Content widths ── */
  --content-default: 1120px;
  --content-wide: 1280px;
}

/* ── Light mode ── */
:root,
[data-theme="light"] {
  --color-bg: #f6f7f8;
  --color-surface: #ffffff;
  --color-surface-2: #f0f3f5;
  --color-surface-offset: #e8edf0;
  --color-surface-dynamic: #d4dde2;
  --color-divider: #d7dde1;
  --color-border: rgba(16, 24, 40, 0.1);

  --color-text: #0e151b;
  --color-text-muted: #52606d;
  --color-text-faint: #7b8792;
  --color-text-inverse: #eff4f6;

  --color-primary: #35c2b5;
  --color-primary-hover: #2aa69b;
  --color-primary-active: #1c7f78;
  --color-primary-highlight: rgba(53, 194, 181, 0.15);

  --shadow-sm: 0 1px 2px rgba(10, 16, 22, 0.06);
  --shadow-md: 0 12px 30px rgba(10, 16, 22, 0.08);
  --shadow-lg: 0 22px 60px rgba(10, 16, 22, 0.12);
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --color-bg: #0d0f12;
  --color-surface: #14181d;
  --color-surface-2: #181d23;
  --color-surface-offset: #11161a;
  --color-surface-dynamic: #252d35;
  --color-divider: #222931;
  --color-border: rgba(223, 234, 241, 0.1);

  --color-text: #ebf1f4;
  --color-text-muted: #97a6b2;
  --color-text-faint: #6d7a86;
  --color-text-inverse: #0d0f12;

  --color-primary: #46d6c9;
  --color-primary-hover: #67e2d7;
  --color-primary-active: #2ba598;
  --color-primary-highlight: rgba(70, 214, 201, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.36);
}

/* ── System preference fallback (no JS required) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0d0f12;
    --color-surface: #14181d;
    --color-surface-2: #181d23;
    --color-surface-offset: #11161a;
    --color-surface-dynamic: #252d35;
    --color-divider: #222931;
    --color-border: rgba(223, 234, 241, 0.1);

    --color-text: #ebf1f4;
    --color-text-muted: #97a6b2;
    --color-text-faint: #6d7a86;
    --color-text-inverse: #0d0f12;

    --color-primary: #46d6c9;
    --color-primary-hover: #67e2d7;
    --color-primary-active: #2ba598;
    --color-primary-highlight: rgba(70, 214, 201, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.36);
  }
}
