:root { --muted: #56605a; --line: #000c0c26; --theme-reveal-duration: 700ms; color-scheme: light; }
:root[data-theme="dark"] {
  --paper: #101413;
  --ink: #f3f5ee;
  --muted: #aeb8b1;
  --line: #ffffff26;
  --blue: #b1aaff;
  color-scheme: dark;
}
.theme-ready body, .theme-ready .site-nav, .theme-ready #case {
  transition: background-color 180ms ease-out, color 180ms ease-out;
}
/* Reveal the theme through one circle; moving content stays live above it. */
.theme-revealing body, .theme-revealing .site-nav, .theme-revealing #case {
  transition: none;
}
.theme-revealing::view-transition,
.theme-revealing::view-transition-group(root),
.theme-revealing::view-transition-image-pair(root),
.theme-revealing::view-transition-old(root),
.theme-revealing::view-transition-new(root) { pointer-events: none; }
.theme-revealing::view-transition-group(root),
.theme-revealing::view-transition-old(root),
.theme-revealing::view-transition-new(root) { animation: none; }
.theme-revealing::view-transition-old(root),
.theme-revealing::view-transition-new(root) { mix-blend-mode: normal; opacity: 1; }
.theme-revealing::view-transition-old(root) { z-index: 1; }
.theme-revealing::view-transition-new(root) {
  z-index: 2;
  clip-path: circle(0px at var(--theme-origin-x) var(--theme-origin-y));
}
/* Named moving regions use the live new view, never the frozen old capture.
   Keep their viewport containers stationary while their children animate. */
.theme-revealing::view-transition-group(*) {
  animation: none;
  pointer-events: none;
  z-index: 3;
}
.theme-revealing::view-transition-group(root) { z-index: 0; }
.theme-revealing::view-transition-image-pair(*),
.theme-revealing::view-transition-new(*) {
  animation: none;
  pointer-events: none;
  mix-blend-mode: normal;
  opacity: 1;
}
.theme-revealing::view-transition-old(*) { display: none; }
.theme-revealing::view-transition-old(root) { display: block; }
.theme-toggle {
  position: absolute; left: 38px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 48px; height: 48px;
  padding: 0; border: 1px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  transition: scale 100ms var(--ease-out), background-color 160ms ease-out;
}
.theme-toggle svg { grid-area: 1 / 1; width: 21px; height: 21px; pointer-events: none; }
.theme-sun { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
[data-theme="dark"] .theme-moon { display: none; }
.theme-toggle:active { scale: .94; }
.case-open .theme-toggle { left: 98px; }
@media (max-width: 650px) {
  .theme-toggle { left: 14px; width: 44px; height: 44px; }
  .case-open .theme-toggle { left: 66px; }
}
@media (hover:hover) and (pointer:fine) {
  .theme-toggle:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
}

/* The artwork keeps its original palette; only the surrounding UI changes. */
[data-theme="dark"] .site-nav .logo img { filter: none; }
[data-theme="dark"] :is(.bio, .about-copy .eyebrow, .story, .case-intro .description, .next-label, .contact-lead, .contact-privacy, .contact-alternative, .project-category, .preview-note, .work-controls, footer .signature) { color: var(--muted); }
[data-theme="dark"] .about .bio strong { color: var(--ink); }
[data-theme="dark"] footer, [data-theme="dark"] .review-byline { border-color: var(--line); }
[data-theme="dark"] .review-card {
  background: linear-gradient(138deg, #ffffff0f, #ffffff05 48%, #ffffff09), #151b18;
  box-shadow: inset 0 1px 0 #ffffff26, inset 1px 0 0 #ffffff12, inset -1px -1px 0 #00000055, 0 14px 30px -22px #000000b3;
}
[data-theme="dark"] .controls button {
  color: var(--ink); border-color: #ffffff26;
  background: linear-gradient(145deg, #ffffff14, #ffffff04);
  box-shadow: inset 0 1px 1px #ffffff24, inset 0 -1px 2px #00000055, 0 10px 22px -10px #00000080;
}
@media (hover:hover) and (pointer:fine) {
  [data-theme="dark"] .review-card:hover { box-shadow: inset 0 1px 0 #ffffff38, inset 1px 0 0 #ffffff20, 0 20px 32px -24px #000000d9; }
  [data-theme="dark"] .controls button:hover { background: linear-gradient(145deg, #ffffff24, #ffffff0a); }
}
[data-theme="dark"] :is(.contact-cta, .contact-submit),
[data-theme="dark"] :is(.contact-cta, .contact-submit):hover { color: #f9faf3; }
[data-theme="dark"] :is(.contact-cta, .contact-submit) .cta-arrow,
[data-theme="dark"] .site-nav .header-contact .cta-arrow,
[data-theme="dark"] .reel-play svg { background: #f9faf3; }
[data-theme="dark"] :is(.reel, .reel video) { background-color: #000c0c; }
[data-theme="dark"] :is(.reel-cover, .reel-name, .reel-volume, .reel-2 .reel-volume) { color: #f9faf3; }
[data-theme="dark"] #contact-dialog { background: #171e1b; box-shadow: 0 24px 80px #00000080, inset 0 1px 0 #ffffff1a; }
[data-theme="dark"] #contact-form :is(input, textarea, select) { border-color: #ffffff38; background-color: #101613; }
[data-theme="dark"] #contact-form :is(input, textarea)::placeholder { color: #9ca89f; }
[data-theme="dark"] #contact-form select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23f3f5ee' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme="dark"] .contact-sheet-handle { background: #ffffff40; }
[data-theme="dark"] .contact-close:focus-visible { background: #ffffff12; box-shadow: 0 0 0 2px #ffffff80; }
[data-theme="dark"] .analytics-consent { border-color: var(--line); box-shadow: 0 8px 40px #00000066; }
[data-theme="dark"] .skip { background: #f3f5ee; color: #101413; }
[data-theme="dark"] ::selection { background: #ff3d0066; color: #fff; }
@media (prefers-reduced-motion:reduce) { .theme-toggle:active { scale: 1; } }
