/* Screen chrome follows the selected theme. The source media and the printed CV keep their own palette. */
@media screen {
  html[data-theme="dark"],
  html[data-theme="dark"] .brutalist-site {
    color-scheme: dark;
    --paper: #151616;
    --white: #1e2020;
    --ink: #f0efeb;
    --ink-hover: #fff;
    --muted: #b5b8b5;
    --rule: #555957;
    --control-rule: #868b88;
    --quiet-ground: #242726;
    --artifact-ground: #1b1d1d;
    --soft-ground: #252827;
    --stage: #090a0a;
    --inverse-text: #f1f1ed;
    --inverse-muted: #c2c6c3;
    --focus: #b6d6ff;
    --focus-inverse: #b6d6ff;
    --focus-home: #b6d6ff;
    --error: #ffa79e;
    --saved-ground: #23392d;
    --saved-ink: #c7efd0;
    --scrollbar-thumb: #747a76;
    --scrollbar-track: #171919;
    --dialog-backdrop: rgb(0 0 0 / .86);
    --brutal-black: var(--ink);
    --brutal-white: var(--paper);
    --brutal-muted: var(--muted);
    --dark-panel: #1e2020;
    --dark-deep: #0c0d0d;
    --dark-seam: #484c4a;
    --logo-paper: #e5e6e0;
    --image-proof: brightness(.84) saturate(.94);
    --document-proof: brightness(.88);
    color: var(--ink);
    background: var(--paper);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    accent-color: #d8ddd5;
    caret-color: var(--ink);
  }

  html[data-theme="dark"] .brutalist-site :is(.site-header, .home-programme, .home-learning,
    .home-intents, .home-intents a, .home-brief, .approach, .approach article, .project-heading,
    .records-heading, .credential-record, .library-group, .career-layout, .experience-cover,
    .track-supporting, .track-next, .track-lead, .track-case, .service-index, .case-shell) {
    border-color: var(--dark-seam);
  }
  html[data-theme="dark"] .brutalist-site .site-header {
    background: #101111;
    color: var(--ink);
  }
  html[data-theme="dark"] .brutalist-site .site-header :is(nav a,.contact-link,.site-directory) {
    border-color: var(--control-rule);
  }
  html[data-theme="dark"] .brutalist-site .site-header .brand img,
  html[data-theme="dark"] .brutalist-site .footer-bottom .brand img {
    filter: invert(1);
  }
  html[data-theme="dark"] .brutalist-site :is(.site-header,.home-journey,.case-next,.case-journey,.reading-outline,footer) :focus-visible,
  html[data-theme="dark"] .brutalist-site .showcase :focus-visible { outline-color: var(--focus-inverse); }

  /* Film controls, archive captions and terminal navigation use dark charcoal, with original media in a deeper matte. */
  html[data-theme="dark"] .brutalist-site :is(.showcase,.artifact-link,.home-journey,.case-next,.reading-outline,footer) {
    --brutal-black: var(--dark-deep);
    --brutal-white: var(--ink);
    --focus: var(--focus-inverse);
  }
  html[data-theme="dark"] .brutalist-site .showcase,
  html[data-theme="dark"] .brutalist-site .work-tile .artifact-link,
  html[data-theme="dark"] .brutalist-site :is(.case-next,.home-journey,.reading-outline,footer) {
    border-color: var(--dark-seam);
    background: var(--dark-panel);
    color: var(--ink);
  }
  html[data-theme="dark"] .brutalist-site .showcase :is(.film-marquee,.work-select,.work-select a,.stage-caption,.film-caption),
  html[data-theme="dark"] .brutalist-site .home-journey :is(.home-chapter-nav,.home-journey-actions),
  html[data-theme="dark"] .brutalist-site footer :is(.footer-invite,.footer-paths,.footer-bottom) {
    border-color: var(--dark-seam);
  }
  html[data-theme="dark"] .brutalist-site .showcase :is(.stage-open,.film-marquee,.stage-caption,.film-caption) {
    background: var(--dark-deep);
    color: var(--ink);
  }
  html[data-theme="dark"] .brutalist-site .showcase :is(.stage-open,.film-marquee):is(:hover,:focus-visible) {
    background: var(--ink);
    color: var(--dark-deep);
  }
  html[data-theme="dark"] .brutalist-site .work-tile :is(.poster-art,.poster-art .work-image),
  html[data-theme="dark"] .brutalist-site .case-output .case-artwork-link,
  html[data-theme="dark"] .brutalist-site :is(.reader-page,.reader-highlights img,.career-proof img,.track-source-image,
    .home-chapter-art img,.artwork-index .library-thumb,.print-zoom,.expanded-system,.about-opening > img) {
    background: var(--artifact-ground);
  }
  html[data-theme="dark"] .brutalist-site :is(.source-image.on-dark,.media-dialog img.on-dark,
    .stage-artwork,.stage-artwork > .work-image,.film video,.case-film video,.teaser-dialog iframe) {
    background: var(--stage);
  }
  html[data-theme="dark"] .brutalist-site :is(.media-dialog,.teaser-dialog,.credential-atlas) {
    color: var(--ink);
    background: var(--dark-panel);
    border-color: var(--control-rule);
  }
  html[data-theme="dark"] :is(.media-dialog,.teaser-dialog,.credential-atlas)::backdrop { background: var(--dialog-backdrop); }
  html[data-theme="dark"] .brutalist-site :is(.track-source-image,.reader-page,.reader-highlights img) {
    border-color: var(--dark-seam);
  }

  /* Covers also appear in timelines, comparators, academic exhibits and film credits. */
  html[data-theme="dark"] .brutalist-site main img:where(
    [src^="/assets/presentations/"],[src^="/assets/credentials/"],[src^="/assets/display/"],
    [src^="/ui/botbox-preview.png"]
  ) { filter: var(--document-proof); }

  /* Black and multicolour marks need a neutral mount. White marks keep their existing dark mount. */
  html[data-theme="dark"] .brutalist-site :is(.record-identity img,.organization-grid img,.credential-marks img,
    .learning-record-mark img,.issuer-strip img,.holding-marks img,.gallery-link.is-logo,
    .project-signature,.project-mark,.mark-only .case-artwork-link,
    .case-output .mark-only .case-artwork-link,.stage-artwork > .logo-image,.poster-art .logo-image) {
    background-color: var(--logo-paper);
  }
  html[data-theme="dark"] .brutalist-site :is(.record-identity img,.organization-grid img,.credential-marks img,
    .learning-record-mark img,.project-mark) { padding: 4px; }
  html[data-theme="dark"] .brutalist-site img:is(
    [src$="/wajeeh-white.svg"],[src$="/bushra-day-white.svg"],[src$="/kku-languages-white.png"],
    [src$="/ruht-wordmark.svg"]
  ) { background-color: var(--dark-deep); }
  html[data-theme="dark"] .brutalist-site .media-dialog img { background-color: var(--artifact-ground); }
  html[data-theme="dark"] .brutalist-site .media-dialog img:is([src*="/logos/"],[src*="/home-marks/"]):not(.on-dark) {
    background-color: var(--logo-paper);
  }
  /* Concentrate light on the evidence itself. Enlarged originals remain available at their supplied exposure. */
  html[data-theme="dark"] .brutalist-site :is(
    .poster-art .work-image,.stage-artwork > .work-image,.library-thumb img,.career-proof img,.track-source-image,
    .credential img,.credential-atlas img,.home-chapter-art img,.service-example img,.business-art img,
    .case-feature .work-image,.about-opening > img,.experience-portrait,.signature-portrait,
    .case-film video,.film video,[data-teaser] > img,
    .gallery img,.shoot-day img,.credit-evidence img,.case-gallery img,.reader-highlights img,
    :where(#main) img[src^="/assets/work-thumbnails/"],:where(#main) img[src^="/assets/projects/"],
    :where(#main) img[src^="/assets/file-thumbnails/"],:where(#main) img[src^="/assets/artwork/"]
  ):not(.work-thumbnail,.work-icon,[src^="/assets/night/"]),
  html[data-theme="dark"] .brutalist-site .identity .identity-name .signature-portrait,
  html[data-theme="dark"] .admin .media-library img {
    filter: var(--image-proof);
  }
  /* The supplied home marks are transparent, single-colour artwork. */
  html[data-theme="dark"] .brutalist-site .learning-record-mark img[src^="/assets/home-marks/"],
  html[data-theme="dark"] .brutalist-site .showcase .work-select img.project-mark {
    background: transparent;
    padding: 0;
    filter: invert(.92);
  }
  html[data-theme="dark"] .brutalist-site .showcase .work-select a:is([aria-current="true"],:hover,:focus-visible) img.project-mark {
    filter: none;
  }
  html[data-theme="dark"] .brutalist-site :is(.reader-page img,.source-image img,.presentation img[data-reader-page]) {
    filter: var(--document-proof);
  }
  html[data-theme="dark"] .brutalist-site .teaser-dialog iframe { filter: brightness(.93) saturate(.96); }
  html[data-theme="dark"] .brutalist-site img[src^="/assets/night/"],
  html[data-theme="dark"] .brutalist-site :is(.work-thumbnail,.work-icon) { filter: none; }
  /* Every published page of this original specification is achromatic text, tables or wireframes. */
  html[data-theme="dark"] .brutalist-site .reader-page img[src*="/library/mihyar/platform-requirements/"],
  html[data-theme="dark"] .brutalist-site .reader-highlights[data-reader-highlights] img[src*="/library/mihyar/platform-requirements/"],
  html[data-theme="dark"] .brutalist-site :is(.library-thumb,.source-image) img[src*="/library/mihyar/platform-requirements/"] {
    filter: invert(.91) brightness(1.04);
  }
  html[data-theme="dark"] .brutalist-site .library-edition { background: var(--dark-panel); border-color: var(--dark-seam); }
  html[data-theme="dark"] .brutalist-site .library-leaf {
    background: #303635;
    color: var(--ink);
    border-color: #6c7974;
  }
  html[data-theme="dark"] .brutalist-site .library-leaf small { color: #d7ddd6; }
  html[data-theme="dark"] .brutalist-site .agency-plate { color: var(--ink); }
  html[data-theme="dark"] .brutalist-site :is(.reader-step[aria-disabled],.record-state,.track-period) { color: var(--muted); }
  html[data-theme="dark"] .brutalist-site .zoom-hint { background: #101111e8; color: #f0efeb; }

  html[data-theme="dark"] .brutalist-site :is(.account-chart,.film-header,.case-journey) {
    background: var(--dark-deep);
    color: var(--ink);
  }
  html[data-theme="dark"] .brutalist-site .account-chart :is(a,small,figcaption) { color: var(--ink); }
  html[data-theme="dark"] .brutalist-site .account-chart nav a[aria-current] { border-color: var(--ink); }
  html[data-theme="dark"] .brutalist-site .partner-register th { background: var(--dark-panel); }
  html[data-theme="dark"] .brutalist-site .forum-cues { background: #252521; }
  html[data-theme="dark"] .brutalist-site .with-work > .shoot-day { --sheet-ink: #a2d4c2; }
  html[data-theme="dark"] .brutalist-site :is(.cinp-step,.cinp-journey svg) { color: #ecc1c6; }
  html[data-theme="dark"] .brutalist-site .restaurant-report {
    --restaurant-snap: #ed858b;
    --restaurant-tik: #b8cbc7;
  }
  html[data-theme="dark"] .brutalist-site .basket-campaigns { --basket-orange: #f09b5d; }
  html[data-theme="dark"] .brutalist-site .bouquet-plan {
    --bouquet-ink: #f1dcdf;
    --bouquet-rule: #715e65;
    color: var(--bouquet-ink);
    background: #302629;
  }
  html[data-theme="dark"] .brutalist-site .bouquet-selector select,
  html[data-theme="dark"] .brutalist-site .bouquet-chip a:is([aria-current],:hover,:focus-visible) { background: #45363c; }
  html[data-theme="dark"] .brutalist-site .bouquet-selector button { color: #2e2025; }
  html[data-theme="dark"] .brutalist-site .bouquet-plan :focus-visible { outline-color: var(--focus); }

  html[data-theme="dark"] :is(.admin,.brutalist-site) :is(:where(input:not([type="checkbox"]):not([type="radio"]):not([type="image"]):not([type="range"])),
    select,textarea) {
    color: var(--ink);
    background-color: var(--dark-panel);
    border-color: var(--control-rule);
  }
  html[data-theme="dark"] :is(.admin,.brutalist-site) :is(input,textarea)::placeholder { color: var(--muted); opacity: 1; }
  html[data-theme="dark"] :is(.admin,.brutalist-site) [aria-invalid="true"] { border-color: var(--error); }
  html[data-theme="dark"] :is(.admin,.brutalist-site) :is(.field-error,[role="alert"]) { color: var(--error); }
  html[data-theme="dark"] :is(.admin,.brutalist-site) :is(input,select,textarea,button):disabled { opacity: .65; }
  html[data-theme="dark"] .admin { background: var(--paper); color: var(--ink); }
  html[data-theme="dark"] .admin .admin-header { background: var(--dark-deep); border-color: var(--rule); }
  html[data-theme="dark"] .admin :is(.admin-table,fieldset,.media-choices,.short-record,.short-section) { border-color: var(--rule); }
  html[data-theme="dark"] .admin th { background: var(--dark-panel); color: var(--ink); }
  html[data-theme="dark"] .admin .admin-table tbody tr:hover { background: var(--dark-panel); }
  html[data-theme="dark"] .admin .media-library img { background: var(--artifact-ground); }
  html[data-theme="dark"] .admin .media-library img:is([src*="/logos/"],[src*="/home-marks/"]) { background: var(--logo-paper); }
  html[data-theme="dark"] .admin .short-notice { border-color: var(--error); }
  html[data-theme="dark"] .admin .saved { color: var(--saved-ink); background: var(--saved-ground); }
}
