/* Design tokens — the single source of truth for color/spacing/type/shadow
   scales, loaded before shell.css on every page. Pure presentation, same
   rule as shell.css: no feature/business-logic content lives here.

   Accent is a deliberately distinct blue-violet — not WhatsApp's green, not
   a generic Bootstrap/Tailwind blue — so the product reads as its own
   brand, not a WhatsApp-tools clone. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Raw neutral scale */
  --gray-0: #ffffff;
  --gray-50: #f8f9fb;
  --gray-100: #f1f2f5;
  --gray-200: #e4e6eb;
  --gray-300: #d1d5db;
  --gray-400: #9aa1ac;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2430;
  --gray-900: #12151c;

  /* Accent */
  --accent: #5b5fef;
  --accent-hover: #4548d6;
  --accent-active: #3a3dbd;
  --accent-subtle: #eef0ff;
  --accent-contrast: #ffffff;

  /* Semantic */
  --success: #12875a;
  --success-subtle: #e6f7ef;
  --warning: #b45309;
  --warning-subtle: #fef3e2;
  --danger: #d92d20;
  --danger-subtle: #fde9e7;
  --info: #1570ef;
  --info-subtle: #eaf3ff;

  /* Semantic tokens (existing names — every page already uses these) */
  --bg: var(--gray-50);
  --surface: var(--gray-0);
  --surface-hover: var(--gray-100);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --border: var(--gray-200);

  /* Spacing, 4px base */
  --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;

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  /* Type */
  --font-sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --leading-tight: 1.25;
  --leading-normal: 1.55;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);

  /* Motion */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 120ms;
  --duration: 180ms;
}

:root[data-theme="dark"] {
  --gray-0: #12151c;
  --gray-50: #171b23;
  --gray-100: #1d2129;
  --gray-200: #2a2f3a;
  --gray-300: #3a4150;
  --gray-400: #5b6472;
  --gray-500: #8890a0;
  --gray-600: #aab0bd;
  --gray-700: #c7ccd6;
  --gray-800: #e4e7ec;
  --gray-900: #f5f6f8;

  --accent: #7b7fff;
  --accent-hover: #9195ff;
  --accent-active: #6266f0;
  --accent-subtle: #23233f;
  --accent-contrast: #0f1115;

  --success: #3fc586;
  --success-subtle: #123425;
  --warning: #f0a13d;
  --warning-subtle: #3a2a12;
  --danger: #f26d63;
  --danger-subtle: #3a1c1a;
  --info: #5aa6ff;
  --info-subtle: #12233a;

  --bg: var(--gray-50);
  --surface: var(--gray-100);
  --surface-hover: var(--gray-200);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --border: var(--gray-200);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* System-preference fallback for a first-ever visit with no stored choice —
   mirrors :root[data-theme="dark"] exactly (kept in sync manually, same
   pattern the artifact-design convention uses: media query first, explicit
   attribute always wins). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gray-0: #12151c;
    --gray-50: #171b23;
    --gray-100: #1d2129;
    --gray-200: #2a2f3a;
    --gray-300: #3a4150;
    --gray-400: #5b6472;
    --gray-500: #8890a0;
    --gray-600: #aab0bd;
    --gray-700: #c7ccd6;
    --gray-800: #e4e7ec;
    --gray-900: #f5f6f8;

    --accent: #7b7fff;
    --accent-hover: #9195ff;
    --accent-active: #6266f0;
    --accent-subtle: #23233f;
    --accent-contrast: #0f1115;

    --success: #3fc586;
    --success-subtle: #123425;
    --warning: #f0a13d;
    --warning-subtle: #3a2a12;
    --danger: #f26d63;
    --danger-subtle: #3a1c1a;
    --info: #5aa6ff;
    --info-subtle: #12233a;

    --bg: var(--gray-50);
    --surface: var(--gray-100);
    --surface-hover: var(--gray-200);
    --text: var(--gray-900);
    --text-muted: var(--gray-500);
    --border: var(--gray-200);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}
