/* ==========================================================================
   Design Tokens — Cereble Ai Brand Guide v1.0
   Source: docs/brand/brand.md
   This is the single source of truth. No other file hardcodes these values.
   ========================================================================== */

:root {
  /* ── Colours: Backgrounds (always light) ── */
  --page-white: #ffffff;
  --surface-mist: #f0f6ff;
  --surface-blue: #ebf2fb;
  --surface-lilac: #f5eefb;

  /* ── Colours: Brand & Text ── */
  --cereble-blue: #4a8fd6;
  /* Darkened --cereble-blue for WCAG AA 4.5:1 contrast on white backgrounds */
  --cereble-blue-accessible: #3479c0;
  --cereble-lilac: #9b6fcc;
  --text-primary: #0f1923;
  --accent-dark: #1a1a2e;

  /* ── Gradient ── */
  --gradient-brand: linear-gradient(120deg, #4a8fd6, #9b6fcc);
  /* Darkened variant for WCAG AA 4.5:1 contrast with white text */
  --gradient-brand-accessible: linear-gradient(120deg, #3575b5, #8a5fbb);

  /* ── Semantic colour aliases ── */
  --color-primary: var(--cereble-blue);
  --color-secondary: var(--cereble-lilac);
  --color-accent: var(--accent-dark);
  --color-text: var(--text-primary);
  --color-text-light: #4a5568;
  --color-bg: var(--page-white);
  --color-bg-alt: var(--surface-mist);
  --color-text-on-dark: var(--page-white);
  --color-text-on-dark-muted: rgba(255, 255, 255, 0.8);
  --color-brand-blue-light: #b8d4f0;
  --color-border: #d1d9e6;
  --color-success: #2f855a;
  --color-error: #c53030;
  /* Darkened --cereble-blue-accessible for WCAG AA 4.5:1 contrast on --surface-mist (#F0F6FF) */
  --cereble-blue-on-mist: #2b6299;

  /* ── Typography ── */
  --font-heading: "Montserrat", sans-serif;
  --font-body: "Inter", sans-serif;

  /* ── Fluid type scale (mobile → desktop) ── */
  /* H1:  32px → 52px */
  --text-h1: clamp(2rem, 1.25rem + 3.75vw, 3.25rem);
  /* H2:  24px → 34px */
  --text-h2: clamp(1.5rem, 1.125rem + 1.875vw, 2.125rem);
  /* H3:  18px → 22px */
  --text-h3: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
  /* Body Large: 16px → 18px */
  --text-lg: clamp(1rem, 0.9375rem + 0.3125vw, 1.125rem);
  /* Body Default: 15px → 16px */
  --text-base: clamp(0.9375rem, 0.90625rem + 0.15625vw, 1rem);
  /* Badge / Label: 11px → 12px */
  --text-badge: clamp(0.6875rem, 0.65625rem + 0.15625vw, 0.75rem);

  /* Legacy fluid scale (for compatibility) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-xl: clamp(1.25rem, 1rem + 1vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.1rem + 1.5vw, 2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2vw, 3rem);
  --text-4xl: clamp(2.5rem, 1.8rem + 3vw, 4rem);

  /* ── Line heights ── */
  --lh-heading-h1: 1.1;
  --lh-heading-h2: 1.2;
  --lh-heading-h3: 1.3;
  --lh-tight: 1.4;
  --lh-body: 1.7;

  /* ── Font weights ── */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* ── Letter spacing ── */
  --ls-badge: 0.08em;

  /* ── Spacing scale ── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);

  /* ── Layout ── */
  --container-max: 1200px;
  --container-narrow: 640px;
  --container-padding: clamp(1rem, 3vw, 2rem);

  /* ── Icon sizes ── */
  --icon-sm: 1.5rem;
  --icon-md: 2.5rem;

  /* ── Borders & Radius ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* ── Transitions ── */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}
