/* Dark surfaces derive from the logo blue; original artwork is never recoloured. */
:root {
  color-scheme: light;
  --surface: var(--warm-paper);
  --surface-raised: var(--card);
  --ink: var(--brand-navy);
  --copy: var(--body-text);
  --secondary: var(--muted);
  --rule: var(--hairline);
  --link: var(--trust-bronze);
}
:root.dark {
  color-scheme: dark;
  --surface: var(--reading-ink);
  --surface-raised: var(--reading-card);
  --ink: var(--reading-paper);
  --copy: var(--reading-body);
  --secondary: var(--reading-body);
  --rule: var(--reading-hair);
  --link: var(--reading-paper);
}
#theme-toggle { width: 44px; height: 44px; flex: 0 0 44px; }
.ace-brand-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 56px; width: 56px; height: 56px; padding: 5px; border: 1px solid rgb(var(--hairline)); border-radius: 6px; background: #fff; }
.ace-brand-mark img { display: block; width: 44px; height: auto; max-width: 100%; object-fit: contain; opacity: 1; filter: none; mix-blend-mode: normal; transform: none; }
.dark .ace-brand-mark { border-color: rgb(var(--warm-paper)); box-shadow: 0 3px 0 rgb(var(--reading-ink)), 0 6px 14px rgb(var(--reading-ink)/.4); }
header nav .ace-dropdown-panel.bg-warm-paper a:is(:hover,:focus-visible) { color: rgb(var(--link)); background: rgb(var(--rule)/.4); }
header nav .ace-dropdown-panel:not(.bg-warm-paper) a:is(:hover,:focus-visible) { color: rgb(var(--warm-paper)); }
header nav .ace-dropdown-panel:not(.bg-warm-paper) :focus-visible { outline-color: rgb(var(--warm-paper)); }
header nav .ace-dropdown-panel:not(.bg-warm-paper) .text-terracotta { color: rgb(var(--warm-paper)) !important; }
header nav .ace-dropdown-panel :is(.text-warm-paper\/40,.text-warm-paper\/50,.text-warm-paper\/60) { color: rgb(var(--warm-paper)/.8); }
.ace-disclosure.is-open > .ace-dropdown-toggle { background: rgb(var(--rule)/.5); }

.dark body { background: rgb(var(--surface)); color: rgb(var(--copy)); }
.dark body > header { background: rgb(var(--brand-navy)) !important; border-color: rgb(var(--rule)); }
.dark body > footer { background-color: rgb(var(--reading-ink)); }
.dark header nav .ace-dropdown-panel:not(.bg-warm-paper) { background-color: rgb(var(--brand-navy)); }
.dark .ace-map-expand { background-color: rgb(var(--brand-navy)); }
.dark :is(.bg-warm-paper,.bg-white) { background-color: rgb(var(--surface)); }
.dark :is(.bg-card,.bg-warm-paper\/50,.bg-hairline\/30,.bg-hairline\/40,.bg-hairline\/50) { background-color: rgb(var(--surface-raised)); }
.dark .text-brand-navy { color: rgb(var(--ink)); }
.dark .text-body-text { color: rgb(var(--copy)); }
.dark :is(.text-muted,.text-muted\/70,.text-body-text\/70,.text-brand-navy\/70) { color: rgb(var(--secondary)); }
.dark .prose-article a { color: rgb(var(--reading-paper)); }
.dark .bg-terracotta\/90.text-warm-paper { background-color: rgb(var(--trust-bronze)); }
.dark .border-hairline { border-color: rgb(var(--rule)); }
.dark .divide-hairline > :not([hidden]) ~ :not([hidden]) { border-color: rgb(var(--rule)); }
.dark :is(.text-terracotta,.text-trust-bronze,.ace-accent-readable) { color: rgb(var(--reading-paper)) !important; }
.dark .material-symbols-outlined:is(.text-terracotta,.text-trust-bronze) { color: rgb(var(--terracotta)) !important; }
.dark :is(.text-critical,.text-success) { color: rgb(var(--reading-paper)); }
.dark :is(a,button).bg-warm-paper.rounded-full { background-color: rgb(var(--warm-paper)); color: rgb(var(--brand-navy)); }
.dark :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible { outline-color: rgb(var(--reading-paper)); }
.dark :is(.ace-icon-button,.ace-dropdown-toggle) { color: rgb(var(--ink)); border-color: rgb(var(--rule)); }
.dark :is(.ace-icon-button,.ace-dropdown-toggle):hover { border-color: rgb(var(--terracotta)); }
.dark header a.bg-brand-navy { background: rgb(var(--warm-paper)) !important; border-color: rgb(var(--warm-paper)); color: rgb(var(--brand-navy)) !important; }
.dark header a.bg-brand-navy:hover { background: rgb(var(--reading-paper)) !important; border-color: rgb(var(--reading-paper)); }
.dark :is(.ace-action,.cinema-button:not(.cinema-button--light):not(.cinema-button--ghost)) { border-color: rgb(var(--reading-body)); }
.dark :is(.ace-mb-drawer,.ace-mb-head,.ace-mb-link,.ace-mb-foot) { border-color: rgb(var(--rule)); }
.dark .ace-mb-drawer { background: rgb(var(--surface)); color: rgb(var(--copy)); }
.dark :is(.ace-mb-link,.ace-mb-sublink,.ace-mb-head > span,.ace-text-link,.ace-search-results a) { color: rgb(var(--ink)); }
.dark :is(.ace-mb-eyebrow,.ace-caption,.ace-form-context,.ace-service-evidence figcaption) { color: rgb(var(--secondary)); }
.dark .ace-project-tile .ace-project-caption { background: rgb(var(--surface-raised)); color: rgb(var(--ink)); }
.dark :is(.ace-project-record h3,.ace-legal-masthead h1,.ace-legal .legal-content h2,.ace-legal .ace-reading h2) { color: rgb(var(--ink)); }
.dark :is(.ace-project-caption p,.ace-project-record p,.ace-proof-facts dt,.ace-legal-masthead p) { color: rgb(var(--secondary)); }
.dark :is(.ace-project-record,.ace-proof-facts,.ace-programme,.ace-legal-masthead,.ace-method-rows > div:not(.method-line)) { border-color: rgb(var(--rule)); }
.dark .cinema-proof { background: rgb(var(--surface-raised)); border-color: rgb(var(--rule)); }
.dark .ace-programme-track { background: rgb(var(--rule)); }
.dark .ace-programme-track span { background: rgb(var(--reading-body)); }
.dark :is(input:not([type='checkbox']):not([type='radio']):not([type='range']),select,textarea) { color: rgb(var(--reading-paper)); background-color: rgb(var(--reading-card)); border-color: rgb(var(--reading-body)/.6); }
.dark :is(input,textarea)::placeholder { color: rgb(var(--reading-body)); opacity: 1; }
.dark :is(input,select,textarea)[aria-invalid='true'] { border-color: rgb(var(--terracotta)); box-shadow: inset 3px 0 0 rgb(var(--terracotta)); }
.dark option { color: rgb(var(--reading-paper)); background-color: rgb(var(--reading-card)); }
.dark :is(.bk-chip,.bk-slot) { color: rgb(var(--reading-paper)); background: rgb(var(--reading-card)); border-color: rgb(var(--reading-body)/.6); }
.dark :is(.bk-chip,.bk-slot).sel { border-color: rgb(var(--reading-paper)) !important; box-shadow: inset 0 0 0 1px rgb(var(--reading-paper)); }

