/* Semantic palette roles shared by every section and modal. Original values are
   intentionally retained for 01; fixed photo whites and SVG artwork stay intact. */
:root {
  color-scheme: light;
  --page-bg: #fff;
  --feature-text: #fff;
  --feature-muted: #cfdfe2;
  --button-bg: #fff;
  --button-text: #12333d;
  --feature-focus: #fff;
  --header-bg: rgb(18 51 61 / .96);
  --depth-rgb: 18 51 61;
  --glow-rgb: 35 124 134;
  --ornament-rgb: 207 223 226;
  --hover-rgb: 234 242 243;
  --feature-line: rgb(var(--ornament-rgb) / .3);
  --feature-hover: rgb(var(--hover-rgb) / .1);
  --feature-selected-bg: #eaf2f3;
  --feature-selected-text: #12333d;
  --rail-feature: #82bec6;
  --photo-line: rgb(35 124 134 / .7);
  --glow-opacity: .48;
  --panel-bg: #fff;
  --panel-border: #91b0b7;
  --selected-bg: #12333d;
  --selected-text: #fff;
}
:root[data-theme="02"] {
  --dark: #315965;
  --feature-muted: #e0ecef;
  --button-text: #315965;
  --header-bg: rgb(49 89 101 / .97);
  --depth-rgb: 49 89 101;
  --glow-rgb: 95 169 177;
  --ornament-rgb: 224 236 239;
  --feature-selected-text: #315965;
  --rail-feature: #acd1d6;
  --photo-line: rgb(150 203 209 / .6);
  --glow-opacity: .28;
  --selected-bg: #315965;
}
:root:is([data-theme="03"], [data-theme="04"]) {
  color-scheme: light;
  --dark: #e5eff1;
  --page-bg: #fff;
  --surface: #e5eff1;
  --line: #91b0b7;
  --feature-text: #1c3037;
  /* Slightly darker than the PDF secondary text to retain contrast over glows. */
  --feature-muted: #49636b;
  --muted: #49636b;
  --button-bg: #12333d;
  --button-text: #fff;
  --control-hover: #315965;
  --feature-focus: #237c86;
  --header-bg: rgb(229 239 241 / .97);
  --depth-rgb: 18 51 61;
  --glow-rgb: 128 180 186;
  --ornament-rgb: 82 109 117;
  --hover-rgb: 18 51 61;
  --feature-line: #91b0b7;
  --feature-selected-bg: #12333d;
  --feature-selected-text: #fff;
  --rail-feature: #557e87;
  --photo-line: #91b0b7;
  --glow-opacity: .24;
}
:root[data-theme="04"] {
  --dark: #f3f0e9;
  --surface: #f3f0e9;
  --header-bg: rgb(243 240 233 / .97);
}
/* Contrast and feature roles differ from the ordinary body/white card roles. */
.dark,.technology,.site-header,.gallery-lightbox,.works-visual figcaption {color:var(--feature-text)}
.brand img.brand-logo-light {display:none}
:root:is([data-theme="03"], [data-theme="04"]) .brand img.brand-logo-dark {display:none}
:root:is([data-theme="03"], [data-theme="04"]) .brand img.brand-logo-light {display:block}
.site-header.is-fixed {background:var(--header-bg)}
.hero-light,.contact-light {background:radial-gradient(ellipse,rgb(var(--glow-rgb) / var(--glow-opacity)),transparent 68%)}
.photo-frame {border-color:var(--photo-line)}
.technology {background:radial-gradient(ellipse at 80% 45%,rgb(var(--glow-rgb) / .28),transparent 66%),var(--dark)}
.button,.main-nav .mobile-contact {background:var(--button-bg);color:var(--button-text)}
.button:hover,.main-nav .mobile-contact:hover {background:var(--control-hover)}
.dark .eyebrow,.technology .eyebrow {color:var(--feature-muted)}
.hero-lead,.hero-photo figcaption,.detail-photo figcaption,.hero-bottom,
.tech-figure figcaption,.mechanism .number,.scene-text,.contact-grid p,.footer,
.languages,.languages button,.project-visual figcaption,#lightbox-context {color:var(--feature-muted)}
.languages button:hover,.languages button[aria-current="true"],.menu-toggle,
.scene-title,.scene-tabs>button[aria-selected="true"],.lightbox-close,
.gallery-arrow,#gallery-open {color:var(--feature-text)}
.scene-tabs>button,.scene-tabs>button>span {color:var(--feature-muted)}
.scene-tabs>button[aria-selected="true"] {background:var(--feature-selected-bg);border-color:var(--feature-selected-bg);color:var(--feature-selected-text)}
.scene-tabs>button[aria-selected="true"]>span {color:inherit}
.scene-tabs>button[aria-selected="true"]>i {background:var(--line)}
.well-list button[aria-selected="true"] {background:var(--selected-bg);border-color:var(--selected-bg);color:var(--selected-text)}
.place-options button:hover,.place-options button[aria-pressed="true"] {color:var(--button-text)}
.scroll-rail.on-dark {color:var(--rail-feature)}
.dark a:focus-visible,.dark button:focus-visible,.site-header a:focus-visible,
.site-header button:focus-visible,.project-gallery button:focus-visible,
.gallery-lightbox button:focus-visible {outline-color:var(--feature-focus)}
:root:is([data-theme="03"], [data-theme="04"]) .skip-link {color:var(--ink)}
.phone:hover {color:var(--feature-muted)}
.gallery-expand {color:var(--selected-text)}
.gallery-thumb[aria-pressed="true"] {border-color:var(--feature-text)}
:root:is([data-theme="03"], [data-theme="04"]) :is(.hero-actions>.text-link,.scene-tabs>button,.menu-toggle,.lightbox-close,.gallery-arrow) {border-color:var(--feature-line)}
:root:is([data-theme="03"], [data-theme="04"]) :is(.hero-actions>.text-link,.scene-tabs>button,.menu-toggle,.lightbox-close):hover {background:var(--feature-hover);border-color:var(--feature-text)}
:root .scene-tabs>button[aria-selected="true"]:hover {background:var(--feature-selected-bg);border-color:var(--feature-selected-bg)}
.main-nav>a:after {background:var(--feature-muted)}
.project-visual {background:radial-gradient(ellipse at 30% 70%,rgb(var(--glow-rgb)),transparent 75%),var(--dark);color:var(--feature-text)}
:root:is([data-theme="03"], [data-theme="04"]) .project-visual {background:var(--surface)}
:root:is([data-theme="03"], [data-theme="04"]) .languages button {opacity:1}
:root:is([data-theme="03"], [data-theme="04"]) .orbits i {border-color:rgb(var(--ornament-rgb) / .18)}

