/* ============================================================
   Preloader — fullscreen overlay with animated logo
   Pairs with logo_animated.css for the SVG fill animations
   ============================================================ */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #101828; /* brand dark */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 99999;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.preloader--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Prevent body scroll while preloader is active */
body.preloader-active {
    overflow: hidden;
}

/* Logo container — smooth reveal: scale up + fade in */
.preloader__logo-container {
    animation: preloader-reveal 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes preloader-reveal {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Logo sizing — nascode wordmark (wide aspect ratio) */
.preloader__logo {
    width: 160px;
    height: auto;
    display: block;
}

/* Larger logo on wider screens */
@media (min-width: 768px) {
    .preloader__logo {
        width: 220px;
    }
}

/* Pulsing dots beneath the logo */
.preloader__dots {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.preloader__dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #f3ece1; /* cream, matches recolored logo */
    opacity: 0.35;
    animation: preloader-dot 1.4s ease-in-out infinite both;
}

.preloader__dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.preloader__dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes preloader-dot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .preloader__logo-container { animation: none; }
    .preloader__dots span { animation: none; opacity: 0.7; }
}
