/* ============================================================================
   ClimateDoor website tokens — the ONE source of truth for the site's look.
   Source: brand book V1 + the approved home page. Documented in /DESIGN.md.

   Every page links this file FIRST. Page CSS may READ these tokens; it must
   not redefine them. New colours, fonts, radii or spacing go here (via PR),
   never as raw values inside a page. The design-tokens gate counts raw
   colour literals per page and goes red when a PR adds any.

   Naming: --cd-*   raw brand colours (the palette, never re-tuned per page)
           --bg-* / --fg-* / --accent / --border   semantic roles: USE THESE
           --sp-* --r-* --shadow-* --dur-* --ease-* --font-*   scales
   ============================================================================ */
:root {
  /* ---- Brand palette (brand book) ---- */
  --cd-teal:        #294144;   /* THE brand colour. Headings, body, dark sections, footer. */
  --cd-peach:       #F8C18D;   /* THE accent. Primary buttons, one highlighted word, eyebrows on dark. */
  --cd-black:       #000000;   /* Photo overlay base only. Never text. */
  --cd-white:       #FFFFFF;   /* Text/logo on teal; white section grounds. */
  --cd-off-white:   #F7F5F1;   /* Page ground. */
  --cd-bone:        #EEEAE2;   /* Alternate light ground for banded sections. */
  --cd-line:        #D9D4CA;   /* Hairline borders on light grounds. */
  --cd-line-dark:   rgba(255,255,255,0.14); /* Hairlines on teal. */

  /* Secondaries: charts, diagrams, states, the door motif. NOT small text (all < 4.5:1). */
  --cd-sage:        #5E807B;   /* success state; "green feel" without green */
  --cd-slate:       #698192;   /* chart / diagram accent */
  --cd-stone:       #8C8F86;   /* muted decorative fills only */
  --cd-sand:        #CBB5A1;   /* warning state; outline-button hover wash */
  /* Tertiaries: chart accents only. Never text. */
  --cd-sky:         #86B3D9;
  --cd-lime:        #E3E68C;

  /* Teal tints (the brand book's 80/60/40/20 ramp). */
  --cd-teal-80: color-mix(in srgb, var(--cd-teal) 80%, white);  /* secondary headings, 5.5:1 */
  --cd-teal-60: color-mix(in srgb, var(--cd-teal) 60%, white);  /* light half of a two-tone h2, 24px+ only */
  --cd-teal-40: color-mix(in srgb, var(--cd-teal) 40%, white);  /* decorative rules, inactive marks */
  --cd-teal-20: color-mix(in srgb, var(--cd-teal) 20%, white);  /* soft dividers, chart gridlines */

  /* ---- Semantic roles: what page CSS should actually reference ---- */
  --bg:             var(--cd-off-white);   /* page ground */
  --bg-alt:         var(--cd-bone);        /* banded section */
  --bg-inverse:     var(--cd-teal);        /* dark section, footer, mobile nav */
  --fg-1:           var(--cd-teal);        /* primary text on light */
  --fg-2:           color-mix(in srgb, var(--cd-teal) 75%, transparent); /* secondary text, 4.9:1 */
  --fg-3:           color-mix(in srgb, var(--cd-teal) 55%, transparent); /* 24px+ or decorative ONLY (2.95:1) */
  --fg-on-dark-1:   var(--cd-white);
  --fg-on-dark-2:   color-mix(in srgb, var(--cd-white) 75%, transparent);
  --accent:         var(--cd-peach);
  --accent-ink:     var(--cd-teal);        /* text on a peach fill (6.7:1) */
  --border:         var(--cd-line);
  --border-dark:    var(--cd-line-dark);
  --nav-link-on-dark: rgba(255,255,255,0.82);
  --footer-text:    rgba(255,255,255,0.60);

  /* Buttons */
  --btn-peach-hover:  color-mix(in srgb, var(--cd-peach) 82%, white);
  --btn-teal-hover:   color-mix(in srgb, var(--cd-teal) 88%, black);
  --btn-outline-hover-wash: rgba(203,181,161,0.40);

  /* Photo overlays: ALWAYS one of these under text on a photo. */
  --overlay-black-40: rgba(0,0,0,0.40);
  --overlay-black-50: rgba(0,0,0,0.50);
  --overlay-teal-40:  rgba(41,65,68,0.40);
  --overlay-teal-60:  rgba(41,65,68,0.60);

  /* States: always paired with a word or icon, never colour alone. */
  --state-ok:       var(--cd-sage);
  --state-warn:     var(--cd-sand);
  --state-danger:   #E3373A;

  /* ---- Type ---- */
  --font-sans: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;   /* the only typeface */
  --font-mono: var(--font-sans);   /* RETIRED 29 Sept: the brand book lists Montserrat only. Name kept so old pages resolve; pages drop the reference as they migrate. */
  --cd-heading-light: 300;   /* heading weight inside .cd-v0port only (Nick's V0-ported sections, ruling 5); brand-book sections stay 600 */

  /* ---- Space (4px grid) ---- */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;    /* card padding */
  --sp-6:  32px;    /* gap between cards */
  --sp-7:  48px;
  --sp-8:  64px;    /* section padding, phone */
  --sp-9:  96px;    /* section padding, desktop */
  --sp-10: 128px;   /* hero + closing statement */
  --sp-rhythm: 112px; /* Home, desktop: the space above and below every content section between the hero and the closer
                         (Nick, 9 Oct 2026, CLI-5469). Read by section.cd-rhythm in home.html. */

  /* ---- Radius: nearly square ---- */
  --r-none: 0px;
  --r-xs:   2px;
  --r-sm:   4px;    /* buttons, inputs, logo tiles: the default */
  --r-md:   8px;    /* cards, panels */
  --r-lg:   16px;   /* photo frames only */
  --r-pill: 999px;  /* eyebrow pills, dots, avatars */

  /* ---- Shadow: teal-tinted, quiet. Never pure black. ---- */
  --shadow-xs: 0 1px 2px rgba(41,65,68,0.06);
  --shadow-sm: 0 2px 6px rgba(41,65,68,0.08);
  --shadow-md: 0 8px 24px rgba(41,65,68,0.10);
  --shadow-lg: 0 20px 60px rgba(41,65,68,0.18);

  /* ---- Motion ---- */
  --dur-fast:   140ms;   /* colour, link hover */
  --dur-med:    240ms;   /* cards */
  --dur-slow:   420ms;   /* reveals */
  --ease-standard: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Layout ---- */
  --container-max: 1240px;
  --container-pad: clamp(20px, 4vw, 48px);
  --nav-height:    76px;

  /* ---- Type scale, rem (1rem = the browser base, 16px by default). Added 29 Sept. Pages use these, never a px font-size. ---- */
  --fs-display: clamp(3.25rem, 5.5vw, 4.5rem);   /* closing statements on teal */
  --fs-h1:      clamp(2.5rem, 4vw, 3.75rem);     /* the hero */
  --fs-h2:      clamp(1.875rem, 3vw, 2.5rem);    /* section headings */
  --fs-h3:      1.75rem;    /* 28px  card and column headings */
  --fs-h4:      1.375rem;   /* 22px  small headings inside cards */
  --fs-lead:    1.25rem;    /* 20px  intro paragraph */
  --fs-body:    1rem;       /* 16px  body copy */
  --fs-sm:      0.875rem;   /* 14px  captions, meta, attributions; button labels */
  --fs-xs:      0.75rem;    /* 12px  THE FLOOR. Footer, legal, nav links, tags, meta labels, small buttons. Nothing smaller anywhere. */
  --fs-eyebrow: 0.8125rem;  /* 13px  the label above a heading */
  /* Blog sizes (v2 blog design, Khushi Malik 8 Oct 2026; tools/blog). Blog pages only. */
  --fs-prose:    1.125rem;  /* 18px  blog post body text */
  --fs-h2-sm:    2rem;      /* 32px  headings inside a blog post body; the "Up next" card title */
  --fs-h1-post:  clamp(2rem, 3.4vw, 3rem);          /* 32 to 48px  a blog post's title in its hero */
  --fs-quote:    clamp(1.375rem, 2.2vw, 1.875rem);  /* 22 to 30px  the first "In their words" quote */
  --fs-figure:   3.25rem;   /* 52px  a "By the numbers" figure */
  --fs-dropcap:  5.5rem;    /* 88px  the first letter of a blog post's first body paragraph */

  /* ---- Caps tracking (brand book: 0 to 100 = 0 to 0.10em). Added 29 Sept. ---- */
  --track-caps: .1em;       /* eyebrows, buttons, tags */
  --track-chip: .08em;      /* nav links, chips */

  /* ---- Additions from Nick's 28 Sept audit (Kelsie rulings, 29 Sept). Revert point: DESIGN.md section 12. ---- */
  --cd-peach-40:  #FCE6D1;   /* the book's 40% peach swatch. Soft button and tag fill on light; teal text on it (8.99:1). */
  --cd-peach-16:  color-mix(in srgb, var(--cd-peach) 16%, transparent);  /* tag fill on teal; peach text on it (4.80:1) */
  --cd-teal-deep: #1A2E31;   /* teal under about 30% black. The one deep surface: any ground darker than teal, on any page (DESIGN.md section 3). Never text. Nick's ask; revertible. */
  --cd-forest:    #3E6A52;   /* brand book: gradients only. Never a flat fill, never text. */

  /* ---- Brand Book 2025 tints (Kelsie's ruling, 10 Oct 2026, CLI-5462): each colour mixed with white at
     the book's 80 / 60 / 40 / 20% steps. Added for Nick's 10 Oct Home and Services blocks; the book
     beats a picked-by-eye value, so his near-misses map onto these (map in the CLI-5470 PR body).
     Same contrast rules as the parent colour: none of these is small text on a light ground. ---- */
  --cd-peach-60:  #FBDABB;   /* soft peach fill: the light end of a peach tile */
  --cd-sand-40:   #EAE1D9;   /* warm card fill on off-white */
  --cd-sand-20:   #F5F0EC;   /* near-white warm ground and tile fill; near-white text on teal-deep */
  --cd-sage-60:   #9EB3B0;   /* sage marks; secondary text on --cd-teal-deep (6.4:1) or --cd-teal (4.9:1) */
  --cd-sage-20:   #DFE6E5;   /* pale sage tile fill; teal text on it (8.6:1) */
  --cd-sky-80:    #9EC2E1;   /* sky marks on dark grounds */
  --cd-sky-20:    #E7F0F7;   /* pale sky tile fill; teal text on it (9.4:1) */

  /* ---- The book's five gradients (Colour Palette page). The ONLY gradients allowed on the site. ---- */
  --cd-grad-green: linear-gradient(135deg, var(--cd-forest) 0%, var(--cd-teal) 100%);   /* white text only */
  --cd-grad-steel: linear-gradient(135deg, var(--cd-slate) 0%, var(--cd-teal) 100%);    /* white text only */
  --cd-grad-sky:   linear-gradient(135deg, var(--cd-sky) 0%, var(--cd-sage) 100%);      /* shapes and backgrounds, no text */
  --cd-grad-sand:  linear-gradient(135deg, var(--cd-sand) 0%, var(--cd-stone) 100%);    /* shapes and backgrounds, no text */
  --cd-grad-lime:  linear-gradient(135deg, var(--cd-lime) 0%, var(--cd-forest) 100%);   /* shapes and backgrounds, no text */
  --cd-grad-overlay: linear-gradient(180deg, rgba(41,65,68,0) 0%, rgba(41,65,68,0.85) 100%);  /* photo overlay under white text */

  /* ---- Blog topic colours (Khushi Malik, 8 Oct 2026; DESIGN.md section 13). ONLY on blog topic tags,
     topic buttons and the 4px line under a card photo: a 135deg (tags, buttons) or 90deg (line) fade from
     --cd-topic-<slug> to --cd-topic-<slug>-tint. Text on them is always --cd-teal (6:1 or better). ---- */
  --cd-topic-business-development:       #FFDEC3;   /* Business Development: start of its fade. */
  --cd-topic-business-development-tint:  #FFEFE1;   /* Business Development: end of its fade. */
  --cd-topic-weekly-signal:              #FCC9A6;   /* Weekly Signal: start of its fade. */
  --cd-topic-weekly-signal-tint:         #FEE4D2;   /* Weekly Signal: end of its fade. */
  --cd-topic-esg-consulting:             #EADBC4;   /* ESG Consulting: start of its fade. */
  --cd-topic-esg-consulting-tint:        #F5EDE1;   /* ESG Consulting: end of its fade. */
  --cd-topic-press-release:              #CBE3F2;   /* Press Release: start of its fade. */
  --cd-topic-press-release-tint:         #E5F1F9;   /* Press Release: end of its fade. */
  --cd-topic-raise-capital:              #A9CBE6;   /* Raise Capital: start of its fade. */
  --cd-topic-raise-capital-tint:         #D4E5F3;   /* Raise Capital: end of its fade. */
  --cd-topic-ai-implementation:          #86B3D9;   /* AI Implementation: start of its fade. */
  --cd-topic-ai-implementation-tint:     #C3D9EC;   /* AI Implementation: end of its fade. */
  --cd-topic-climate-impact:             #BFE3E0;   /* Climate Impact: start of its fade. */
  --cd-topic-climate-impact-tint:        #DFF1EF;   /* Climate Impact: end of its fade. */
  --cd-topic-growth-marketing:           #B5B5DB;   /* Growth Marketing: start of its fade. */
  --cd-topic-growth-marketing-tint:      #DADAED;   /* Growth Marketing: end of its fade. */
  --cd-topic-government-funding:         #D2BFE0;   /* Government Funding: start of its fade. */
  --cd-topic-government-funding-tint:    #E9DFF0;   /* Government Funding: end of its fade. */
  --cd-topic-carbon-emission:            #98C0AE;   /* Carbon Emission: start of its fade. Soft sage: approved exception to the no-green rule (Khushi, 8 Oct). */
  --cd-topic-carbon-emission-tint:       #CCE0D7;   /* Carbon Emission: end of its fade. */
}
