/* Immersive Scroll Section */
.immersive-container {
    height: 750vh;
    position: relative;
    z-index: 10;
    margin-top: 4rem;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-phase {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

/* Ensure moved interactive sections are clickable when active */
.scroll-phase.phase-7,
.scroll-phase.phase-8 {
    pointer-events: all;
}

.immersive-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: transform 0.1s linear, opacity 0.1s linear;
    z-index: 1;
}

.immersive-video {
    background: transparent;
}

.immersive-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.immersive-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Overlay for text readability */
}

.immersive-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    opacity: 0;
    transition: transform 0.1s linear, opacity 0.1s linear, filter 0.1s linear;
    color: white;
}

.immersive-content h2 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.immersive-content p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Cursor Mockup Styles */
.cursor-mockup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    /* Hidden by default, driven by js opacity */
}

.cursor-pointer {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    position: relative;
}

.cursor-pointer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: ping 1.5s infinite;
}

.cursor-label {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Animations for specific phases */
/* These animations will be running always, but only visible when opacity > 0 */
.cursor-move-1 {
    animation: cursorPath1 8s infinite ease-in-out;
}

.cursor-move-2 {
    animation: cursorPath2 10s infinite ease-in-out;
}

.cursor-move-3 {
    animation: cursorPath3 7s infinite ease-in-out;
}

@keyframes ping {
    0% {
        width: 40px;
        height: 40px;
        opacity: 0.8;
    }

    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

@keyframes cursorPath1 {

    0%,
    100% {
        transform: translate(-100px, 100px);
    }

    25% {
        transform: translate(150px, -50px);
    }

    50% {
        transform: translate(-50px, -150px);
    }

    75% {
        transform: translate(100px, 100px);
    }
}

@keyframes cursorPath2 {

    0%,
    100% {
        transform: translate(200px, 0px);
    }

    33% {
        transform: translate(-150px, 100px);
    }

    66% {
        transform: translate(0px, -200px);
    }
}

@keyframes cursorPath3 {

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

    50% {
        transform: translate(0px, 0px) scale(0.9);
    }

    /* Click effect */
}


/* Isolated Styles for Moved Sections */
/* Trust Card inside Immersive */
.imm-trust-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.imm-trust-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

/* Responsive Adjustments for Immersive Section */
@media (max-width: 1024px) {
    .immersive-content h2 {
        font-size: 3.2rem;
    }

    .immersive-content p {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .immersive-container {
        height: 500vh;
        /* Less scrolling on mobile */
    }

    .immersive-content {
        padding: 1.5rem;
        max-width: 90%;
    }

    .immersive-content h2 {
        font-size: 2.5rem;
    }

    .immersive-content p {
        font-size: 1.1rem;
    }

    /* On mobile, let's try contain to see if it fixes the "zoomed in" feel */
    /* Or better, maintain a more natural aspect ratio if possible */
    .immersive-video video {
        /* object-fit: cover; // shows zoomed video on phone also  */
        object-fit: cover;
        aspect-ratio: 9/16;
        /* put contain here to show full video on phone also but horizontal will be a problem then */
        background: black;
        /* transform: scale(0.9); */
        /* Add background for pillar/letterboxing if needed */
    }

    .immersive-bg {
        /* Reduce the scrolling scale effect on mobile if it's too much */
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
}

@media (max-width: 480px) {
    .immersive-content h2 {
        font-size: 2rem;
    }

    .immersive-content p {
        font-size: 1rem;
    }
}

.imm-step-card {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}


/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 5;
    opacity: 0.7;
    animation: fadeOutScroll 3s forwards 1s;
    /* Hide after scrolling starts typically, or keep persistent */
}

.scroll-indicator span {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.mouse-icon {
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    position: relative;
}

.mouse-icon::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: scrollMouse 1.5s infinite;
}

@keyframes scrollMouse {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) translateY(15px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .immersive-container {
        height: 420vh;
        margin-top: 2.5rem;
    }

    .sticky-wrapper {
        height: 100svh;
    }

    .immersive-content h2 {
        font-size: 2.5rem;
    }

    .immersive-content p {
        font-size: 1.1rem;
    }

    .trust-grid,
    .workflow-grid {
        grid-template-columns: 1fr !important;
    }
}