/* ==========================================================================
   Moore2Lend design system - DUAL-BRAND TOKEN ARCHITECTURE
   DEFAULT brand: "M2L" - the client deck identity (charcoal + bright M2L
   green #7EDA57, chevron/halftone graphic language, Archivo display).
   ALTERNATE brand: "spruce" - the v1 "Kitchen Table" spruce & copper system,
   selected via <html data-brand="spruce"> (preview toggle in scripts.html).
   All brand differences live in the token scopes below; component rules
   reference semantic tokens only. Liquid layout via clamp()/min()/max().
   Self-hosted fonts, zero third-party bytes. AEO Site Protocol v2.x.
   ========================================================================== */

/* ---------- Fonts (self-hosted woff2, static/fonts/) ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/archivo-var.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/fraunces-var.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/fraunces-italic-var.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/public-sans-var.woff2") format("woff2");
}
@font-face {
  font-family: "Spline Sans Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/spline-sans-mono-var.woff2") format("woff2");
}

/* ==========================================================================
   TOKENS - the single theming surface.
   Scope 1: :root                          → M2L brand, light (DEFAULT)
   Scope 2: dark media, :root:not(spruce)  → M2L brand, dark (the deck world)
   Scope 3: :root[data-brand="spruce"]     → Spruce/Copper v1, light
   Scope 4: dark media, [data-brand=...]     → Spruce/Copper v1, dark
   Every scope defines the COMPLETE semantic set; components never reference
   raw palette names.
   ========================================================================== */
