/*
 * The loader is HIDDEN by default.
 * JS adds 'is-visible' when navigating between pages (outgoing navigation).
 * On arrival it removes 'is-visible' once the page is ready.
 */
.infinity-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* 10% black background overlay */
    background: rgba(0, 0, 0, 0.10);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    /* Hidden by default; safe fallback so page never blocks */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
}

/* Shown during navigation or while initial load is in progress */
.infinity-loader-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Explicitly hidden once done */
.infinity-loader-overlay.is-done {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

.infinity-loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: infinityWrapperPulse 2.4s ease-in-out infinite;
}

.infinity-svg {
    overflow: visible;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1));
}

.infinity-track {
    stroke: rgba(0, 0, 0, 0.12);
    stroke-width: 5;
}

.infinity-path-main {
    stroke: #000000;
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 140 320;
    stroke-dashoffset: 460;
    animation: infinityFlow 1.6s cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.infinity-loader-brand {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 5px;
    color: #000000;
    text-transform: uppercase;
    margin-top: 6px;
    opacity: 0.85;
    animation: infinityTextFade 1.6s ease-in-out infinite alternate;
}

@keyframes infinityFlow {
    0% {
        stroke-dashoffset: 460;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes infinityWrapperPulse {

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

    50% {
        transform: scale(1.04);
    }
}

@keyframes infinityTextFade {
    0% {
        opacity: 0.35;
        letter-spacing: 4px;
    }

    100% {
        opacity: 0.95;
        letter-spacing: 6px;
    }
}