/* === GSAP-ONLY GATE ANIMATION STYLES ===
   All animations are handled by GSAP JavaScript
   This CSS file only contains structural styles
=== */

:root {
    --focus-x: 50%;
    --focus-y: 50%;
    --flower-overlap-x: -70px;
}

/* === BUTTON STYLES === */
#btn-open-gate {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* === GATE OVERLAY CONTAINER === */
.gate-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate3d(0, 0, 0);
    transform-origin: var(--focus-x) var(--focus-y);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

.gate-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* === CLOUD TRANSITION LAYER === */
.cloud-transition {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
    will-change: opacity;
}

.t-cloud {
    position: absolute;
    width: var(--c-size, 100vw);
    height: auto;
    max-width: none;
    opacity: 1;
    will-change: transform, opacity;
}

/* Cloud positioning */
.t-cloud:nth-child(1) {
    --c-size: 110vw;
    top: 0%;
    left: -5%;
}

.t-cloud:nth-child(2) {
    --c-size: 100vw;
    bottom: 0%;
    right: -5%;
}

.t-cloud:nth-child(3) {
    --c-size: 80vw;
    top: 15%;
    left: 0%;
}

.t-cloud:nth-child(4) {
    --c-size: 80vw;
    bottom: 15%;
    right: 0%;
}

.t-cloud:nth-child(5) {
    --c-size: 90vw;
    top: 30%;
    left: -10%;
}

.t-cloud:nth-child(6) {
    --c-size: 90vw;
    bottom: 30%;
    right: -10%;
}

.t-cloud:nth-child(7) {
    --c-size: 100vw;
    top: 10%;
    left: -15%;
}

.t-cloud:nth-child(8) {
    --c-size: 100vw;
    bottom: 10%;
    right: -25%;
}

@media (min-width: 768px) {
    .t-cloud {
        width: var(--c-size, 80vw);
    }
}

/* === PILAR (FRONT LAYER) === */
.pillar {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    image-rendering: -webkit-optimize-contrast;
}

/* === CURTAINS (MIDDLE LAYER) === */
.curtain {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    width: 54%;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    will-change: transform;
    overflow: hidden;
}

.curtain img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.curtain.left {
    left: -4%;
    transform-origin: left center;
}

.curtain.left img {
    object-position: left center;
}

.curtain.right {
    right: -4%;
    transform-origin: right center;
}

.curtain.right img {
    object-position: right center;
}

/* === FLOWER BED === */
.flower-bed {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    font-size: 0;
    line-height: 0;
    height: auto;
    width: max-content;
}

.flower {
    flex: 0 0 auto;
    transform: translate3d(0, 0, 0);
    transform-origin: 50% 100%;
    backface-visibility: hidden;
    will-change: transform;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    position: relative;
    line-height: 0;
    margin: 0;
    padding: 0;
    vertical-align: bottom;
}

.flower+.flower {
    margin-left: var(--flower-overlap-x);
}

.flower:nth-child(1) {
    z-index: 1;
}

.flower:nth-child(2) {
    z-index: 2;
}

.flower:nth-child(3) {
    z-index: 3;
}

.flower:nth-child(4) {
    z-index: 4;
}

.flower:nth-child(5) {
    z-index: 5;
}

.flower img {
    width: auto;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    max-height: 200px;
    max-width: 30vw;
    transform: translateZ(0);
}

/* === COVER CONTENT === */
#cover-content {
    will-change: transform, opacity;
}

/* === MOBILE OPTIMIZATION === */
@media (max-width: 768px) {
    :root {
        --flower-overlap-x: -40px;
    }

    .flower,
    .t-cloud {
        filter: none !important;
        box-shadow: none !important;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === HERO SECTION ITEMS === */
#hero .hero-item {
    opacity: 0;
    will-change: transform, opacity;
}

.animated-flower {
    transform-origin: bottom center;
    will-change: transform, opacity;
    backface-visibility: hidden;
    opacity: 0;
}

/* === HERO CLOUDS === */
.hero-clouds-layer {
    opacity: 0;
}

.hero-cloud {
    position: absolute;
    will-change: transform;
}

.hero-cloud img {
    display: block;
    width: 100%;
    height: 100%;
    filter: blur(1px);
}

/* Cloud positioning */
.hero-cloud-1 {
    width: 180px;
    height: 60px;
    top: 8%;
    left: -200px;
}

.hero-cloud-2 {
    width: 140px;
    height: 50px;
    top: 25%;
    left: -180px;
}

.hero-cloud-3 {
    width: 100px;
    height: 35px;
    top: 15%;
    left: -150px;
}

.hero-cloud-4 {
    width: 200px;
    height: 70px;
    top: 40%;
    left: -220px;
}

.hero-cloud-5 {
    width: 120px;
    height: 45px;
    top: 60%;
    left: -160px;
}

@media (max-width: 768px) {
    .hero-cloud-1 {
        width: 120px;
        height: 40px;
    }

    .hero-cloud-2 {
        width: 100px;
        height: 35px;
    }

    .hero-cloud-3 {
        width: 80px;
        height: 28px;
    }

    .hero-cloud-4 {
        width: 140px;
        height: 50px;
    }

    .hero-cloud-5 {
        width: 90px;
        height: 32px;
    }
}