/* Two atmospheres share the approved geometry and semantic identity tokens. */
:root{color-scheme:light;--background-rgb:250,250,252;--photo-text:#fff;--photo-text-rgb:255,255,255;--button-text:#fff;--selection-text:#171A1A;--timeline-base:#D5E4E0;--timeline-active:var(--violet);--timeline-node-outline:#829E97;--timeline-connector:#D5E4E0;--ambient-rgb:0,194,168;--tech-surface:rgba(250,250,252,.95);--immersive-surface:var(--dark-surface);--immersive-alt:var(--dark-surface-alt);--shadow-overlay:0 24px 75px rgba(7,28,29,.3)}
:root[data-theme="dark"]{color-scheme:dark;--background:#071C1D;--background-rgb:7,28,29;--surface:var(--surface-dark);--surface-rgb:8,35,34;--surface-tint:#082322;--lavender-bg:#082322;--text:var(--night-text-primary);--text-rgb:250,250,252;--text-muted:var(--night-text-muted);--text-secondary:var(--night-text-secondary);--text-on-dark:var(--night-text-primary);--text-on-dark-muted:var(--night-text-secondary);--violet:var(--turquoise-luminous);--violet-deep:var(--turquoise-light);--violet-light:var(--turquoise-light);--violet-rgb:24,213,188;--violet-deep-rgb:142,234,220;--violet-light-rgb:142,234,220;--border:var(--night-border);--border-light:var(--night-border);--border-dark:var(--night-border);--dark-surface:var(--surface-violet-universal);--dark-surface-alt:var(--surface-violet-universal);--dark-rgb:7,28,29;--studio-label-on-light:#8EEADC;--studio-label-on-dark:#8EEADC;--button-text:#071C1D;--timeline-base:rgba(142,234,220,.14);--timeline-node-outline:#9FB9B4;--timeline-connector:rgba(142,234,220,.18);--ambient-rgb:24,213,188;--tech-surface:rgba(7,28,29,.95);--immersive-surface:#06191A;--immersive-alt:#082322;--shadow-light:0 20px 60px rgba(4,18,19,.35);--shadow-dark:0 24px 70px rgba(4,18,19,.45);--shadow-overlay:0 24px 75px rgba(4,18,19,.5)}
.theme-toggle{position:relative;display:inline-grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--border);border-radius:50%;background:transparent;color:var(--text);cursor:pointer;touch-action:manipulation;z-index:102}
.theme-toggle:hover{border-color:var(--violet);color:var(--violet-deep)}
.theme-toggle:focus-visible{outline:2px solid var(--violet);outline-offset:4px}
.site-header>.theme-toggle{position:absolute;left:calc(var(--page-x) + 175px);top:50%;transform:translateY(-50%)}
.projects-header>.theme-toggle{margin-left:20px;flex-shrink:0}
.projects-header>nav{margin-left:auto}
:root[data-theme="dark"] :focus-visible{outline-color:var(--lavender)}
:root[data-theme="dark"] .site-header:is(.is-closing-mode,.is-work-mode) .theme-toggle{color:var(--text-on-dark)}
:root[data-theme="dark"] .menu-toggle{background:var(--surface);border-color:var(--border);color:var(--text)}
:root[data-theme="dark"] .mobile-menu{background:var(--background);color:var(--text)}
:root[data-theme="dark"] .mobile-contact{color:var(--button-text)}
:root[data-theme="dark"] .hero-card,:root[data-theme="dark"] .immersive360-card{color:var(--text-on-dark)}
:root[data-theme="dark"] .hero-card__nav,:root[data-theme="dark"] .hero-card__copy,:root[data-theme="dark"] .hero-card__index{color:var(--photo-text)}
:root[data-theme="dark"] .hero-card__copy p{color:rgba(var(--photo-text-rgb),.92)}
:root[data-theme="dark"] .hero-card__nav,:root[data-theme="dark"] .hero-card__copy a{border-color:rgba(var(--photo-text-rgb),.5)}
:root[data-theme="dark"] .studio-merge h2>span,:root[data-theme="dark"] .studio-merge__copy,:root[data-theme="dark"] .studio-merge__mark{background:linear-gradient(90deg,var(--photo-text) 0 50%,var(--text) 50% 100%);-webkit-background-clip:text;background-clip:text}
:root[data-theme="dark"] .immersive360-section{--i-bg:var(--immersive-surface);--i-surface:var(--surface)}
:root[data-theme="dark"] .immersive360-card__chrome,:root[data-theme="dark"] .immersive360-card__body,:root[data-theme="dark"] .immersive360-card h3 em{color:var(--photo-text)}
:root[data-theme="dark"] .immersive360-card__chrome i{background:rgba(var(--photo-text-rgb),.42)}
:root[data-theme="dark"] .immersive360-card__shade{background:linear-gradient(180deg,rgba(23,26,26,.05) 12%,rgba(23,26,26,.08) 35%,rgba(7,20,21,.88) 100%),linear-gradient(90deg,rgba(0,105,92,.16),transparent 52%)}
:root[data-theme="dark"] .projects-site .skip{background:var(--surface);color:var(--text)}
:root[data-theme="dark"] .demo-toolbar button{color:var(--text)}
::selection{background:var(--lavender);color:var(--selection-text)}
@media(max-width:920px){.site-header>.theme-toggle{left:auto;right:calc(var(--page-x) + 54px)}}
@media(max-width:800px){:root[data-theme="dark"] .studio-merge h2>span,:root[data-theme="dark"] .studio-merge__copy,:root[data-theme="dark"] .studio-merge__mark{background:none;color:var(--photo-text)}}
@media(max-width:767px){.projects-header>.theme-toggle{margin-left:12px}}
/* Photo typography and legacy Home color islands retain semantic contrast. */
:root[data-theme="dark"] .hero-card,:root[data-theme="dark"] .work-ui,:root[data-theme="dark"] .work-card,:root[data-theme="dark"] .immersive360-card{--surface:var(--photo-text);--surface-rgb:var(--photo-text-rgb)}
:root[data-theme="dark"] .service-selector>strong{color:var(--text)}
:root[data-theme="dark"] .service-selector__aside,:root[data-theme="dark"] .services-module__head,:root[data-theme="dark"] .capabilities-outro{color:var(--text-muted)}
:root[data-theme="dark"] .service-selector,:root[data-theme="dark"] .services-module,:root[data-theme="dark"] .services-module__head{border-color:var(--border)}
:root[data-theme="dark"] .service-selector>i{background:var(--border)}
:root[data-theme="dark"] .approach-section--v56>.approach-shell,:root[data-theme="dark"] .approach-section--v56>.approach-shell *{color:var(--text)!important}
:root[data-theme="dark"] .approach-section--v56 .approach-invert-layer,:root[data-theme="dark"] .approach-section--v56 .approach-invert-layer *{color:var(--text-on-dark)!important}
:root[data-theme="dark"] .studio-discipline--development:not(.studio-discipline--mirror) h3,:root[data-theme="dark"] .studio-discipline--development:not(.studio-discipline--mirror) .studio-discipline__body,:root[data-theme="dark"] .studio-discipline--development:not(.studio-discipline--mirror) .studio-discipline__tags,:root[data-theme="dark"] .studio-discipline--mirror.studio-discipline--design h3,:root[data-theme="dark"] .studio-discipline--mirror.studio-discipline--design .studio-discipline__body,:root[data-theme="dark"] .studio-discipline--mirror.studio-discipline--design .studio-discipline__tags{color:var(--text-on-dark)}
:root[data-theme="dark"] .approach-section--v56>.approach-shell .approach-title-wrap em{color:var(--violet-deep)!important}
:root[data-theme="dark"] .final-cta__trigger,:root[data-theme="dark"] .projects-site .button{color:var(--button-text)!important}
/* Manual change only: no transition on initial paint or system resolution. */
@media(prefers-reduced-motion:no-preference){.theme-changing body,.theme-changing .projects-header,.theme-changing .theme-toggle{transition:background-color .22s,color .22s,border-color .22s}}



/* V15: surface continuity. Light sheets and all interaction geometry stay intact. */
body:not(.projects-site) .studio-section { --studio-ink:var(--surface-violet-deep); }
:root[data-theme="dark"] body:not(.projects-site) :is(#work,#capabilities,#approach,#needs,#build,#principles) { border-top-color:transparent; border-bottom-color:transparent; }
:root[data-theme="dark"] body:not(.projects-site) .problem-stage::before { background:none; }
body:not(.projects-site) .approach-section--v56 .approach-invert-layer .approach-step--v56 { background:transparent; }
body:not(.projects-site) .studio-grain { background:none; }
/* Light hierarchy: explicit major accents, leaving nodes/progress/focus untouched. */
:root:not([data-theme="dark"]) body:not(.admin-site) :is(.hero-title-accent>span,.work-title-block h2 em,.principles-head h2 em,.principle-row h3 em,.problem-card__index,.principle-row__index) { color:var(--brand-violet-primary) !important; background:none; -webkit-text-fill-color:currentColor; }
:root:not([data-theme="dark"]) .approach-section--v56 > .approach-shell :is(.approach-title-wrap em,.approach-step__number) { color:var(--brand-violet-primary) !important; }
:root:not([data-theme="dark"]) .final-cta:not(.is-expanded):not(.is-scroll-expanded) h2 em { color:var(--brand-violet-primary) !important; background:none; -webkit-text-fill-color:currentColor; }
:root:not([data-theme="dark"]) body:not(.admin-site) :is(.button-primary,.final-cta__trigger) { background:var(--brand-violet-primary) !important; border-color:var(--brand-violet-primary); color:#FAFAFC; }
:root:not([data-theme="dark"]) body:not(.admin-site) :is(.button-primary,.final-cta__trigger):is(:hover,:focus-visible) { background:var(--brand-violet-secondary) !important; border-color:var(--brand-violet-secondary); }
:root:not([data-theme="dark"]) .final-cta__trigger::before { background:var(--brand-violet-secondary); }
:root:not([data-theme="dark"]) .service-selector.is-active strong { color:var(--brand-violet-primary); }
:root:not([data-theme="dark"]) .projects-site:not(.admin-site) :is(.entry-link,.index-empty a,.index-demo-banner a[aria-current],.index-pagination a[aria-current]) { color:var(--brand-violet-primary); }
:root[data-theme="dark"] body:not(.projects-site) .studio-section { --studio-ink:var(--surface-violet-deep); }
:root:not([data-theme="dark"]) .problem-card h2 em { color:var(--brand-violet-primary) !important; }
:root:not([data-theme="dark"]) body:not(.projects-site) .problem-stage::before { background:radial-gradient(ellipse 65% 40% at 65% 50%,rgba(0,194,168,.065),transparent 100%); }

/* V16 — Night contrast only. No surface, geometry or motion changes. */
:root[data-theme="dark"] body:not(.admin-site) {
 --text:var(--text-primary-dark); --text-secondary:var(--text-secondary-dark); --text-muted:var(--text-muted-dark);
 --text-on-dark:var(--text-primary-dark); --text-on-dark-muted:var(--text-secondary-dark);
 --border:var(--border-soft-dark); --border-light:var(--border-soft-dark); --border-dark:var(--border-soft-dark);
 --footer-text:var(--text-primary-dark); --footer-muted:var(--text-secondary-dark); --footer-border:var(--border-soft-dark);
 --studio-label-on-light:var(--text-muted-dark); --studio-label-on-dark:var(--text-muted-dark);
}
:root[data-theme="dark"] :is(.hero-service-rail,.capabilities-outro-index,.capabilities-outro-index span,.capabilities-outro-mark small,.problem-dot span) { color:var(--text-muted-dark); }
:root[data-theme="dark"] :is(.hero-carousel__label,.hero-carousel__navigation,.entry-description,.index-lead) { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .project-detail main { --case-secondary:var(--text-secondary-dark); --case-muted:var(--text-muted-dark); --border:var(--border-soft-dark); }
/* Distinguish prose and labels from the legacy all-white Process override. */
:root[data-theme="dark"] .approach-section--v56 :is(.approach-shell,.approach-invert-layer) :is(.approach-lead,.approach-note p,.approach-step__copy p) { color:var(--text-secondary-dark) !important; }
:root[data-theme="dark"] .approach-section--v56 :is(.approach-shell,.approach-invert-layer) :is(.approach-kicker p,.approach-note>span,.approach-step__verb,.approach-footer span) { color:var(--text-muted-dark) !important; }
:root[data-theme="dark"] .approach-section--v56 :is(.approach-step__copy p,.approach-step__verb,.approach-step__number) { opacity:1; }
:root[data-theme="dark"] .approach-section--v56 .approach-step__number { color:var(--accent-dark) !important; }
:root[data-theme="dark"] .studio-discipline .studio-discipline__body { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .studio-discipline__tags { color:var(--text-muted-dark) !important; }
:root[data-theme="dark"] .studio-merge__copy { background:none; -webkit-text-fill-color:var(--text-secondary-dark); color:var(--text-secondary-dark); opacity:1; }
:root[data-theme="dark"] :is(.site-footer__nav>span,.site-footer__capabilities>span,.site-footer__bottom,.site-footer__toplink,.site-footer__capabilities p) { color:var(--text-muted-dark); }
/* Image text uses the existing dark shade, without changing imagery/overlays. */
:root[data-theme="dark"] .service-visual figcaption { color:var(--text-primary-dark); }
:root[data-theme="dark"] :is(.hero-card__copy p,.work-ui__content p,.immersive360-card__body p,.work-card__meta p) { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .work-card__meta :is(small,p) { opacity:1; }
:root[data-theme="dark"] .work-card__meta small { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .work-ui__meta span { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .work-ui__progress span { color:var(--text-muted-dark); }
/* Readable chips and controls; actual disabled controls keep their old state. */
:root[data-theme="dark"] :is(.hero-carousel__chips span,.case-tags span,.index-filters a,.gallery-lightbox__toolbar button:not(:disabled),.case-gallery__controls button:not(:disabled)) { color:var(--text-secondary-dark); border-color:var(--border-soft-dark); }
:root[data-theme="dark"] :is(.hero-carousel__chips span,.case-tags span,.index-filters a,.gallery-lightbox__toolbar button:not(:disabled),.case-gallery__controls button:not(:disabled)):is(:hover,:focus-visible) { color:var(--text-primary-dark); border-color:var(--border-visible-dark); }
:root[data-theme="dark"] .index-filters a[aria-current] { color:var(--accent-dark); border-color:var(--accent-secondary-dark); }
:root[data-theme="dark"] .projects-index :is(.entry-tech,.entry-index) { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .projects-index .is-active .entry-index { color:var(--accent-dark); }
:root[data-theme="dark"] .immersive360-controls { border-color:var(--border-visible-dark); }
:root[data-theme="dark"] .immersive360-controls__progress :is(span,i),:root[data-theme="dark"] .immersive360-controls__gesture b { color:var(--text-muted-dark); }
:root[data-theme="dark"] .immersive360-controls button { color:var(--text-secondary-dark); border-color:var(--border-soft-dark); }
:root[data-theme="dark"] .immersive360-controls button:is(:hover,:focus-visible) { color:var(--text-primary-dark); border-color:var(--border-visible-dark); }
:root[data-theme="dark"] :is(.service-selector.is-active strong,.problem-dot.is-active span) { color:var(--accent-dark); }

:root[data-theme="dark"] .studio-section .studio-discipline .studio-discipline__body { color:var(--text-secondary-dark); }
:root[data-theme="dark"] .case-gallery__controls button:not(:disabled):is(:hover,:focus-visible) { background:var(--surface); }
:root[data-theme="dark"] .work-ui__progress span.is-active { color:var(--accent-dark); }

:root[data-theme="dark"] :is(.index-status,.case-demo-label,.final-cta__micro) { color:var(--text-subtle-dark); }
/* V17 — Night important text cannot inherit dark ink from Light. */
:root[data-theme="dark"] .problem-card h2 em { color:var(--accent-dark); -webkit-text-fill-color:currentColor; }
:root[data-theme="dark"] :is(.problem-top,.problem-bottom) { color:var(--text-muted-dark); border-color:var(--border-soft-dark); }
:root[data-theme="dark"] .problem-dot span { color:var(--text-muted-dark); }
:root[data-theme="dark"] .problem-dot:is(.is-active,[aria-current="true"]) span { color:var(--accent-dark); }
:root[data-theme="dark"] .problem-dot:is(.is-active,[aria-current="true"]) i { background:var(--accent-secondary-dark) !important; }
:root[data-theme="dark"] .capabilities-outro-mark { color:var(--text-primary-dark); }

/* Canonical Night vocabulary. Old names are compatibility aliases, not extra palettes. */
:root[data-theme="dark"] {
 --night-bg:var(--surface-violet-universal); --night-surface:var(--surface-dark);
 --night-text-primary:#FAFAFC; --night-text-secondary:#D0E2DD; --night-text-muted:#A1BBB5; --night-text-subtle:#8BA6A0;
 --night-accent:#8EEADC; --night-accent-strong:#18D5BC; --night-border:rgba(142,234,220,.16); --night-hairline:rgba(142,234,220,.16);
 --text-primary-dark:var(--night-text-primary); --text-secondary-dark:var(--night-text-secondary);
 --text-muted-dark:var(--night-text-muted); --text-subtle-dark:var(--night-text-subtle);
 --border-soft-dark:var(--night-border); --border-visible-dark:rgba(142,234,220,.26);
 --accent-dark:var(--night-accent); --accent-secondary-dark:var(--night-accent-strong);
}
/* Four transparent atmospheres; none owns an opaque panel or a viewport-sized box. */
:root {
 --atmosphere-calm:radial-gradient(ellipse 58% 38% at 78% 50%,rgba(24,213,188,.075),transparent 100%);
 --atmosphere-focus:radial-gradient(ellipse 64% 38% at 24% 52%,rgba(0,194,168,.14),transparent 100%),radial-gradient(ellipse 42% 28% at 78% 61%,rgba(24,213,188,.07),transparent 100%);
 --atmosphere-depth:radial-gradient(ellipse 65% 30% at 50% 63%,rgba(0,194,168,.17),transparent 100%),radial-gradient(ellipse 40% 22% at 50% 46%,rgba(24,213,188,.065),transparent 100%);
 --atmosphere-ambient:radial-gradient(ellipse 60% 35% at 18% 52%,rgba(24,213,188,.065),transparent 100%);
 --editorial-orbit:radial-gradient(ellipse 60% 27% at 85% 48%,transparent 99.5%,rgba(142,234,220,.045) 100%,transparent 100.5%);
}
:root[data-theme="dark"] body:not(.projects-site) :is(#hero,#work) { background:var(--atmosphere-calm),var(--surface-violet-universal); }
:root[data-theme="dark"] body:not(.projects-site) #work { background:var(--editorial-orbit),var(--atmosphere-calm),var(--surface-violet-universal); }
:root[data-theme="dark"] body:not(.projects-site) #capabilities { background:var(--atmosphere-focus),var(--surface-violet-universal); }
:root[data-theme="dark"] body:not(.projects-site) #approach { background:var(--atmosphere-calm),var(--surface-violet-universal) !important; }
body:not(.projects-site) .approach-section--v56 .approach-dark-reveal { background:var(--atmosphere-calm),var(--surface-violet-universal) !important; }
body:not(.projects-site) .studio-bg__right,body:not(.projects-site) .studio-bg__left::after { background:var(--atmosphere-focus),var(--studio-ink); }
:root[data-theme="dark"] body:not(.projects-site) #needs { background:var(--atmosphere-ambient),var(--surface-violet-universal) !important; }
:root[data-theme="dark"] body:not(.projects-site) #build { background:var(--atmosphere-depth),var(--surface-violet-universal); }
:root[data-theme="dark"] body:not(.projects-site) #principles { background:var(--surface-violet-universal) !important; }
:root[data-theme="dark"] body:not(.projects-site) #principles>.principles-list { background:var(--editorial-orbit),var(--atmosphere-ambient); }
:root[data-theme="dark"] body:not(.projects-site) .final-cta { background:var(--atmosphere-calm),var(--surface-violet-universal); }
body:not(.projects-site) .final-cta::before { background:var(--atmosphere-calm),var(--surface-violet-universal) !important; }
:root[data-theme="dark"] .projects-site:not(.admin-site) { background-color:var(--surface-violet-universal); }
:root[data-theme="dark"] .projects-site:not(.admin-site) main { --background:var(--surface-violet-universal); }
:root[data-theme="dark"] .projects-index .index-ambient { background:var(--atmosphere-calm); }
:root[data-theme="dark"] .projects-index .index-orbit { border-color:rgba(142,234,220,.085); }
:root[data-theme="dark"] .project-detail .case-opening { background:var(--atmosphere-calm),var(--surface-violet-universal); }
:root[data-theme="dark"] .project-detail .case-block--text { background:var(--atmosphere-ambient),var(--surface-violet-universal); }
:root[data-theme="dark"] .project-detail .case-next-project { background:var(--atmosphere-calm),var(--surface-violet-universal); }
@media(max-width:767px) {
 :root[data-theme="dark"] body:not(.projects-site) #work { background:var(--atmosphere-calm),var(--surface-violet-universal); }
 :root[data-theme="dark"] body:not(.projects-site) #principles>.principles-list { background:var(--atmosphere-ambient); }
}

/* Studio color roles follow the existing surface inversion. The static
   fallback retains its initial paper/ink split; no wipe or timing changes. */
@media(min-width:801px) and (prefers-reduced-motion:no-preference) {
 :root:not([data-theme="dark"]) .studio-merge h2 em { color:var(--turquoise-accessible) !important; }
}
@media(min-width:801px) and (prefers-reduced-motion:reduce) {
 :root:not([data-theme="dark"]) :is(.studio-merge h2>span,.studio-merge__copy,.studio-merge__mark) {
  background-image:linear-gradient(90deg,var(--text) 0 50%,var(--text-on-dark) 50% 100%);
 }
 :root:not([data-theme="dark"]) .studio-merge__eyebrow {
  background-image:linear-gradient(90deg,var(--turquoise-accessible) 0 50%,var(--turquoise-light) 50% 100%);
 }
 :root:not([data-theme="dark"]) .studio-merge h2 em { color:var(--turquoise-light) !important; }
}
