/* ==========================================================================
   LeaderScale — Light theme layer
   Loaded AFTER tokens.css and site.css. Purely additive.

   Remove the <link> to this file and the `lightmode` class on <body> and the
   site returns to the original dark build with nothing else changed.

   THE RULE (Colum review July 29 2026, revised with Mike the same evening):
     dark   header, footer, every page hero, .section--soft
     light  plain .section, .section--tight, the .band CTA before the footer,
            AND every rounded card inside them (light gray fill, dark ink)
   Every dark-to-light seam is a hard edge with a 1px emerald hairline. The
   cross-fades from the first pass are gone. They read as blur, not gradient.

   WHEN JOSH'S STYLE SHEET ARRIVES: every light value lives in the one block
   marked LIGHT SURFACE RAMP below. Swap those hex values and nothing else.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. LIGHT SURFACE RAMP — the only place light values are declared
   -------------------------------------------------------------------------- */
body.lightmode {
  /* Surfaces. Cool off-white page, light gray cards, white form fields. Each
     step carries the navy family's blue cast, so the light sections read as
     the same brand rather than generic SaaS white. */
  --lm-bg:          #F5F8FC;   /* page */
  --lm-surface:     #E8EDF5;   /* cards, panels, callout boxes */
  --lm-surface-2:   #CBD5E4;   /* raised elements, inactive signal track. Needs
                                  real separation from the card, or the unlit
                                  signal segments vanish. */
  --lm-field:       #FFFFFF;   /* form fields, so inputs read as inputs on gray */

  /* Text. --lm-text is the brand kit's Background/Inverse navy, used as ink.
     Worst case is the gray card: 15.2 / 6.7 / 4.8. All clear AA. */
  --lm-text:        #0F172B;
  --lm-text-dim:    #44526B;
  --lm-text-dimmer: #5A6880;

  --lm-line:        rgba(15, 23, 43, .13);
  --lm-line-strong: rgba(15, 23, 43, .22);

  /* Semantic colors darkened for legibility as TEXT on light. The signal
     colors themselves never change. Emerald/500 reads 2.3:1 on light, so
     green text drops to Emerald/800, which is in the brand ramp already. */
  --lm-green-fg:    #006045;   /* Emerald/800 — 6.5:1 on the gray card */
  --lm-blue-fg:     #2B5FD9;   /* 4.8:1 */
  --lm-red-fg:      #AE3714;   /* 5.3:1 */
  --lm-amber-fg:    #7E5A12;   /* 5.3:1 */

  --lm-green-wash:  rgba(0, 188, 125, .12);
  --lm-green-edge:  rgba(0, 150, 102, .34);
  --lm-red-wash:    rgba(242, 96, 60, .14);

  /* The hairline marking every dark-to-light seam. One value, four seams.
     Solid on purpose. A semi-transparent green composites down against the
     dark side and disappears, so the rule has to be opaque to read on both.
     Emerald/600 sits between the CTA green and the deep gradient green.
     Set this to a neutral like rgba(15,23,43,.18) to mute the seams. */
  --lm-seam:        #009966;
}

/* --------------------------------------------------------------------------
   2. WHICH SECTIONS GO LIGHT
   Plain .section, .section--tight, and the closing .band. Cards inside them
   inherit this context, so they go light gray with dark ink automatically.
   -------------------------------------------------------------------------- */
body.lightmode .section:not(.section--soft),
body.lightmode .section--tight:not(.section--soft),
body.lightmode .band {
  --bg:           var(--lm-bg);
  --bg-soft:      var(--lm-field);
  --surface:      var(--lm-surface);
  --surface-2:    var(--lm-surface-2);
  --text:         var(--lm-text);
  --text-dim:     var(--lm-text-dim);
  --text-dimmer:  var(--lm-text-dimmer);
  --line:         var(--lm-line);
  --line-strong:  var(--lm-line-strong);
  --green-fg:     var(--lm-green-fg);
  --blue-fg:      var(--lm-blue-fg);
  --red-fg:       var(--lm-red-fg);
  --amber-fg:     var(--lm-amber-fg);
  --green-wash:   var(--lm-green-wash);
  --green-edge:   var(--lm-green-edge);
  --red-wash:     var(--lm-red-wash);
  --shadow-panel: 0 1px 2px rgba(15, 23, 43, .05), 0 14px 34px -22px rgba(15, 23, 43, .20);

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

/* Cards on a light page need a real edge, because the fill difference alone
   is subtle. Hairline plus a whisper of shadow, nothing heavier. */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft),
  .band
) :is(
  .panel, .card, .symptoms,
  .path, .direct div,
  .mstep, .compare__col, .rung,
  .rim__panel, .rimstat,
  .inv-card, .founder-card, .member,
  .shift, .cp, .filter-box, .quote-card, .layer
) {
  border-color: var(--lm-line);
  box-shadow: 0 1px 2px rgba(15, 23, 43, .05), 0 12px 30px -22px rgba(15, 23, 43, .22);
}

