/* ============================================================================
   ClimateDoor block contract: the shared hero (.cd-hero) and stats band (.cd-stats).
   Reference: site/home.html as rendered on 22 Sept 2026 (Khushi: "the home page is the
   agreed reference"). Values are copied from home.html .hero / #cd-final-overrides /
   .stats, not invented. DESIGN.md §4, §5, §7 govern.

   Tokens only: every colour is a var() from cd-tokens.css. Sizes are literal because
   cd-tokens.css carries no type scale yet (home.html declares --fs-* page-locally).

   WHY !important. The five pages that adopt this block each carry a page-local hero
   stylesheet that pins the same properties (.hero h1{font-size…}, .chero .wrap{padding…},
   .eyebrow.on-dark{color}, .shell{padding}). This file is linked FIRST, right after
   cd-tokens.css, so at equal specificity the page's later rule would win. The contract
   declarations are therefore !important: the block wins regardless of link position or
   what a page's local CSS says. When a page's local hero CSS is deleted in its migration
   PR nothing here changes.

   Markup contract (home.html L1795-1820):
     <section class="hero cd-hero">
       <div class="bg"> <img> <video class="cd-hero-video"> </div>
       <div class="wrap cd-hero__in">
         <p class="eyebrow cd-hero__eyebrow">…</p>
         <h1>… <em class="cd-hero__em">one peach phrase</em> …</h1>
         <p class="lead cd-hero__lead">…</p>
         <div class="actions cd-hero__actions"> .btn.btn-peach + .btn.btn-outline.on-dark </div>
       </div>
     </section>
     <section class="stats cd-stats"><div class="wrap">
       <div class="stat"><b>150+</b><span>Commercial deals closed</span></div> …
     </div></section>
   ============================================================================ */

/* ---- .cd-hero: full-bleed photo/video, one viewport minus the nav ---- */
.cd-hero {
  position: relative !important;
  display: flex !important;
  min-height: calc(100vh - 132px) !important;      /* home #cd-final-overrides: 768px at 1440x900, 712 at 390x844 */
  padding: var(--nav-height) 0 0 !important;       /* the fixed 76px nav sits over the top of the hero */
  margin: 0 !important;
  overflow: hidden !important;
  background: var(--bg-inverse) !important;        /* teal under the photo while it loads */
  color: var(--fg-on-dark-1) !important;
  border: 0 !important;
}
/* engine pages paint a breathing peach radial wash in .hero::after; home has none */
.cd-hero::before, .cd-hero::after { content: none !important; }

/* media layer, home.html L879-888 (overlay in token form as carried by the shell blocks) */
.cd-hero .bg { position: absolute; inset: 0; z-index: 0; }
.cd-hero .bg img, .cd-hero .bg video { width: 100%; height: 100%; object-fit: cover; object-position: 60% center; }
.cd-hero .bg video { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.cd-hero .bg video.is-ready { opacity: 1; }
.cd-hero .bg::after {
  content: "" !important; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, var(--overlay-teal-60) 0%, var(--overlay-teal-40) 34%, var(--overlay-black-40) 66%, var(--overlay-black-50) 100%),
    linear-gradient(180deg, var(--overlay-black-50) 0%, transparent 34%, transparent 66%, var(--overlay-black-50) 100%),
    linear-gradient(90deg, var(--overlay-black-50) 0%, color-mix(in srgb, var(--cd-black) 18%, transparent) 55%, color-mix(in srgb, var(--cd-black) 6%, transparent) 100%) !important;
}

/* content column: --container-max wide, --container-pad gutters (48px at 1440, 20px at 390), vertically centred */
.cd-hero__in {
  position: relative !important; z-index: 1 !important;
  width: 100% !important; max-width: var(--container-max) !important;
  margin: auto !important;                          /* home: .hero > .wrap{margin:auto} */
  padding: 0 var(--container-pad) !important;
}

/* eyebrow: DESIGN.md eyebrow style; home renders it white with a 2px peach rule (CD-FINAL Jul 27) */
.cd-hero .cd-hero__eyebrow {
  display: inline-block !important;
  margin: 0 0 22px !important;
  padding: 0 0 7px !important;
  border: 0 !important;
  border-bottom: 2px solid var(--cd-peach) !important;
  font-size: var(--fs-eyebrow) !important;          /* 13px */
  font-weight: 600 !important;
  line-height: 1.45 !important;
  letter-spacing: var(--track-caps) !important;
  text-transform: uppercase !important;
  color: var(--fg-on-dark-1) !important;
  text-shadow: none !important;
}
.cd-hero .cd-hero__eyebrow::before, .cd-hero .cd-hero__eyebrow::after { content: none !important; }  /* engine pages draw a 26px dash */

