/* Simple Fade Transition */

body {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Fade all accent-colored elements */
* {
    transition: color 0.5s ease, 
                background-color 0.5s ease, 
                border-color 0.5s ease, 
                box-shadow 0.5s ease,
                fill 0.5s ease,
                stroke 0.5s ease;
}

/* Color Spread Animation - Mobile-First Approach */
.color-spread-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.color-spread-overlay::before {
    content: '';
    position: absolute;
    top: var(--spread-y, 50%);
    left: var(--spread-x, 50%);
    width: 100px;
    height: 100px;
    margin-left: -50px;
    margin-top: -50px;
    background: radial-gradient(circle, var(--spread-color) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    will-change: transform, opacity;
}

.color-spread-overlay.spreading::before {
    animation: mobileSpread 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes mobileSpread {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    30% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(50);
    }
}

/* Desktop - Enhanced with blur */
@media (min-width: 769px) {
    .color-spread-overlay::before {
        filter: blur(40px);
    }
    
    .color-spread-overlay.spreading::before {
        animation: desktopSpread 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    
    @keyframes desktopSpread {
        0% {
            opacity: 0;
            transform: scale(0);
        }
        40% {
            opacity: 0.15;
        }
        100% {
            opacity: 0;
            transform: scale(60);
        }
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .color-spread-overlay.spreading::before {
        animation-duration: 0.2s !important;
    }
}
