/* ═══ Animated Theme Toggle — Sun/Moon morph ═══ */
.theme-toggle-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
}
.theme-toggle-wrap button {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--stage);
  color: var(--ink);
  transition: background var(--ease-fast);
  overflow: hidden;
}
.theme-toggle-wrap button:hover { background: var(--surface-2); }

.toggle-icon {
  position: relative;
  width: 22px;
  height: 22px;
}
.toggle-icon svg {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  transition: opacity 400ms var(--ease), transform 500ms var(--ease);
}
/* Sun visible in light mode */
.toggle-icon .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.toggle-icon .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}
/* Moon visible in dark mode */
[data-mode="dark"] .toggle-icon .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}
[data-mode="dark"] .toggle-icon .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .toggle-icon svg { transition: none !important; }
}
