/* ============================================
   Loader — Animated Logo
   ============================================ */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loader);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Logo Spinner */
.loader-logo-container {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    margin-bottom: var(--space-lg);
    position: relative;
    animation: logoPulse 2s ease-in-out infinite;
}

.loader-logo {
    display: block;
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0, 140, 160, 0.6));
}

/* Orbital ring around logo */
.loader-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 96px;
    height: 96px;
    margin-top: -48px;
    margin-left: -48px;
    border: 1px solid rgba(0, 140, 160, 0.25);
    border-radius: 50%;
    animation: orbitSpin 3s linear infinite;
    pointer-events: none;
}

.loader-orbit::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--color-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-secondary);
}

.loader-text {
    font-size: var(--text-h2);
    font-weight: var(--weight-bold);
    color: var(--color-white);
    letter-spacing: -0.02em;
    animation: textFadeIn 0.8s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.loader-subtitle {
    font-size: var(--text-small);
    color: var(--color-neutral);
    margin-top: var(--space-xs);
    animation: textFadeIn 0.8s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

/* Keyframes */
@keyframes logoPulse {
    0%, 100% { 
        transform: scale(1); 
        filter: drop-shadow(0 0 15px rgba(0, 140, 160, 0.4));
    }
    50% { 
        transform: scale(1.08); 
        filter: drop-shadow(0 0 25px rgba(0, 140, 160, 0.7));
    }
}

@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes textFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .loader-logo-container {
        animation: none;
    }
    
    .loader-orbit {
        animation: none;
    }
    
    .loader {
        transition: none;
    }
}

/* ============================================
   Pause hero entrance animations until the
   loader has finished hiding. Without this the
   animations run behind the loader overlay and
   the user never sees them.
   ============================================ */
body.preload .hero-logo-wrapper,
body.preload .title-line,
body.preload .hero-subtitle,
body.preload .hero-cta-group,
body.preload .hero-stats {
    animation: none !important;
    opacity: 0;
}
