/* =====================================================================================================================
   DREAMWORTH DESIGN TOKENS — the single source of truth for spacing, colour, type, layout, radius, shadow and motion.
   Every page links this file first, then components.css. Pages reference tokens; they do not restate values.

   GRID: 8-point. Spacing, sizing and layout are multiples of 8 px (--grid). 4 px (--space-1) is allowed only for
   fine detail: icon-to-text nudges, hairline offsets, tiny pips. Font sizes and line heights sit on 4 px half-steps.
   Token names follow the N × 4 px convention (--space-6 = 24 px), so only even steps exist above --space-1.
   ===================================================================================================================== */
:root {
  /* ---- Grid ------------------------------------------------------------------------------------------------------ */
  --grid: 8px;
  --grid-fine: 4px;

  /* ---- Spacing (8-point scale) ----------------------------------------------------------------------------------- */
  --space-0: 0px;
  --space-1: 4px;      /* fine detail only */
  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-18: 72px;
  --space-20: 80px;
  --space-22: 88px;
  --space-24: 96px;
  --space-26: 104px;
  --space-28: 112px;
  --space-30: 120px;
  --space-32: 128px;
  --space-34: 136px;
  --space-36: 144px;
  --space-38: 152px;
  --space-40: 160px;
  --space-48: 192px;
  --space-60: 240px;

  /* ---- Colour primitives (hex for direct use, rgb channels for alpha tints: rgb(var(--rgb-navy-900) / .5)) ------ */
  --color-white: #FFFFFF;            --rgb-white: 255 255 255;
  --color-black: #000000;            --rgb-black: 0 0 0;
  --color-navy-950: #030A1E;         --rgb-navy-950: 3 10 30;
  --color-navy-900: #0B1B3F;         --rgb-navy-900: 11 27 63;
  --color-navy-800: #1A2E5C;         --rgb-navy-800: 26 46 92;
  --color-navy-700: #2A3352;         --rgb-navy-700: 42 51 82;
  --color-blue-900: #0A2C66;         --rgb-blue-900: 10 44 102;
  --color-blue-800: #0F3E86;         --rgb-blue-800: 15 62 134;
  --color-blue-700: #004A9C;         --rgb-blue-700: 0 74 156;
  --color-blue-600: #005DC2;         --rgb-blue-600: 0 93 194;
  --color-blue-500: #3D86DA;         --rgb-blue-500: 61 134 218;
  --color-blue-400: #7FA9E3;         --rgb-blue-400: 127 169 227;
  --color-blue-300: #BBD4F5;         --rgb-blue-300: 187 212 245;
  --color-blue-200: #CAE0FF;         --rgb-blue-200: 202 224 255;
  --color-blue-150: #DCE6F6;         --rgb-blue-150: 220 230 246;
  --color-blue-100: #E4EEFC;         --rgb-blue-100: 228 238 252;
  --color-blue-50: #EEF3FA;          --rgb-blue-50: 238 243 250;
  --color-blue-25: #F4F7FC;          --rgb-blue-25: 244 247 252;
  --color-ink-700: #4B5270;          --rgb-ink-700: 75 82 112;
  --color-ink-600: #5F6782;          --rgb-ink-600: 95 103 130;
  --color-ink-500: #6E7792;          --rgb-ink-500: 110 119 146;
  --color-ink-400: #7A84A0;          --rgb-ink-400: 122 132 160;
  --color-ink-300: #8D97B5;          --rgb-ink-300: 141 151 181;
  --color-ink-200: #A8B1CC;          --rgb-ink-200: 168 177 204;
  --color-ink-150: #B9C3D8;          --rgb-ink-150: 185 195 216;
  --color-ink-100: #C9D1E6;          --rgb-ink-100: 201 209 230;
  --color-line-300: #D5DBE7;         --rgb-line-300: 213 219 231;
  --color-line-200: #E1E5EE;         --rgb-line-200: 225 229 238;
  --color-line-100: #E9EDF3;         --rgb-line-100: 233 237 243;
  --color-grey-50: #F3F5FA;          --rgb-grey-50: 243 245 250;
  --color-beige-700: #8C7A5B;        --rgb-beige-700: 140 122 91;
  --color-beige-300: #E6DDCF;        --rgb-beige-300: 230 221 207;
  --color-beige-200: #F1EFEA;        --rgb-beige-200: 241 239 234;
  --color-beige-100: #F6EEE6;        --rgb-beige-100: 246 238 230;
  --color-beige-50: #FBFAF7;         --rgb-beige-50: 251 250 247;
  --color-red-700: #B3263A;          --rgb-red-700: 179 38 58;
  --color-red-600: #D9475A;          --rgb-red-600: 217 71 90;
  --color-red-50: #FDE8EB;           --rgb-red-50: 253 232 235;
  --color-green-700: #1E7A50;        --rgb-green-700: 30 122 80;     /* success text: AA on green-50 */
  --color-green-600: #3DBE84;        --rgb-green-600: 61 190 132;
  --color-green-50: #E7F6EF;         --rgb-green-50: 231 246 239;

  /* ---- Colour roles (semantic) ----------------------------------------------------------------------------------- */
  --color-primary: var(--color-blue-600);
  --color-secondary: var(--color-navy-900);
  --color-accent: var(--color-blue-200);
  --color-background: var(--color-white);
  --color-surface: var(--color-blue-50);
  --color-surface-warm: var(--color-beige-200);
  --color-surface-elevated: var(--color-white);
  --color-surface-inverse: var(--color-navy-900);
  --color-text-primary: var(--color-navy-900);
  --color-text-secondary: var(--color-ink-700);
  --color-text-muted: var(--color-ink-500);
  --color-text-on-dark: var(--color-white);
  --color-text-on-dark-muted: var(--color-ink-100);
  --color-text-on-primary: var(--color-blue-100);
  --color-border: var(--color-line-200);
  --color-divider: var(--color-line-300);
  --color-interactive: var(--color-blue-600);
  --color-hover: var(--color-navy-900);
  --color-focus: var(--color-blue-200);
  --color-disabled: var(--color-ink-200);
  --color-success: var(--color-green-600);
  --color-success-text: var(--color-green-700);
  --color-success-surface: var(--color-green-50);
  --color-warning: var(--color-beige-700);   /* the brand has no amber; the warm accent stands in */
  --color-error: var(--color-red-600);
  --color-error-surface: var(--color-red-50);

  /* ---- Typography ------------------------------------------------------------------------------------------------ */
  --font-sans: 'Gillune', system-ui, sans-serif;
  --font-script: 'Blesh Forte', cursive;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  /* Sizes: fluid, snapped to 4 px half-steps. */
  --text-display-xl: round(clamp(96px, 17vw, 280px), 4px);   /* page-title words (About) */
  --text-display-l: round(clamp(48px, 6.6vw, 112px), 4px);   /* homepage section titles */
  --text-poster: round(clamp(40px, 8.6vw, 128px), 4px);    /* About hero poster headline: three uppercase lines */
  --text-team: round(clamp(48px, 9.6vw, 144px), 4px);       /* About team headline words woven into the portrait grid */
  --text-wordmark: round(clamp(56px, 15.6vw, 236px), 4px);   /* footer "dreamworth" wordmark: fits the 1440 frame */
  --text-display-stat: round(clamp(64px, 8.6vw, 144px), 4px); /* big stat figures (350+, outcomes) */
  --text-h1: round(clamp(52px, 5.6vw, 80px), 4px);           /* inner-page hero */
  --text-h2: round(clamp(44px, 5.6vw, 88px), 4px);           /* inner-page section titles */
  --text-display-s: round(clamp(40px, 4.4vw, 68px), 4px);    /* statements, read-along lines */
  --text-h3: round(clamp(32px, 3.4vw, 56px), 4px);           /* sub-heads, award / office titles */
  --text-h4: round(clamp(28px, 3vw, 44px), 4px);             /* list titles */
  --text-h4-fit: round(clamp(28px, min(3vw, 5.4vh), 48px), 4px); /* stacked-card titles: also shrink on short screens */
  --text-h5: round(clamp(20px, calc(1.6vw + 4px), 32px), 4px); /* card titles */
  --text-body-xl: round(clamp(24px, 2.1vw, 32px), 4px);      /* pull lines, intro leads */
  --text-body-l: round(clamp(20px, 1.6vw, 24px), 4px);       /* hero sub copy, leads */
  --text-body: round(clamp(16px, 1.4vw, 20px), 4px);
  --text-body-s: 16px;
  --text-caption: 14px;
  --text-overline: 12px;
  --text-button: 16px;
  /* Line heights (unitless or snapped to 4 px) */
  --leading-none: 1;
  --leading-display: 1.04;
  --leading-heading: 1.08;
  --leading-snug: 1.2;
  --leading-lead: 1.35;
  --leading-body: 1.5;
  --leading-relaxed: 1.6;
  /* Letter spacing */
  --tracking-display: -0.03em;
  --tracking-heading: -0.015em;
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-overline: 0.14em;

  /* ---- Layout ---------------------------------------------------------------------------------------------------- */
  --container-max: 1440px;                        /* outer frame of every section */
  --container-standard: 1232px;                   /* content width at 1440 with desktop gutters */
  --container-narrow: 960px;                      /* long-form text, forms */
  --measure: 40em;                                /* comfortable line length for body copy */
  --gutter: round(clamp(24px, 4vw, 56px), 8px);   /* mobile / tablet; desktop below */
  --gutter-bleed: max(var(--gutter), calc((100vw - var(--container-max)) / 2 + var(--gutter)));
  --grid-columns: 12;
  --grid-gap: var(--space-6);
  --section-y-s: round(clamp(64px, 7vw, 104px), 8px);
  --section-y: round(clamp(80px, 8.5vw, 128px), 8px);
  --section-y-l: round(clamp(96px, 10vw, 160px), 8px);
  --header-h: 80px;
  /* Breakpoints (media queries cannot read custom properties: use these exact numbers) */
  --bp-sm: 520px;     /* small phones: header CTA hides */
  --bp-md: 640px;     /* phone -> tablet */
  --bp-tablet: 760px; /* swipe rows / stacked layouts end */
  --bp-lg: 1000px;    /* tablet -> desktop */
  --bp-xl: 1400px;    /* full header menu */

  /* ---- Radius ---------------------------------------------------------------------------------------------------- */
  --radius-none: 0;
  --radius-xs: 4px;                                /* fine detail: pips, bar caps */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: round(clamp(32px, 3.4vw, 48px), 8px);
  --radius-pill: 999px;
  --radius-full: 50%;

  /* ---- Shadow (restrained; navy-tinted) --------------------------------------------------------------------------- */
  --shadow-none: none;
  --shadow-sm: 0 1px 2px rgb(var(--rgb-navy-900) / .05), 0 16px 32px -24px rgb(var(--rgb-navy-900) / .5);
  --shadow-md: 0 1px 2px rgb(var(--rgb-navy-900) / .06), 0 24px 48px -24px rgb(var(--rgb-navy-900) / .5);
  --shadow-lg: 0 48px 96px -40px rgb(var(--rgb-navy-900) / .55);
  --shadow-stack: 0 -12px 40px -20px rgb(var(--rgb-navy-950) / .26);   /* stacked cards rising over each other */

  /* ---- Motion ---------------------------------------------------------------------------------------------------- */
  --dur-instant: 100ms;
  --dur-fast: 200ms;
  --dur-normal: 300ms;
  --dur-moderate: 450ms;
  --dur-slow: 600ms;
  --dur-slower: 800ms;
  --dur-slowest: 1000ms;
  --ease-standard: cubic-bezier(.455, .03, .515, .955);   /* hover and state changes */
  --ease-entrance: cubic-bezier(.16, 1, .3, 1);           /* things arriving: reveals, cards, menus */
  --ease-exit: cubic-bezier(.4, 0, 1, 1);                 /* things leaving */
  --ease-state: cubic-bezier(.4, 0, .2, 1);               /* selected-state moves (tabs, offices) */
  --ease-curtain: cubic-bezier(.76, 0, .24, 1);           /* full-screen curtain only */
  --ease-overshoot: cubic-bezier(.34, 1.56, .64, 1);      /* small playful pops in UI mockups */
  --rise: var(--space-6);                                 /* standard entrance distance (24 px) */
  --stagger: 70ms;

  /* ---- Legacy aliases (kept for values set from page scripts; new work uses the names above) ---------------------- */
  --fs-h1: var(--text-h1);
  --fs-h2: var(--text-h2);
  --fs-h3: var(--text-h4);
  --fs-quote: var(--text-display-s);
  --fs-pull: var(--text-body-xl);
  --fs-lead: var(--text-body-l);
  --fs-body: var(--text-body);
  --h2: var(--text-display-l);
  --h3: var(--text-h3);
  --tc: var(--text-h5);
  --dw-io: var(--ease-standard);
  --dw-card: var(--dur-moderate);
  --dw-ui: var(--dur-normal);
  --dw-ul: var(--dur-moderate);
}

@media (min-width: 1000px) {
  :root { --gutter: var(--space-26); }   /* 104 px desktop gutter */
}
