/* ==========================================================================
   WEBPOT CINEMATIC PRELOADER
   0–100% Counter Entry with Clip-Path Curtain Wipe Reveal
   ========================================================================== */

/* ---- Overlay Container ---- */
.preloader-overlay {
    position: fixed;
    inset: 0;
    background: #050508;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: clip-path 0.9s cubic-bezier(0.77, 0, 0.175, 1);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.preloader-overlay.finished {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    pointer-events: none;
}

/* ---- Counter Typography ---- */
.preloader-counter-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.15em;
    user-select: none;
}

.preloader-counter-num {
    font-family: 'Space Grotesk', 'DM Sans', monospace;
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.preloader-counter-symbol {
    font-family: 'Space Grotesk', monospace;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1;
}

/* ---- Progress Bar ---- */
.preloader-bar {
    width: min(280px, 60vw);
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.preloader-bar .fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #38bdf8, #a855f7, #38bdf8);
    background-size: 200% 100%;
    border-radius: 999px;
    transition: width 0.08s linear;
    animation: preloaderShimmer 2s linear infinite;
}

@keyframes preloaderShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Brand Label ---- */
.preloader-brand {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-top: 1rem;
}

/* ---- Body Lock During Load ---- */
body.preloader-active {
    overflow: hidden !important;
}

/* ---- Accessibility: Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .preloader-overlay {
        transition: opacity 0.3s ease;
        clip-path: none;
    }
    .preloader-overlay.finished {
        opacity: 0;
        clip-path: none;
    }
    .preloader-bar .fill {
        animation: none;
    }
}
