.theme-button[data-ea-theme-switch] {
    display: grid;
    place-items: center;
    width: 46px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgb(var(--color-1));
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

html.html-auth .theme-button[data-ea-theme-switch] { display: none; }
.theme-button[data-ea-theme-switch]::before { content: none; }

.theme-button[data-ea-theme-switch]:focus-visible {
    outline: 1px solid rgb(var(--color-5));
    outline-offset: -6px;
}

.ea-theme-switch__glyph {
    position: relative;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    transition: transform 210ms cubic-bezier(.2, .8, .3, 1);
}

.theme-button:hover .ea-theme-switch__glyph { transform: scale(1.12); }
.theme-button:active .ea-theme-switch__glyph { transform: scale(.9); }

.ea-theme-switch__glyph svg {
    display: block;
    width: 100%;
    height: 100%;
}

.ea-theme-switch__glyph svg:nth-child(2),
html:not(.html-auth).dark .ea-theme-switch__glyph svg:first-child { display: none; }
html:not(.html-auth).dark .ea-theme-switch__glyph svg:nth-child(2) { display: block; }

.ea-theme-switch__drop {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 144px;
    height: 144px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.theme-pointer-merged #js-cursor,
.theme-pointer-merged .c-cursors { opacity: 0; }
.theme-pointer-merged .theme-button[data-ea-theme-switch] { cursor: none; }
.theme-pointer-merged .ea-theme-switch__glyph { transition: none; }

.theme-sheet .ea-theme-switch__glyph { view-transition-name: ea-theme-glyph; }

.theme-sheet::view-transition-group(root),
.theme-sheet::view-transition-old(root),
.theme-sheet::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

.theme-sheet::view-transition-new(root) {
    animation: ea-theme-sheet 500ms cubic-bezier(.42, 0, .26, 1) both;
}

.theme-sheet::view-transition-group(ea-theme-glyph) {
    animation: none;
    z-index: 1;
}

.theme-sheet::view-transition-old(ea-theme-glyph) {
    animation: ea-theme-glyph-out 160ms ease-in both;
    mix-blend-mode: normal;
}

.theme-sheet::view-transition-new(ea-theme-glyph) {
    animation: ea-theme-glyph-in 325ms cubic-bezier(.18, .76, .27, 1) 75ms both;
    mix-blend-mode: normal;
}

@keyframes ea-theme-glyph-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(1.18, .54); }
}

@keyframes ea-theme-glyph-in {
    0% { opacity: 0; transform: scale(.66, .48); }
    56% { opacity: 1; transform: scale(1.12, 1.22); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes ea-theme-sheet {
    0% { clip-path: ellipse(10px 7px at var(--ea-theme-x) var(--ea-theme-y)); }
    22% { clip-path: ellipse(28px 19px at var(--ea-theme-x) var(--ea-theme-y)); }
    100% {
        clip-path: ellipse(var(--ea-theme-radius) var(--ea-theme-radius) at var(--ea-theme-x) var(--ea-theme-y));
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-button[data-ea-theme-switch] .ea-theme-switch__glyph { transition: none; }
    .theme-button:hover .ea-theme-switch__glyph,
    .theme-button:active .ea-theme-switch__glyph { transform: none; }
}
