/* Public modes only. The light palette and layout remain in daylight.css.
   The second token block is the CSS-only fallback: dark unless the OS requests light.
   Keep both blocks identical (covered by tests/theme.mjs). */
:root.public-theme[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08060d;
  --bg-soft: #0c0913;
  --surface: #11101a;
  --surface-2: #171323;
  --line: rgba(255,255,255,.11);
  --line-bright: rgba(255,255,255,.22);
  --text: #f8f7ff;
  --muted: #a9a4b8;
  --purple: #8b5cf6;
  --purple-light: #c084fc;
  --cyan: #22d3ee;
  --green: #61f2a4;
  --header-bg: rgba(8,6,13,.96);
  --nav-text: #cbc6d4;
  --portrait-bg: #171323;
  --portrait-border: #352a46;
  --portrait-shadow: #00000040;
  --portrait-label: #c1b3d4;
  --overlay-border: #ffffff24;
  --portrait-caption: #110d1af0;
  --signature-text: #b9afc8;
  --strip-bg: #0c0913;
  --strip-text: #c1b3d4;
  --audience-purple: #1b1428;
  --audience-green: #10201b;
  --card-hover: #21192e;
  --card-hover-border: #66517e;
  --feature-bg: #21162e;
  --feature-caption: #171323;
  --feature-label: #c084fc;
  --feature-small: #b9afc8;
  --cover-purple: #21162e;
  --cover-green: #15251f;
  --cover-warm: #292019;
  --wordmark-text: #f1e8ff;
  --about-border: #352a46;
  --about-bg: #171323;
  --event-text: #c9bbda;
  --event-bg: #241b32;
  --art-bg: #1c1428;
  --visual-badge-bg: #110d1ae8;
  --visual-badge-text: #e2c9ff;
  --tag-text: #c9bbda;
  --tag-bg: #241b32;
  --detail-bg: #171323;
  --sector-bg: #110d1aeb;
  --sector-text: #ddd0eb;
  --article-text: #d0cad7;
  --article-caption-text: #e2d7ec;
  --article-caption-bg: #110d1ae8;
  --promise-text: #ccc6d3;
  --label-text: #bfb5cd;
  --input-bg: #0c0913;
  --input-border: #665873;
  --placeholder: #9b90ab;
  --choice-text: #c0b4cf;
  --choice-bg: #171120;
  --choice-active-text: #ead8ff;
  --choice-active-bg: #332046;
  --error-text: #ffc1cc;
  --error-bg: #30151e;
  --error-border: #794152;
  --success-text: #baf8d5;
  --success-bg: #12291e;
  --success-border: #38664c;
  --focus: #c084fc;
  --cookie-bg: #110d1af5;
  --cookie-shadow: #00000060;
  --raised-bg: #21192e;
  --button-bg: #7142ce;
  --accent-text: #c084fc;
  --logo-bg: #f0eaf7;
  --logo-padding: 14px;
  --logo-radius: 14px;
}
@media not all and (prefers-color-scheme: light) {
  :root.public-theme:not([data-theme]) {
    color-scheme: dark;
    --bg: #08060d;
    --bg-soft: #0c0913;
    --surface: #11101a;
    --surface-2: #171323;
    --line: rgba(255,255,255,.11);
    --line-bright: rgba(255,255,255,.22);
    --text: #f8f7ff;
    --muted: #a9a4b8;
    --purple: #8b5cf6;
    --purple-light: #c084fc;
    --cyan: #22d3ee;
    --green: #61f2a4;
    --header-bg: rgba(8,6,13,.96);
    --nav-text: #cbc6d4;
    --portrait-bg: #171323;
    --portrait-border: #352a46;
    --portrait-shadow: #00000040;
    --portrait-label: #c1b3d4;
    --overlay-border: #ffffff24;
    --portrait-caption: #110d1af0;
    --signature-text: #b9afc8;
    --strip-bg: #0c0913;
    --strip-text: #c1b3d4;
    --audience-purple: #1b1428;
    --audience-green: #10201b;
    --card-hover: #21192e;
    --card-hover-border: #66517e;
    --feature-bg: #21162e;
    --feature-caption: #171323;
    --feature-label: #c084fc;
    --feature-small: #b9afc8;
    --cover-purple: #21162e;
    --cover-green: #15251f;
    --cover-warm: #292019;
    --wordmark-text: #f1e8ff;
    --about-border: #352a46;
    --about-bg: #171323;
    --event-text: #c9bbda;
    --event-bg: #241b32;
    --art-bg: #1c1428;
    --visual-badge-bg: #110d1ae8;
    --visual-badge-text: #e2c9ff;
    --tag-text: #c9bbda;
    --tag-bg: #241b32;
    --detail-bg: #171323;
    --sector-bg: #110d1aeb;
    --sector-text: #ddd0eb;
    --article-text: #d0cad7;
    --article-caption-text: #e2d7ec;
    --article-caption-bg: #110d1ae8;
    --promise-text: #ccc6d3;
    --label-text: #bfb5cd;
    --input-bg: #0c0913;
    --input-border: #665873;
    --placeholder: #9b90ab;
    --choice-text: #c0b4cf;
    --choice-bg: #171120;
    --choice-active-text: #ead8ff;
    --choice-active-bg: #332046;
    --error-text: #ffc1cc;
    --error-bg: #30151e;
    --error-border: #794152;
    --success-text: #baf8d5;
    --success-bg: #12291e;
    --success-border: #38664c;
    --focus: #c084fc;
    --cookie-bg: #110d1af5;
    --cookie-shadow: #00000060;
    --raised-bg: #21192e;
    --button-bg: #7142ce;
    --accent-text: #c084fc;
    --logo-bg: #f0eaf7;
    --logo-padding: 14px;
    --logo-radius: 14px;
  }
}

/* Preserve original logo colors, including dark marks on transparent backgrounds. */
.public-site .project-logo,
.public-site .case-logo-wrap img,
.public-site .case-cover img {
  background: var(--logo-bg, transparent);
  padding: var(--logo-padding, 0);
  border-radius: var(--logo-radius, 0);
}
.public-site ::selection { background: var(--button-bg); color: #fff; }
.theme-control { display: inline-flex; align-items: center; flex-shrink: 0; position: relative; }
.theme-control[hidden], .no-js .theme-control { display: none; }
.theme-control::after { content: ''; position: absolute; right: 12px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); pointer-events: none; }
.theme-control select { appearance: none; width: auto; min-width: 100px; min-height: 44px; padding: 9px 30px 9px 13px; border: 1px solid var(--line-bright); border-radius: 99px; color: var(--text); background: var(--surface); font: 600 12px var(--font-body); cursor: pointer; }
.theme-control select:hover { border-color: var(--accent-text); }
.theme-control select:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.theme-control select option { color: var(--text); background: var(--surface); }
@media (max-width: 1120px) {
  .site-nav .theme-control { margin-top: 6px; }
  .theme-control select { min-width: 140px; font-size: 14px; }
}
@media (forced-colors: active) {
  .theme-control select { appearance: auto; }
  .theme-control::after { display: none; }
}
