:root {
  color-scheme: dark;
  --page-bg: #171717;
  --page-bg-alt: #232323;
  --page-bg-soft: #333333;
  --page-text: #f4f4f5;
  --page-text-muted: rgba(244, 244, 245, 0.78);
  --page-text-soft: rgba(244, 244, 245, 0.68);
  --page-border: rgba(255, 255, 255, 0.12);
  --page-border-strong: rgba(255, 255, 255, 0.2);
  --page-card: rgba(255, 255, 255, 0.05);
  --page-card-strong: rgba(255, 255, 255, 0.08);
  --page-button: #555555;
  --page-button-hover: #777777;
  --page-accent: #2563eb;
  --page-accent-hover: #1d4ed8;
  --page-link: #ffffff;
  --page-link-hover: #86efac;
  --page-link-visited: #d4d4d8;
  --page-shadow: rgba(0, 0, 0, 0.18);
  --page-hero-glow: rgba(37, 99, 235, 0.14);
}

:root[data-theme-effective="light"] {
  color-scheme: light;
  --page-bg: #f7f7f5;
  --page-bg-alt: #ece9e1;
  --page-bg-soft: #e2ddd3;
  --page-text: #171717;
  --page-text-muted: rgba(23, 23, 23, 0.82);
  --page-text-soft: rgba(23, 23, 23, 0.68);
  --page-border: rgba(23, 23, 23, 0.12);
  --page-border-strong: rgba(23, 23, 23, 0.18);
  --page-card: rgba(255, 255, 255, 0.7);
  --page-card-strong: rgba(255, 255, 255, 0.86);
  --page-button: #d4cec1;
  --page-button-hover: #c4bcad;
  --page-accent: #2563eb;
  --page-accent-hover: #1d4ed8;
  --page-link: #1f2937;
  --page-link-hover: #0f766e;
  --page-link-visited: #4b5563;
  --page-shadow: rgba(15, 23, 42, 0.08);
  --page-hero-glow: rgba(37, 99, 235, 0.08);
}

.theme-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--page-border);
  background: var(--page-card-strong);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px var(--page-shadow);
}

.theme-switcher-label {
  padding: 0 8px 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--page-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-switcher button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--page-text-muted);
  min-height: 34px;
  padding: 0 10px;
  font: inherit;
  cursor: pointer;
}

.theme-switcher button.is-active {
  border-color: var(--page-border-strong);
  background: var(--page-card);
  color: var(--page-text);
}

@media (max-width: 640px) {
  .theme-switcher {
    top: 10px;
    right: 10px;
    left: 10px;
    justify-content: space-between;
  }

  .theme-switcher-label {
    padding-right: 0;
  }
}
