/* INDEVO V32 — final light/dark contrast layer. Loaded last on every page. */
html[data-theme="light"]{
  --ui-bg:#f7f8f9;--ui-surface:#ffffff;--ui-surface2:#eef3f5;
  --ui-ink:#071b25;--ui-text:#2f4651;--ui-muted:#607781;--ui-line:#d7e1e5;
}
html[data-theme="dark"]{
  --ui-bg:#061117;--ui-surface:#0a1a22;--ui-surface2:#0d232d;
  --ui-ink:#f4f8fa;--ui-text:#c7d5da;--ui-muted:#9aadb5;--ui-line:#26434f;
}
html[data-theme] body{background:var(--ui-bg)!important;color:var(--ui-text)!important}

/* Standard content surfaces — keep type tied to the active theme. */
html[data-theme] :where(.section:not(.dark),.sub-intro,.technical-depth,.projects-premium,.about-capabilities,.quality-docs,.certificate-spread,.legal-page,.contact-section,.contact-main,.process-section,.manifest:not(.always-dark)) :where(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,strong,b){color:var(--ui-ink)}
html[data-theme] :where(.section:not(.dark),.sub-intro,.technical-depth,.projects-premium,.about-capabilities,.quality-docs,.certificate-spread,.legal-page,.contact-section,.contact-main,.process-section,.manifest:not(.always-dark)) :where(p,li,dd,dt,.lead){color:var(--ui-text)}
html[data-theme] :where(.section:not(.dark),.sub-intro,.technical-depth,.projects-premium,.about-capabilities,.quality-docs,.certificate-spread,.legal-page,.contact-section,.contact-main,.process-section,.manifest:not(.always-dark)) :where(.muted,small,.meta,.cap-meta){color:var(--ui-muted)}

/* Theme-aware cards / rows. */
html[data-theme="light"] :where(.capability-row,.depth-grid article,.about-cap-grid article,.process-rail article,.values-rail>div,.contact-card,.form-card,.rfq-form,.support,.cert,.certificate-paper,.legal-body,.legal-item,.case-study,.domain-row:not(.always-dark),.metric-card){background-color:var(--ui-surface)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-theme="dark"] :where(.capability-row,.depth-grid article,.about-cap-grid article,.process-rail article,.values-rail>div,.contact-card,.form-card,.rfq-form,.support,.cert,.certificate-paper,.legal-body,.legal-item,.case-study,.domain-row:not(.always-dark),.metric-card){background-color:var(--ui-surface)!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-theme] :where(.capability-row,.depth-grid article,.about-cap-grid article,.process-rail article,.values-rail>div,.contact-card,.form-card,.rfq-form,.support,.cert,.certificate-paper,.legal-body,.legal-item,.case-study,.metric-card) :where(h2,h3,h4,b,strong,.contact-info-value,.contact-card-title,.metric-label){color:var(--ui-ink)!important}
html[data-theme] :where(.capability-row,.depth-grid article,.about-cap-grid article,.process-rail article,.values-rail>div,.contact-card,.form-card,.rfq-form,.support,.cert,.certificate-paper,.legal-body,.legal-item,.case-study,.metric-card) :where(p,li,.metric-desc){color:var(--ui-text)!important}
html[data-theme] :where(.contact-info-label,.field-status.is-optional,.case-spec,.cap-meta){color:var(--ui-muted)!important}

