:root { color-scheme: dark; }
.theme-toggle { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; color: #c9d8ec; background: transparent; border: 0; border-radius: 50%; transition: color .2s, background-color .2s; }
.theme-toggle:hover { color: #fff; background: #bfd4ee14; }
.theme-toggle:active .lucide { transform: scale(.9); }
.theme-toggle .lucide { width: 21px; height: 21px; animation: theme-icon-enter .28s ease-out; transition: transform .2s; }
@keyframes theme-icon-enter { from { opacity: .4; transform: rotate(-35deg) scale(.8); } to { opacity: 1; transform: none; } }
.is-theme-changing :is(body,.site-header,.hero,.research-index,.research-overview,.work,.people,.notes,.contact,.site-footer,.project-dialog) { transition: background-color .28s ease, color .28s ease, border-color .28s ease; }

:root[data-theme='light'] { color-scheme: light; --theme-base: #f3f6fa; --theme-ink: #202e42; --theme-muted: #56677d; --theme-accent: #3e628e; --theme-line: #344a6826; --theme-contact: #e0e8f2; }
[data-theme='light'] :is(body,.members-page,.publications-page,.home-page .people,.home-page .notes,.project-dialog) { --ink: var(--theme-ink); --muted: var(--theme-muted); --paper: var(--theme-base); --soft: #e5ebf3; --white: #fff; --line: var(--theme-line); --accent: var(--theme-accent); color: var(--ink); color-scheme: light; }
[data-theme='light'] body { background: var(--theme-base); }
[data-theme='light'] ::selection { color: #152a45; background: #c9dbf3; }
[data-theme='light'] :focus-visible { outline-color: var(--theme-accent); }
[data-theme='light'] .site-header { color: var(--theme-ink); background: #f3f6faed; border-color: var(--theme-line); }
[data-theme='light'] .site-header :is(.brand-wordmark small,.language-switch button) { color: var(--theme-muted); }
[data-theme='light'] .site-header .language-switch { border-color: var(--theme-line); }
[data-theme='light'] .site-header .language-switch button.is-active { color: var(--theme-ink); }
[data-theme='light'] .site-header .site-nav a::after { background: var(--theme-accent); }
[data-theme='light'] .site-header::after { background: linear-gradient(90deg,#9db9db,#426b9c); }
[data-theme='light'] :is(.theme-toggle,.site-header .menu-button) { color: #426287; }
[data-theme='light'] :is(.theme-toggle,.site-header .menu-button):hover { color: #203e63; background: #446d9e12; }
[data-theme='light'] .section-nav::before { background: #6f8aa340; }
[data-theme='light'] .section-nav::after { background-color: #f3f6faeb; border-color: var(--theme-line); box-shadow: 8px 12px 36px #142d4914, inset 0 1px 0 #fff9; }
[data-theme='light'] .section-nav a { color: #70849d; }
[data-theme='light'] .section-nav a.is-active { color: #365e90; }
[data-theme='light'] .section-nav-label { color: #354d6b; }
[data-theme='light'] .section-nav-number { color: #637b98; }
[data-theme='light'] .section-nav a.is-active .section-nav-number { color: #365e90; }
[data-theme='light'] .section-nav:is(:hover,:has(a:focus-visible)) a:hover, [data-theme='light'] .section-nav a:focus-visible { color: #254b7b; background: #446d9e12; }
[data-theme='light'] .section-nav a:is(:hover,:focus-visible) .section-nav-label { color: #203e63; }

[data-theme='light'] .research-stage { background: linear-gradient(180deg,#fafcfe 0%,#f1f6fc 42%,var(--theme-base) 94%); }
[data-theme='light'] .research-stage::before { background: linear-gradient(90deg,transparent 0%,#aac3e218 16%,#b1c9e63b 31%,#c0d5ef42 42%,#dce7f42b 51%,#cfdeef12 65%,transparent 88%); }
[data-theme='light'] .research-stage::after { opacity: .35; }
[data-theme='light'] .hero-scene { mask-image: linear-gradient(90deg,transparent,#0001 5%,#0005 12%,#000b 20%,#000 30%,#000 70%,#000b 80%,#0005 88%,#0001 95%,transparent),linear-gradient(180deg,transparent,#0001 5%,#0005 12%,#000b 20%,#000 30%,#000 70%,#000b 80%,#0005 88%,#0001 95%,transparent); mask-composite: intersect; }
[data-theme='light'] .hero-brand-outline { opacity: .65; }
[data-theme='light'] :is(.hero,.research-index,.research-overview,.work) { color: var(--theme-ink); }
[data-theme='light'] .hero-bottom { color: #4f6887; }
[data-theme='light'] .hero-hotspot:focus-visible .hotspot-link-icon { box-shadow: 0 0 0 3px var(--theme-base), 0 0 0 5px var(--theme-accent); }
[data-theme='light'] :is(.research-index,.research-index a,.research-overview .latest-list,.research-overview .latest-paper,.filter-bar,.publication-tools,.work-bottom) { border-color: var(--theme-line); }
[data-theme='light'] :is(.research-index a > span:first-child,.research-overview .section-title > span:first-child,.research-overview .research-number,.section-link,.work .section-title > span:first-child) { color: var(--theme-accent); }
[data-theme='light'] :is(.research-index a:hover,.research-overview .latest-paper:hover) { color: #2a5183; }
[data-theme='light'] .research-overview .research-row { background: #ffffff4d; border-color: var(--theme-line); }
[data-theme='light'] .research-overview .research-row:is(:hover,:focus-visible) { background: var(--research-hover); border-color: #688ab94d; box-shadow: 0 12px 28px #2847691c, inset 0 1px 0 #fffa; }
[data-theme='light'] .research-overview .research-row:not(:hover):not(:focus-visible) :is(p,li), [data-theme='light'] :is(.research-overview .latest-paper p,.research-overview .paper-venue span,.project-copy > p,.result-count) { color: var(--theme-muted); }
[data-theme='light'] :is(.section-link:hover,.section-link:focus-visible,.research-overview .research-link:hover) { color: #284e7e; background: #446d9e12; }
[data-theme='light'] .filter-bar button { color: var(--theme-muted); }
[data-theme='light'] .filter-bar button:is(:hover,.is-active) { color: var(--theme-ink); border-bottom-color: var(--theme-accent); }

[data-theme='light'] .work { background: var(--theme-base); }
[data-theme='light'] .work-group { --work-wash: #7196c52b; --work-ink: #43658e; --card-surface: #edf3fbd9; --card-hover: #e5eefbed; --card-line: #5f7fa62b; }
[data-theme='light'] .work-group[data-work-group='spatial'] { --work-wash: #83adb526; --work-ink: #426b7b; --card-surface: #edf5f7d9; --card-hover: #e2eff3ed; --card-line: #5c89952b; }
[data-theme='light'] .work-group[data-work-group='decision'] { --work-wash: #aba39a21; --work-ink: #65616a; --card-surface: #f4f3f6d9; --card-hover: #ebe9f1ed; --card-line: #8078852b; }
[data-theme='light'] .work-group::before { background-color: var(--theme-base); }
[data-theme='light'] .work-group + .work-group { border-color: var(--theme-line); }
[data-theme='light'] .project-card::before { box-shadow: 0 2px 6px #223b5908, inset 0 1px 0 #fff9; }
[data-theme='light'] .project-card:focus-within::before { border-color: #58789f45; box-shadow: 0 12px 28px #263f5a14, inset 0 1px 0 #fffc; }
@media (hover: hover) {
  [data-theme='light'] .project-card:hover::before { border-color: #58789f45; box-shadow: 0 12px 28px #263f5a14, inset 0 1px 0 #fffc; }
}
[data-theme='light'] .project-media { background: #e6edf5; border-color: #344a6814; }
[data-theme='light'] :is(.home-page .people,.home-page .notes) { background-color: var(--theme-base); }
[data-theme='light'] .home-page .notes { background-image: url('assets/images/surface-grain.png'), linear-gradient(180deg,var(--theme-base) calc(100% - 112px),var(--theme-contact)); }
[data-theme='light'] .contact { color: var(--theme-ink); background-color: var(--theme-contact); }
[data-theme='light'] .contact .section-title > span:first-child { color: var(--theme-accent); }
[data-theme='light'] :is(.contact-copy > p,.qr-block span) { color: #526780; }
[data-theme='light'] .contact-actions .text-link { color: #345982; }
[data-theme='light'] .button-light { color: #253e61; background: #fff; border-color: #6984a533; }
[data-theme='light'] .button-light:hover { color: #1b3559; background: #dce9f8; border-color: #6688b166; }
[data-theme='light'] .button-ghost { color: #345982; border-color: #607e9f66; }
[data-theme='light'] .button-ghost:hover { color: #1b3559; background: #fff6; border-color: #345982; }
[data-theme='light'] .site-footer { color: #344d6d; background-color: var(--theme-base); }
[data-theme='light'] .home-page .site-footer { background-image: url('assets/images/surface-grain.png'), linear-gradient(180deg,var(--theme-contact),var(--theme-base) 50px); }
[data-theme='light'] .footer-meta { color: var(--theme-muted); }
[data-theme='light'] :is(.footer-meta a:hover,.footer-wordmark:hover) { color: #2a5183; }

[data-theme='light'] .publication-search { background-color: #e9eff7; }
[data-theme='light'] :is(.publication-search-toggle,.publication-venue) { color: var(--theme-accent); }
[data-theme='light'] .publication-search-toggle:is(:hover,[aria-expanded='true']) { color: #284e7e; background: #446d9e12; }
[data-theme='light'] .publication-search .icon-button:hover { color: #fff; background: var(--theme-accent); }
[data-theme='light'] .publication-status option { color: var(--theme-ink); background: var(--theme-base); }
[data-theme='light'] .project-dialog { background-color: var(--theme-base); }
[data-theme='light'] .project-dialog::backdrop { background: #263f5c80; }
[data-theme='light'] .dialog-close { color: var(--theme-ink); background: #f3f6faf2; }
[data-theme='light'] .dialog-media { background: #e6edf5; }
[data-theme='light'] :is(.dialog-actions .button-primary,.project-dialog .icon-button:hover) { color: #fff; background: #3d628f; }
[data-theme='light'] .dialog-actions .button-primary:hover { background: #2c4d77; }

@media (max-width: 1100px) {
  [data-theme='light'] .site-nav, [data-theme='light'] .home-page .site-nav { background: var(--theme-base); }
  [data-theme='light'] .home-page .site-nav a { border-color: var(--theme-line); }
}
@media (max-width: 700px) {
  .theme-toggle { width: 36px; flex-basis: 36px; }
}
@media (max-width: 360px) {
  .header-inner { gap: 8px; }
  .brand { gap: 7px; }
  .brand-wordmark { font-size: 16px; }
  .brand-wordmark small { font-size: 8px; }
  .language-switch { padding-left: 5px; }
  .language-switch button { min-width: 30px; }
  .theme-toggle { width: 32px; flex-basis: 32px; }
  .menu-button { width: 32px; }
}
@media (prefers-reduced-transparency: reduce) {
  [data-theme='light'] :is(.site-header,.section-nav::after) { background-color: var(--theme-base); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle .lucide { animation: none; }
}
