/* ====================================
   ETHERION SCROLL ANIMATION SYSTEM (OPTIMIZED)
   ==================================== */

/* Container for Etherion Scroll Animation */
.etherion-scroll-container {
    position: relative;
    width: 100%;
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 120px;
    padding: 60px 20px;
    overflow: hidden;
    will-change: transform;
    contain: layout style paint;
}

/* Etherion Image Wrapper - Main Container */
.etherion-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: auto;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    opacity: 0;
    transform: scale(0.85) translateY(60px);
    filter: blur(8px) brightness(0.7);
    transition: 
        opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
        transform 1s cubic-bezier(0.4, 0, 0.2, 1),
        filter 1s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform, filter;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Activated State - Triggered by Scroll */
.etherion-image-wrapper.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0px) brightness(1);
}

/* The Etherion Car Image */
.etherion-scroll-image {
    width: 100%;
    max-width: 650px;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 10;
    filter: 
        drop-shadow(0 10px 30px rgba(255, 0, 110, 0.4))
        drop-shadow(0 20px 60px rgba(255, 46, 156, 0.3))
        brightness(1.1)
        contrast(1.05);
    transform: translateZ(0);
    transition: 
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        filter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, filter;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Enhanced Image on Scroll */
.etherion-image-wrapper.active .etherion-scroll-image {
    animation: etherionFloatSmooth 4s ease-in-out infinite;
}

/* Smooth Floating Animation */
@keyframes etherionFloatSmooth {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-15px) scale(1.02);
    }
}

/* Glow Ring Around Image */
.etherion-glow-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: 
        radial-gradient(
            circle at center,
            rgba(255, 0, 110, 0.1) 0%,
            rgba(255, 46, 156, 0.15) 30%,
            rgba(255, 20, 147, 0.1) 50%,
            transparent 70%
        );
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: 
        opacity 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
        transform 1s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    will-change: opacity, transform;
}

/* Active Glow Ring */
.etherion-image-wrapper.active .etherion-glow-ring {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: glowPulseSmooth 3s ease-in-out infinite;
}

/* Smooth Pulsing Glow Animation */
@keyframes glowPulseSmooth {
    0%, 100% {
        box-shadow: 
            0 0 40px rgba(255, 0, 110, 0.25),
            0 0 80px rgba(255, 46, 156, 0.15);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 
            0 0 60px rgba(255, 0, 110, 0.4),
            0 0 100px rgba(255, 46, 156, 0.25);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Etherion Title */
.etherion-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.15em;
    color: transparent;
    background: linear-gradient(135deg, 
        #fff 0%, 
        var(--primary-pink) 50%, 
        var(--accent-pink) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 
        0 0 20px rgba(255, 0, 110, 0.3),
        0 0 40px rgba(255, 46, 156, 0.2);
    margin-top: 25px;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    transition: 
        opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
    position: relative;
    z-index: 15;
    will-change: opacity, transform;
}

/* Active Title */
.etherion-image-wrapper.active .etherion-title {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: titleShimmerSubtle 3s ease-in-out infinite;
}

/* Subtle Title Shimmer Effect */
@keyframes titleShimmerSubtle {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

/* Etherion Subtitle */
.etherion-subtitle {
    font-family: var(--font-accent);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 500;
    letter-spacing: 0.3em;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    margin-top: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
    position: relative;
    z-index: 15;
    will-change: opacity, transform;
}

/* Active Subtitle */
.etherion-image-wrapper.active .etherion-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* Simplified Particle Effects Container */
.etherion-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            circle at 30% 50%,
            rgba(255, 0, 110, 0.05) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 70% 50%,
            rgba(255, 46, 156, 0.05) 0%,
            transparent 50%
        );
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}

.etherion-image-wrapper.active::before {
    opacity: 1;
}

/* Remove heavy speed lines effect */
.etherion-image-wrapper::after {
    display: none;
}

/* Progress Indicator */
.etherion-scroll-container::after {
    content: '';
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 80px;
    background: linear-gradient(
        to bottom,
        rgba(255, 0, 110, 0.8),
        rgba(255, 46, 156, 0.4),
        transparent
    );
    opacity: 0;
    transition: opacity 0.6s ease 1s;
}

.etherion-image-wrapper.active ~ .etherion-scroll-container::after,
.etherion-scroll-container:has(.etherion-image-wrapper.active)::after {
    opacity: 1;
    animation: scrollIndicator 2s ease-in-out infinite;
}

@keyframes scrollIndicator {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) translateY(15px);
        opacity: 0.3;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .etherion-scroll-container {
        margin-bottom: 80px;
        padding: 40px 15px;
    }

    .etherion-image-wrapper {
        padding: 30px 15px;
        min-height: 400px;
    }

    .etherion-scroll-image {
        max-width: 100%;
    }

    .etherion-title {
        font-size: clamp(2.5rem, 10vw, 4.5rem);
        letter-spacing: 0.12em;
        margin-top: 20px;
    }

    .etherion-subtitle {
        font-size: clamp(0.9rem, 3.5vw, 1.3rem);
        letter-spacing: 0.25em;
    }

    .etherion-glow-ring {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .etherion-scroll-container {
        margin-bottom: 60px;
        padding: 30px 10px;
    }

    .etherion-image-wrapper {
        min-height: 350px;
        padding: 20px 10px;
    }

    .etherion-title {
        margin-top: 15px;
        font-size: clamp(2rem, 12vw, 3.5rem);
    }

    .etherion-subtitle {
        margin-top: 10px;
        font-size: clamp(0.75rem, 4vw, 1.1rem);
    }
}

/* Advanced Parallax Effect - Layered Depth */
@media (prefers-reduced-motion: no-preference) {
    .etherion-image-wrapper.active .etherion-scroll-image {
        animation: 
            etherionFloat 4s ease-in-out infinite,
            etherionParallax 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    @keyframes etherionParallax {
        0% {
            transform: translateZ(50px) translateY(0) scale(1);
        }
        100% {
            transform: translateZ(80px) translateY(-10px) scale(1.02);
        }
    }
}

/* Scroll Progress Bar (Optional Enhancement) */
.etherion-scroll-progress {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 0%;
    background: linear-gradient(
        to bottom,
        var(--primary-pink),
        var(--accent-pink),
        var(--highlight-pink)
    );
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    box-shadow: 
        0 0 10px rgba(255, 0, 110, 0.5),
        0 0 20px rgba(255, 46, 156, 0.3);
}

/* Hover Effects (Desktop Only) */
@media (hover: hover) {
    .etherion-image-wrapper.active .etherion-scroll-image:hover {
        transform: scale(1.05);
        filter: 
            drop-shadow(0 10px 40px rgba(255, 0, 110, 0.5))
            drop-shadow(0 20px 70px rgba(255, 46, 156, 0.4))
            brightness(1.15);
        cursor: pointer;
    }

    .etherion-title:hover {
        filter: brightness(1.3);
        cursor: default;
    }
}

/* Accessibility - Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .etherion-image-wrapper,
    .etherion-scroll-image,
    .etherion-glow-ring,
    .etherion-title,
    .etherion-subtitle {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }

    .etherion-image-wrapper.active {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
