/* Theme tokens extend the restrained V3 identity; product images are never filtered. */
:root {
  color-scheme: light;
  --theme-header: rgba(250,250,250,.82); --theme-on-ink: #fff; --theme-ink-hover: #333;
  --theme-muted: #8a8a8a; --theme-grid: rgba(17,17,17,.045);
  --theme-dots: #e3e3e3; --theme-core-shadow: rgba(17,17,17,.04);
  --theme-stage: #f0f0f0; --theme-contact: #111;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #101112; --surface: #191a1c; --ink: #f2f2f2; --ink-soft: #d5d5d5;
  --secondary: #aaaeb3; --hairline: #303236; --hairline-strong: #50545a;
  --link: #8ac0ff; --focus: #8ac0ff;
  --theme-header: rgba(16,17,18,.88); --theme-on-ink: #111111; --theme-ink-hover: #d5d5d5;
  --theme-muted: #9c9fa4; --theme-grid: rgba(255,255,255,.055);
  --theme-dots: #484b50; --theme-core-shadow: rgba(255,255,255,.055);
  --theme-stage: #1b1d20; --theme-contact: #08090a;
  --shadow-soft: 0 2px 8px rgba(0,0,0,.15); --shadow-window: 0 12px 48px rgba(0,0,0,.3);
}

::selection { background: var(--ink); color: var(--canvas); }
.site-header { background: var(--theme-header); }
.button--ink, .skip-link { color: var(--theme-on-ink); }
.button--ink:hover { background: var(--theme-ink-hover); }
.button--ghost:hover { background: var(--surface); }
.button--light { color: #111; }
.hero__muted { color: var(--theme-muted); }
.system__bar, .stage { background: var(--surface); }
.system__dots i { background: var(--theme-dots); }
.stage--core { box-shadow: 0 0 0 4px var(--theme-core-shadow); }
.system__panel::before { background-image: linear-gradient(to right, var(--theme-grid) 1px, transparent 1px), linear-gradient(to bottom, var(--theme-grid) 1px, transparent 1px); }
.contact { background: var(--theme-contact); }
:root[data-theme="dark"] .case__stage { background: var(--theme-stage); }

.theme-toggle:not([hidden]) { display: inline-flex; }
.theme-toggle {
  flex: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 1px solid var(--hairline);
  border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); border-color: var(--hairline-strong); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-moon { display: none; }
@media (max-width: 47.99rem) {
  .theme-toggle { order: 2; }
  .site-nav { order: 3; }
}
@media (max-width: 22.49rem) {
  .site-header__inner { padding-inline: 1rem; gap: .25rem; }
  .site-header .brand { gap: .375rem; }
  .site-header .brand__word { font-size: .9375rem; }
  .site-header .brand__mark { width: 1.5rem; height: 1.5rem; }
}
@media print { .theme-toggle { display: none !important; } }