/* h1: DESIGN.md h1 (600, -0.02em). 60px at 1440 like home's pin; 4.1667vw hits 60 exactly at 1440 (4vw would give 57.6) */
.cd-hero h1 {
  margin: 0 !important;
  max-width: 1060px !important;
  font-family: var(--font-sans) !important;
  font-size: clamp(2.5rem, 4.1667vw, 3.75rem) !important;
  font-weight: 600 !important;
  line-height: 1.06 !important;
  letter-spacing: -0.02em !important;
  color: var(--fg-on-dark-1) !important;
  text-shadow: 0 2px 30px color-mix(in srgb, var(--cd-black) 35%, transparent);
}
.cd-hero h1 * { white-space: normal !important; }  /* engine pages pin .l1/.l2/.draw nowrap; at 390 that is the investors overflow */
.cd-hero__em { font-style: normal !important; font-weight: inherit !important; color: var(--cd-peach) !important; }
.cd-hero__em::after { content: none !important; }  /* about/investors draw a peach underline under the phrase; home colours the word instead */

/* lead: home .hero .lead + #cd-final-overrides */
.cd-hero .cd-hero__lead {
  margin: 12px 0 0 !important;
  max-width: 740px !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: color-mix(in srgb, var(--cd-white) 88%, transparent) !important;
  text-shadow: 0 1px 16px var(--overlay-black-40);
}

/* buttons: DESIGN.md §7 .btn-peach / .btn-outline.on-dark come from each page's shell CSS (copied from home) */
.cd-hero .cd-hero__actions { display: flex !important; flex-wrap: wrap !important; gap: 14px !important; margin: 20px 0 0 !important; }

/* phones: home.html R38-c */
@media (max-width: 640px) {
  .cd-hero h1 { font-size: clamp(30px, 8.6vw, 40px) !important; line-height: 1.12 !important; max-width: 100% !important; }
}

/* ---- .cd-stats: the dark band directly under the hero, never inside it ---- */
.cd-stats {
  display: block !important;
  padding: 0 !important; margin: 0 !important;
  background: var(--bg-inverse) !important;
  border: 0 !important;
  border-top: 1px solid var(--border-dark) !important;
  color: var(--fg-on-dark-1);
}
/* home: repeat(6,1fr) + padding 30px 0. auto-fit lets a 3-, 4- or 5-stat band fill the row; the
   side padding keeps the --container-pad gutter that home's `30px 0` drops at phone width. */
