/**
 * Emailer Design System — tokens.
 * Single source of visual truth: landing and dashboard consume the same
 * custom properties. Dark mode is the default aesthetic; light mode is a
 * first-class citizen. All color pairs meet WCAG AA on their surfaces.
 */

:root {
  /* Typography — system stack, no external font requests */
  --font-sans: ui-sans-serif, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;
  --leading-tight: 1.2;
  --leading-normal: 1.55;
  --tracking-tight: -0.02em;

  /* Spacing scale (4px base) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 350ms;

  /* Brand */
  --brand-hue: 255;
  --accent: hsl(var(--brand-hue) 85% 62%);
  --accent-strong: hsl(var(--brand-hue) 85% 55%);
  --accent-soft: hsl(var(--brand-hue) 85% 62% / 0.14);
  --accent-contrast: #ffffff;

  /* Status */
  --success: hsl(152 60% 42%);
  --warning: hsl(38 92% 50%);
  --danger: hsl(0 72% 55%);
  --success-soft: hsl(152 60% 42% / 0.14);
  --warning-soft: hsl(38 92% 50% / 0.14);
  --danger-soft: hsl(0 72% 55% / 0.14);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --content-max: 1120px;

  /* Elevation */
  --shadow-sm: 0 1px 2px hsl(240 20% 4% / 0.35);
  --shadow-md: 0 4px 16px hsl(240 20% 4% / 0.35);
  --shadow-lg: 0 16px 48px hsl(240 20% 4% / 0.45);

  color-scheme: dark;

  /* Dark surfaces (default) */
  --bg: hsl(240 14% 6%);
  --surface-1: hsl(240 12% 9%);
  --surface-2: hsl(240 11% 12%);
  --surface-3: hsl(240 10% 16%);
  --border: hsl(240 10% 20%);
  --border-strong: hsl(240 10% 28%);
  --text-1: hsl(240 12% 96%);
  --text-2: hsl(240 8% 70%);
  --text-3: hsl(240 6% 50%);
  --backdrop: hsl(240 14% 3% / 0.65);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: hsl(240 20% 99%);
  --surface-1: hsl(0 0% 100%);
  --surface-2: hsl(240 18% 97%);
  --surface-3: hsl(240 15% 94%);
  --border: hsl(240 12% 89%);
  --border-strong: hsl(240 10% 80%);
  --text-1: hsl(240 20% 10%);
  --text-2: hsl(240 8% 38%);
  --text-3: hsl(240 6% 58%);
  --backdrop: hsl(240 15% 10% / 0.4);
  --shadow-sm: 0 1px 2px hsl(240 20% 20% / 0.08);
  --shadow-md: 0 4px 16px hsl(240 20% 20% / 0.10);
  --shadow-lg: 0 16px 48px hsl(240 20% 20% / 0.16);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: hsl(240 20% 99%);
    --surface-1: hsl(0 0% 100%);
    --surface-2: hsl(240 18% 97%);
    --surface-3: hsl(240 15% 94%);
    --border: hsl(240 12% 89%);
    --border-strong: hsl(240 10% 80%);
    --text-1: hsl(240 20% 10%);
    --text-2: hsl(240 8% 38%);
    --text-3: hsl(240 6% 58%);
    --backdrop: hsl(240 15% 10% / 0.4);
    --shadow-sm: 0 1px 2px hsl(240 20% 20% / 0.08);
    --shadow-md: 0 4px 16px hsl(240 20% 20% / 0.10);
    --shadow-lg: 0 16px 48px hsl(240 20% 20% / 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}
