/* Sun / black hole theme toggle — photoreal SVG cores, no chrome */

.theme-cosmos {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease;
}

.theme-cosmos:hover .theme-cosmos__art {
  filter: brightness(1.06) saturate(1.05);
}

.theme-cosmos:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 50%;
}

.theme-cosmos:active {
  transform: scale(0.94);
}

.theme-cosmos__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.theme-cosmos__body {
  position: absolute;
  inset: 0;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    filter 0.4s ease;
}

.theme-cosmos__art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

html[data-theme="dark"] .theme-cosmos__body--sun,
html[data-theme="light"] .theme-cosmos__body--black-hole {
  opacity: 0;
  transform: scale(0.7);
  filter: blur(2px);
  pointer-events: none;
}

html[data-theme="light"] .theme-cosmos__body--sun,
html[data-theme="dark"] .theme-cosmos__body--black-hole {
  opacity: 1;
  transform: scale(1);
  filter: none;
}

/* Sun: soft corona bloom on the art */
html[data-theme="light"] .theme-cosmos__body--sun .theme-cosmos__art,
.home-sidebar__strip-theme .theme-cosmos__body--sun .theme-cosmos__art {
  filter: drop-shadow(0 0 3px rgba(255, 193, 77, 0.65))
    drop-shadow(0 0 8px rgba(255, 152, 0, 0.32));
}

/* Black hole: faint outer glow on dark UI */
html[data-theme="dark"] .theme-cosmos__body--black-hole .theme-cosmos__art,
.home-sidebar__strip-theme .theme-cosmos__body--black-hole .theme-cosmos__art {
  filter: drop-shadow(0 0 3px rgba(255, 183, 77, 0.22))
    drop-shadow(0 0 6px rgba(126, 92, 255, 0.18));
}

.theme-cosmos.theme-toggle--panel .theme-cosmos__stage {
  width: 36px;
  height: 36px;
}

html.theme-cosmos--transitioning .theme-cosmos .theme-cosmos__stage {
  animation: theme-cosmos-pulse 0.4s ease;
}

@keyframes theme-cosmos-pulse {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-cosmos__body {
    transition: none;
    animation: none;
  }

  html.theme-cosmos--transitioning .theme-cosmos .theme-cosmos__stage {
    animation: none;
  }
}