.cd-stats .wrap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 24px;
  max-width: var(--container-max); margin: 0 auto; padding: 30px var(--container-pad);
}
.cd-stats .stat { padding: 0 !important; margin: 0 !important; border: 0 !important; text-align: left; }
.cd-stats .stat b {
  display: block; font-size: clamp(1.5rem, 2.4vw, 2.05rem); font-weight: 600; line-height: 1;
  letter-spacing: -0.02em; color: var(--fg-on-dark-1); text-shadow: none;
}
.cd-stats .stat span {
  display: block; margin-top: 9px; font-size: var(--fs-xs); font-weight: 600; line-height: 1.45;
  letter-spacing: var(--track-chip); text-transform: uppercase; color: var(--fg-on-dark-2);   /* meta row, DESIGN.md section 4: --track-chip, as Home and Results' captions */
}
@media (max-width: 1000px) { .cd-stats .wrap { grid-template-columns: repeat(3, 1fr); gap: 28px 20px; } }
@media (max-width: 620px)  { .cd-stats .wrap { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================================
   Type contract (DESIGN.md §4), applied on every page. Khushi, 24 Sept: "all of the titles have
   different weights, some bold, some thin, some feel like a different font... it feels like
   different websites." Measured before this block: home h2 600/40px; about, careers, investors
   and portfolio h2 300/48px with italic 300 phrases; eyebrows 11px/700 on the engine pages vs
   13px/600 on home. One heading voice: Montserrat 600, tight tracking, sentence case. The
   hero (.cd-hero h1) keeps its own rule above; results.html keeps Nick's h1 size pin (#105).
   ============================================================================ */
h1 { font-family: var(--font-sans) !important; font-weight: 600 !important; letter-spacing: -0.02em !important; }
h2, .h2 {
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: clamp(1.875rem, 3vw, 2.5rem) !important;   /* 30 → 40px */
  line-height: 1.12 !important;
  letter-spacing: -0.015em !important;
  font-style: normal !important;
}
/* the closing statement takes the display style (DESIGN.md section 4 display row, section 7 item 6). The h2 contract above
   held it at h2 size on every page since 26 Sept; each page's own closer rule asked for a display size and lost to it. */
.closer h2, .cd-closer-host h2 { font-size: var(--fs-display) !important; line-height: 1.08 !important; letter-spacing: -0.02em !important; }
/* the emphasised half of a heading: same weight, never italic; colour stays whatever the page set (peach on dark, teal on light) */
h2 b, h2 strong, h2 em, h2 i, h2 .ip, h2 .ip-d, h2 .draw, .h2 b, .h2 strong, .h2 em, .h2 i, .h2 .ip, .h2 .ip-d, .h2 .draw {
  font-weight: 600 !important; font-style: normal !important;
}
/* home's two-tone second half: weight 500 in teal-60 (DESIGN.md §4) stays the one allowed lighter half */
h2 .lite { font-weight: 500 !important; }
h3, .h3 { font-family: var(--font-sans) !important; font-weight: 600 !important; letter-spacing: -0.01em !important; font-style: normal !important; }
h3 b, h3 em, h3 .ip, .h3 b, .h3 em { font-weight: 600 !important; font-style: normal !important; }
/* case-page h3 headings set --fs-h4 and took body's 1.65; the h4 row is 22 / 1.22 (DESIGN.md section 4 h4 row; CLI-5348 F2). --lh-snug is in each case page's :root */
.cs-h3, .cs-body h3 { line-height: var(--lh-snug); }
/* eyebrow: --fs-eyebrow (13px) / 600 / --track-caps (0.1em) uppercase everywhere (DESIGN.md §4 eyebrow row) */
.eyebrow, .kicker, .cs-eyebrow, [class$="__eyebrow"], [class*="__eyebrow "], .sec-head .eyebrow {
  font-family: var(--font-sans) !important;
  font-size: var(--fs-eyebrow) !important;
  font-weight: 600 !important;
  letter-spacing: var(--track-caps) !important;
  text-transform: uppercase !important;
  line-height: 1.45 !important;
}
/* section lead paragraph: 20 / 1.45 (DESIGN.md lead); the hero lead keeps its own rule */
.lede:not(.cd-hero__lead), .sec-head > p, .lead:not(.cd-hero__lead) {
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem) !important; line-height: 1.45 !important; font-weight: 400 !important;
}
/* home's two ported V0 headings pin weight 300 with !important at class specificity; match them at class+element specificity */
.cd-v0port h2.lc-h2, .cd-v0port h2.pfdraw__h, h2.lc-h2, h2.pfdraw__h, .cd-v0port h2.lc-h2 b, .cd-v0port h2.pfdraw__h b { font-weight: 600 !important; letter-spacing: -0.015em !important; }
.cd-v0port .h2, .cd-v0port h2.h2, .cd-v0port .h2 b, .cd-v0port .h2 .nl { font-weight: 600 !important; font-style: normal !important; }

/* ============================================================================
   Keyboard focus ring on the 16 case pages (CLI-5427). The other ten pages that link this file
   carry the ring in their own <style id="cd-focus"> (site/about.html); the case pages had no
   focus rule, so a keyboard user saw Chromium's default ring. This is that ring: 2px solid,
   :focus-visible only, outline-offset 3px as the live cd-focus blocks draw it (DESIGN.md
   section 7 says offset 2px; the live pages use 3px and this matches them).
   Colour by ground (DESIGN.md section 7: peach on dark, teal on light), from a Tab walk of all
   16 pages at 1440, 1024 and 390. A case page is near-white with a light bar, so teal is the
   default: 9.97:1 on --cd-off-white, where peach is 1.48:1. Peach (6.72:1 on --cd-teal) on the
   teal grounds: the footer and the menu panel at 1100px and below carry stops today; the teal
   hero band carries none and is listed so a link added there is never teal on teal (1.00:1).
   Scope: body.cd-nav-light, the case pages' opt-in for the light bar; no other page has it, so
   these rules match nothing on the other pages. video: the Soil + Sky film is a Tab stop.
   ============================================================================ */
body.cd-nav-light :is(a,button,[tabindex],video):focus-visible { outline: 2px solid var(--cd-teal); outline-offset: 3px; }
body.cd-nav-light :is(.cs-hero,.footer) :is(a,button,[tabindex],video):focus-visible { outline-color: var(--cd-peach); }
@media (max-width: 1100px) {
  body.cd-nav-light .nav .links :is(a,button,[tabindex]):focus-visible { outline-color: var(--cd-peach); }
}
/* "Back to Results" hover on the case pages: --cd-teal-80 (5.5:1 on the --cd-off-white band), the light-ground hover the nav
   uses (DESIGN.md section 7 item 1). Each case page's own .cs-back-link:hover asks for --cd-sage, 3.98:1 on 12px caps, which
   section 3 rules out for small text; this selector outranks it, so the sixteen page rules no longer apply (CLI-4345). */
body.cd-nav-light .cs-back-link:hover { color: var(--cd-teal-80); }

/* ============================================================================
   Cookie consent banner (CLI-5441; decision Khushi Malik, 7 Oct 2026). Markup and logic:
   site/assets/cd-analytics.js, which builds <div class="cd-consent"> only on the public site
   (or with ?cd-consent=preview). Lives here, not in cd-chrome.css, because apply.html and
   build-engine-popup.html link this file but not the chrome sheet.
   A solid teal block fixed to the bottom, never a full-screen wall. Below the nav (z-index 50),
   so the open menu panel always shows over it. While it is open, html.cd-consent-open pads the
   page bottom by its height (--cd-consent-h, set by the script) so the last form button on a
   phone can scroll clear of it. Two buttons of equal size and weight: Accept and Decline look
   the same. Teal on --cd-off-white 9.97:1; white on teal 10.86:1; peach link on teal 6.72:1.
   No motion, so nothing to stop under reduced motion. Focus: peach ring on the teal ground.
   ============================================================================ */
.cd-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--bg-inverse); color: var(--fg-on-dark-1); border-top: 1px solid var(--border-dark); box-shadow: var(--shadow-lg); font-family: var(--font-sans); padding: var(--sp-4) var(--container-pad); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-3) var(--sp-5); }
.cd-consent[hidden] { display: none; }
.cd-consent .cd-consent__text { margin: 0; max-width: 60ch; font-size: var(--fs-sm); line-height: 1.45; font-weight: 400; color: var(--fg-on-dark-1); }
.cd-consent .cd-consent__text a { color: var(--cd-peach); text-decoration: underline; text-underline-offset: 2px; }
.cd-consent .cd-consent__actions { display: flex; gap: var(--sp-3); flex: 0 0 auto; }
.cd-consent .cd-consent__btn { min-width: 8.5rem; min-height: 44px; padding: var(--sp-3) var(--sp-5); border: 1px solid var(--cd-off-white); border-radius: var(--r-sm); background: var(--cd-off-white); color: var(--cd-teal); font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: 600; line-height: 1.2; letter-spacing: var(--track-caps); text-transform: uppercase; cursor: pointer; }
.cd-consent .cd-consent__btn:hover { background: var(--cd-white); border-color: var(--cd-white); }
.cd-consent :is(a,button):focus-visible { outline: 2px solid var(--cd-peach); outline-offset: 3px; }
html.cd-consent-open body { padding-bottom: var(--cd-consent-h, 0px); }
@media (max-width: 600px) {
  .cd-consent { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  .cd-consent .cd-consent__actions { width: 100%; }
  .cd-consent .cd-consent__btn { flex: 1 1 0; min-width: 0; }
}
/* The footer's "Cookie settings" control (tools/chrome/footer.html): a button styled as the contact row's text
   links. Hidden in the markup; cd-analytics.js shows it only where the banner can appear. */
.footer .cd-cookie-settings { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: inherit; }
.footer .cd-cookie-settings[hidden] { display: none; }
.footer .cd-cookie-settings:hover { color: var(--cd-white); }
