html { color-scheme: light; }
html[data-theme="dark"] {
 color-scheme: dark;
 --bg: #171c20; --bg-card: #20272c;
 --text-primary: #f0eee7; --text-secondary: #c4c9cc;
 --text-muted: #a2abb0; --text-label: #a2abb0;
 --border: rgba(255,255,255,.12); --border-strong: rgba(255,255,255,.24);
 --ink-about: #88bce5; --ink-experience: #91c694; --ink-research: #eeb078;
 --ink-podcast: #c6a4e3; --ink-blog: #e8a78c; --ink-contact: #7bcfc4;
}
html[data-theme="dark"] svg [fill="rgba(247,245,239,0.94)"] { fill: #20272c; }
html[data-theme="dark"] svg text { fill: var(--text-secondary); }
.map-header, .site-header { gap: 16px; flex-wrap: wrap; }
@media (min-width: 769px) and (max-width: 1400px) {
 .map-title span { font-size: 16px; margin-left: 16px; }
 .map-nav { gap: 8px; }
 .map-nav a { font-size: 15px; padding: 6px; }
}

@media (max-width: 768px) {
 .mobile-header .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
 .mobile-header .mobile-nav a { padding: 10px 2px; text-align: center; font-size: 12px; min-height: 40px; }
 body.subpage { padding-top: 0; }
 .subpage .mobile-header { position: sticky; }
}

/* A quiet theme control within every page navigation. */
.theme-switch {
 appearance: none; display: inline-flex; align-items: center; justify-content: center;
 flex: 0 0 32px; width: 32px; height: 40px; padding: 8px;
 border: 0; background: transparent; color: var(--text-secondary);
 opacity: .65; cursor: pointer; pointer-events: auto;
}
.theme-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch:hover { opacity: 1; }
.theme-switch:focus-visible { opacity: 1; outline: 1px solid var(--text-secondary); outline-offset: 2px; }
@media (max-width: 768px) {
 .mobile-header .mobile-nav.theme-nav { grid-template-columns: 32px repeat(4, minmax(0, 1fr)); gap: 3px; align-items: center; }
 .mobile-nav.theme-nav a { border-color: transparent; }
 .theme-switch { height: 44px; }
}

@media print { .theme-switch { display: none !important; } }