/* --------------------------------------------------------------------------
   3. HARD SEAMS
   A 1px emerald hairline at every dark-to-light boundary. It reads against
   both sides, which a neutral line cannot do. Retune all four seams by
   changing --lm-seam, or set it to a neutral rgba to make them disappear.
   -------------------------------------------------------------------------- */
body.lightmode .hero,
body.lightmode .page-hero { border-bottom: 1px solid var(--lm-seam); }

body.lightmode .section--soft {
  border-top: 1px solid var(--lm-seam);
  border-bottom: 1px solid var(--lm-seam);
}

/* The band is usually the last light section before the dark footer. Pages
   without a band (investors) end on a plain .section, so seam that too. */
body.lightmode .band { border-bottom: 1px solid var(--lm-seam); }
body.lightmode main > :last-child:is(.section, .section--tight):not(.section--soft) {
  border-bottom: 1px solid var(--lm-seam);
}
body.lightmode .site-footer { border-top: 0; }

/* --------------------------------------------------------------------------
   4. ACCENT TEXT PICKS UP THE CONTEXTUAL COLOR
   Each rule falls back to the original token, so dark sections are untouched.
   -------------------------------------------------------------------------- */
body.lightmode .eyebrow,
body.lightmode .arrow,
body.lightmode .card__k,
body.lightmode .band h2 em,
body.lightmode .shift__cap,
body.lightmode .mstep__n,
body.lightmode .mstep__tag,
body.lightmode .inv-card span,
body.lightmode .member__mono,
body.lightmode .founder-card__links a,
body.lightmode .verdict__label--green,
body.lightmode .rung:last-child span,
body.lightmode .layer--us .layer__job,
body.lightmode .layer--us .layer__role,
body.lightmode .layer--us .layer__tools span,
body.lightmode .axis__col--us .axis__arrow,
body.lightmode .verdict__line b,
body.lightmode .post__more,
body.lightmode .form-done,
body.lightmode .chain li:last-child,
body.lightmode .tstat__num,
body.lightmode .rim__num,
body.lightmode .step__n,
body.lightmode .chain li i,
body.lightmode .foot-col a:hover {
  color: var(--green-fg, var(--green));
}

body.lightmode .eyebrow--blue,
body.lightmode .arrow--blue,
body.lightmode .card__k--blue,
body.lightmode .fit,
body.lightmode .pane .fit {
  color: var(--blue-fg, var(--blue));
}

body.lightmode .eyebrow--dim { color: var(--text-dimmer); }

body.lightmode .tags span {
  color: var(--green-fg, var(--green));
  background: var(--green-wash);
  border-color: var(--green-edge);
}

/* Rules, tracks and borders keep the true brand green. Only text darkens. */
body.lightmode .tstat__rule {
  background: linear-gradient(90deg, var(--green), var(--green-deep));
}

/* Avatar circles keep their dark gradient, so their initials stay white. */
body.lightmode .who__av { color: #ECF1F8; }

/* --------------------------------------------------------------------------
   5. BUTTONS AND FORM FIELDS
   Primary stays solid Emerald/500 with dark ink, 7.6:1, unchanged everywhere.
   -------------------------------------------------------------------------- */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft),
  .band
) .btn--ghost {
  color: var(--lm-text);
  border-color: var(--lm-line-strong);
  background: var(--lm-field);
}
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft),
  .band
) .btn--ghost:hover {
  color: var(--lm-green-fg);
  border-color: var(--lm-green-fg);
}

/* ---- The HubSpot embed --------------------------------------------------
   HubSpot generates <form id="hsForm_0cc58078-..."> and ships a stylesheet
   with rules like `#hsForm_xxx .hs-input`. That is an ID plus a class, which
   outranks our `#hs-form-early-access input` (ID plus element). So the first
   pass lost the cascade and the fields kept HubSpot's white-on-dark styling.
   These use !important, which is the only thing that reliably wins against a
   stylesheet we do not control and cannot predict the selectors of.
   ------------------------------------------------------------------------- */