:root {
  color-scheme: light;

  /* ----- BRAND SET: "M2L" light - the deck's paper counterpart -----
     Deck source: charcoal #201C19-#272727 panels, M2L green #7EDA57
     (sampled rgb(126,218,87), consistent across slides 1-14), white type,
     green chevrons + halftone dots. On paper, charcoal carries type, the
     bright green is graphic punctuation (fills, rules, marks), and the
     AA-safe green ink #2F6B1B carries green at text sizes. */
  --bg:            #FBFAF7;  /* warm ivory canvas (industry trust-neutral) */  /* neutral paper, faint warm cast like the deck note pages */
  --surface:       #EFEDE8;  /* stone */  /* raised surfaces, table stripes */
  --tint-info:     #EDF2F7;  /* navy wash - answer cards, calc results */  /* soft green wash - answer cards, calc results */
  --tint-warm:     #F4F3F0;  /* neutral wash - highlight rows, hero halo */
  --text:          #201C19;  /* deck charcoal as ink */
  --text-muted:    #4F5B66;  /* slate */
  --heading:       #1B3A5C;  /* navy headlines; green confined to logo, buttons, micro-accents */
  --brand:         #1B3A5C;  /* navy-800 - links, interactive (trust primary) */  /* links & interactive - AA-safe M2L green ink */
  --brand-fill:    #7ED956;  /* exact one-pager green */  /* primary CTA fill - the deck's green card */
  --on-brand:      #14110E;
  --brand-fill-hover: #201C19; /* CTA hover flips to charcoal... */
  --on-brand-hover:   #7EDA57; /* ...with green type, the slide look */
  --deep:          #132A44;  /* navy-900 field (footer, deep sections) */  /* footer field, dark bands = deck panel */
  --on-deep:       #F2F0EC;
  --on-deep-muted: #ABA49B;
  --accent:        #1B3A5C;  /* navy - eyebrows, link hover, body-size accents */
  --accent-bright: #7ED956;  /* M2L green - permitted accents only: rules, underscores, checkmarks */
  --on-accent:     #14110E;  /* text set on an accent-bright fill */
  --lake-ui:       #2F6B1B;  /* calculator/info UI accents */
  --rule: color-mix(in oklab, var(--text) 18%, var(--bg));
  --rule-deep: color-mix(in oklab, var(--on-deep) 20%, var(--deep));
  --focus:         #2F6B1B;
  --selection-bg:  #7EDA57;
  --selection-text:#14110E;
  --logo-mark:     #7EDA57;  /* the M2L green chevron lockup (logo, contrast-exempt) */

  /* Type voice */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --weight-display: 700;
  --track-display: -0.015em;
  --opsz-display: normal;          /* Archivo has no optical axis */
  --quote-style: normal;           /* deck voice: bold grotesque, not italic serif */
  --quote-weight: 600;
  --disclosure-marker: "\00BB";    /* » - the deck chevron as FAQ marker */
  --disclosure-rotate: 90deg;
  --hero-media-radius: var(--radius-md); /* crisp deck panel, no arch */

  /* Shadows (charcoal-tinted) */
  --shadow-1: 0 1px 2px rgba(20, 17, 14, 0.07);
  --shadow-2: 0 4px 16px rgba(20, 17, 14, 0.10);
  --shadow-3: 0 12px 40px rgba(20, 17, 14, 0.16);

  /* ----- Shared scale (brand-independent) ----- */
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --font-data: "Spline Sans Mono", "SFMono-Regular", Consolas, monospace;

  --text-xs:   clamp(0.78rem, 0.74rem + 0.18vw, 0.84rem);
  --text-sm:   clamp(0.89rem, 0.85rem + 0.20vw, 0.98rem);
  --text-base: clamp(1.05rem, 1.00rem + 0.25vw, 1.155rem);
  --text-md:   clamp(1.22rem, 1.15rem + 0.40vw, 1.42rem);
  --text-lg:   clamp(1.45rem, 1.32rem + 0.70vw, 1.85rem);
  --text-xl:   clamp(1.80rem, 1.55rem + 1.30vw, 2.55rem);
  --text-2xl:  clamp(2.25rem, 1.80rem + 2.30vw, 3.55rem);
  --text-hero: clamp(2.60rem, 2.00rem + 3.20vw, 4.40rem);

  --leading-tight: 1.12;
  --leading-body: 1.62;
  --tracking-label: 0.08em;

  /* Space */
  --space-3xs: clamp(0.25rem, 0.23rem + 0.10vw, 0.31rem);
  --space-2xs: clamp(0.50rem, 0.46rem + 0.20vw, 0.63rem);
  --space-xs:  clamp(0.75rem, 0.69rem + 0.30vw, 0.94rem);
  --space-sm:  clamp(1.00rem, 0.92rem + 0.40vw, 1.25rem);
  --space-md:  clamp(1.50rem, 1.38rem + 0.60vw, 1.88rem);
  --space-lg:  clamp(2.25rem, 2.00rem + 1.25vw, 3.00rem);
  --space-xl:  clamp(3.50rem, 2.90rem + 3.00vw, 5.25rem);
  --space-2xl: clamp(5.00rem, 4.00rem + 5.00vw, 8.00rem);

  /* Radius / border */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --border-hairline: 1px solid var(--rule);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-med:  280ms;
  --dur-slow: 600ms;

  /* Layout */
  --measure: 68ch;
  --container: min(72rem, 92vw);
  --container-wide: min(85rem, 94vw);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: clamp(4.25rem, 3.9rem + 1.2vw, 5.5rem);
  --header-h-condensed: 4rem;
  --tap-target: 44px;
}

/* Dark-scheme token override removed 2026-07-24: the deck charcoal lives in panels (hero card, footer, CTA card), not as a full-page takeover. Reintroduce only as a deliberate approved theme. */


