/* LF-SITE-001B — Universal Contrast, Density & Hierarchy Repair
   Video-confirmed sitewide rules. Loaded last on top-level pages.
   Purpose: readable contrast, compact rhythm, fewer headline wraps,
   stronger focal hierarchy, and denser-but-cleaner cards/CTAs. */
:root{
  --ep-ink:#0b2d27;
  --ep-body:#223830;
  --ep-body-strong:#172d26;
  --ep-muted:#445a51;
  --ep-ivory:#fbf7ee;
  --ep-ivory-2:#f2eee4;
  --ep-gold:#c79a45;
  --ep-gold-soft:#e4c777;
  --ep-dark:#0a2a23;
  --ep-dark-2:#123a31;
  --ep-dark-text:#f8f4e9;
  --ep-dark-body:#e3ece7;
  --ep-dark-muted:#bfd0c8;
}

/* ---------- 1. Readability law — scoped, never global ----------
   IMPORTANT: Do not infer surface color from generic .section wrappers.
   Color is assigned only to known surface components so a light panel nested
   inside a dark page (or vice versa) cannot inherit the wrong contrast. */
body :is(.dark-band,.cta-band,.premium-rule-band){color:var(--ep-dark-text)}
body :is(.dark-band,.cta-band,.premium-rule-band) :is(h1,h2,h3,h4,strong,b){color:#fffaf0}
body :is(.dark-band,.cta-band,.premium-rule-band) :is(p,li,small){color:var(--ep-dark-body)}

body :is(.light-card,.legal-box,.quiet-panel,.form-shell){color:var(--ep-body)}
body :is(.light-card,.legal-box,.quiet-panel,.form-shell) :is(h1,h2,h3,h4,strong,b){color:var(--ep-ink)}
body :is(.light-card,.legal-box,.quiet-panel,.form-shell) :is(p,li,small){color:var(--ep-body)}

/* Page-specific dark surfaces. Deliberately exclude generic .section/.panel. */
body[data-page="home"] :is(.audience-clean,.ep-client-value,.ep-market-action-chart){color:var(--ep-dark-text)}
body[data-page="home"] :is(.audience-clean,.ep-client-value,.ep-market-action-chart) :is(h1,h2,h3,h4,strong,b){color:#fffaf0}
body[data-page="home"] :is(.audience-clean,.ep-client-value,.ep-market-action-chart) :is(p,li,small){color:var(--ep-dark-body)}

body[data-page="personal-dashboard"] :is(.dark-card,.watchlist-panel,.movers-card){color:#f7f2e6}
body[data-page="personal-dashboard"] :is(.dark-card,.watchlist-panel,.movers-card) :is(h1,h2,h3,h4,strong,b){color:#fffaf0}
body[data-page="personal-dashboard"] :is(.dark-card,.watchlist-panel,.movers-card) :is(p,li,small){color:#d7e4dd}

body[data-page="strategy-lab"] :is(.workspace,.control-group,.compare-shell,.scenario-slot){color:#f8f4e9}
body[data-page="strategy-lab"] :is(.workspace,.control-group,.compare-shell,.scenario-slot) :is(h1,h2,h3,h4,strong,b){color:#fffaf0}
body[data-page="strategy-lab"] :is(.workspace,.control-group,.compare-shell,.scenario-slot) :is(p,li,small){color:#e3ece7}
/* ---------- 2. Headline discipline ---------- */
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .section-head h2,
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .split h2,
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .cta-band h2{
  max-width:30ch!important;
  line-height:.98!important;
  text-wrap:balance;
}
@media(min-width:1281px){
  body[data-page="solutions"] .ep-services-head h2,
  body[data-page="home"] .ep-fast-head h2,
  body:is([data-page="technology"],[data-page="performance"],[data-page="institutional"],[data-page="about"],[data-page="contact"]) .section-head h2{
    max-width:27ch!important;
  }
}

/* ---------- 3. Sitewide compact rhythm ---------- */
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .section{
  padding-top:clamp(30px,3.3vw,48px)!important;
  padding-bottom:clamp(30px,3.3vw,48px)!important;
}
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .section-head{
  margin-bottom:clamp(14px,1.5vw,22px)!important;
  gap:clamp(16px,2vw,28px)!important;
}
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .split{
  gap:clamp(18px,2.4vw,34px)!important;
}
body :is(.cards-4,.cards-3,.mini-grid,.steps-grid){gap:9px!important}

/* ---------- 4. Cards earn their size ---------- */
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) :is(.icon-card,.mini-card,.quiet-panel,.legal-box){
  padding:clamp(13px,1.1vw,18px)!important;
}
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) :is(.icon-card,.mini-card) h3{
  margin:0 0 5px!important;
  line-height:1.05!important;
}
body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) :is(.icon-card,.mini-card) p{
  margin:0!important;
  color:var(--ep-body)!important;
  font-weight:500!important;
  line-height:1.36!important;
}

/* ---------- 5. CTA bands: punchy, not second heroes ---------- */
body .cta-band{
  padding-top:clamp(24px,2.8vw,38px)!important;
  padding-bottom:clamp(24px,2.8vw,38px)!important;
}
body .cta-band .section-inner,
body .cta-band .cta-copy{
  gap:12px!important;
}
body .cta-band h2{
  font-size:clamp(31px,2.6vw,46px)!important;
  margin:0 0 8px!important;
}
body .cta-band p{max-width:62ch!important;margin:0!important;line-height:1.42!important}
body .cta-band .actions{margin-top:14px!important}

/* ---------- 6. Homepage pair: keep both sides compact and purposeful ---------- */
body[data-page="home"] .ep32-pair-band{padding-top:12px!important;padding-bottom:12px!important}
body[data-page="home"] .ep32-pair-grid{gap:10px!important;align-items:start!important}
body[data-page="home"] .ep32-pair-grid>.section{min-height:0!important;height:auto!important}
body[data-page="home"] .ep32-pair-grid>.section .section-inner{padding-top:16px!important;padding-bottom:16px!important}
body[data-page="home"] .ep-fast-head{margin-bottom:12px!important}
body[data-page="home"] .ep-fast-head h2{font-size:clamp(34px,2.8vw,48px)!important;line-height:.96!important;margin-bottom:7px!important}
body[data-page="home"] .ep-fast-head p{font-size:12.5px!important;line-height:1.4!important;font-weight:600!important}
body[data-page="home"] .ep-client-value-card,
body[data-page="home"] .ep-why-fast-grid .icon-card{min-height:88px!important}

/* ---------- 7. Services: compact four-offer presentation ---------- */
body[data-page="solutions"] .ep-services-core{padding-top:30px!important;padding-bottom:34px!important}
body[data-page="solutions"] .ep-service-offer-grid{gap:9px!important}
body[data-page="solutions"] .ep-service-offer{
  min-height:0!important;
  padding:15px 16px 14px!important;
}
body[data-page="solutions"] .ep-service-offer h3{min-height:0!important;margin-bottom:7px!important}
body[data-page="solutions"] .ep-service-offer>p{font-size:12px!important;line-height:1.38!important;color:#1f352e!important}
body[data-page="solutions"] .ep-offer-outcome{margin-top:8px!important;padding-top:8px!important}
body[data-page="solutions"] .ep-offer-outcome strong{color:#0b2b25!important}

/* ---------- 8. AI Market Explainer: explicit contrast repair ---------- */
body[data-page="market-explainer"] .explain{
  background:#f7edd6!important;
  border-color:#d5bd83!important;
  color:#132f28!important;
}
body[data-page="market-explainer"] .explain>h2,
body[data-page="market-explainer"] .explain-top strong{color:#173229!important}
body[data-page="market-explainer"] .explain>p{color:#1d312b!important;font-weight:500!important}
body[data-page="market-explainer"] .explain-cards{gap:10px!important}
body[data-page="market-explainer"] .explain-cards section{
  background:linear-gradient(150deg,#123b2e,#08271f 70%,#061f19)!important;
  border-color:#426f5c!important;
  color:#f8f2e5!important;
  min-height:104px!important;
  padding:12px 13px!important;
}
body[data-page="market-explainer"] .explain-cards section>div,
body[data-page="market-explainer"] .explain-cards section strong{color:#fff4d4!important}
body[data-page="market-explainer"] .explain-cards section p{
  color:#eef5f0!important;
  opacity:1!important;
  font-size:12.2px!important;
  line-height:1.38!important;
  font-weight:500!important;
}
body[data-page="market-explainer"] .explain-cards .premium-icon{color:#efcf7f!important}
body[data-page="market-explainer"] .rail .panel:not(.impact):not(.source),
body[data-page="market-explainer"] .feed.panel{
  color:#eef5f0!important;
}
body[data-page="market-explainer"] .rail .panel:not(.impact):not(.source) :is(p,small,span),
body[data-page="market-explainer"] .feed.panel :is(p,small,span){color:#dbe9e2!important}

/* ---------- 9. Market Dashboard: hierarchy + contrast without changing geometry ---------- */
body[data-page="personal-dashboard"] .dark-card,
body[data-page="personal-dashboard"] .watchlist-panel,
body[data-page="personal-dashboard"] .movers-card{
  color:#f7f2e6!important;
}
body[data-page="personal-dashboard"] :is(.dark-card,.watchlist-panel,.movers-card) :is(p,small,.muted,.subtle){
  color:#d7e4dd!important;
}
body[data-page="personal-dashboard"] :is(.panel-title-row,.subhead-row) h2,
body[data-page="personal-dashboard"] :is(.panel-title-row,.subhead-row) strong{color:#fff4d6!important}
body[data-page="personal-dashboard"] .light-card :is(p,small,.muted){color:#2d433b!important}

/* ---------- 10. MI family hero: stronger, shorter first viewport ---------- */
body:is([data-page="radar"],[data-page="market-weather"],[data-page="personal-dashboard"],[data-page="market-explainer"],[data-page="strategy-lab"]) .mi-universal-hero{
  min-height:0!important;
  padding-top:clamp(24px,2.8vw,40px)!important;
  padding-bottom:clamp(18px,2.2vw,30px)!important;
}
body:is([data-page="radar"],[data-page="market-weather"],[data-page="personal-dashboard"],[data-page="market-explainer"],[data-page="strategy-lab"]) .mi-hero-copy h1{
  line-height:.95!important;
  max-width:22ch!important;
}
body:is([data-page="radar"],[data-page="market-weather"],[data-page="personal-dashboard"],[data-page="market-explainer"],[data-page="strategy-lab"]) .mi-hero-copy p{
  color:#dce7e1!important;
  max-width:62ch!important;
}

/* ---------- 11. Interior CTA/feature compression ---------- */
body:is([data-page="institutional"],[data-page="about"],[data-page="technology"],[data-page="performance"],[data-page="contact"]) .feature-strip{
  padding-top:22px!important;
  padding-bottom:22px!important;
}
body[data-page="institutional"] .premium-rule-band{padding-top:24px!important;padding-bottom:24px!important}
body[data-page="institutional"] .steps-section{padding-top:32px!important;padding-bottom:34px!important}
body[data-page="contact"] .contact-human{gap:24px!important}

/* ---------- 12. Laptop safety ---------- */
@media(min-width:1100px) and (max-width:1450px){
  body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .section-head h2{font-size:clamp(32px,2.8vw,43px)!important}
  body[data-page="home"] .ep-fast-head h2{font-size:clamp(32px,2.65vw,42px)!important}
  body .cta-band h2{font-size:clamp(30px,2.5vw,40px)!important}
}

@media(max-width:900px){
  body .cta-band h2,
  body:not([data-page="radar"]):not([data-page="market-weather"]):not([data-page="personal-dashboard"]):not([data-page="market-explainer"]):not([data-page="strategy-lab"]) .section-head h2{max-width:none!important}
}
