/* Theme toggle (minimal, cleaned) */
#theme-toggle {
    --size: 40px;
    width: var(--size);
    height: var(--size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 1.15rem;
    color: var(--accent-2);
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s, box-shadow .25s, transform .25s;
}

:root.light #theme-toggle {
    color: var(--accent);
}

#theme-toggle:hover,
#theme-toggle:focus-visible {
    background: var(--card);
    box-shadow: 0 3px 10px -2px rgba(0, 0, 0, .45);
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

#theme-toggle:active {
    transform: scale(.9);
}

#theme-toggle .icon {
    transition: opacity .28s ease, transform .32s cubic-bezier(.4, .8, .3, 1);
    display: inline-block;
    will-change: transform, opacity;
}

/* micro keyframe for crisp pop */
@keyframes iconPop {
    0% {
        transform: scale(.55) rotate(-20deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.15) rotate(6deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

#theme-toggle .icon.swap {
    animation: iconPop .42s cubic-bezier(.55, 1.4, .4, 1) both;
}