:root {
  color-scheme: dark;
  --page-bg: #0a0e12;
  --surface: #0d1319;
  --surface-soft: #0b1016;
  --surface-raised: #0f151c;
  --surface-deep: #080b0e;
  --text: #e8edf2;
  --text-muted: #aab4bf;
  --text-secondary: #8a95a1;
  --text-subtle: #778394;
  --text-code: #c6cdd5;
  --accent: #0292cb;
  --accent-link: #4fc3ef;
  --accent-link-hover: #7fd0f0;
  --accent-hover: #33b5e6;
  --on-accent: #04121a;
  --border: rgba(255, 255, 255, .09);
  --border-soft: rgba(255, 255, 255, .07);
  --border-faint: rgba(255, 255, 255, .06);
  --border-08: rgba(255, 255, 255, .08);
  --border-10: rgba(255, 255, 255, .1);
  --border-12: rgba(255, 255, 255, .12);
  --border-15: rgba(255, 255, 255, .15);
  --border-strong: rgba(255, 255, 255, .2);
  --grid: rgba(255, 255, 255, .035);
  --accent-border: rgba(2, 146, 203, .4);
  --accent-tint: rgba(2, 146, 203, .07);
  --accent-tint-strong: rgba(2, 146, 203, .12);
  --shadow: rgba(0, 0, 0, .5);
  --shadow-soft: rgba(0, 0, 0, .45);
}

:root[data-theme="light"] {
  color-scheme: light;
  --page-bg: #f6f9fc;
  --surface: #fff;
  --surface-soft: #f0f5f9;
  --surface-raised: #eaf1f6;
  --surface-deep: #e5eef5;
  --text: #182733;
  --text-muted: #4a5d6b;
  --text-secondary: #526574;
  --text-subtle: #5b6e7d;
  --text-code: #2d4352;
  --accent: #0876a8;
  --accent-link: #075f8d;
  --accent-link-hover: #044d74;
  --accent-hover: #0a6590;
  --on-accent: #fff;
  --border: rgba(22, 46, 66, .14);
  --border-soft: rgba(22, 46, 66, .11);
  --border-faint: rgba(22, 46, 66, .08);
  --border-08: rgba(22, 46, 66, .12);
  --border-10: rgba(22, 46, 66, .16);
  --border-12: rgba(22, 46, 66, .18);
  --border-15: rgba(22, 46, 66, .21);
  --border-strong: rgba(22, 46, 66, .25);
  --grid: rgba(22, 46, 66, .07);
  --accent-border: rgba(8, 118, 168, .38);
  --accent-tint: rgba(8, 118, 168, .08);
  --accent-tint-strong: rgba(8, 118, 168, .14);
  --shadow: rgba(22, 46, 66, .16);
  --shadow-soft: rgba(22, 46, 66, .12);
}

.theme-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 0;
  background: transparent;
  color: var(--accent-link);
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.theme-toggle:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-link);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .theme-moon,
:root[data-theme="light"] .theme-toggle .theme-sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .theme-moon {
  display: block;
}

@media (max-width: 860px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}
