/* Clean Card Elevation */
/* No border: the popup is defined by layered shadow instead.
    Tight contact shadow for a crisp edge, deeper ambient shadow for lift,
    and a soft Karmo-green glow so the edge still reads against the dark backdrop. */
.karmo-card {
    background: #FFFFFF;
    border: none;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.30),
        0 16px 32px -6px rgba(0, 0, 0, 0.50),
        0 40px 90px -12px rgba(0, 0, 0, 0.65),
        0 0 70px -8px rgba(0, 174, 142, 0.40);
}

/* Custom smooth scrollbar for mobile modal body */
.mobile-modal-scroll::-webkit-scrollbar {
    width: 4px;
}

.mobile-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 174, 142, 0.25);
    border-radius: 4px;
}

/* Left-to-right letter-by-letter gradient text sweep (3.3s) */
.animated-headline {
    background: linear-gradient(90deg,
            #00AE8E 0%,
            #00AE8E 50%,
            #0f172a 50.1%,
            #0f172a 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textSweep 3.3s cubic-bezier(0.25, 1, 0.5, 1) 0.65s forwards;
}

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

    100% {
        background-position: 0% 0;
    }
}

/* Subtle shimmer effect on primary CTA */
.shimmer-btn {
    position: relative;
    overflow: hidden;
}

.shimmer-btn::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0,
            rgba(255, 255, 255, 0.25) 20%,
            rgba(255, 255, 255, 0.5) 60%,
            rgba(255, 255, 255, 0));
    animation: shimmer 3s infinite;
}

/* Standard dismiss transition */
.popup-leave-active {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
    transition: all 0.25s ease-in;
}

/* Intro length. Set from CONFIG.UTE_INTRO_MS in the script, this is only the fallback. */
:root {
    --ute-intro-duration: 4800ms;
}

/* ========================================================================= */
/* POPUP UTE REAR-TOW INTRO SEQUENCE (Tightly Coupled Convoy Physics) */
/* ========================================================================= */

/* 1. Entire Convoy (Popup Ute + Tow Strap + Popup) Enters from Off-Screen Left */
@keyframes convoyTowedIn {
    0% {
        transform: translate3d(-135vw, 0, 0);
        opacity: 0.96;
    }

    62% {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }

    74% {
        transform: translate3d(10px, 0, 0);
    }

    85% {
        transform: translate3d(-3px, 0, 0);
    }

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

/* 2. Popup Ute Unhitches from Rear Tow and Rockets Off-Screen to the Right */
@keyframes popupUteRocketExit {

    0%,
    62% {
        /* Holds tight towing position directly ahead of the modal */
        transform: translate3d(0, 0, 0);
    }

    72% {
        /* Engine rev & slight backward chassis flex before launch */
        transform: translate3d(-8px, 0, 0);
    }

    80% {
        /* Initial wheelspin takeoff */
        transform: translate3d(80px, 0, 0);
    }

    100% {
        /* Blasts completely off the right edge of the screen */
        transform: translate3d(140vw, 0, 0);
    }
}

/* 3. Rear Tow Strap Release & Recoil */
@keyframes towStrapRelease {

    0%,
    64% {
        opacity: 1;
        transform: scaleX(1);
    }

    72% {
        /* Snaps loose and drops */
        opacity: 0.9;
        transform: scaleX(0.7) rotate(8deg) translateY(6px);
    }

    80%,
    100% {
        opacity: 0;
        transform: scaleX(0) translateY(16px);
    }
}

/* 4. Light motion blur on the ute as it launches */
@keyframes popupUteSpeedBlur {

    0%,
    74% {
        filter: blur(0);
    }

    88%,
    100% {
        filter: blur(1.5px);
    }
}

.animate-popup-ute-exit #popupUtePhotoWrap {
    animation: popupUteSpeedBlur var(--ute-intro-duration) ease-in forwards;
}

/* 5. Spinning wheels: cut-outs of each wheel laid over the photo and rotated by script */
.popup-ute-wheel {
    position: absolute;
    z-index: 20;
    width: 13.043%;
    height: auto;
    pointer-events: none;
    user-select: none;
    will-change: transform;
}

/* Animation Classes */
.animate-convoy-in {
    animation: convoyTowedIn var(--ute-intro-duration) cubic-bezier(0.22, 0.9, 0.36, 1) forwards;
    will-change: transform;
}

.animate-popup-ute-exit {
    animation: popupUteRocketExit var(--ute-intro-duration) cubic-bezier(0.22, 0.9, 0.36, 1) forwards;
    will-change: transform;
}

.animate-tow-release {
    animation: towStrapRelease var(--ute-intro-duration) ease-out forwards;
    transform-origin: left center;
    will-change: transform, opacity;
}