/* ----- BRAND SET: "spruce" light - v1 "Kitchen Table" (alternate) ----- */
:root[data-brand="spruce"] {
  --bg:            #FBF7EF;
  --surface:       #F2EBDF;
  --tint-info:     #E4EEE7;
  --tint-warm:     #F6E3D4;
  --text:          #2B2620;
  --text-muted:    #5A523F;
  --heading:       #1E4B3C;
  --brand:         #1E4B3C;
  --brand-fill:    #1E4B3C;
  --on-brand:      #FBF7EF;
  --brand-fill-hover: #123227;
  --on-brand-hover:   #F0EADC;
  --deep:          #123227;
  --on-deep:       #F0EADC;
  --on-deep-muted: #B8C4BC;
  --accent:        #8C3D12;
  --accent-bright: #B4551F;
  --on-accent:     #FBF7EF;
  --lake-ui:       #3D5A63;
  --rule: color-mix(in oklab, var(--text) 18%, var(--bg));
  --rule-deep: color-mix(in oklab, var(--on-deep) 22%, var(--deep));
  --focus:         #1E4B3C;
  --selection-bg:  #F6E3D4;
  --selection-text:#2B2620;
  /* Logo remedy: the bright M2L green lockup vibrates against spruce;
     the mark renders in copper inside this brand (see brief §logo). */
  --logo-mark:     #B4551F;

  --font-display: "Fraunces", "Georgia", serif;
  --weight-display: 600;
  --track-display: -0.01em;
  --opsz-display: "opsz" 72;
  --quote-style: italic;
  --quote-weight: 300;
  --disclosure-marker: "+";
  --disclosure-rotate: 45deg;
  --hero-media-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 24% 24% var(--radius-lg) var(--radius-lg);

  --shadow-1: 0 1px 2px rgba(43, 38, 32, 0.06);
  --shadow-2: 0 4px 16px rgba(43, 38, 32, 0.08);
  --shadow-3: 0 12px 40px rgba(18, 50, 39, 0.14);
}

/* Dark-scheme token override removed 2026-07-24: the deck charcoal lives in panels (hero card, footer, CTA card), not as a full-page takeover. Reintroduce only as a deliberate approved theme. */


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  color: var(--heading);
  letter-spacing: var(--track-display);
  margin: 0 0 var(--space-sm);
  max-width: 28ch;
}
h1 { font-size: var(--text-2xl); font-variation-settings: var(--opsz-display); }
h2 { font-size: var(--text-xl); font-variation-settings: var(--opsz-display); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }

p, ul, ol, dl { margin: 0 0 var(--space-sm); }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

::selection { background: var(--selection-bg); color: var(--selection-text); }

img, svg, video { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: var(--border-hairline); margin: var(--space-lg) 0; }

code, pre, time { font-family: var(--font-data); font-size: 0.92em; }

blockquote {
  margin: var(--space-md) 0;
  padding-left: var(--space-md);
  border-left: 2px solid var(--accent-bright);
  font-family: var(--font-display);
  font-style: var(--quote-style);
  font-weight: var(--quote-weight);
  font-size: var(--text-md);
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--space-sm); top: -4rem; z-index: 100;
  background: var(--brand-fill); color: var(--on-brand);
  padding: 0.6rem 1.1rem; border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-sm); color: var(--on-brand); }

/* Eyebrow: the mono label with an accent underscore (brand-token colored) */
.eyebrow {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-2xs);
}
.eyebrow::after {
  content: "";
  display: block;
  width: 1.5rem; height: 2px;
  margin-top: var(--space-3xs);
  background: var(--accent-bright);
  transform-origin: left center;
}

/* ---------- Buttons: dual-CTA system ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5ch;
  min-height: var(--tap-target);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  font: 600 var(--text-sm)/1.2 var(--font-body);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  background: var(--brand-fill);
  color: var(--on-brand);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.button:hover { background: var(--brand-fill-hover); color: var(--on-brand-hover); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.button:active { transform: translateY(0); }

.button-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.button-outline:hover { background: var(--tint-info); color: var(--brand); box-shadow: none; }

.button-accent { background: var(--accent-bright); color: #14110E; }
.button-accent:hover { background: var(--brand-fill-hover); color: var(--on-brand-hover); }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; margin: var(--space-md) 0 var(--space-2xs); }

.de-risk {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* ---------- App-shell header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: var(--border-hairline);
  transition: background var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}

.site-nav {
  width: var(--container-wide);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--header-h);
  padding: var(--space-2xs) 0;
  transition: min-height var(--dur-med) var(--ease-out);
}

.brand-block { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--text-md);
  color: var(--heading);
  text-decoration: none;
  line-height: 1.1;
}
.brand:hover { color: var(--accent); }
/* Triple-chevron logo mark (deck lockup); color is a brand token so the
   spruce alternate can render it in copper (logo-clash remedy). */
