:root{color-scheme:light}
:root[data-theme=dark]{color-scheme:dark;--bg:#141e2b;--paper:#1d2a3a;--ink:#e6edf5;--muted:#acbbcd;--line:#34465b;--accent:#efa18c;--accent-mark:#e69783;--accent-soft:#3a2c2d;--soft:#233246}
[data-theme=dark] body,[data-theme=dark] .cabin,[data-theme=dark] .cabin>.portfolio-sky{background:var(--bg);color:var(--ink)}
[data-theme=dark] :is(h1,h2,h3,h4,strong,.wordmark,.nav nav a,.hero-name,.room-project-open,.email,.contact-bottom a,.stage-next,.stage-previous){color:var(--ink)}
[data-theme=dark] :is(p,.eyebrow,.hero-role,.room-project .project-decision,.room-project-org,.timeline-entry time,.timeline-meta,.timeline-summary,.timeline-role,.folder-content p,.folder-bar span,.folder-sidebar>p,.folder-sidebar button,.folder-sidebar-note,.project-points li,.project-meta,.brand-role,.project-skill-tools li,.photography-copy p,figcaption,.gesture-invitation-help,.gesture-invitation-note){color:var(--muted)}
[data-theme=dark] :is(.copy-highlight,.project-highlight,.experience-highlight),[data-theme=dark] #intro-title .copy-highlight,[data-theme=dark] .opening-copy .copy-highlight,[data-theme=dark] #experience .experience-highlight,[data-theme=dark] .room-project .project-highlight{color:var(--accent)}
[data-theme=dark] :is(.room-project,.room-stat,.timeline-panel,.project-folder,.gesture-panel,.hand-zoom-guide){background:var(--paper);border-color:var(--line);color:var(--ink);box-shadow:0 12px 28px #0000001c}
[data-theme=dark] :is(.folder-bar,.folder-sidebar){background:#192535;border-color:var(--line)}
[data-theme=dark] :is(.folder-content,.folder-workspace){background:var(--paper);color:var(--ink)}
[data-theme=dark] :is(.room-project-open,.timeline-entry,.project-points li,.project-skill-tools,.folder-content .outcome,.folder-content .study-context,.venn-explanation,.email){border-color:var(--line)}
[data-theme=dark] :is(.room-hand-control,.room-hand-control[aria-pressed=true],.room-project-picker,.stage-arrow-circle,.gesture-panel button,.hand-zoom-guide button){background:var(--soft);color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(.folder-sidebar button:hover,#folder-close:hover){background:var(--soft);color:var(--ink)}
[data-theme=dark] .folder-sidebar button[aria-selected=true]{background:var(--accent-soft);color:var(--accent)}
[data-theme=dark] .folder-content a{color:var(--accent)}
[data-theme=dark] :is(#folder-close,.folder-bar svg){color:var(--muted);stroke:var(--muted)}
[data-theme=dark] .project-folder::backdrop{background:#050b1470}
[data-theme=dark] .timeline-logo{background:#f6f8fb}
[data-theme=dark] .room-project .project-preview-image{background:#edf1f6;border-color:#34465b}
[data-theme=dark] .room-project:has(.room-project-open:hover){border-color:#a77b70;box-shadow:0 8px 26px #0002}
[data-theme=dark] .room-project-open:hover{color:var(--accent)}
[data-theme=dark] #gesture-toggle{background:#dbe5f1;color:#182638}
[data-theme=dark] .window-frame{box-shadow:0 16px 30px #0003}
[data-theme=dark] .window-frame::before{background-image:url('assets/images/window-material-grain.svg'),linear-gradient(180deg,#657181,#455365 55%,#344253);box-shadow:inset 0 1px 2px #c6d3df40}
[data-theme=dark] .window-frame::after{border-color:#b3c5d526}
[data-theme=dark] .window-reveal{border-color:#3b4959;background-image:url('assets/images/window-material-grain.svg'),linear-gradient(180deg,#293544,#465365 55%,#657587 87%,#4c5b6d);box-shadow:inset 0 10px 15px #0003,inset 0 -2px 4px #d2e1ef20}
[data-theme=dark] .window-glass{border-color:#8190a1;box-shadow:0 0 0 2px #18263855,0 -4px 9px #0004}
[data-theme=dark] .window-shade{background-image:url('assets/images/window-material-grain.svg'),radial-gradient(ellipse at 50% 40%,#657588,#4b5b6e 68%,#354558);box-shadow:inset 0 6px 12px #101c2c42,0 5px 9px #0005}
/* Sky and photography retain their original colours and legibility. */
[data-theme=dark] .window-actions :is(button,a){color:#263b53}
[data-theme=dark] .study-context,[data-theme=dark] .folder-content .visual-study-context{background:var(--soft);border-color:var(--line)}
[data-theme=dark] .room-workspace:not(.room-view-only) :is(.room-project,.room-stat){background:var(--paper)}
[data-theme=dark] .room-workspace{background:transparent}
[data-theme=dark] .room-project-picker button{color:var(--muted)}
[data-theme=dark] .room-project-picker button[aria-pressed=true]{background:var(--soft);color:var(--ink)}
.sunset-sky,.night-collage{display:none}
[data-theme=dark] .day-sky,[data-theme=dark] .day-collage{display:none}
[data-theme=dark] .sunset-sky,[data-theme=dark] .night-collage{display:block}
.night-collage .row-one{grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr)}
.night-collage .row-two{grid-template-columns:repeat(2,minmax(0,1fr))}
[data-theme=dark] .room-project .project-preview-image>img{filter:brightness(.8)}
[data-theme=dark] .room-project .project-preview-image{background:#bec4ce}
[data-theme=dark] .photography-copy .text-link{color:var(--ink);border-color:var(--line)}
/* Sunset copy stays readable against its shaded cloud surface. */
[data-theme=dark] .window-actions :is(button,a){color:#162b42;text-shadow:0 1px 5px #ffffff9c}
[data-theme=dark] .project-visual-frame{border-color:var(--line);background:var(--paper)}
[data-theme=dark] .visual-study-context :is(.venn-select,.venn-explanation p){color:var(--muted)}
[data-theme=dark] .visual-study-context .venn-select[aria-pressed=true]{background:var(--accent-soft);color:var(--accent)}
[data-theme=dark] .visual-study-context .venn-select:hover{background:var(--soft)}
[data-theme=dark] .visual-study-context .venn-key{background:var(--paper);color:var(--ink);border-color:var(--line)}
[data-theme=dark] .visual-study-context svg>rect{fill:var(--paper);stroke:var(--line)}
[data-theme=dark] .visual-study-context svg text{fill:var(--ink)}

/* A quiet dusk horizon, shown without the daytime cloud crop. */
[data-theme=dark] .window-glass .sunset-sky{transform:none;object-position:50% 50%;filter:none}
[data-theme=dark] .window-actions :is(button,a){color:#f3f5f9;text-shadow:0 1px 5px #07111ed9}

/* Quiet, keyboard-accessible appearance menu. */
.nav nav{align-items:center}.appearance-control{position:relative;display:flex;align-items:center}
#theme-toggle{display:grid;place-items:center;width:36px;height:40px;padding:8px;border:0;background:transparent;color:var(--ink);border-radius:9px}
#theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.4}
#theme-toggle:hover{background:var(--soft,#e5eaf0)}
#theme-toggle .theme-sun{display:none}
[data-theme=dark] #theme-toggle .theme-sun{display:block}
[data-theme=dark] #theme-toggle .theme-moon{display:none}
@media(max-width:650px){.nav nav,.window-enlarged .nav nav{gap:6px}#theme-toggle{width:28px;padding:5px}.nav .wordmark,.window-enlarged .nav .wordmark{font-size:19px}}
@media(max-width:360px){.nav nav,.window-enlarged .nav nav{gap:4px}.nav .wordmark,.window-enlarged .nav .wordmark{font-size:16px}.nav nav a{font-size:10px}#theme-toggle{width:24px}}

/* Keep diagram number badges readable against their opaque light circles. */
[data-theme=dark] .visual-study-context .venn-marker text{fill:#263b53;font-weight:650}
[data-theme=dark] .visual-study-context .venn-marker circle{fill:#f3f6fb;stroke:#acbbcd;fill-opacity:1}
/* Project tabs share readable text and inset surfaces in either appearance. */
[data-theme=dark] .folder-content :is(.project-skill-group li,.research-proof,.research-proof span,.outcome span){color:var(--muted)}
[data-theme=dark] .folder-content figure{background:var(--soft);border-color:var(--line)}
[data-theme=dark] .folder-content figure figcaption{color:var(--ink)}
[data-theme=dark] .folder-content .decision-branches strong{color:var(--ink)}

[data-theme=dark] .project-skill-tools img{background:#f3f6fb;border-radius:5px;padding:3px}

[data-theme=dark] .folder-content .testing-results h4{color:var(--ink)}

/* Room between links; narrow phones use a dedicated navigation row. */
@media(min-width:481px) and (max-width:700px){.nav nav,.window-enlarged .nav nav{gap:18px}}
@media(max-width:480px){
 .nav,.window-enlarged .nav{height:88px;padding:5px 20px 0;display:grid;grid-template-columns:1fr;grid-template-rows:31px 47px;align-content:start}
 .nav .wordmark,.window-enlarged .nav .wordmark{font-size:19px;justify-self:start;align-self:center}
 .nav nav,.window-enlarged .nav nav{width:100%;margin:0;justify-content:space-between;gap:14px}
 .nav nav a{font-size:11px;padding-block:10px}
 #theme-toggle{width:32px;min-height:44px;padding:7px}
}
[data-theme=dark] .experience-picker{background:var(--paper);border-color:var(--line)}
[data-theme=dark] .experience-picker button{color:var(--muted)}
[data-theme=dark] .experience-picker button[aria-pressed=true]{background:var(--soft);color:var(--ink)}

/* Apply the same dimming to artwork and its surrounding margin. */
[data-theme=dark] .room-project .feedback-preview.project-preview-image{background:color-mix(in srgb,#F4F6F8 80%,#000)}
[data-theme=dark] .room-project .record-preview.project-preview-image{background:#ccc}
[data-theme=dark] .room-project .clustering-preview.project-preview-image{background:color-mix(in srgb,#f4f6f8 80%,#000)}
