/* ============================================================
   A4E — Design Tokens
   Brand palette: logo navy + crimson, Google-accent tech quartet
   ============================================================ */

:root,
[data-theme='light'] {
  /* Surfaces — clean paper white */
  --color-bg: #ffffff;
  --color-surface: #f7f8fb;
  --color-surface-2: #ffffff;
  --color-surface-offset: #eef1f6;
  --color-surface-offset-2: #e2e7f0;
  --color-surface-dynamic: #d4dae6;
  --color-divider: #dde2ec;
  --color-border: #c9d0dd;

  /* Text — logo navy family */
  --color-text: #0f1e3d;
  --color-text-muted: #4a5772;
  --color-text-faint: #8891a5;
  --color-text-inverse: #ffffff;

  /* Ink — deepest navy */
  --color-ink: #0b1835;
  --color-ink-2: #152a55;

  /* Primary — logo navy */
  --color-primary: #1b2e63;
  --color-primary-hover: #152450;
  --color-primary-active: #0f1c3f;
  --color-primary-highlight: #dde2f1;

  /* Secondary — logo crimson */
  --color-crimson: #c8264a;
  --color-crimson-hover: #a81d3e;
  --color-crimson-active: #8a1631;
  --color-crimson-highlight: #f9dde4;

  /* Google-accent quartet — used for tech category chips */
  --color-google-blue: #4285f4;
  --color-google-red: #ea4335;
  --color-google-yellow: #fbbc04;
  --color-google-green: #34a853;

  /* Legacy indigo alias kept for existing class refs — now maps to google blue */
  --color-indigo: #1a73e8;
  --color-indigo-hover: #1557b0;
  --color-indigo-highlight: #d4e4fc;

  /* Secondary — muted gold (kept for compatibility) */
  --color-gold: #b48a2c;
  --color-gold-hover: #8f6c1e;

  /* Utility */
  --color-success: #34a853;

  /* Radii — restrained */
  --radius-xs: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

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

  /* Shadows — subtle, paper-matched */
  --shadow-sm: 0 1px 2px rgba(19, 34, 58, 0.05);
  --shadow-md: 0 6px 20px rgba(19, 34, 58, 0.07);
  --shadow-lg: 0 24px 48px -12px rgba(19, 34, 58, 0.14);

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-md: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --text-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.3rem + 4vw, 4.75rem);
  --text-hero: clamp(3rem, 1.1rem + 6.4vw, 7rem);

  /* Spacing — 4px scale */
  --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-14: 3.5rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1040px;
  --content-wide: 1280px;
  --content-edge: 1440px;

  /* Fonts */
  --font-display: 'Poppins', 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-serif: 'Fraunces', 'Newsreader', Georgia, serif;
  --font-body: 'Poppins', 'Inter Tight', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Aliases for page-template styles */
  --color-muted: var(--color-text-muted);
  --color-secondary: var(--color-google-red);
  --color-accent-red: #c8264a;
  --color-accent-blue: var(--color-google-blue);
  --color-accent-yellow: var(--color-google-yellow);
  --color-accent-green: var(--color-google-green);
  --color-surface-alt: var(--color-surface-offset);
  --radius-md: 18px;
}

/* DARK MODE — deep navy night */
[data-theme='dark'] {
  --color-bg: #07102a;
  --color-surface: #0d1a3d;
  --color-surface-2: #142550;
  --color-surface-offset: #050b20;
  --color-surface-offset-2: #17295a;
  --color-surface-dynamic: #1c3068;
  --color-divider: #213573;
  --color-border: #2c4287;

  --color-text: #e8ecf7;
  --color-text-muted: #9ba5c4;
  --color-text-faint: #5d6888;
  --color-text-inverse: #07102a;

  --color-ink: #f0f2fa;
  --color-ink-2: #c7cde0;

  --color-primary: #6b8cff;
  --color-primary-hover: #8aa3ff;
  --color-primary-active: #4e6fe0;
  --color-primary-highlight: #1a2b66;

  --color-crimson: #f24566;
  --color-crimson-hover: #ff6381;
  --color-crimson-active: #d6284b;
  --color-crimson-highlight: #4a1326;

  --color-google-blue: #8ab4f8;
  --color-google-red: #f28b82;
  --color-google-yellow: #fdd663;
  --color-google-green: #81c995;

  --color-indigo: #8ab4f8;
  --color-indigo-hover: #a6c5fa;
  --color-indigo-highlight: #1a2b66;

  --color-gold: #d4a94b;
  --color-gold-hover: #e4be66;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
  }
}
