:root[data-theme="light"] {
  color-scheme: light;
  --color-void-canvas: #f3f9ff;
  --color-midnight-surface: #fff;
  --color-deep-indigo: #e1f0ff;
  --color-lilac-white: #0c243c;
  --color-ash: #344f68;
  --color-fog: #465f78;
  --color-steel: #627d98;
  --color-lavender-accent: #0044b8;
  --color-cosmic-gradient: #0056c0;
  --gradient-cosmic-gradient: linear-gradient(95deg, #006b9b, #0044b8);
  --color-border-default: #cbddeb;
  --color-border-control: #8da9bf;
  --shadow-lg: 0 8px 30px rgb(0 47 130 / 8%);
  --shadow-lg-2: 0 12px 36px rgb(0 47 130 / 10%);
  --shadow-md: 0 3px 12px rgb(0 47 130 / 10%);
}

[data-theme="light"] .nav-shell {
  background: rgb(255 255 255 / 92%);
}

[data-theme="light"] .button.primary {
  background: #0044b8;
  border-color: #0044b8;
  color: white;
}

[data-theme="light"] .button.primary:hover { background: #002f82; }
[data-theme="light"] .button.secondary .icon-arrow,
[data-theme="light"] .text-link .icon-arrow,
[data-theme="light"] .card-top > img,
[data-theme="light"] .demo-pane-heading img {
  filter: brightness(0) saturate(100%) invert(24%) sepia(45%) saturate(1840%) hue-rotate(189deg);
}

[data-theme="light"] .signal-scrim {
  background: linear-gradient(180deg, transparent, rgb(243 249 255 / 75%));
}

[data-theme="light"] .star-field { filter: brightness(.4) sepia(1) hue-rotate(162deg); opacity: .2; }
[data-theme="light"] .star-field-distant { opacity: .1; }

.theme-switch {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.theme-track {
  position: relative;
  display: block;
  width: 100%;
  height: 32px;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(120deg, #061b36, #103a65);
  box-shadow: inset 0 0 0 1px rgb(136 211 255 / 36%), inset 0 2px 8px rgb(0 0 0 / 45%);
}

.theme-track::before,
.theme-track::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: opacity .45s ease;
}

.theme-track::before {
  background: radial-gradient(circle at 60% 28%, #e5f8ff 1px, transparent 1.8px),
    radial-gradient(circle at 79% 60%, #a5dfff 1px, transparent 1.8px),
    radial-gradient(circle at 91% 29%, #d1f1ff 1px, transparent 1.8px);
}

.theme-track::after {
  background: radial-gradient(ellipse at 25% 100%, white 0 14%, transparent 16%),
    radial-gradient(ellipse at 15% 92%, white 0 9%, transparent 11%),
    linear-gradient(125deg, #b8d8ff, #fff0c7);
  opacity: 0;
}

.theme-orb {
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #ebfaff;
  border-radius: 50%;
  background: linear-gradient(145deg, #137ab4, #0c315f);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 40%), 0 0 12px #18b7fb80;
  transition: left .48s cubic-bezier(.2,.85,.25,1.12), background .3s, box-shadow .3s;
}

.theme-orb svg {
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  transition: transform .48s ease, opacity .32s ease;
}

.theme-sun { opacity: 0; transform: rotate(-70deg) scale(.6); }
[aria-checked="true"] .theme-track::before { opacity: 0; }
[aria-checked="true"] .theme-track::after { opacity: 1; }
[aria-checked="true"] .theme-orb {
  left: calc(100% - 29px);
  background: linear-gradient(145deg, #fff9d9, #ffd269);
  color: #744106;
  box-shadow: inset 0 0 0 1px #fff9dc, 0 0 12px #ffbe45b0;
}
[aria-checked="true"] .theme-moon { opacity: 0; transform: rotate(70deg) scale(.6); }
[aria-checked="true"] .theme-sun { opacity: 1; transform: none; }
.theme-switch:hover .theme-track { filter: brightness(1.12); }

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) { z-index: 1; }

@media (max-width: 359px) {
  .theme-switch { width: 54px; }
  .nav .brand { gap: 5px; }
  .nav .brand-mark { width: 27px; height: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-track::before, .theme-track::after, .theme-orb, .theme-orb svg { transition: none; }
}