.brand-mark { fill: var(--logo-mark); flex: none; }
.brand-byline {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.03em;
  max-height: 1.4em;
  overflow: hidden;
  transition: max-height var(--dur-med) var(--ease-out), opacity var(--dur-med) var(--ease-out);
}

/* Condensed state: shell tightens and inverts to spruce-deep */
.site-header.is-condensed { background: var(--deep); border-bottom-color: var(--rule-deep); box-shadow: var(--shadow-2); }
.site-header.is-condensed .site-nav { min-height: var(--header-h-condensed); }
.site-header.is-condensed .brand-byline { max-height: 0; opacity: 0; }
.site-header.is-condensed .brand,
.site-header.is-condensed .nav-menu a { color: var(--on-deep); }
.site-header.is-condensed .nav-menu a:hover { color: var(--accent-bright); }
.site-header.is-condensed .nav-toggle { color: var(--on-deep); border-color: var(--rule-deep); }
.site-header.is-condensed .button-outline { color: var(--on-deep); border-color: var(--on-deep-muted); }
.site-header.is-condensed .button-outline:hover { background: color-mix(in srgb, var(--on-deep) 8%, transparent); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.2vw, 1.4rem);
  list-style: none;
  margin: 0; padding: 0;
}
.nav-menu a {
  display: inline-block;
  position: relative;
  padding: 0.5rem 0.15rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
/* accent underscore draws left to right */
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.2rem;
  height: 2px;
  background: var(--accent-bright);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav-menu a:hover::after, .nav-menu a:focus-visible::after, .nav-menu a[aria-current="page"]::after { transform: scaleX(1); }

.nav-ctas { display: flex; align-items: center; gap: var(--space-2xs); }

.nav-toggle {
  display: none;
  min-width: var(--tap-target); min-height: var(--tap-target);
  align-items: center; justify-content: center; gap: 0.5ch;
  background: transparent;
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: 600 var(--text-sm) var(--font-body);
  cursor: pointer;
}

/* Structural query: nav collapses to overlay */
@media (max-width: 64em) {
  .nav-toggle { display: inline-flex; }
  .nav-drawer {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-h-condensed);
    z-index: 40;
    background: var(--deep);
    padding: var(--space-lg) var(--gutter) var(--space-2xl);
    overflow-y: auto;
  }
  .site-header.nav-open { background: var(--deep); }
  .site-header.nav-open .brand, .site-header.nav-open .nav-toggle { color: var(--on-deep); }
  .site-header.nav-open .brand-byline { color: var(--on-deep-muted); }
  .site-header.nav-open .nav-toggle { border-color: var(--rule-deep); }
  .site-header.nav-open .nav-drawer { display: block; animation: drawer-in var(--dur-med) var(--ease-out); }
  .nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu a {
    display: block;
    padding: var(--space-sm) 0;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    color: var(--on-deep);
    border-bottom: 1px solid var(--rule-deep);
  }
  .nav-menu a::after { content: none; }
  .nav-menu a:hover { color: var(--accent-bright); }
  .nav-ctas { flex-direction: column; align-items: stretch; margin-top: var(--space-lg); }
  .nav-ctas .button { width: 100%; }
  .nav-ctas .button-outline { color: var(--on-deep); border-color: var(--on-deep-muted); }
  @media (prefers-color-scheme: light) {
    .nav-drawer .button { background: var(--on-deep); color: var(--deep); }
  }
}
@keyframes drawer-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Mobile sticky action bar ---------- */
.mobile-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--deep);
  box-shadow: var(--shadow-3);
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translateY(0);
  transition: transform var(--dur-med) var(--ease-out);
}
.mobile-bar.is-hidden { transform: translateY(110%); }
.mobile-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 0.5rem 0.25rem;
  background: var(--deep);
  color: var(--on-deep);
  font: 600 var(--text-xs)/1.2 var(--font-body);
  text-decoration: none;
  text-align: center;
}
.mobile-bar a:hover { color: var(--accent-bright); }
.mobile-bar .bar-label-sub { font-family: var(--font-data); font-weight: 400; color: var(--on-deep-muted); font-size: 0.68rem; }
@media (max-width: 48em) {
  .mobile-bar { display: grid; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0)); }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(120% 90% at 85% 10%, color-mix(in oklab, var(--tint-warm) 55%, transparent) 0%, transparent 55%),
    radial-gradient(100% 100% at 10% 90%, color-mix(in oklab, var(--tint-info) 60%, transparent) 0%, transparent 60%),
    var(--bg);
  border-bottom: var(--border-hairline);
}
.hero-inner {
  width: var(--container);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl) 0 var(--space-lg);
}
@media (max-width: 48em) {
  .hero-inner { grid-template-columns: 1fr; gap: var(--space-lg); }
}

