/* The light appearance stays in styles.css and home.css. */
html{color-scheme:light}
/* Route headings receive focus for navigation, without an interactive outline. */
:where(h1,h2,h3,h4,h5,h6)[tabindex="-1"]:focus{outline:none}
html[data-theme="dark"]{
  color-scheme:dark;
  --paper:#0b1118;
  --ink:#eaf0f4;
  --muted:#a7b6c4;
  --line:#293b4b;
  --blue:#55cce9;
  --cyan:#83dced;
  --orange:#fc9b55;
  --navy:#07111d;
}

/* An explicit two-choice control remains visible at every screen size. */
.header-inner{gap:24px}
.theme-switch{display:flex;align-items:stretch;flex:0 0 auto;align-self:center;height:44px;border:1px solid var(--line);border-radius:3px;overflow:visible;background:transparent}
.theme-switch button{display:flex;align-items:center;justify-content:center;gap:5px;min-width:60px;height:42px;padding:0 9px;border-radius:2px;font-size:10px;font-weight:500;line-height:1;color:var(--muted);white-space:nowrap}
.theme-switch button+button{border-left:1px solid var(--line)}
.theme-switch button svg{display:block;width:14px;height:14px;flex:0 0 14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.theme-switch button[aria-pressed="true"]{background:#e5eef3;color:var(--ink)}
.theme-switch button:hover{color:var(--ink);background:#edf2f5}
.theme-switch button:focus-visible{outline:2px solid var(--blue);outline-offset:-3px}

/* Body, header, and Home. Scientific artwork retains its original colors. */
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .site-header{background:var(--paper);border-color:var(--line)}
html[data-theme="dark"] .theme-switch{background:#101b27;border-color:#35495a}
html[data-theme="dark"] .theme-switch button+button{border-color:#35495a}
html[data-theme="dark"] .theme-switch button[aria-pressed="true"]{background:#294052;color:#f1f6f9}
html[data-theme="dark"] .theme-switch button:hover{background:#1d3243;color:#fff}
html[data-theme="dark"] .brand-symbol .brand-logo-light{display:none}
html[data-theme="dark"] .brand-symbol .brand-logo-dark{display:block}
html[data-theme="dark"] .skip-link{background:#eaf0f4;color:#07111d}
html[data-theme="dark"] #home-page .home-description{color:#b2c0cc}
html[data-theme="dark"] #home-page .home-publications-link{border-color:#38576b}
html[data-theme="dark"] #home-page .home-publications-link:hover{color:#eaf0f4;border-color:#a7b6c4}
html[data-theme="dark"] #home-page .home-carousel{background:#07111d;box-shadow:inset 0 0 0 1px #263949}
html[data-theme="dark"] #home-page .home-topic{border-color:var(--line)}

/* Compact topic/year filters and publication layouts. */
html[data-theme="dark"] .filter-panel button{background:#121d29;color:#bdc9d3;border-color:#304354}
html[data-theme="dark"] .filter-panel button:hover{background:#172f40;color:#caf0f8;border-color:#55cce9}
html[data-theme="dark"] .filter-panel button[aria-pressed="true"]{background:#01589e;color:#fff;border-color:#399acd}
html[data-theme="dark"] .filter-panel button[aria-pressed="true"]:hover{background:#006caa;border-color:#55cce9}
html[data-theme="dark"] .view-switch button.selected{background:#294052}
html[data-theme="dark"] .view-switch button.selected svg{stroke:#eaf0f4}
html[data-theme="dark"] .view-switch button:hover{background:#1c3041}
html[data-theme="dark"] .publication-card{background:#101b27;border-color:var(--line)}
html[data-theme="dark"] .publication-card:hover{border-color:#415d72;box-shadow:0 7px 25px #00000024}
html[data-theme="dark"] .card-details{color:#b2bec8}
html[data-theme="dark"] .card-actions{border-color:#293b4b}
html[data-theme="dark"] .card-actions a:hover{color:var(--blue)}
html[data-theme="dark"] .card-kicker .dot{background:#8ba1b2}

/* Publication information and navigation dialogs. */
html[data-theme="dark"] dialog::backdrop{background:#010710cc}
html[data-theme="dark"] #paper-dialog,
html[data-theme="dark"] .paper-dialog-top,
html[data-theme="dark"] .paper-information,
html[data-theme="dark"] #section-dialog{background:#121d29;color:var(--ink)}
html[data-theme="dark"] .paper-dialog-top{border-color:var(--line)}
html[data-theme="dark"] .paper-visual{background:#0b1622}
html[data-theme="dark"] .media-tabs{background:#182735}
html[data-theme="dark"] .media-tabs>button[aria-pressed="true"]{background:#294052;color:#f1f6f9;box-shadow:none}
html[data-theme="dark"] .media-caption{color:#a7b6c4}
html[data-theme="dark"] .paper-tags span{background:#132c3d;border-color:#38566d;color:#9bdff0}
html[data-theme="dark"] .paper-authors,
html[data-theme="dark"] .citation-box p{color:#b2c0cc}
html[data-theme="dark"] .icon-button:hover{background:#22394a}
html[data-theme="dark"] #section-dialog ul{color:#b5c9d7}
html[data-theme="dark"] .primary-button{background:#55cce9;border-color:#55cce9;color:#07111d}
html[data-theme="dark"] .primary-button:hover{background:#83dced;border-color:#83dced;color:#07111d}
html[data-theme="dark"] .secondary-button{background:#192a39;border-color:#3a5365;color:#eaf0f4}
html[data-theme="dark"] .secondary-button:hover{background:#233c50;border-color:#55cce9;color:#caf0f8}
html[data-theme="dark"] #image-dialog{background:#080f18}
html[data-theme="dark"] .image-dialog-bar{background:#0f1c2a;border-color:#2b4153}
html[data-theme="dark"] .image-dialog-bar .icon-button:hover{background:#243f53}
html[data-theme="dark"] .toast{background:#dceef5;color:#07111d}

/* The abstract image and its white display surface are intentionally untouched. */
html[data-theme="dark"] .site-footer{background:#070e16;border-top:1px solid var(--line)}
html[data-theme="dark"] .site-footer p{color:#a0b3c3}
html[data-theme="dark"] .site-footer a:hover{color:var(--blue)}
html[data-theme="dark"] :focus-visible{outline-color:#83dced}
html[data-theme="dark"] ::selection{background:#1a5f7a;color:#fff}

@media(max-width:1359px){
  .header-inner{height:auto;min-height:78px;flex-wrap:wrap;padding-top:19px;gap:15px}
  .header-inner .wordmark{order:0}
  .header-inner nav{order:2;width:100%;height:auto;margin:0;justify-content:space-between;gap:8px}
  .header-inner nav>a,.header-inner nav>button{height:auto;min-height:44px;padding:12px 4px}
}
@media(max-width:380px){
  .header-inner{column-gap:9px;padding-inline:12px}
  .header-inner>.wordmark{font-size:20px;letter-spacing:.9px}
}

/* The footer remains dark in both themes. */
.site-footer .brand-symbol .brand-logo-light{display:none}
.site-footer .brand-symbol .brand-logo-dark{display:block}

/* Approved B2: exact outlined Bellefair, open spacing, heavier NAHA only. */
.brand-vector-definitions{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
.brand-lockup-light{color:#000}
.brand-lockup-dark{color:#fff}
.site-header .brand-final,.site-footer .brand-final{width:389.596940712px;max-width:100%;flex:0 0 auto;line-height:0;letter-spacing:0}
.brand-final .brand-lockup{display:block;width:100%;min-width:0;aspect-ratio:657.44483745/129.6}
.brand-lockup img,.brand-lockup>svg{display:block;width:100%;height:auto;aspect-ratio:657.44483745/129.6}
.brand-lockup .brand-lockup-dark{display:none}
html[data-theme="dark"] .brand-lockup .brand-lockup-light,.site-footer .brand-lockup .brand-lockup-light{display:none}
html[data-theme="dark"] .brand-lockup .brand-lockup-dark,.site-footer .brand-lockup .brand-lockup-dark{display:block}
@media(min-width:1360px){
  .header-inner{height:110px;gap:20px}
  .header-inner nav{gap:18px}
  .site-header nav>a,.site-header nav>button{display:inline-flex;align-items:center;padding-top:0;padding-bottom:0}
}
@media(max-width:1100px){
  .site-footer{flex-wrap:wrap;gap:24px}
  .site-footer>p{display:none}
}
@media(max-width:600px){
  .site-header .header-inner{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .site-header .brand-final{grid-column:1/-1;justify-self:center}
  .site-header .header-inner nav{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0 6px;align-items:center}
  .site-header nav>a{display:flex;align-items:center;justify-content:center;min-width:0;height:44px;padding:0 2px;text-align:center;font-size:clamp(10px,2.8vw,12px)}
  .site-header nav>.theme-switch{width:100%;min-width:0;margin:0}
  .theme-switch button{flex:1 1 0;min-width:0;width:auto;padding:0}
  .theme-switch button span{display:none}
  .site-footer{grid-template-columns:minmax(0,1fr);gap:18px}
  .site-footer>div{min-width:0}
  .site-footer>a{justify-self:start}
}
@media(max-width:430px){
  .site-header .header-inner{column-gap:10px}
}
@media(max-width:380px){
  .site-header .header-inner{column-gap:6px}
  .site-footer{grid-template-columns:1fr;gap:18px}
  .site-footer>a{justify-self:start}
}
