/* The language and appearance controls remain together on narrow screens. */
.header-preferences{display:flex;align-items:center;gap:12px;flex-shrink:0}
.theme-toggle{display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;padding:0;border:1px solid #bda16a70;border-radius:50%;background:#ffffff08;color:#ead6ab;cursor:pointer;transition:background .18s,border-color .18s}
.theme-toggle:hover{background:#ffffff18;border-color:var(--gold)}
.theme-toggle svg{width:19px;height:19px;pointer-events:none}
.theme-toggle .theme-sun{display:none}
html[data-theme=dark] .theme-toggle .theme-sun{display:block}
html[data-theme=dark] .theme-toggle .theme-moon{display:none}
html[data-theme=light]{color-scheme:light}
html[data-theme=dark]{color-scheme:dark;--ink:#e3eaf0;--muted:#a9b8c5;--line:#344352;--soft:#141f2b;--gold:#ceb27c;--theme-surface:#1b2937;--theme-accent:#dfc58f}
html[data-theme=dark] body,html[data-theme=dark] body:not([data-page=contact]) main{background:#101923}
html[data-theme=dark] header,html[data-theme=dark] nav{background:#14212e}
html[data-theme=dark] .topbar,html[data-theme=dark] footer{background:#0c1620}
html[data-theme=dark] :is(.focus-bar,.profile-overview,.expertise-section,.message-section){background:var(--soft)}
html[data-theme=dark] :is(.metric-card,.education-card,.timeline-item,.article,.cv-document,.news-empty,.achievement-card,.published-card,.search-result,.document-toolbar,.document-controls,.pdf-label,.skip){background:var(--theme-surface);box-shadow:none}
html[data-theme=dark] :is(.document-toolbar button,.document-controls button,.document-controls a,.topic-filters button){background:var(--theme-surface);color:var(--ink)}
html[data-theme=dark] :is(.document-frame,.published-cover,#document-dialog,.form-result){background:#243443}
html[data-theme=dark] :is(.metric-value,.menu-toggle,.pdf-label,.cv-secondary,.published-link,.reading-back,.reading-body :is(h3,h2.outline-heading),.reading-body a,.news-source a,.text-link,nav a:hover,nav a.active,.form-result){color:var(--theme-accent)}
html[data-theme=dark] :is(.eyebrow,.card-type,.job-date,.timeline-item .job-date,.certificate-year,.document-view,.published-meta,.topic-label,.search-result-type,.form-field:focus-within label,.form-field label>span[aria-hidden]){color:var(--theme-accent)}
html[data-theme=dark] .card-bottom{color:var(--muted)}
html[data-theme=dark] .topic-filters button[aria-pressed=true]{background:#d6bc85;color:#14212e;border-color:#d6bc85}
html[data-theme=dark] :is(.cv-primary,.form-send){background:#d6bc85;color:#14212e;border-color:#d6bc85}
html[data-theme=dark] .cv-secondary{border-color:var(--gold)}
html[data-theme=dark] .cv-secondary:hover{background:var(--navy);color:#fff}
html[data-theme=dark] :is(.form-field input,.form-field textarea):focus{background:var(--theme-surface);border-bottom-color:var(--gold)}
html[data-theme=dark] .section[data-section-number]:before{color:#ffffff06}
html[data-theme=dark] .brand-logo{filter:invert(1)}
html[data-theme=dark] .education-logo img{background:#fff;border-radius:50%;padding:6px}
html[data-theme=dark] .footer-disclaimer{color:var(--muted)}
@media(max-width:720px){.header-preferences{margin-left:auto;gap:8px}.header-preferences .languages{margin-left:0}.theme-toggle{width:36px;height:36px}}
@media(max-width:360px){.topbar{letter-spacing:.5px}.header-preferences{gap:5px}.languages button{padding:0 7px}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}