.hero-headline {
  font-family: var(--font-display);
  font-variation-settings: var(--opsz-display);
  font-weight: var(--weight-display);
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  letter-spacing: var(--track-display);
  color: var(--heading);
  max-width: 16ch;
  margin: 0 0 var(--space-sm);
}
.hero-subheadline {
  font-size: var(--text-md);
  color: var(--text-muted);
  max-width: 46ch;
  margin: 0;
}

.hero-media { position: relative; }
/* offset frame removed: it outlined the full column and dangled below the image */
.hero-media video[hidden] { display: none; }
.hero-media img, .hero-media video {
  position: relative;
  width: 100%;
  border-radius: var(--hero-media-radius);
  box-shadow: var(--shadow-2);
}

/* Entrance animation removed 2026-07-24: content is visible at first paint. */
/* Deck signature: two-tone tagline (slide 1) - line A ink, line B green, "right" underlined */
.hero-line-a, .hero-line-b { display: block; }
.hero-line-b { color: var(--heading); }
.hero-right { font-style: normal; text-decoration: underline; text-decoration-color: var(--brand-fill); text-decoration-thickness: 0.08em; text-underline-offset: 0.12em; }

/* ---------- Trust bar: proof by numbers ---------- */
.trust-bar {
  width: var(--container);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  border-top: var(--border-hairline);
  padding: var(--space-md) 0 var(--space-lg);
  gap: var(--space-sm) var(--space-md);
  list-style: none;
}
.trust-bar li { padding-left: var(--space-sm); border-left: 2px solid var(--accent-bright); }
.trust-fact {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-md);
  color: var(--heading);
}
.trust-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ---------- Page shell & section rhythm ---------- */
.page-content {
  width: var(--container);
  margin-inline: auto;
  padding: var(--space-xl) 0 var(--space-2xl);
}
.page-content > article > header { margin-bottom: var(--space-lg); }
.page-content section + section { margin-top: var(--space-xl); }
.page-content section { position: relative; }

.page-content p, .page-content li, .lede { max-width: var(--measure); }

.lede {
  font-size: var(--text-md);
  color: var(--text-muted);
  line-height: 1.5;
}

/* section h2 gets the ledger underscore, drawn when scrolled into view */
.page-content section > h2 { padding-bottom: var(--space-2xs); }
.page-content section > h2::after {
  content: "";
  display: block;
  width: 2.25rem; height: 2px;
  margin-top: var(--space-2xs);
  background: var(--accent-bright);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-slow) var(--ease-out);
}
.page-content section.in-view > h2::after, .no-js .page-content section > h2::after { transform: scaleX(1); }

/* hairline-ruled lists inside prose pages */
.page-content article > ul, .ruled-list { padding-left: 0; }
.ruled-list li { list-style: none; padding: var(--space-2xs) 0; border-bottom: var(--border-hairline); }

