:root {
    --theme-switch-x: 50vw;
    --theme-switch-y: 50vh;
    --theme-switch-radius: 0px;
    --theme-switch-duration: 620ms;
    --theme-switch-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition:
        background-color 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        clip-path 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switch-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    clip-path: circle(0px at var(--theme-switch-x) var(--theme-switch-y));
    transition:
        clip-path var(--theme-switch-duration) var(--theme-switch-ease),
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-switch-layer::before {
    content: '';
    position: absolute;
    inset: -10%;
    opacity: 0.9;
    transform: scale(0.9);
    transition: transform var(--theme-switch-duration) var(--theme-switch-ease);
}

.theme-switch-layer[data-target='dark'] {
    background:
        radial-gradient(circle at 18% 18%, rgba(53, 179, 168, 0.20), transparent 22%),
        radial-gradient(circle at 82% 14%, rgba(224, 146, 33, 0.14), transparent 16%),
        linear-gradient(180deg, rgba(3, 3, 3, 0.94) 0%, rgba(10, 10, 10, 0.98) 100%);
}

.theme-switch-layer[data-target='dark']::before {
    background:
        radial-gradient(circle at var(--theme-switch-x) var(--theme-switch-y), rgba(83, 233, 218, 0.28), transparent 18%),
        radial-gradient(circle at var(--theme-switch-x) var(--theme-switch-y), rgba(53, 179, 168, 0.16), transparent 34%);
}

.theme-switch-layer[data-target='light'] {
    background:
        radial-gradient(circle at 18% 18%, rgba(15, 118, 110, 0.16), transparent 22%),
        radial-gradient(circle at 82% 14%, rgba(245, 158, 11, 0.14), transparent 16%),
        linear-gradient(180deg, rgba(248, 251, 250, 0.96) 0%, rgba(241, 246, 243, 0.98) 100%);
}

.theme-switch-layer[data-target='light']::before {
    background:
        radial-gradient(circle at var(--theme-switch-x) var(--theme-switch-y), rgba(255, 255, 255, 0.50), transparent 16%),
        radial-gradient(circle at var(--theme-switch-x) var(--theme-switch-y), rgba(15, 118, 110, 0.14), transparent 32%);
}

.theme-switch-layer.is-active {
    opacity: 1;
    clip-path: circle(var(--theme-switch-radius) at var(--theme-switch-x) var(--theme-switch-y));
}

.theme-switch-layer.is-active::before {
    transform: scale(1);
}

.is-theme-triggered {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 16px 36px rgba(18, 42, 35, 0.14);
}

@media (prefers-reduced-motion: reduce) {
    .theme-switch-layer {
        display: none;
    }
}
