/* v24: global dark-mode palette refinement, reduce overly long stark-white headings */
html[data-theme="dark"]{
  --d24-head:#dfe7ff;
  --d24-head-soft:#cfd9fb;
  --d24-head-strong:#99a9ff;
  --d24-body:#b3bfdc;
  --d24-chip:#1a2547;
  --d24-chip2:#141d39;
  --d24-chip-line:rgba(139,155,217,.16);
}

/* Global dark typography */
html[data-theme="dark"] .hero-copy h1,
html[data-theme="dark"] .continuity-title-block h2,
html[data-theme="dark"] .organization-v15-head h2,
html[data-theme="dark"] .instrument-v14-title h2,
html[data-theme="dark"] .contact-shell h2,
html[data-theme="dark"] .final-cta h2{
  color:var(--d24-head)!important;
  letter-spacing:-.055em!important;
  line-height:1.01!important;
  text-wrap:balance;
  text-shadow:0 6px 24px rgba(63,86,188,.12)!important;
}
html[data-theme="dark"] .hero-copy h1 span,
html[data-theme="dark"] .continuity-title-block h2 em,
html[data-theme="dark"] .organization-v15-head h2 em,
html[data-theme="dark"] .instrument-v14-title h2 em,
html[data-theme="dark"] .final-cta h2 em{
  color:var(--d24-head-strong)!important;
}
html[data-theme="dark"] .hero-copy p,
html[data-theme="dark"] .continuity-v10-copy>p,
html[data-theme="dark"] .organization-v15-head>p,
html[data-theme="dark"] .instrument-v14-title>p,
html[data-theme="dark"] .contact-shell p,
html[data-theme="dark"] .contact-shell li,
html[data-theme="dark"] .final-cta p{
  color:var(--d24-body)!important;
}
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .organization-v15-head small,
html[data-theme="dark"] .instrument-v11-title .eyebrow,
html[data-theme="dark"] .continuity-title-block .eyebrow{
  color:#8d9cff!important;
}

/* Better headline proportion in dark mode */
html[data-theme="dark"] .organization-v15-head{align-items:center!important}
html[data-theme="dark"] .organization-v15-head h2{max-width:900px!important;font-size:clamp(42px,4.65vw,76px)!important}
html[data-theme="dark"] .continuity-title-block h2{max-width:860px!important;font-size:clamp(44px,4.8vw,78px)!important}
html[data-theme="dark"] .instrument-v14-title h2{max-width:900px!important;font-size:clamp(40px,4.2vw,68px)!important}
html[data-theme="dark"] .hero-copy h1{max-width:760px!important;font-size:clamp(48px,5vw,88px)!important}

/* Unify all white-like dark buttons/chips to dark premium surfaces */
html[data-theme="dark"] .button-light,
html[data-theme="dark"] .site-header .button-light,
html[data-theme="dark"] .final-cta .button-light,
html[data-theme="dark"] .institution-pane-head button,
html[data-theme="dark"] .workbench-controls-v11 button,
html[data-theme="dark"] .context-play,
html[data-theme="dark"] .contact-copy .copy-chip,
html[data-theme="dark"] .contact-actions .button,
html[data-theme="dark"] .contact-actions .button-light,
html[data-theme="dark"] .contact-actions .button-outline,
html[data-theme="dark"] .contact-form button,
html[data-theme="dark"] .hero-actions .button-light,
html[data-theme="dark"] .hero-actions .button-outline{
  background:linear-gradient(180deg,var(--d24-chip),var(--d24-chip2))!important;
  color:#eaf0ff!important;
  border:1px solid var(--d24-chip-line)!important;
  box-shadow:0 12px 28px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.03)!important;
}
html[data-theme="dark"] .button-light:hover,
html[data-theme="dark"] .site-header .button-light:hover,
html[data-theme="dark"] .final-cta .button-light:hover,
html[data-theme="dark"] .institution-pane-head button:hover,
html[data-theme="dark"] .context-play:hover,
html[data-theme="dark"] .contact-form button:hover,
html[data-theme="dark"] .hero-actions .button-light:hover{
  background:linear-gradient(180deg,#22325d,#192649)!important;
  border-color:rgba(129,145,255,.34)!important;
}

/* Chips / pills / utility controls */
html[data-theme="dark"] .workbench-controls-v11,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .context-play,
html[data-theme="dark"] .context-switch,
html[data-theme="dark"] .instrument-v11 .instrument-tabs,
html[data-theme="dark"] .contact-copy .copy-chip{
  border-color:rgba(141,156,214,.12)!important;
}
html[data-theme="dark"] .workbench-controls-v11 button.active,
html[data-theme="dark"] .context-play.active,
html[data-theme="dark"] .institution-pane-head button.active,
html[data-theme="dark"] .theme-toggle[aria-pressed="true"]{
  background:linear-gradient(180deg,#243665,#1a2850)!important;
  border-color:rgba(130,145,255,.32)!important;
  color:#fff!important;
}

/* Section surfaces slightly brighter so hierarchy is cleaner */
html[data-theme="dark"] .continuity-v10-stage,
html[data-theme="dark"] .instrument-workbench-v11,
html[data-theme="dark"] .institution-duet,
html[data-theme="dark"] .contact-shell,
html[data-theme="dark"] .contact-form{
  box-shadow:0 28px 72px rgba(0,0,0,.24)!important;
}
html[data-theme="dark"] .continuity-v10-stage,
html[data-theme="dark"] .instrument-workbench-v11,
html[data-theme="dark"] .institution-duet{
  background:linear-gradient(180deg,rgba(14,22,43,.985),rgba(10,17,34,.985))!important;
}
html[data-theme="dark"] .context-assets,
html[data-theme="dark"] .context-audit,
html[data-theme="dark"] .instrument-workbench-top-v11,
html[data-theme="dark"] .instrument-workbench-footer-v11,
html[data-theme="dark"] .institution-pane,
html[data-theme="dark"] .contact-shell,
html[data-theme="dark"] .contact-form{
  background:linear-gradient(180deg,rgba(18,27,51,.98),rgba(13,21,40,.98))!important;
}

/* Improve readability inside institution panes */
html[data-theme="dark"] .institution-pane-copy h3{color:#edf3ff!important}
html[data-theme="dark"] .institution-pane-copy p,
html[data-theme="dark"] .institution-inline-meta,
html[data-theme="dark"] .engineering-layer span,
html[data-theme="dark"] .engineering-layer small,
html[data-theme="dark"] .institution-v15-footer{color:#aeb8d3!important}
html[data-theme="dark"] .engineering-layer{background:linear-gradient(180deg,rgba(23,32,58,.96),rgba(15,23,43,.96))!important}

/* Improve contact area consistency */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  background:rgba(255,255,255,.025)!important;
  color:#eef3ff!important;
  border:1px solid rgba(141,156,214,.14)!important;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus{
  outline:none!important;
  border-color:rgba(129,145,255,.34)!important;
  box-shadow:0 0 0 4px rgba(108,126,244,.10)!important;
}

/* Mobile heading tune */
@media (max-width: 900px){
  html[data-theme="dark"] .hero-copy h1,
  html[data-theme="dark"] .continuity-title-block h2,
  html[data-theme="dark"] .organization-v15-head h2,
  html[data-theme="dark"] .instrument-v14-title h2,
  html[data-theme="dark"] .contact-shell h2,
  html[data-theme="dark"] .final-cta h2{
    letter-spacing:-.05em!important;
    line-height:1.04!important;
  }
}