/* ---------- Ledger cards (program cards, teasers) ---------- */
.program-card, .post-teaser, .faq-item {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.program-card:hover, .post-teaser:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }

.program-card h2, .post-teaser h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2xs);
  padding-bottom: var(--space-2xs);
  border-bottom: 2px solid var(--accent-bright);
  max-width: none;
  display: inline-block;
}
.program-card h2::after { content: none; }
.program-card > p:last-child { margin-bottom: 0; }

.post-teaser h2 { border-bottom: none; padding-bottom: 0; display: block; }
.post-teaser h2 a { text-decoration: none; }
.post-teaser h2 a:hover { color: var(--accent); }
.post-teaser time { color: var(--accent); font-size: var(--text-sm); font-weight: 500; }
.post-teaser > p:last-child { margin-bottom: 0; }

/* ledger fact row: mono facts separated by hairlines */
.fact-row {
  display: flex; flex-wrap: wrap;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  border-top: var(--border-hairline);
  border-bottom: var(--border-hairline);
  margin: var(--space-sm) 0;
}
.fact-row > span { padding: var(--space-2xs) var(--space-sm); border-right: var(--border-hairline); }
.fact-row > span:first-child { padding-left: 0; }
.fact-row > span:last-child { border-right: 0; }

/* "At a glance" ledger panel */
.ledger-panel {
  background: var(--tint-info);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.ledger-panel dl { margin: 0; }
.ledger-panel dt {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: var(--space-2xs);
}
.ledger-panel dd {
  margin: 0 0 var(--space-2xs);
  padding-bottom: var(--space-2xs);
  border-bottom: var(--border-hairline);
  font-family: var(--font-data);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ledger-panel dd:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------- Tables: kept books ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--space-md) 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
}
caption {
  text-align: left;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--space-2xs);
}
th, td { text-align: left; padding: var(--space-2xs) var(--space-sm); border-bottom: var(--border-hairline); }
th {
  font-family: var(--font-data);
  font-weight: 500;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}
td { font-family: var(--font-data); }
tbody tr:nth-child(even) { background: var(--surface); }

/* ---------- FAQ / disclosure ---------- */
details {
  border-bottom: var(--border-hairline);
  padding: var(--space-2xs) 0;
  max-width: var(--measure);
}
details summary {
  display: flex; align-items: baseline; gap: var(--space-2xs);
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--text-md);
  color: var(--heading);
  padding: var(--space-2xs) 0;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: var(--disclosure-marker);
  font-family: var(--font-data);
  color: var(--accent-bright);
  transition: transform var(--dur-fast) var(--ease-out);
}
details[open] summary::before { transform: rotate(var(--disclosure-rotate)); }
details > *:not(summary) { max-width: var(--measure); }

/* ---------- Forms ---------- */
.contact-form, .calculator {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  max-width: 40rem;
}
.form-intro { color: var(--text-muted); font-size: var(--text-sm); }

