/* tokens.css — WorkRightsNYC design system
   Warm, credible, non-bureaucratic legal-aid palette.
   Primary: deep forest/sage teal (trust, growth, calm — not corporate blue)
   Warning/accent: warm terracotta (approachable, human)
   Surfaces: warm paper cream, not clinical white/gray. */

:root {
  /* ---- Type scale (fluid, clamp-based) ---- */
  --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.25rem);

  /* ---- 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;
  --space-32: 8rem;

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

  /* ---- Transitions ---- */
  --transition-interactive: 160ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Content widths ---- */
  --content-narrow: 640px;
  --content-default: 780px;
  --content-wide: 1120px;
  --content-full: 100%;

  /* ---- Fonts ---- */
  --font-display: 'Fraunces', 'DM Serif Display', Georgia, serif;
  --font-body: 'General Sans', 'Work Sans', 'Helvetica Neue', sans-serif;
}

/* ===================== LIGHT MODE (default) ===================== */
:root,
[data-theme='light'] {
  /* Surfaces — warm paper cream, not clinical white */
  --color-bg: #faf6ee;
  --color-surface: #ffffff;
  --color-surface-2: #fdfbf6;
  --color-surface-offset: #f2ecdf;
  --color-surface-offset-2: #ece3d2;
  --color-surface-dynamic: #e4d9c3;
  --color-divider: #e1d6c0;
  --color-border: #d6c8a9;

  /* Text — warm charcoal, not pure black */
  --color-text: #23291f;
  --color-text-muted: #5c6153;
  --color-text-faint: #9a9c8c;
  --color-text-inverse: #fbf7ee;

  /* Primary accent — deep forest teal (trust, calm, growth) */
  --color-primary: #16594b;
  --color-primary-hover: #0e3f35;
  --color-primary-active: #0a2e27;
  --color-primary-highlight: #d5e6de;

  /* Warm terracotta accent (used sparingly, secondary CTAs) */
  --color-accent: #c05a2c;
  --color-accent-hover: #9c4620;
  --color-accent-highlight: #f1ddce;

  /* Warning */
  --color-warning: #96591b;
  --color-warning-hover: #744419;
  --color-warning-highlight: #eddcc4;

  /* Error */
  --color-error: #a4293a;
  --color-error-hover: #7d1e2c;
  --color-error-highlight: #ecd3d6;

  /* Success */
  --color-success: #3e7a3f;
  --color-success-hover: #2c5c2d;
  --color-success-highlight: #dbe9d5;

  /* Info / neutral badge (used for "unsure"/partial states) */
  --color-info: #6b5a9c;
  --color-info-hover: #52447a;
  --color-info-highlight: #e2dced;

  --shadow-sm: 0 1px 2px oklch(0.25 0.02 90 / 0.08);
  --shadow-md: 0 4px 14px oklch(0.25 0.02 90 / 0.10);
  --shadow-lg: 0 14px 36px oklch(0.25 0.02 90 / 0.16);
}

/* ===================== DARK MODE ===================== */
[data-theme='dark'] {
  --color-bg: #171b16;
  --color-surface: #1d2219;
  --color-surface-2: #21261d;
  --color-surface-offset: #262b21;
  --color-surface-offset-2: #2c3126;
  --color-surface-dynamic: #343a2d;
  --color-divider: #333a2c;
  --color-border: #414a37;

  --color-text: #ece7d9;
  --color-text-muted: #a7ab99;
  --color-text-faint: #737a66;
  --color-text-inverse: #1a1f16;

  --color-primary: #64b39c;
  --color-primary-hover: #85c7b3;
  --color-primary-active: #9fd6c4;
  --color-primary-highlight: #253830;

  --color-accent: #e08a5c;
  --color-accent-hover: #eda579;
  --color-accent-highlight: #3d2c22;

  --color-warning: #dba75f;
  --color-warning-hover: #e8bd85;
  --color-warning-highlight: #3f321f;

  --color-error: #e2707f;
  --color-error-hover: #ea94a0;
  --color-error-highlight: #3d2429;

  --color-success: #86c087;
  --color-success-hover: #a3d3a4;
  --color-success-highlight: #263a26;

  --color-info: #a99bd6;
  --color-info-hover: #bcb0e0;
  --color-info-highlight: #322c47;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 14px 36px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #171b16;
    --color-surface: #1d2219;
    --color-surface-2: #21261d;
    --color-surface-offset: #262b21;
    --color-surface-offset-2: #2c3126;
    --color-surface-dynamic: #343a2d;
    --color-divider: #333a2c;
    --color-border: #414a37;
    --color-text: #ece7d9;
    --color-text-muted: #a7ab99;
    --color-text-faint: #737a66;
    --color-text-inverse: #1a1f16;
    --color-primary: #64b39c;
    --color-primary-hover: #85c7b3;
    --color-primary-active: #9fd6c4;
    --color-primary-highlight: #253830;
    --color-accent: #e08a5c;
    --color-accent-hover: #eda579;
    --color-accent-highlight: #3d2c22;
    --color-warning: #dba75f;
    --color-warning-hover: #e8bd85;
    --color-warning-highlight: #3f321f;
    --color-error: #e2707f;
    --color-error-hover: #ea94a0;
    --color-error-highlight: #3d2429;
    --color-success: #86c087;
    --color-success-hover: #a3d3a4;
    --color-success-highlight: #263a26;
    --color-info: #a99bd6;
    --color-info-hover: #bcb0e0;
    --color-info-highlight: #322c47;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 14px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 14px 36px oklch(0 0 0 / 0.5);
  }
}
