/* ==========================================================================
   Trustline Resources - Animations & Interactions CSS (v3)
   ========================================================================== */

/* 1. Scroll Reveal System (data-animate) */
@media (prefers-reduced-motion: no-preference) {
    
    [data-animate] {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: opacity, transform;
    }

    [data-animate].is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger Delays */
    .delay-100 { transition-delay: 100ms; }
    .delay-200 { transition-delay: 200ms; }
    .delay-300 { transition-delay: 300ms; }
    .delay-400 { transition-delay: 400ms; }
    .delay-500 { transition-delay: 500ms; }
    
    /* Hero elements fast stagger */
    .hero-delay-1 { transition-delay: 100ms; }
    .hero-delay-2 { transition-delay: 300ms; }
    .hero-delay-3 { transition-delay: 500ms; }

    /* Nav Underline Slide Hover */
    .nav-link {
        position: relative;
        display: inline-block;
        padding-bottom: 4px;
    }
    
    .nav-link::after {
        content: '';
        position: absolute;
        width: 100%;
        transform: scaleX(0);
        height: 2px;
        bottom: 0;
        left: 0;
        background-color: var(--purple);
        transform-origin: bottom right;
        transition: transform 0.3s ease-out;
    }
    
    .nav-link:hover::after {
        transform: scaleX(1);
        transform-origin: bottom left;
    }
    
    /* Active Nav State */
    .nav-link.active::after {
        transform: scaleX(1);
    }

    /* ==========================================================================
       2. Magnetic Buttons
       ========================================================================== */
    .btn-solid, .btn-pill, .btn-magnetic {
        /* Smooth out the JS transform */
        transition: transform 0.1s ease-out, background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
        will-change: transform;
    }

    /* ==========================================================================
       3. Parallax Image Reveal
       ========================================================================== */
    .photo-card-img-wrapper {
        overflow: hidden;
        /* Define a container size */
        position: relative;
    }

    .photo-card-img-wrapper img {
        /* Default CSS Var for inner parallax shift set by JS */
        --parallax-y: 0px;
        /* Scale up slightly more to allow room for parallax shifting without showing edges */
        transform: scale(1.2) translateY(var(--parallax-y));
        transform-origin: center center;
        transition: transform 0.1s linear; /* Smooth micro-stutters from JS scroll events */
        will-change: transform;
    }

    /* ==========================================================================
       4. Floating Shapes (Mouse Parallax)
       ========================================================================== */
    .floating-shape {
        position: absolute;
        pointer-events: none;
        will-change: transform;
        z-index: 1; /* Below text, above bg */
    }

}

/* Reduced Motion Fallbacks */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1;
        transform: none;
    }
    .photo-card-img-wrapper img {
        transform: scale(1);
    }
}
