/* Preloader Wrapper */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Logo Container */
.preloader-logo-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Floating Logo Animation */
.preloader-logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
    animation: float 4s ease-in-out infinite, fadeInLogo 0.5s ease-out forwards;
    opacity: 0;
    /* Starts hidden but fades in instantly once CSS loads */
    will-change: transform, opacity;
}

/* Soft Glow Effect */
.preloader-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: pulseGlow 4s ease-in-out infinite;
}

/* Keyframes */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
        filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    }

    50% {
        transform: translateY(-20px);
        filter: drop-shadow(0 25px 30px rgba(0, 0, 0, 0.1));
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes fadeInLogo {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide content until loaded to avoid flash */
body.loading {
    overflow: hidden;
}

body.loading section,
body.loading div:not(#preloader) {
    opacity: 0;
}