/* =====================================================
   Apple 스타일 스크롤 애니메이션
   main0 섹션의 이미지 애니메이션
   ===================================================== */

/* 메인 섹션 기본 설정 */
.main0 {
    min-height: 100vh; /* 스크롤 애니메이션을 위한 충분한 높이 */
    position: relative;
    overflow: hidden;
}

/* 고정된 컨테이너 - 스크롤시 화면에 고정 */
.main0__fixed-container {
    position: sticky;
    top: 0;
    height: 120vh;
    overflow: hidden;
}

/* 배경 그라데이션 */
.main0__bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.main0__bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

/* 왼쪽 이미지 - 초기 상태 */
.main0__img_left {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    position: absolute;
    top: 50%;
    left: -10%; /* 화면 밖에서 시작 */
    width: 468px;
    height: 670px;
    max-width: 30%;
    z-index: 1;
    transform: translate(0, -50%) scale(0.7); /* 초기 축소 */
    opacity: 0; /* 초기 투명 */
    transition: all 0.1s ease-out;
    will-change: transform, opacity, left;
}

/* 오른쪽 이미지 - 초기 상태 */
.main0__img_right {
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    position: absolute;
    top: 50%;
    right: -10%; /* 화면 밖에서 시작 */
    width: 481px;
    height: 671px;
    max-width: 30%;
    z-index: 1;
    transform: translate(0, -50%) scale(0.7); /* 초기 축소 */
    opacity: 0; /* 초기 투명 */
    transition: all 0.1s ease-out;
    will-change: transform, opacity, right;
}


/* 애니메이션 활성화 상태 */
.main0__img_left.animate {
    left: 5%; /* 최종 위치 */
    transform: translate(0, -50%) scale(1);
    opacity: 1;
}

.main0__img_right.animate {
    right: 5%; /* 최종 위치 */
    transform: translate(0, -50%) scale(1);
    opacity: 1;
}

.main0 .in_text.animate {
    opacity: 1;
    transform: translateY(0);
}

/* 태블릿 반응형 (768px ~ 1024px) */
@media (max-width: 1024px) {
    .main0__img_left,
    .main0__img_right {
        max-width: 35%;
    }

    .main0__img_left.animate {
        left: 2%;
    }

    .main0__img_right.animate {
        right: 2%;
    }
}

/* 모바일 반응형 (최대 768px) */
@media (max-width: 768px) {
    .main0 {
        min-height: 150vh; /* 모바일에서는 스크롤 높이 조정 */
    }

    .main0__img_left {
        width: 280px;
        height: 400px;
        max-width: 40%;
        left: -15%;
    }

    .main0__img_right {
        width: 280px;
        height: 400px;
        max-width: 40%;
        right: -15%;
    }

    .main0__img_left.animate {
        left: 0%;
    }

    .main0__img_right.animate {
        right: 0%;
    }
}

/* 작은 모바일 (최대 480px) */
@media (max-width: 480px) {
    .main0 {
        min-height: 120vh;
    }

    .main0__img_left {
        width: 200px;
        height: 300px;
        max-width: 35%;
        left: -20%;
    }

    .main0__img_right {
        width: 200px;
        height: 300px;
        max-width: 35%;
        right: -20%;
    }

    .main0__img_left.animate {
        left: -5%;
    }

    .main0__img_right.animate {
        right: -5%;
    }
}

/* 성능 최적화 */
.main0__img_left,
.main0__img_right,
.main0__bg {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}
