/* Night/day switch between the résumé (night) and the Disney trivia app (day). */
.world-switch {
  --night: #1a1f45;
  --day: #8cc3ec;
  --frame: #3a4080;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ws-track {
  position: relative;
  display: block;
  flex: none;
  width: 40px;
  height: 20px;
  background: var(--night);
  box-shadow:
    0 -2px 0 0 var(--frame),
    0 2px 0 0 var(--frame),
    -2px 0 0 0 var(--frame),
    2px 0 0 0 var(--frame);
  transition: background-color 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
.ws-track img {
  position: absolute;
  top: 5px;
  width: 10px;
  height: 10px;
  image-rendering: pixelated;
}
.ws-moon { left: 5px; }
.ws-sun { right: 5px; }
.ws-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #ece6d6;
  box-shadow: inset -2px -2px 0 0 #b9b19c;
  transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}
/* Night: knob rests on the moon, the sun shows where the switch goes. */
.world-switch .ws-moon { opacity: 0; }
.world-switch.is-day .ws-track { background: var(--day); }
.world-switch.is-day .ws-knob { transform: translateX(20px); }
.world-switch.is-day .ws-moon { opacity: 1; }
.world-switch.is-day .ws-sun { opacity: 0; }
/* Flipping on click, just before the page changes. */
.world-switch.is-going .ws-track { background: var(--day); }
.world-switch.is-going .ws-knob { transform: translateX(20px); }
.world-switch.is-day.is-going .ws-track { background: var(--night); }
.world-switch.is-day.is-going .ws-knob { transform: translateX(0); }
.world-switch:active .ws-knob { width: 16px; }
.world-switch.is-day:active .ws-knob { margin-left: -2px; }
.world-switch:focus-visible {
  outline: 2px solid #e3b55b;
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .ws-track, .ws-knob { transition: none; }
}

/* Disney page: the switch sits in its own row above the app. */
.ws-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: max(12px, env(safe-area-inset-top));
}
.ws-bar .world-switch { font-weight: 700; color: var(--muted); }