body.lightmode #hs-form-early-access
  :is(input, select, textarea, .hs-input):not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not(.hs-button) {
  background: var(--lm-field) !important;
  color: var(--lm-text) !important;
  border: 1px solid var(--lm-line-strong) !important;
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
}
body.lightmode #hs-form-early-access :is(input, textarea, .hs-input)::placeholder {
  color: var(--lm-text-dimmer) !important;
  opacity: 1;
}
body.lightmode #hs-form-early-access
  :is(input, select, textarea, .hs-input):focus { border-color: var(--green) !important; outline: none; }

/* Labels, field hints, legends, and consent copy. */
body.lightmode #hs-form-early-access :is(label, legend, .hs-field-desc, .hs-form-field > label span) {
  color: var(--lm-text-dimmer) !important;
}
/* The required asterisk and the error text both live inside a <label>, so the
   label rule above outranks a plain class selector. These have to be deeper. */
body.lightmode #hs-form-early-access :is(label, span).hs-form-required,
body.lightmode #hs-form-early-access .hs-form-field > label .hs-form-required {
  color: var(--lm-red-fg) !important;
}
body.lightmode #hs-form-early-access
  :is(.legal-consent-container, .hs-richtext, .hs-richtext p, .inputs-list label span) {
  color: var(--lm-text-dim) !important;
}
body.lightmode #hs-form-early-access :is(.hs-richtext a, .legal-consent-container a) {
  color: var(--lm-green-fg) !important;
  text-decoration: underline;
}

/* Checkbox and radio labels sit next to the control, so they read as body copy. */
body.lightmode #hs-form-early-access :is(.hs-form-booleancheckbox, .hs-form-checkbox, .hs-form-radio) label,
body.lightmode #hs-form-early-access .inputs-list label {
  color: var(--lm-text) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-family: var(--font-body) !important;
  font-size: .93rem !important;
}

/* Checkbox and radio lists render with a stray bullet and a wandering control
   unless the list is reset. HubSpot's own CSS handles this, and it is cheap
   insurance for when their stylesheet is slow or blocked. */
body.lightmode #hs-form-early-access .inputs-list { list-style: none !important; padding-left: 0 !important; }
body.lightmode #hs-form-early-access .inputs-list li { display: block; }
body.lightmode #hs-form-early-access .inputs-list label {
  display: flex !important; align-items: flex-start; gap: 10px;
}
body.lightmode #hs-form-early-access .inputs-list :is([type="checkbox"], [type="radio"]) {
  width: auto !important; margin: 3px 0 0 !important; flex: none;
  accent-color: var(--green);
}

/* The submit. HubSpot renders it as <input type="submit" class="hs-button">,
   which the field rule above would repaint white. Keep it Emerald/500. */
body.lightmode #hs-form-early-access :is(.hs-button, [type="submit"]) {
  background: var(--green) !important;
  color: var(--ink) !important;
  border: 1px solid transparent !important;
  border-radius: var(--r-pill) !important;
}
body.lightmode #hs-form-early-access :is(.hs-button, [type="submit"]):hover {
  background: var(--green-bright) !important;
}

/* Validation. --red reads 3.0:1 on the light card, so errors drop to the
   darkened red. Error field outlines keep the true red, since a border is a
   signal rather than text. */
body.lightmode #hs-form-early-access :is(.hs-error-msg, .hs-error-msgs li, .hs-main-font-element),
body.lightmode #hs-form-early-access .hs_error_rollup .hs-error-msgs li label,
body.lightmode #hs-form-early-access .hs_error_rollup .hs-error-msgs li label span,
body.lightmode #hs-form-early-access .hs-error-msgs li label,
body.lightmode #hs-form-early-access .hs-error-msgs li label span,
body.lightmode #hs-form-early-access .hs-form-field .hs-error-msgs li label {
  color: var(--lm-red-fg) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-family: var(--font-body) !important;
}
body.lightmode #hs-form-early-access .hs-input.invalid { border-color: var(--red) !important; }
body.lightmode #hs-form-early-access .submitted-message { color: var(--lm-text) !important; }

/* The hand-coded fallback form, for whenever the embed is not in play. */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft)
) .field :is(input, select, textarea) { border-color: var(--lm-line-strong); }

/* --------------------------------------------------------------------------
   6. LIGHT-SECTION DETAILS
   -------------------------------------------------------------------------- */

/* Green-highlighted boxes layer their wash OVER the surface. Without the
   surface underneath, the page shows through and the text disappears. */
