:root { color-scheme: dark; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #edf2f5;
  --bg-soft: #e2ebf1;
  --surface: #e2ebf1;
  --surface-high: #f6f9fb;
  --text: #243546;
  --muted: #52697b;
  --dim: #52697b;
  --accent: #496d8b;
  --accent-deep: #34546f;
  --accent-rgb: 73,109,139;
  --line: rgba(52,84,111,.23);
  --line-soft: rgba(52,84,111,.085);
  --mist: #d4e3ed;
  --mist-edge: #c5d8e5;
  --mist-shadow: rgba(36,53,70,.09);
}

.theme-toggle {
  position: relative;
  z-index: 82;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--text);
  background: transparent;
  font: 400 13px/1 var(--sans);
  cursor: pointer;
  transition: color .2s,border-color .2s,background-color .2s;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-moon { display: none; }
[data-theme="light"] .theme-toggle .theme-sun { display: none; }
[data-theme="light"] .theme-toggle .theme-moon { display: block; }
.site-header { grid-template-columns: minmax(0,1fr) auto auto auto; gap: clamp(20px,3vw,48px); }
.site-header .theme-toggle { grid-column: 3; grid-row: 1; }
.site-header .menu-toggle { grid-column: 4; grid-row: 1; }
.site-header .site-nav { grid-column: 4; grid-row: 1; }