.contact-form label, .calculator label {
  display: block;
  margin: var(--space-sm) 0 var(--space-3xs);
  font-weight: 600;
  font-size: var(--text-sm);
}
.contact-form input, .contact-form textarea, .contact-form select,
.calculator input, .calculator select {
  display: block;
  width: 100%;
  min-height: var(--tap-target);
  padding: 0.55rem 0.8rem;
  margin-top: var(--space-3xs);
  border: 1px solid color-mix(in oklab, var(--text) 30%, var(--bg));
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: 400 var(--text-base)/1.4 var(--font-body);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.calculator input { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.contact-form input:focus, .contact-form textarea:focus, .calculator input:focus { border-color: var(--focus); }
.contact-form textarea { min-height: 8rem; resize: vertical; }

input[type="range"] { accent-color: var(--lake-ui); min-height: var(--tap-target); padding: 0; border: 0; background: transparent; }

.hp-field { position: absolute; left: -9999px; top: auto; }
.form-status { font-weight: 600; color: var(--brand); min-height: 1.5em; }

.contact-form .button, .calculator .button { margin-top: var(--space-md); }

/* Calculator result: the dominant figure */
.calculator [role="status"], .calc-result {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--tint-info);
  border-left: 3px solid var(--lake-ui);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.calc-figure {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: var(--opsz-display);
  font-weight: var(--weight-display);
  font-size: var(--text-xl);
  color: var(--heading);
  font-variant-numeric: lining-nums tabular-nums;
}
.calc-breakdown {
  font-family: var(--font-data);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: var(--space-2xs) 0 0;
}
.calc-disclaimer {
  display: block;
  margin-top: var(--space-2xs);
  padding-top: var(--space-2xs);
  border-top: var(--border-hairline);
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- Contact block ---------- */
.contact-block {
  font-style: normal;
  font-family: var(--font-data);
  font-size: var(--text-sm);
  line-height: 1.9;
  background: var(--tint-info);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  max-width: 34rem;
}
.contact-block a { color: var(--brand); }

/* ---------- Inverted proof band ---------- */
.band-deep {
  background: var(--deep);
  color: var(--on-deep);
  padding: var(--space-xl) 0;
}
.band-deep h2, .band-deep h3 { color: var(--on-deep); }
.band-deep a { color: var(--accent-bright); }
.band-deep .inner { width: var(--container); margin-inline: auto; }

/* ---------- Footer with compliance block ---------- */
.site-footer {
  background: var(--deep);
  color: var(--on-deep);
  font-size: var(--text-sm);
  margin-top: var(--space-2xl);
}
.site-footer .footer-inner {
  width: var(--container);
  margin-inline: auto;
  padding: var(--space-xl) 0 var(--space-lg);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-lg);
}
.site-footer h2 {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--on-deep-muted);
  margin-bottom: var(--space-sm);
}
.site-footer a { color: var(--on-deep); text-decoration-color: var(--on-deep-muted); }
.site-footer a:hover { color: var(--accent-bright); }
.site-footer a.button-accent { color: #14110E; }
.site-footer a.button-accent:hover { color: #14110E; background: var(--brand-fill-hover); }
.footer-wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--text-lg);
  color: var(--on-deep);
  margin-bottom: var(--space-2xs);
}
.footer-identity p, .footer-identity address { margin: 0 0 var(--space-2xs); font-style: normal; }
.footer-identity .nmls-line { font-family: var(--font-data); font-size: var(--text-xs); color: var(--on-deep-muted); letter-spacing: 0.03em; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { border-bottom: 1px solid var(--rule-deep); }
.footer-nav a { display: inline-block; padding: var(--space-2xs) 0; text-decoration: none; }

.footer-compliance {
  border-top: 1px solid var(--rule-deep);
}
.footer-compliance .footer-inner-narrow {
  width: var(--container);
  margin-inline: auto;
  padding: var(--space-md) 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
}
@media (max-width: 48em) { .footer-compliance .footer-inner-narrow { grid-template-columns: 1fr; } }
.footer-compliance p { font-size: var(--text-xs); color: var(--on-deep-muted); margin: 0 0 var(--space-2xs); max-width: 80ch; }
.eho-mark { width: 44px; height: 44px; }
.footer-legal { border-top: 1px solid var(--rule-deep); }
.footer-legal p {
  width: var(--container);
  margin-inline: auto;
  padding: var(--space-sm) 0;
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--on-deep-muted);
}

/* ---------- Consent banner ---------- */
.consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex; flex-wrap: wrap; gap: var(--space-sm);
  align-items: center; justify-content: center;
  background: var(--deep);
  color: var(--on-deep);
  padding: var(--space-sm) var(--gutter);
  box-shadow: var(--shadow-3);
}
.consent-banner p { margin: 0; max-width: 60ch; font-size: var(--text-xs); color: var(--on-deep-muted); }
.consent-banner a { color: var(--on-deep); }
.consent-banner .button { background: var(--accent-bright); color: var(--on-accent); }

