/* Site-wide appearance. Photographs, original documents and screenshots keep their colours. */
:root {
 color-scheme: light;
 --surface: #eeeee7;
 --surface-raised: #e8ece4;
 --strong-surface: #283d31;
 --on-strong: #f4f2ec;
}
:root[data-theme="dark"] {
 color-scheme: dark;
 --paper: #141d19;
 --ink: #ecf0e8;
 --muted: #b0bdaf;
 --line: #35473b;
 --accent: #bad4a5;
 --surface: #1b2821;
 --surface-raised: #223329;
 --strong-surface: #101b15;
 --on-strong: #ecf0e8;
 --sc-tint: #1b2821;
}
body, .reference-header, section, footer, .case-contents,
.document-dialog-panel, .case-viewer-panel {
 transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.header-controls { position: absolute; right: 40px; top: 25px; display: flex; align-items: center; gap: 10px; }
[data-theme="dark"] ::selection { background: #bad4a5; color: #141d19; }
[data-theme="dark"] :is(a, button, summary):focus-visible { outline-color: var(--accent); }
[data-theme="dark"] :is(.work, .education-section, .skills-section, .artefacts-section,
 .ua-scope, .ua-density, .ua-hotspot, .sc-tinted, .values-section, .volunteering,
 .mission-section, .mission-item, .tutoring-diagram) { background: var(--surface); }
[data-theme="dark"] .sc-page { --sc-tint: #1b2821; }
[data-theme="dark"] .case-study .case-research-scope { background: transparent; }
[data-theme="dark"] :is(.mission-item p, .tutoring-diagram span) { color: var(--muted); }
[data-theme="dark"] .mission-grid:before { border-color: #506747; }
[data-theme="dark"] .mission-item img { background: #e6eadf; border-radius: 50%; padding: 6px; }
[data-theme="dark"] :is(.career-timeline:before, .education-section > .institution:before) { background: #4e674f; }
[data-theme="dark"] :is(.project, details, .course-heading, .artefact, .reflection-label,
 .volunteer-grid .skill-line, .ua-method-steps li, .study-status, .tutoring-diagram > div) { border-color: var(--line); }
[data-theme="dark"] :is(.competencies, .artefact-body aside .evidence-status) { color: var(--accent); }
[data-theme="dark"] .artefact-body aside .evidence-status { border-color: #879767; }
/* Keep fixed dark feature bands readable when the normal paper token is dark. */
[data-theme="dark"] :is(#contact, .system-diagram, .case-study .case-ending, .sc-reflection) { background: var(--strong-surface); color: var(--on-strong); }
[data-theme="dark"] :is(#contact p, #contact .label, .system-diagram p,
 .system-diagram span, .system-diagram > b, .case-study .case-ending p,
 .case-study .case-ending figcaption span) { color: #c1ceba; }
[data-theme="dark"] :is(#contact a, .case-study .case-ending a, .case-study .case-ending strong,
 .sc-starr strong) { color: var(--on-strong); }
[data-theme="dark"] .welcome-banner { color: var(--on-strong); }
[data-theme="dark"] .welcome-banner .underlined { color: var(--on-strong); }
[data-theme="dark"] .welcome-banner .underlined:hover { color: var(--accent); }
/* Transparent brand marks sit directly on the page, without a backing card. */
[data-theme="dark"] :is(.entry-logo .organisation-logo, .volunteer-brand img) { background: transparent; }
/* The single-colour Münster wordmark needs a light version on dark surfaces. */
[data-theme="dark"] .entry-logo img[src*="muenster.svg"] { filter: brightness(0) invert(.92); }
[data-theme="dark"] .accreditation-badges img { background: #f4f2ec; }
[data-theme="dark"] .volunteering-heading > p a { text-decoration-color: #839a75; }
/* Document and screenshot surfaces stay bright so evidence is faithfully reproduced. */
[data-theme="dark"] :is(.certificate-preview, .ua-figure-link, .case-study .case-image-link, .sc-image-link) { background: #fff; border-color: #41503f; }
[data-theme="dark"] .certificate-preview { box-shadow: 0 8px 28px #0004; }
[data-theme="dark"] .case-contents, [data-theme="dark"] .sc-contents { background: #141d19f5; }
[data-theme="dark"] .sc-enlarge { color: #ecf0e8; background: #1b2821ed; border-color: #59694f; }
[data-theme="dark"] .document-stage { --stage-color: #243229; }
[data-theme="dark"] .stage-teal { --stage-color: #20362f; }
[data-theme="dark"] .stage-sand { --stage-color: #34372a; }
[data-theme="dark"] .document-stage:before { background: linear-gradient(125deg, transparent 35%, #ffffff15 50%, transparent 65%); }
[data-theme="dark"] .document-preview-label { color: var(--ink); }
[data-theme="dark"] .gallery-filters button:hover:not([aria-pressed="true"]) { background: var(--surface-raised); border-color: #607454; }
[data-theme="dark"] .document-open { background: var(--accent); color: #141d19; }
[data-theme="dark"] .document-open:hover { background: #cbe4b7; }
[data-theme="dark"] :is(.document-dialog-panel, .document-dialog-top, .document-dialog-info, .case-viewer-panel, .case-viewer-toolbar, .case-viewer-bottom) { background: var(--paper); color: var(--ink); }
[data-theme="dark"] :is(.document-dialog-image, .document-dialog-viewer, .case-viewer-image) { background: #202e25; }
[data-theme="dark"] :is(.document-side-nav, .document-dialog > .document-side-nav, .case-viewer-arrow, .case-viewer-close) { background: var(--surface); color: var(--ink); border-color: #52644b; }
[data-theme="dark"] :is(.document-side-nav, .document-dialog > .document-side-nav, .case-viewer-arrow):hover:not(:disabled) { background: #32482e; }
[data-theme="dark"] .document-dialog-navigation button { border-color: #52644b; }
[data-theme="dark"] .document-dialog-navigation button:hover:not(:disabled) { background: var(--surface-raised); }
[data-theme="dark"] :is(.document-dialog, .case-lightbox)::backdrop { background: #050b08e8; }
@media (max-width: 720px) {
 .header-controls { position: static; gap: 6px; flex-shrink: 0; }
 .header-controls #menu { padding: 8px 4px; }
 .reference-header .identity { min-width: 0; }
}
@media (max-width: 380px) {
 .header-controls { gap: 4px; }
 .header-controls #menu { font-size: 11px; }
 .reference-header { gap: 8px; }
 .reference-header .identity { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
 body, .reference-header, section, footer, .case-contents, .document-dialog-panel,
 .case-viewer-panel { transition: none; }
}
[data-theme="dark"] .education-section > .institution:after { box-shadow: 0 0 0 6px var(--surface); }
[data-theme="dark"] .stage-project { --stage-color: #22382e; }