[data-theme="light"],
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] .site-header,
[data-theme="light"] .site-nav { background: var(--bg); }
[data-theme="light"] .site-header.is-scrolled { background: rgba(237,242,245,.94); }
[data-theme="light"] :is(.site-nav > a:not(.nav-cv),.hero-copy p,.scroll-cue,.reel-description,.text-link,.reference-section-label h2,.project-entry,.project-entry > strong,.career-entry > strong,.campaign-archive summary,.client-marquee-toggle,.connect-canvas h2,.site-footer) { color: var(--text); }
[data-theme="light"] .text-link:hover,
[data-theme="light"] .site-nav > a:hover { color: var(--accent); }
[data-theme="light"] .reference-statement { color: #7a8e9f; }
[data-theme="light"] .reference-statement .reading-word.is-read { color: var(--text); }
[data-theme="light"] .sculpture-divider img,
[data-theme="light"] .featured::before { filter: url(#mist-art-ink); mix-blend-mode: multiply; }
[data-theme="light"] .connect-canvas::before { filter: url(#mist-logo-ink); mix-blend-mode: multiply; }
[data-theme="light"] .projects { background: none; isolation: isolate; }
[data-theme="light"] .projects::before { content: ''; position: absolute; z-index: -1; inset: 0; background: url('decor/particles.png') center 40px/100% auto no-repeat; filter: url(#mist-logo-ink); mix-blend-mode: multiply; mask-image: linear-gradient(transparent,#000 18%,#000 82%,transparent); opacity: .65; pointer-events: none; }
[data-theme="light"] .showreel,
[data-theme="light"] .motion-stage { background: var(--bg); }
[data-theme="light"] .motion-stage::before { background: linear-gradient(90deg,var(--bg),transparent 8%,transparent 92%,var(--bg)); }
[data-theme="light"] .stage-vignette { background: linear-gradient(var(--bg),transparent 12%,transparent 80%,var(--bg)); }
[data-theme="light"] .project-client-logo > img,
[data-theme="light"] .employer-logo img { filter: url(#mist-logo-ink); opacity: .9; }
[data-theme="light"] .employer-logo:hover img { opacity: 1; }
[data-theme="light"] :is(.case-dialog,.lightbox,.case-dialog__inner,.reel-dialog,.case-points article) { background: var(--bg); }
[data-theme="light"] .case-dialog::backdrop,
[data-theme="light"] .lightbox::backdrop,
[data-theme="light"] .reel-dialog::backdrop { background: rgba(237,242,245,.97); }
[data-theme="light"] .case-dialog__header { background: linear-gradient(var(--bg) 70%,transparent); }
[data-theme="light"] .case-intro > div > p { color: var(--text); }
[data-theme="light"] .case-points p { color: var(--muted); }
[data-theme="light"] .dialog-close,
[data-theme="light"] .lightbox-nav { background: var(--surface-high); color: var(--accent-deep); }

/* Independent work shares the same palette, while original media stays untouched. */
[data-theme="light"] :is(.intro p a,.work-copy p,.work-jumps a,.web-project > p,.motion-toolbar > p,.film-dialog-footer a,.film-dialog-footer p,.share-feedback button) { color: var(--muted); }
[data-theme="light"] .work-jumps a:hover,
[data-theme="light"] .intro p a:hover { color: var(--accent); }
[data-theme="light"] .project-preview { background: var(--bg-soft); border: 1px solid var(--line); box-shadow: 0 12px 32px var(--mist-shadow); }
[data-theme="light"] .gallery-controls button,
[data-theme="light"] .film-close { background: var(--surface-high); color: var(--accent-deep); border-color: var(--line); }
[data-theme="light"] .motion-gallery { scrollbar-color: #91a9bc var(--bg-soft); }
[data-theme="light"] .film-dialog { background: var(--bg); color: var(--text); border-color: var(--line); }
[data-theme="light"] .share-feedback { background: var(--surface-high); border-color: var(--line); box-shadow: 0 12px 40px var(--mist-shadow); }
[data-theme="light"] .share-url { background: var(--bg-soft); color: var(--text); border-color: var(--line); }
.showreel-video,.reel-dialog video,.case-media video,.film-player { color-scheme: dark; }

/* Blue Mist is a complete ink-and-paper system, shared across both pages. */
.theme-filters { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
[data-theme="light"] ::selection { background: var(--accent); color: var(--surface-high); }
[data-theme="light"] { scrollbar-color: #91a9bc var(--bg); }
[data-theme="light"] .skip-link { color: var(--surface-high); }
[data-theme="light"] .cursor--ring { border-color: rgba(52,84,111,.5); }
[data-theme="light"] .cursor--ring.is-hovering { border-color: var(--accent); }
[data-theme="light"] .hero::before { display: block; background: radial-gradient(ellipse at 70% 80%,rgba(158,189,211,.2),transparent 58%); }
[data-theme="light"] .workflow-video { filter: none; mix-blend-mode: normal; }
[data-theme="light"] .workflow-toggle { color: var(--accent-deep); background: rgba(246,249,251,.6); }
[data-theme="light"] .workflow-toggle:hover { border-color: var(--accent); background: var(--bg-soft); }
[data-theme="light"] .workflow-steps button[aria-current="step"] { color: var(--accent-deep); }
[data-theme="light"] .hero-role { color: var(--muted); }
[data-theme="light"] .brand i,
[data-theme="light"] .reference-section-label > i,
[data-theme="light"] .orange-marker { background: linear-gradient(110deg,var(--accent-deep),#7398b2); }
[data-theme="light"] .theme-toggle { background: rgba(246,249,251,.65); }
[data-theme="light"] .theme-toggle:hover { background: var(--bg-soft); color: var(--accent-deep); }
[data-theme="light"] .scroll-cue,
[data-theme="light"] .text-link,
[data-theme="light"] .entry-action,
[data-theme="light"] .freelance-entry-action { color: var(--accent); }
[data-theme="light"] .showreel { border: 1px solid var(--line); box-shadow: 0 18px 48px var(--mist-shadow); }
[data-theme="light"] .showreel-controls { padding-inline: 14px; background: linear-gradient(100deg,var(--bg-soft),var(--bg)); }
[data-theme="light"] .reel-description { color: var(--muted); }
[data-theme="light"] .cv-details-title { color: var(--accent-deep); }
[data-theme="light"] .cv-details .cv-detail-grid { background: linear-gradient(135deg,rgba(212,227,237,.55),transparent 70%); }
[data-theme="light"] .project-entry h3,
[data-theme="light"] .career-entry h3 { color: var(--accent-deep); }
[data-theme="light"] button.project-entry:hover { background: linear-gradient(100deg,rgba(212,227,237,.5),transparent 85%); }
[data-theme="light"] button.project-entry:hover h3 { color: var(--text); }
[data-theme="light"] .freelance-entry { background: linear-gradient(110deg,rgba(197,216,229,.36),transparent 90%); }
[data-theme="light"] .sculpture-divider { background: var(--bg); }
[data-theme="light"] .featured { background: linear-gradient(180deg,var(--bg),#e4edf3 65%,var(--bg)); }
[data-theme="light"] .featured::before { opacity: .3; }
[data-theme="light"] .connect-canvas { background: radial-gradient(ellipse at 50% 55%,rgba(187,211,228,.42),transparent 66%); }
[data-theme="light"] .connect-canvas::before { opacity: .44; mask-image: radial-gradient(ellipse,#000 25%,transparent 72%); }
[data-theme="light"] .connect-canvas h2 > span { color: var(--accent); }
[data-theme="light"] .social-row a:hover { color: var(--accent-deep); }
[data-theme="light"] .case-points article { background: var(--surface-high); }
[data-theme="light"] .case-media { border-color: var(--line); background: #192d3e; }
[data-theme="light"] .case-document:hover { color: var(--accent-deep); border-color: var(--accent); }
[data-theme="light"] .gallery-controls button:hover:not(:disabled),
[data-theme="light"] .film-close:hover,
[data-theme="light"] .dialog-close:hover,
[data-theme="light"] .lightbox-nav:hover { background: var(--bg-soft); border-color: var(--accent); }
[data-theme="light"] .header.shell { background: linear-gradient(var(--bg),rgba(237,242,245,0)); }
[data-theme="light"] .freelance-page .page-grid { background-image: linear-gradient(to bottom,rgba(52,84,111,.1) 50%,transparent 50%); }
[data-theme="light"] .freelance-page { background-image: radial-gradient(ellipse 80vw 480px at 80% 220px,rgba(158,189,211,.25),transparent 72%); background-repeat: no-repeat; }
[data-theme="light"] .work-jumps a { color: var(--accent); }
[data-theme="light"] .project-caption h3 { color: var(--accent-deep); }
[data-theme="light"] .visit-label { color: var(--accent-deep); }
[data-theme="light"] .freelance-page .contact { background: radial-gradient(ellipse at 24% 65%,rgba(187,211,228,.25),transparent 65%); }
[data-theme="light"] .film-dialog::backdrop { background: rgba(24,43,60,.62); backdrop-filter: blur(8px); }
[data-theme="light"] .film-play { background: rgba(36,53,70,.85); border-color: rgba(246,249,251,.85); }
[data-theme="light"] .film-card:hover .film-play { background: var(--accent-deep); }
[data-theme="light"] .film-duration { background: rgba(36,53,70,.9); }
[data-theme="light"] .film-dialog-footer a { color: var(--accent-deep); }

@media (max-width: 1050px) {
  .site-header { gap: 20px; }
  .site-header .theme-toggle { width: 44px; padding: 0; }
  .site-header [data-theme-label] { display: none; }
}
@media (max-width: 900px) {
  .site-header { gap: 16px; }
  .site-header .site-nav { grid-column: auto; grid-row: auto; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; }
  .site-header .theme-toggle { padding: 0; }
  .site-header [data-theme-label] { display: none; }
}
@media (max-width: 800px) {
  .header.shell { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 4px 16px; min-height: 116px; padding-top: 12px; padding-bottom: 8px; }
  .header.shell .brand { grid-column: 1; grid-row: 1; }
  .header.shell .share-button { grid-column: 2; grid-row: 1; }
  .header.shell .theme-toggle { grid-column: 3; grid-row: 1; padding: 0; }
  .header.shell [data-theme-label] { display: none; }
  .header.shell nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; gap: 24px; justify-content: flex-start; }
  .header.shell nav a { justify-content: flex-start; }
}
@media (max-width: 359px) {
  .site-header { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
  [data-theme="light"] .reading-word { color: var(--text); }
}
