/* Dark is the default, including when JavaScript or storage is unavailable. */
:root {
  color-scheme: light;
  --header-bg: rgba(245, 245, 247, 0.88);
  --nav-hover: rgba(0, 0, 0, 0.06);
  --glass-bg: rgba(255, 255, 255, 0.82);
  --card-border: rgba(255, 255, 255, 0.8);
  --link-color: #0071e3;
}

:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #101218;
  --surface: #1b1f29;
  --surface-soft: #151922;
  --ink: #f2f4f8;
  --ink-soft: #c6cbd6;
  --muted: #a6aebf;
  --line: rgba(255, 255, 255, 0.14);
  --text: var(--ink);
  --border: var(--line);
  --accent: #80bcff;
  --header-bg: rgba(16, 18, 24, 0.92);
  --nav-hover: rgba(255, 255, 255, 0.09);
  --glass-bg: rgba(27, 31, 41, 0.9);
  --card-border: rgba(255, 255, 255, 0.12);
  --link-color: #80bcff;
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 10px 34px rgba(0, 0, 0, 0.22);
}

.site-header { background: var(--header-bg); border-bottom-color: var(--line, var(--border)); }
.nav-controls { display: flex; align-items: center; gap: 6px; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line, var(--border));
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink, var(--text));
  font: 24px/1 system-ui, sans-serif;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--nav-hover); }
.theme-toggle:focus-visible { outline: 3px solid var(--link-color); outline-offset: 3px; }
.theme-toolbar { display: flex; justify-content: flex-end; max-width: 1180px; margin: 16px auto 0; padding: 0 22px; }

:root:not([data-theme="light"]) .nav-links a { color: var(--ink-soft); }
:root:not([data-theme="light"]) .nav-links a:hover,
:root:not([data-theme="light"]) .nav-links a.active { background: var(--nav-hover); color: var(--ink); }
:root:not([data-theme="light"]) .nav-links a.cta { color: white; }
:root:not([data-theme="light"]) .button.secondary { background: var(--nav-hover); color: var(--ink); }
:root:not([data-theme="light"]) .button.secondary:hover { background: rgba(255, 255, 255, 0.16); }
:root:not([data-theme="light"]) .eyebrow,
:root:not([data-theme="light"]) .status-pill { color: #9fcfff; background: rgba(74, 151, 255, 0.15); }
:root:not([data-theme="light"]) .status-pill-warm { color: #ffd296; background: rgba(255, 159, 10, 0.15); }
:root:not([data-theme="light"]) .kicker,
:root:not([data-theme="light"]) .contact-link,
:root:not([data-theme="light"]) .product-number,
:root:not([data-theme="light"]) .text-link,
:root:not([data-theme="light"]) .resource-panel a { color: var(--link-color); }
:root:not([data-theme="light"]) .logo-card:not(.dark),
:root:not([data-theme="light"]) .policy-item,
:root:not([data-theme="light"]) .contact-card,
:root:not([data-theme="light"]) .contact-block,
:root:not([data-theme="light"]) .disclosure-notes { background: var(--surface); }
:root:not([data-theme="light"]) .footer { background: var(--surface-soft); }
:root:not([data-theme="light"]) .skip-link { background: var(--ink); color: var(--bg); }
:root:not([data-theme="light"]) .store-badge { background: #080a0f; color: #fff; border-color: #8d96a8; }
:root:not([data-theme="light"]) .separator::before,
:root:not([data-theme="light"]) .separator::after { background: var(--line); }
:root:not([data-theme="light"]) .product-visual,
:root:not([data-theme="light"]) .product-hero-art::before {
  background: radial-gradient(circle at 25% 15%, rgba(67, 143, 240, 0.23), transparent 55%),
    linear-gradient(135deg, #192a40, #302940 55%, #243c3b);
}
:root:not([data-theme="light"]) .spellsides-gallery figure { background: var(--surface); }

@media (max-width: 760px) {
  .nav { gap: 10px; }
  :root:not([data-theme="light"]) .nav-links { background: var(--surface); }
}

@media print {
  :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #fff;
    --surface: #fff;
    --surface-soft: #fff;
    --ink: #1d1d1f;
    --ink-soft: #424245;
    --muted: #5f6368;
    --line: #d8dce2;
    --accent: #0b57d0;
    --link-color: #0b57d0;
  }
  .theme-toggle, .theme-toolbar { display: none; }
}