/* Forms must never inherit white-on-white / dark-on-dark from old modules. */
html[data-theme] :where(input,textarea,select){background:var(--ui-surface)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important;-webkit-text-fill-color:var(--ui-ink)!important}
html[data-theme] :where(input,textarea)::placeholder{color:var(--ui-muted)!important;-webkit-text-fill-color:var(--ui-muted)!important;opacity:1}
html[data-theme] :where(label,.field label){color:var(--ui-ink)!important}
html[data-theme="light"] select option,html[data-theme="light"] select optgroup{background:#fff!important;color:#071b25!important}
html[data-theme="dark"] select option,html[data-theme="dark"] select optgroup{background:#0a1a22!important;color:#f4f8fa!important}

/* Intentionally dark/photo sections stay light in BOTH themes. */
html[data-theme] :where(.home-hero,.hero,.page-hero,.technology-section,.tech-stage,.tech-tile,.project,.project-copy,.solution-visual,.solution-caption,.proof-split,.proof-copy,.dfm-section,.quality-process,.quality-story,.process-band,.final-cta,.cta-band,.rfq-band,.section.dark,.always-dark,.force-dark-copy,.dark-panel,.dark-section,.navy-section,.navy-panel,.site-footer,.footer,.contact-map-section){color:#edf5f7!important}
html[data-theme] :where(.home-hero,.hero,.page-hero,.technology-section,.tech-stage,.tech-tile,.project,.project-copy,.solution-visual,.solution-caption,.proof-split,.proof-copy,.dfm-section,.quality-process,.quality-story,.process-band,.final-cta,.cta-band,.rfq-band,.section.dark,.always-dark,.force-dark-copy,.dark-panel,.dark-section,.navy-section,.navy-panel,.site-footer,.footer,.contact-map-section) :where(h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,b,strong){color:#f7fbfc!important}
html[data-theme] :where(.home-hero,.hero,.page-hero,.technology-section,.tech-stage,.tech-tile,.project,.project-copy,.solution-visual,.solution-caption,.proof-split,.proof-copy,.dfm-section,.quality-process,.quality-story,.process-band,.final-cta,.cta-band,.rfq-band,.section.dark,.always-dark,.force-dark-copy,.dark-panel,.dark-section,.navy-section,.navy-panel,.site-footer,.footer,.contact-map-section) :where(p,li,.lead){color:#cfdee3!important}
html[data-theme] :where(.home-hero,.hero,.page-hero,.technology-section,.tech-stage,.tech-tile,.project,.project-copy,.solution-visual,.solution-caption,.proof-split,.proof-copy,.dfm-section,.quality-process,.quality-story,.process-band,.final-cta,.cta-band,.rfq-band,.section.dark,.always-dark,.force-dark-copy,.dark-panel,.dark-section,.navy-section,.navy-panel,.site-footer,.footer,.contact-map-section) :where(.muted,small){color:#adc1c9!important}

/* Image overlays need explicit light copy regardless of global selectors. */
html[data-theme] :where(.tech-body,.project-copy,.solution-caption,.quality-visual-copy,.about-identity,.case-media,.hero-copy) :where(h1,h2,h3,h4,b,strong){color:#fff!important}
html[data-theme] :where(.tech-body,.project-copy,.solution-caption,.quality-visual-copy,.about-identity,.case-media,.hero-copy) :where(p,span,.lead){color:#e1ecef!important}

/* Navigation / mega menu / language controls. */
html[data-theme="light"] .site-header{color:#071b25}
html[data-theme="dark"] .site-header{color:#f4f8fa}
html[data-theme] .desktop-nav>a,html[data-theme] .nav-cluster>a,html[data-theme] .portal,html[data-theme] .theme-toggle{color:var(--ui-ink)!important}
html[data-theme="light"] :where(.mega,.mobile-menu,.cookie-dialog){background:#fff!important;color:#2f4651!important;border-color:#d7e1e5!important}
html[data-theme="dark"] :where(.mega,.mobile-menu,.cookie-dialog){background:#0a1a22!important;color:#c7d5da!important;border-color:#26434f!important}
html[data-theme] :where(.mega,.mobile-menu,.cookie-dialog) :where(h2,h3,h4,b,strong,.mobile-link){color:var(--ui-ink)!important}
html[data-theme] :where(.mega,.mobile-menu,.cookie-dialog) :where(p,span:not(.sun):not(.moon),small){color:var(--ui-text)}
html[data-theme] .mega-rfq,html[data-theme] .rfq-head,html[data-theme] .button.red,html[data-theme] .footer-rfq{color:#fff!important}

/* Homepage technology list: active state and inactive state both readable. */
html[data-theme="light"] body[data-page="index"] .tech-index-item:not(.active){background:transparent!important;color:#f4fafc!important}
html[data-theme="light"] body[data-page="index"] .tech-index-item:not(.active) :where(b,em){color:#f4fafc!important}
html[data-theme="light"] body[data-page="index"] .tech-index-item.active{background:#f4f8fa!important;color:#071b25!important}
html[data-theme="light"] body[data-page="index"] .tech-index-item.active :where(b,em){color:#071b25!important}
html[data-theme="dark"] body[data-page="index"] .tech-index-item{color:#f4fafc!important}
html[data-theme="dark"] body[data-page="index"] .tech-index-item :where(b,em){color:#f4fafc!important}
html[data-theme="dark"] body[data-page="index"] .tech-index-item.active{background:#f4f8fa!important;color:#071b25!important}
html[data-theme="dark"] body[data-page="index"] .tech-index-item.active :where(b,em){color:#071b25!important}

/* Solution selector cards. */
html[data-theme="light"] .sol-item:not(.active){background:#fff!important;color:#071b25!important;border-color:#d7e1e5!important}
html[data-theme="light"] .sol-item:not(.active) h3{color:#071b25!important}
html[data-theme="light"] .sol-item:not(.active) p{color:#526a75!important}
html[data-theme="dark"] .sol-item:not(.active){background:#0a1a22!important;color:#f4f8fa!important;border-color:#26434f!important}
html[data-theme="dark"] .sol-item:not(.active) h3{color:#f4f8fa!important}
html[data-theme="dark"] .sol-item:not(.active) p{color:#a9bbc3!important}
html[data-theme] .sol-item.active{background:#0b2a38!important;color:#fff!important}
html[data-theme] .sol-item.active :where(h3,p,.sol-arrow){color:#fff!important}

/* Footer is deliberately dark in both themes. */
html[data-theme] .site-footer :where(.footer-links a,.footer-contact p,.footer-contact a,.footer-bottom,.footer-legal,.company-ids){color:#c8d6dc!important}
html[data-theme] .site-footer :where(.footer-links a:hover,.footer-contact a:hover){color:#fff!important}

/* Keep accent/labels visible without overpowering body copy. */
html[data-theme] :where(.eyebrow,.sol-num,.tech-index,.dfm-num,.step-num,.process-num,.item-num){color:#48aeca!important}
html[data-theme] .button.ghost{color:inherit}

/* Prevent transition flashes that can temporarily hide text when toggling theme. */
html[data-theme] body,html[data-theme] main,html[data-theme] section,html[data-theme] article,html[data-theme] header,html[data-theme] footer{transition-property:background-color,border-color,color;transition-duration:.18s}
@media (prefers-reduced-motion:reduce){html[data-theme] *{transition:none!important}}

/* V33 — Homepage / selected projects heading: theme-aware surface + contrast.
   home-v27.css hard-coded a light background for .proof-section; in dark mode
   V32 correctly switched copy to light, which produced light text on a light surface.
   These rules keep the whole chapter coherent in both themes. */
html[data-theme="light"] body[data-page="index"] .proof-section{
  background:linear-gradient(180deg,#f5f8f9 0%,#eef3f5 100%)!important;
  color:#2f4651!important;
}
html[data-theme="light"] body[data-page="index"] .proof-section .editorial-head h2{
  color:#071b25!important;
}
html[data-theme="light"] body[data-page="index"] .proof-section .editorial-head>p{
  color:#2f4651!important;
}
html[data-theme="dark"] body[data-page="index"] .proof-section{
  background:linear-gradient(180deg,#061117 0%,#081820 100%)!important;
  color:#c7d5da!important;
}
html[data-theme="dark"] body[data-page="index"] .proof-section .editorial-head h2{
  color:#f4f8fa!important;
}
html[data-theme="dark"] body[data-page="index"] .proof-section .editorial-head>p{
  color:#c7d5da!important;
}
html[data-theme] body[data-page="index"] .proof-section .editorial-head .eyebrow{
  color:#48aeca!important;
}
