/* ═══════════════════════════════════════════════════════════════
   WIN AGENCY — LOADER / PRELOADER CSS
   White theme · High-contrast · Flat design
   Montserrat (logo) · Inter (body)
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&display=swap');


/* ── BODY LOCK WHILE LOADER ACTIVE ────────────────────────── */
body.loader-active {
    overflow: hidden;
}


/* ══════════════════════════════════════════════════════════════
   #loader — THE LOADER SHELL
   Covers the full viewport. Starts at circle(100%) [=full screen]
   and collapses to circle(0%) via GSAP to reveal the site.
   ══════════════════════════════════════════════════════════════ */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;

    /* Full-screen circle — GSAP collapses this to 0% */
    clip-path: circle(150% at 50% 50%);

    /* GPU layer for smooth clip-path animation */
    will-change: clip-path;
    pointer-events: all;
}


/* ══════════════════════════════════════════════════════════════
   .loader-content — CENTERED STACK
   ══════════════════════════════════════════════════════════════ */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    /* Subtle upward optical offset */
    transform: translateY(-5vh);
}


/* ══════════════════════════════════════════════════════════════
   .loader-logo — WIN WORDMARK
   ══════════════════════════════════════════════════════════════ */
.loader-logo {
    font-family: 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(3.5rem, 14vw, 7.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: #0a0a0a;
    margin: 0;
    -webkit-user-select: none;
    user-select: none;

    /* Draw-in animation — from invisible to full opacity */
    animation: ld-logo-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Blue accent on the "W" */
.loader-w {
    color: #007AFF;
}

/* Shimmer underline beneath WIN */
.loader-logo::after {
    content: '';
    display: block;
    width: 60%;
    height: 2px;
    margin: 0.5rem auto 0;
    background: linear-gradient(90deg, transparent, #007AFF 40%, #5856D6, transparent);
    border-radius: 2px;
    transform: scaleX(0);
    animation: ld-bar-in 0.7s 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ld-logo-in {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ld-bar-in {
    to {
        transform: scaleX(1);
    }
}


/* ══════════════════════════════════════════════════════════════
   .progress-container — THIN TRACK BAR
   ══════════════════════════════════════════════════════════════ */
.progress-container {
    width: clamp(220px, 38vw, 360px);
    height: 2px;
    background: #ebebf0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;

    /* Fade in slightly after logo */
    opacity: 0;
    animation: ld-fade-in 0.4s 0.3s ease-out forwards;
}

/* ── Fill — GSAP drives the width via JS ── */
.progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #007AFF 0%, #5856D6 100%);
    border-radius: 2px;
    will-change: width;
    /* Shimmer travelling highlight */
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 50px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65));
    animation: ld-shimmer 1.1s linear infinite;
}

@keyframes ld-shimmer {
    from {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}


/* ══════════════════════════════════════════════════════════════
   #percent — PERCENTAGE COUNTER TEXT
   ══════════════════════════════════════════════════════════════ */
#percent {
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    font-weight: 700;
    color: #0a0a0a;
    letter-spacing: 0.05em;
    margin: 0;
    min-width: 4ch;
    text-align: center;

    opacity: 0;
    animation: ld-fade-in 0.4s 0.4s ease-out forwards;
}

@keyframes ld-fade-in {
    to {
        opacity: 1;
    }
}


/* ══════════════════════════════════════════════════════════════
   #main-content — HIDDEN UNTIL LOADER IRIS OPENS
   ══════════════════════════════════════════════════════════════ */
#main-content {
    visibility: hidden;
}

/* Applied by loader.js onComplete — also used by safety fallback */
#main-content.is-revealed,
body:not(.loader-active) #main-content {
    visibility: visible;
}


/* ══════════════════════════════════════════════════════════════
   PAGE-TRANSITION SUPPRESSION ON HOME PAGE
   (pre-loader owns the first reveal; exit wipes are re-enabled
    by loader.js after animation completes)
   ══════════════════════════════════════════════════════════════ */
.pt-home-suppressed {
    display: none;
}

.pt-home-suppressed.pt-ready {
    display: block;
}


/* ══════════════════════════════════════════════════════════════
   AMBIENT BACKGROUND BLOBS — optional CSS-only texture
   ══════════════════════════════════════════════════════════════ */
.pl-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: ld-blob-drift 9s ease-in-out infinite alternate;
}

.pl-blob--a {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.055), transparent 70%);
    top: -12%;
    left: -10%;
}

.pl-blob--b {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(88, 86, 214, 0.05), transparent 70%);
    bottom: -10%;
    right: -6%;
    animation-delay: -4s;
}

@keyframes ld-blob-drift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(18px, -16px) scale(1.06);
    }
}

/* Content above blobs */
.loader-content {
    position: relative;
    z-index: 1;
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .loader-logo {
        font-size: 2.8rem;
    }

    .progress-container {
        width: 80vw;
    }

    .loader-content {
        transform: translateY(-3vh);
        gap: 1.1rem;
    }

    #main-content {
        padding: 0 15px;
    }
}

@media (max-width: 360px) {
    .loader-logo {
        font-size: 2.2rem;
    }
}