/* ==================== ULTRA SMOOTH SECTION TRANSITIONS - PROMPT 8 ==================== */

/* ===== SECTION BASE - DRAMATIC SLOW TRANSITIONS ===== */
section {
    position: relative;
    opacity: 0;
    transform: translateY(120px) scale(0.92);
    transition: all 2s cubic-bezier(0.16, 1, 0.3, 1); /* 2 seconds - very slow */
    will-change: opacity, transform;
}

section.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Parallax effect on scroll */
section.in-viewport {
    transform: translateY(0) scale(1);
    transition: all 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== NETFLIX/APPLE STYLE DRAMATIC TRANSITIONS ===== */

/* 1. CINEMATIC FADE UP - Slow & Dramatic */
section.transition-fade-up {
    opacity: 0;
    transform: translateY(150px) scale(0.9);
    filter: blur(10px);
}

section.transition-fade-up.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition: all 2.5s cubic-bezier(0.16, 1, 0.3, 1),
                filter 2s ease;
}

/* 2. SLIDE FROM LEFT - Wide & Smooth */
section.transition-slide-left {
    opacity: 0;
    transform: translateX(-200px) rotateY(25deg);
    filter: brightness(0.5);
}

section.transition-slide-left.visible {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
    filter: brightness(1);
    transition: all 2.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 2s ease;
}

/* 3. SLIDE FROM RIGHT - Perspective Effect */
section.transition-slide-right {
    opacity: 0;
    transform: translateX(200px) rotateY(-25deg);
    filter: brightness(0.5);
}

section.transition-slide-right.visible {
    opacity: 1;
    transform: translateX(0) rotateY(0deg);
    filter: brightness(1);
    transition: all 2.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 2s ease;
}

/* 4. ZOOM IN - Apple Style */
section.transition-scale {
    opacity: 0;
    transform: scale(0.7) translateY(80px);
    filter: blur(20px) brightness(0.6);
}

section.transition-scale.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0) brightness(1);
    transition: all 2.8s cubic-bezier(0.16, 1, 0.3, 1),
                filter 2.5s ease;
}

/* 5. BLUR REVEAL - Netflix Hero Style */
section.transition-blur {
    opacity: 0;
    filter: blur(30px) brightness(0.3);
    transform: translateY(100px) scale(1.1);
}

section.transition-blur.visible {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translateY(0) scale(1);
    transition: all 3s cubic-bezier(0.16, 1, 0.3, 1),
                filter 2.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 6. ROTATION REVEAL - 3D Effect */
section.transition-rotate {
    opacity: 0;
    transform: perspective(1000px) rotateX(45deg) translateY(100px);
    transform-origin: bottom;
}

section.transition-rotate.visible {
    opacity: 1;
    transform: perspective(1000px) rotateX(0deg) translateY(0);
    transition: all 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 7. FLIP IN - Card Flip Style */
section.transition-flip {
    opacity: 0;
    transform: perspective(1200px) rotateY(90deg);
    transform-origin: left;
}

section.transition-flip.visible {
    opacity: 1;
    transform: perspective(1200px) rotateY(0deg);
    transition: all 2.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== SECTION LAYERING ===== */

/* Active section pops forward */
section.active {
    z-index: 10;
    transform: translateY(0) scale(1);
}

/* Behind sections fade back */
section.behind {
    opacity: 0.6;
    filter: blur(2px);
    transform: scale(0.98);
    transition: all 0.6s ease;
}

/* ===== CROSSFADE BETWEEN SECTIONS ===== */

section.crossfade-out {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

section.crossfade-in {
    opacity: 1;
    transition: opacity 0.8s ease-in;
}

/* ===== SMOOTH OVERLAYS ===== */

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

section.visible::before {
    opacity: 1;
}

/* ===== SCROLL PROGRESS FADE ===== */

/* Section fades based on scroll position */
section[data-scroll-progress] {
    opacity: calc(var(--scroll-progress, 0));
}

/* ===== CINEMATIC TITLE REVEAL ===== */

section h2,
section .section-header h2 {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

section.visible h2,
section.visible .section-header h2 {
    opacity: 1;
    transform: translateY(0);
}

/* ===== CONTENT STAGGER ===== */

section.visible .section-header {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

section.visible .container > *:nth-child(1) {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

section.visible .container > *:nth-child(2) {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

section.visible .container > *:nth-child(3) {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

section {
    backface-visibility: hidden;
    perspective: 1000px;
    transform: translateZ(0);
}

/* ===== BEAUTIFUL SECTION DIVIDERS ===== */
section + section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.8s ease;
}

section.visible + section.visible::after {
    opacity: 1;
}

/* ===== SMOOTH SCROLL FADE EFFECT ===== */
section {
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s ease,
                filter 0.8s ease;
}

/* Sections not visible get dramatic fade */
section:not(.visible) {
    filter: brightness(0.5) blur(15px);
    opacity: 0.3;
}

section.visible {
    filter: brightness(1) blur(0);
    opacity: 1;
}

/* ===== CINEMATIC ENTRANCE ANIMATIONS ===== */
@keyframes cinematicEnter {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.9);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

section.cinematic-enter {
    animation: cinematicEnter 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== PARALLAX SLOW SCROLL ===== */
section[data-parallax] {
    transform: translateY(calc(var(--scroll-offset, 0) * 0.3px));
    transition: transform 0.1s linear;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    section {
        transition: opacity 0.6s ease, transform 0.6s ease;
        transform: translateY(40px) scale(0.98);
    }
    
    section.transition-blur.visible {
        filter: blur(0);
        transition: all 0.8s ease;
    }
    
    section:not(.visible) {
        filter: brightness(0.8) blur(3px);
    }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
    section,
    section * {
        transition: opacity 0.2s ease !important;
        transform: none !important;
        filter: none !important;
        animation: none !important;
    }
}