/* A compact non-modal disclosure: no layout shift and no blocked page scrolling. */
.theme-control {position:fixed;z-index:110;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));color:var(--ink);font-size:14px}
.theme-control[hidden],.theme-panel[hidden] {display:none}
.theme-toggle,.theme-close,.theme-option {border:1px solid var(--panel-border);background:var(--panel-bg);color:var(--ink);cursor:pointer}
.theme-toggle {display:flex;align-items:center;gap:10px;min-height:46px;padding:10px 16px;border-radius:24px;box-shadow:0 4px 24px rgb(18 51 61 / .16);font-size:13px;font-weight:600}
.theme-toggle svg {width:18px;height:18px;flex:none}
.theme-panel {position:absolute;right:0;bottom:calc(100% + 12px);width:320px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 110px);overflow:auto;padding:18px;background:var(--panel-bg);border:1px solid var(--panel-border);border-radius:20px;box-shadow:0 12px 40px rgb(18 51 61 / .2)}
.theme-panel-header {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.theme-panel h2 {font-size:17px;line-height:1.4;letter-spacing:-.02em;font-weight:600}
.theme-close {display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:50%;font-size:24px}
.theme-options {display:grid;gap:8px}
.theme-option {display:grid;grid-template-columns:28px 1fr 18px;gap:10px;align-items:center;min-height:54px;padding:10px 12px;border-radius:12px;text-align:left;font-size:13px;line-height:1.4}
.theme-option[aria-pressed="true"] {border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);background:var(--surface)}
.theme-check {visibility:hidden;color:var(--ink);font-weight:600}
.theme-option[aria-pressed="true"] .theme-check {visibility:visible}
.theme-swatch {width:28px;height:28px;border-radius:50%;border:1px solid #91b0b7;background:var(--swatch)}
.theme-option[data-theme-option="01"] {--swatch:#12333d}
.theme-option[data-theme-option="02"] {--swatch:#315965}
.theme-option[data-theme-option="03"] {--swatch:#e5eff1}
.theme-option[data-theme-option="04"] {--swatch:#f3f0e9}
.theme-toggle:hover,.theme-close:hover,.theme-option:hover {background:var(--surface)}
.theme-control button:focus-visible {outline:3px solid var(--accent);outline-offset:3px}
@media(max-width:700px) {.theme-control {right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom))}.theme-toggle {min-height:44px;padding:10px 14px}.theme-panel {width:304px;padding:14px}}
