/* Project Background FX */
.project-fx-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* visible above/around video */
    pointer-events: none;
    overflow: hidden;
}

.fx-shape {
    position: absolute;
    opacity: 0.15;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    animation: floatShape linear infinite;
}

@keyframes floatShape {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    33% {
        transform: translate(50px, -30px) rotate(120deg) scale(1.1);
    }

    66% {
        transform: translate(-20px, 50px) rotate(240deg) scale(0.9);
    }

    100% {
        transform: translate(0, 0) rotate(360deg) scale(1);
    }
}

.fx-lightning-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1;
}

.fx-lightning-path {
    stroke: rgba(200, 220, 255, 0.8);
    stroke-width: 2;
    fill: none;
    filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.8));
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes lightningFlashAnim {
    0% {
        opacity: 0;
    }

    2% {
        opacity: 1;
    }

    4% {
        opacity: 0;
    }

    6% {
        opacity: 0.8;
    }

    8% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Rain/Particles falling behind */
.fx-rain {
    position: absolute;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3));
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.paper-stack-video-wrapper::after {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 15px solid rgba(255, 255, 255, 0.9);
    /* Irregular radii for organic look */
    border-radius: 2% 4% 3% 5% / 3% 3% 5% 4%;
    z-index: 2;
    /* On top of video */
    background: transparent;
    pointer-events: none;
    /* Slower but wider animation */
    animation: toddlerShake 2.5s ease-in-out infinite alternate;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

@keyframes toddlerShake {
    0% {
        border-radius: 2% 4% 2.5% 4.5% / 3.5% 2.5% 4% 3%;
        transform: scale(1.00) rotate(0.2deg);
    }

    33% {
        border-radius: 4% 2% 4% 2.5% / 2% 4% 2.5% 4%;
        transform: scale(0.99) rotate(-0.2deg);
    }

    66% {
        border-radius: 2.5% 4.5% 2% 4% / 4% 2% 4% 2.5%;
        transform: scale(1.01) rotate(0.1deg);
    }

    100% {
        border-radius: 2% 4% 2.5% 4.5% / 3.5% 2.5% 4% 3%;
        transform: scale(1.00) rotate(0.2deg);
    }
}

@keyframes edgeGlow {

    0%,
    100% {
        box-shadow:
            inset 15px 0 15px -5px rgba(0, 0, 0, 0.4),
            inset -15px 0 15px -5px rgba(0, 0, 0, 0.4),
            inset 2px 0 5px rgba(255, 255, 255, 0.5),
            inset -2px 0 5px rgba(255, 255, 255, 0.5);
    }

    50% {
        box-shadow:
            inset 15px 0 15px -5px rgba(0, 0, 0, 0.4),
            inset -15px 0 15px -5px rgba(0, 0, 0, 0.4),
            inset 6px 0 10px rgba(255, 255, 255, 0.9),
            inset -6px 0 10px rgba(255, 255, 255, 0.9);
    }
}

@media (max-width: 768px) and (pointer: coarse) {
    .paper-stack-video-wrapper::after {
        display: none !important;
    }

    /* Samsung S6 Edge Simulation */
    .paper-stack-video-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: 20;
        border-radius: 20px;
        /* Rounded Corners */

        /* Edge Shading & Reflection (Simulates Curvature) */
        background: linear-gradient(to right,
                rgba(0, 0, 0, 0.4) 0%,
                /* Left Edge Darkening (Vignette) */
                rgba(255, 255, 255, 0.5) 4%,
                /* Left Specular Highlight (Glass curve) */
                rgba(255, 255, 255, 0) 10%,
                /* Clear Center */
                rgba(255, 255, 255, 0) 90%,
                /* Clear Center */
                rgba(255, 255, 255, 0.5) 96%,
                /* Right Specular Highlight */
                rgba(0, 0, 0, 0.4) 100%
                /* Right Edge Darkening */
            );

        /* Remove wobble for sleek styling */
        animation: none !important;
        box-shadow: none !important;
    }
}

/* =========================================
   Desktop Entrance Animations (Pop-In)
   ========================================= */
@keyframes popInEffect {
    0% {
        opacity: 0;
        scale: 0;
    }

    60% {
        scale: 1.1;
    }

    100% {
        opacity: 1;
        scale: 1;
    }
}

@media (min-width: 769px) {

    /* Apply Pop-In to main elements */
    /* Using 'scale' property to avoid transform conflicts */
    .laptop-image,
    .desk-svg,
    .blog-book-svg,
    .bow-svg,
    .target-svg {
        animation: popInEffect 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    }

    /* Staggered Delays for Sequence */
    .desk-svg {
        animation-delay: 0.1s;
    }

    .laptop-image {
        animation-delay: 0.3s;
    }

    .blog-book-svg {
        animation-delay: 0.5s;
    }

    .bow-svg {
        animation-delay: 0.7s;
    }

    .target-svg {
        animation-delay: 0.8s;
    }
}