/* Cinematic paper scenes become ink scenes; photography and authored media stay intact. */
.dark :is(.cinema-brief,.cinema-delivery,.ace-cinema #about) { background: rgb(var(--surface)); }
.dark :is(.cinema-procurement,.cinema-concept,.cinema-handover,.cinema-document-drawing) { background: rgb(var(--surface-raised)); }
.dark .cinema-nav { background: rgb(var(--surface)/.98); border-color: rgb(var(--rule)); }
.dark :is(.cinema-title,.cinema-nav a,.cinema-site,.cinema-concept-steps span,.cinema-concept-steps li.is-active,.cinema-document h3,.cinema-service-list a,.cinema-trust-facts strong,.cinema-method-list h3) { color: rgb(var(--ink)); }
.dark :is(.cinema-nav-label,.cinema-deliverable dt,.cinema-site figcaption,.cinema-concept-head p,.cinema-concept-caption > p,.cinema-concept-steps li,.cinema-document > .cinema-meta,.cinema-document ul,.cinema-handover-caption,.cinema-service-list p,.cinema-trust-facts,.cinema-method-list .cinema-meta) { color: rgb(var(--secondary)); }
.dark :is(.cinema-procurement,.cinema-deliverable,.cinema-site figcaption,.cinema-concept-steps li,.cinema-document,.cinema-document ul,.cinema-service-list a,.cinema-trust-facts,.cinema-method-list li) { border-color: rgb(var(--rule)); }
.dark .cinema-concept-steps li.is-active { border-color: rgb(var(--terracotta)); }
.dark .cinema-icon-button { color: rgb(var(--ink)); border-color: rgb(var(--reading-body)/.6); }
.dark .cinema-icon-button:hover { background: rgb(var(--surface-raised)); }
.dark .cinema-link { color: rgb(var(--link)); text-decoration-color: rgb(var(--terracotta)); }
.dark .cinema-site .site-grid { stroke: rgb(var(--reading-paper)/.12); }
.dark .cinema-site .site-boundary { stroke: rgb(var(--reading-paper)/.6); }
.dark .cinema-site .site-design { fill: rgb(var(--reading-card)); stroke: rgb(var(--reading-paper)); }
.dark .cinema-site text { fill: rgb(var(--reading-body)); }
.dark .cinema-drawing-row span { border-color: rgb(var(--reading-body)/.6); }
.dark .cinema-drawing-lines { background: repeating-linear-gradient(0deg,transparent 0 15px,rgb(var(--rule)) 15px 16px); }
.dark .ace-cinema #about :is(h2,h3) { color: rgb(var(--ink)); }
.dark .ace-cinema #about :is(p,.text-terracotta) { color: rgb(var(--secondary)) !important; }
.dark .ace-cinema #about .group { border-color: rgb(var(--rule)); }
.dark .cinema-button--light { color: rgb(var(--brand-navy)); background: rgb(var(--warm-paper)); }
.dark .cinema-button--light:focus-visible { outline-color: rgb(var(--terracotta)); }
.dark .cinema-method-intro > .cinema-meta { color: rgb(var(--secondary)); }

@media (hover: hover) {
  .dark :is(.hover\:bg-warm-paper,.hover\:bg-hairline\/40):hover { background-color: rgb(var(--reading-hair)); }
  .dark :is(.hover\:text-brand-navy,.hover\:text-terracotta):hover { color: rgb(var(--reading-paper)); }
}
@media (prefers-reduced-motion: reduce) {
  .ace-dropdown-panel { transition: none; }
}
