/* =============================================================
   MAD Solutions design tokens
   Version 0.3, 13 November 2026. Source: 02-Brand/brand-guide.md
   - Logo colours: final logo R4-2 (02-Brand/logo-final/), 13 November 2026.
     Amber, Deep gold and Light gold are LOGO-ONLY: never UI, text or backgrounds.
   - Fonts: Lexend (headings) + Instrument Sans (body), confirmed from
     the Flowkit style guide PDF. Heading weights 600/500 (decided by
     David, 12 November 2026).
   - Decided 12 November 2026: dark base Ink; light theme with dark
     bands; Paper, Grey, Gold ink added; teal as a very rare accent
     (rules: brand-guide 3.4); #FFDB01 dropped. Purple still open:
     --mad-purple is defined for trials only, do not publish with it.
   Webflow: create these as Variables (same names) in the Variables
   panel, or paste into a site-wide custom code <style> block.
   Fonts (Google Fonts):
   https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;600&family=Lexend:wght@500;600;700&display=swap
   ============================================================= */

:root {
  /* ---------- Brand colours ---------- */
  --mad-ink: #231f20;        /* primary: text, logo ink, dark sections */
  --mad-gold: #ffc82d;       /* accent: buttons, highlights, outer diamond */
  --mad-gold-2: #ffcc40;     /* tint: secondary fills */
  --mad-gold-3: #ffd97f;     /* tint: hover; logo step 3 on Ink */
  --mad-gold-4: #ffecc0;     /* tint: soft panels */
  --mad-logo-amber: #ecb116;      /* LOGO ONLY: step 2 on light, Ink-fix step at <= 32 px */
  --mad-logo-deep-gold: #d99a00;  /* LOGO ONLY: step 3 on light */
  --mad-logo-light-gold: #ffd056; /* LOGO ONLY: step 2 on Ink */
  --mad-white: #ffffff;
  --mad-paper: #faf7f0;      /* proposed: warm off-white section */
  --mad-grey: #6b6566;       /* proposed: secondary text on light only (5.7:1 on white) */
  --mad-gold-ink: #7a5c00;   /* proposed: gold-coloured TEXT on light (6.3:1 on white) */
  --mad-night: #121212;      /* optional deeper dark surface (from style guide) */
  --mad-teal: #1abc9c;       /* RARE accent: status dot, tiny highlight, max one per page. Never text on light (2.4:1), never buttons/backgrounds */
  --mad-teal-ink: #0e7c66;   /* teal as TEXT on light only (5.1:1 on white, 4.8:1 on paper) */
  --mad-purple: #4b2e83;     /* OPEN decision: trials only (brand-guide 3.5) */
  --color-status: var(--mad-teal);   /* e.g. the "live" dot */
  --mad-line-light: rgba(35, 31, 32, 0.12);
  --mad-line-dark: rgba(255, 255, 255, 0.16);

  /* ---------- Semantic colours (light theme default) ---------- */
  --color-bg: var(--mad-white);
  --color-bg-alt: var(--mad-paper);
  --color-bg-soft: var(--mad-gold-4);
  --color-text: var(--mad-ink);
  --color-text-muted: var(--mad-grey);
  --color-accent: var(--mad-gold);
  --color-accent-hover: var(--mad-gold-3);
  --color-on-accent: var(--mad-ink);       /* never white on gold (1.6:1) */
  --color-link: var(--mad-ink);            /* underline in gold */
  --color-link-underline: var(--mad-gold);
  --color-border: var(--mad-line-light);
  --color-focus: var(--mad-ink);

  /* ---------- Typography ---------- */
  --font-heading: "Lexend", "Poppins", ui-sans-serif, system-ui, "Segoe UI", Arial, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heading: 600;     /* style guide had 100-200; see brand guide 4.2 */
  --weight-heading-small: 500;

  /* Heading scale (fluid, 360px to 1440px viewport) */
  --text-hero: clamp(3.5rem, 2.33rem + 5.19vw, 7rem);    /* 56 -> 112px */
  --text-h1: clamp(2.5rem, 1.83rem + 2.96vw, 4.5rem);    /* 40 -> 72px */
  --text-h2: clamp(2rem, 1.67rem + 1.48vw, 3rem);        /* 32 -> 48px */
  --text-h3: clamp(1.5rem, 1.33rem + 0.74vw, 2rem);      /* 24 -> 32px */
  --text-h4: 1.375rem;   /* 22px */
  --text-h5: 1.125rem;   /* 18px */
  --text-h6: 0.875rem;   /* 14px, uppercase */

  /* Paragraph scale (matches the style guide) */
  --text-xxl: 2rem;      /* 32px */
  --text-xl: 1.5rem;     /* 24px */
  --text-lg: 1.125rem;   /* 18px: subheading, quote */
  --text-md: 1rem;       /* 16px: default */
  --text-sm: 0.875rem;   /* 14px: minimum for UI text */
  --text-eyebrow: 0.875rem;

  --leading-tight: 1.05;
  --leading-heading: 1.15;
  --leading-snug: 1.3;
  --leading-body: 1.6;
  --tracking-eyebrow: 0.1em;
  --tracking-h6: 0.08em;
  --tracking-heading: -0.01em;

  /* ---------- Spacing (style guide gap scale, rem-based) ---------- */
  --space-xxs: 0.5rem;   /* 8px  / 2mm print */
  --space-xs: 1rem;      /* 16px / 4mm */
  --space-sm: 2rem;      /* 32px / 8mm */
  --space-md: 3rem;      /* 48px / 12mm */
  --space-lg: 4rem;      /* 64px / 16mm */
  --space-xl: 5rem;      /* 80px / 20mm */
  --space-xxl: 6rem;     /* 96px / 24mm */

  --section-pad: var(--space-xxl);         /* desktop */
  --section-pad-tablet: var(--space-lg);
  --section-pad-phone: var(--space-md);

  /* ---------- Layout ---------- */
  --container-max: 78rem;      /* 1248px */
  --container-pad: 1.5rem;     /* 24px; use 1rem on phones */
  --grid-gutter: 1.5rem;
  --radius-sm: 2px;            /* buttons, tags, inputs */
  --radius-md: 4px;            /* cards, images */
  --border-width: 1px;
  --tap-min: 2.75rem;          /* 44px */

  /* ---------- Logo ---------- */
  --logo-wide-min-height: 32px;
  --logo-mark-min: 33px;      /* 17-32 px: favicon-32 (Ink fix); <= 16 px: favicon-16 (simplified) */
  --logo-clear-space: 0.2;     /* x logo height, on every side */
}

/* Dark sections: add class "is-dark" (Webflow combo class or section class) */
.is-dark {
  --color-bg: var(--mad-ink);
  --color-bg-alt: var(--mad-night);
  --color-bg-soft: #2e2a2b;
  --color-text: var(--mad-white);
  --color-text-muted: rgba(255, 255, 255, 0.72);  /* about 9:1 on ink (estimate) */
  --color-link: var(--mad-gold);
  --color-link-underline: var(--mad-gold);
  --color-border: var(--mad-line-dark);
  --color-focus: var(--mad-gold);
}

/* Gold sections: text stays ink */
.is-gold {
  --color-bg: var(--mad-gold);
  --color-text: var(--mad-ink);
  --color-text-muted: var(--mad-ink);
  --color-accent: var(--mad-ink);
  --color-on-accent: var(--mad-gold);
  --color-link: var(--mad-ink);
  --color-link-underline: var(--mad-ink);
}

@media (max-width: 767px) {
  :root {
    --container-pad: 1rem;
    --section-pad: var(--section-pad-phone);
  }
}