body.lightmode .rung:last-child {
  background: linear-gradient(160deg, var(--green-wash), transparent), var(--surface);
}
body.lightmode .layer--us {
  background: linear-gradient(120deg, var(--green-wash), transparent 70%), var(--surface);
}
body.lightmode .card--wide {
  background: linear-gradient(120deg, rgba(87,144,255,.10), rgba(0,188,125,.06)), var(--surface);
}
body.lightmode .founder-card {
  background: linear-gradient(150deg, rgba(87,144,255,.07), transparent), var(--surface);
}

/* Pull quotes and verdict lines: green rule, light wash, dark ink. */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft)
) :is(.pullquote, .verdict__line) {
  background: linear-gradient(90deg, var(--lm-green-wash), transparent);
  border-left-color: var(--green);
}

/* Persona dividers on who-we-serve. */
body.lightmode .section--tight:not(.section--soft) .persona { border-top-color: var(--lm-line); }

/* The client name row on the investors page. */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft)
) .inv-logos__row span {
  color: var(--lm-text-dim);
  border-color: var(--lm-line-strong);
}

/* Prose links on the policy pages. Headings need no rule: they inherit the
   section's color, which is already contextual. Forcing a literal color here
   turns headings inside cards invisible. Use the contextual token, always. */
body.lightmode .section--tight:not(.section--soft) a:not(.btn):not(.arrow) {
  color: var(--green-fg, var(--green));
}

/* Focus ring has to be visible against light too. */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft),
  .band
) :focus-visible { outline-color: var(--lm-green-fg); }

/* The thesis-card glow was tuned for a dark page. On a light gray card the
   same radial reads as a green stain, so pull it back. */
body.lightmode :is(
  .section:not(.section--soft),
  .section--tight:not(.section--soft)
) .story::after {
  background: radial-gradient(circle, rgba(0, 188, 125, .07), transparent 65%);
}

/* Error text uses --red, which reads 3.0:1 on the light card. Drop it to the
   darkened red so validation messages stay legible. */
body.lightmode #hs-form-early-access :is(.hs-error-msg, .hs-error-msgs li) {
  color: var(--lm-red-fg);
}

/* --------------------------------------------------------------------------
   7. LIGHT ISLANDS INSIDE A DARK SECTION
   The persona tab panel on the homepage. Mike wants the Who we serve section
   to stay dark with its tabs and green highlights intact, and the panel below
   the tabs to read as a separate light box lifted off the black.
   Add `class="tabpanel-light"` to the element wrapping the panes.
   -------------------------------------------------------------------------- */
body.lightmode .tabpanel-light {
  --bg:           var(--lm-bg);
  --bg-soft:      var(--lm-field);
  --surface:      var(--lm-surface);
  --surface-2:    var(--lm-surface-2);
  --text:         var(--lm-text);
  --text-dim:     var(--lm-text-dim);
  --text-dimmer:  var(--lm-text-dimmer);
  --line:         var(--lm-line);
  --line-strong:  var(--lm-line-strong);
  --green-fg:     var(--lm-green-fg);
  --blue-fg:      var(--lm-blue-fg);
  --red-fg:       var(--lm-red-fg);
  --amber-fg:     var(--lm-amber-fg);
  --green-wash:   var(--lm-green-wash);
  --green-edge:   var(--lm-green-edge);
  --red-wash:     var(--lm-red-wash);

  background: var(--lm-bg);
  color: var(--lm-text);
  border: 1px solid var(--lm-line);
  border-radius: var(--r);
  padding: 38px 40px;
  margin-top: 0;
  box-shadow: 0 22px 60px -34px rgba(0, 0, 0, .75);
}
body.lightmode .tabpanel-light .symptoms { background: var(--lm-surface); border-color: var(--lm-line); }
body.lightmode .tabpanel-light .fit { color: var(--lm-blue-fg); }
body.lightmode .tabpanel-light .arrow { color: var(--lm-green-fg); }
body.lightmode .tabpanel-light :focus-visible { outline-color: var(--lm-green-fg); }
@media (max-width: 560px) {
  body.lightmode .tabpanel-light { padding: 26px 22px; }
}

/* --------------------------------------------------------------------------
   8. THE TRUST CALLOUT (why-leaderscale, below the testimonials)
   -------------------------------------------------------------------------- */
body.lightmode .trust-callout {
  background: linear-gradient(115deg, var(--lm-green-wash), transparent 64%), var(--lm-surface);
  border: 1px solid var(--lm-green-edge);
  border-left: 3px solid var(--green);
}
body.lightmode .trust-callout .eyebrow { color: var(--lm-green-fg); }
body.lightmode .trust-callout__marks span {
  color: var(--lm-green-fg);
  background: var(--lm-green-wash);
  border-color: var(--lm-green-edge);
}