/* ---------- Chatbot stub ---------- */
.chatbot { position: fixed; right: var(--space-sm); bottom: var(--space-lg); z-index: 30; }
.chatbot-toggle {
  background: var(--brand-fill); color: var(--on-brand);
  border: none; border-radius: var(--radius-pill);
  min-height: var(--tap-target);
  padding: 0.6rem 1.2rem;
  font: 600 var(--text-sm) var(--font-body);
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
.chatbot-panel {
  background: var(--bg);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  padding: var(--space-sm);
  width: min(90vw, 21rem);
  margin-bottom: var(--space-2xs);
}
.chatbot-log { max-height: 13rem; overflow-y: auto; font-size: var(--text-sm); }
.chatbot-note { color: var(--text-muted); }
.chatbot-panel form { display: flex; gap: var(--space-3xs); }
.chatbot-panel input {
  flex: 1; min-height: var(--tap-target);
  border: var(--border-hairline); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  padding: 0.4rem 0.7rem; font: inherit;
}

/* ---------- PREVIEW ONLY: brand A/B toggle -----------------------------
   Client-review affordance injected by partials/scripts.html so the owner
   can flip between the deck brand (M2L green) and the v1 spruce/copper
   system live. REMOVE (this block + the scripts.html module) BEFORE
   PRODUCTION LAUNCH. */
.brand-preview {
  position: fixed;
  left: var(--space-sm); bottom: var(--space-sm);
  z-index: 70;
  display: flex; align-items: center; gap: 2px;
  padding: 3px;
  background: var(--deep);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-2);
  font-family: var(--font-data);
  font-size: var(--text-xs);
}
.brand-preview .bp-label {
  color: var(--on-deep-muted);
  padding: 0 0.4rem 0 0.7rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.brand-preview button {
  min-height: 36px;
  padding: 0.3rem 0.85rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--on-deep);
  font: inherit;
  cursor: pointer;
}
.brand-preview button[aria-pressed="true"] {
  background: var(--brand-fill);
  color: var(--on-brand);
  font-weight: 600;
}
@media (max-width: 48em) {
  .brand-preview { bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
}

/* Keep fixed elements clear of the mobile action bar (after their base rules
   so these offsets win the cascade). */
@media (max-width: 48em) {
  .consent-banner { bottom: calc(56px + env(safe-area-inset-bottom, 0)); }
  .chatbot { bottom: calc(72px + env(safe-area-inset-bottom, 0) + 3rem); }
}

/* ---------- Blog ---------- */
.byline {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.02em;
  border-bottom: var(--border-hairline);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
  max-width: var(--measure);
}
.post-content { max-width: min(var(--measure), 92vw); }
.post-back { margin-top: var(--space-lg); }

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --text: #000; }
  .site-header, .mobile-bar, .consent-banner, .chatbot, .skip-link,
  .brand-preview, .nav-ctas, .cta-row, .hero-media video { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; padding-bottom: 0; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .site-footer { background: #fff; color: #000; border-top: 1px solid #000; margin-top: 2rem; }
  .site-footer a, .footer-compliance p, .footer-legal p, .footer-wordmark { color: #000; }
  .program-card, .post-teaser, .calculator, .contact-form { box-shadow: none; border: 1px solid #999; }
}

/* ---------- One-pager green field section (black text on M2L green) ---------- */
.green-field {
  background: #132A44;  /* navy-900: green demoted to checkmarks per palette policy */
  color: #F5F8FB;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}
.green-field h2 { color: #FFFFFF; }
.green-field h2::after { background: #7ED956; }
.green-field .check-list li::before { color: #7ED956; }
.check-list { list-style: none; padding: 0; margin: var(--space-sm) 0 0; }
.check-list li { padding-left: 1.8em; position: relative; margin-bottom: 0.55em; font-weight: 600; letter-spacing: 0.04em; }
.check-list li::before { content: "\2713"; position: absolute; left: 0; top: 0; font-weight: 800; }
.brand-mark-m2l { display: block; }
