/* css/hero.css */
.hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-dark);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg video,
.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 雙影片堆疊：靠 opacity 交叉淡化做無縫循環 */
.hero-bg video {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-bg video.is-active {
    opacity: 1;
}

.hero-bg img {
    animation: bg-ken-burns 30s linear infinite alternate;
}

/* 護字遮罩：暖炭色調（法式），上下加重、中段輕透，確保文字不被亮色背景吃掉 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(35, 25, 30, 0.6) 0%,
            rgba(35, 25, 30, 0.3) 30%,
            rgba(35, 25, 30, 0.45) 70%,
            rgba(35, 25, 30, 0.75) 100%);
    z-index: 1;
}

.fireflies-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.butterfly {
    position: absolute;
    width: 34px;
    height: 30px;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    transform-origin: center center;
    perspective: 120px;
    /* 身體:細長深色橢圓 */
    background: radial-gradient(ellipse 2px 10px at 50% 50%, rgba(50, 62, 88, 0.9), rgba(50, 62, 88, 0) 70%);
    filter: drop-shadow(0 0 6px rgba(120, 170, 240, 0.45));
}

.butterfly::before,
.butterfly::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    backface-visibility: visible;
}

/* 左翅:前翅大、後翅小,藍色漸層 */
.butterfly::before {
    left: 0;
    transform-origin: 100% 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='1' y1='0' x2='0' y2='0'%3E%3Cstop offset='0' stop-color='%238fc2f5'/%3E%3Cstop offset='1' stop-color='%234f86d8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M57,32 C52,8 22,-2 9,5 C-2,12 3,26 18,31 C31,35 48,35 57,32 Z' fill='url(%23g)' opacity='0.92'/%3E%3Cpath d='M57,34 C46,36 24,39 14,47 C6,54 13,64 25,61 C39,57 53,46 57,34 Z' fill='url(%23g)' opacity='0.8'/%3E%3C/svg%3E");
    animation: wing-flap-left var(--flap-duration, 0.8s) infinite alternate ease-in-out;
}

/* 右翅:鏡像 */
.butterfly::after {
    right: 0;
    transform-origin: 0% 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='1' y1='0' x2='0' y2='0'%3E%3Cstop offset='0' stop-color='%238fc2f5'/%3E%3Cstop offset='1' stop-color='%234f86d8'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(60 0) scale(-1 1)'%3E%3Cpath d='M57,32 C52,8 22,-2 9,5 C-2,12 3,26 18,31 C31,35 48,35 57,32 Z' fill='url(%23g)' opacity='0.92'/%3E%3Cpath d='M57,34 C46,36 24,39 14,47 C6,54 13,64 25,61 C39,57 53,46 57,34 Z' fill='url(%23g)' opacity='0.8'/%3E%3C/g%3E%3C/svg%3E");
    animation: wing-flap-right var(--flap-duration, 0.8s) infinite alternate ease-in-out;
}

@keyframes wing-flap-left {
    0% {
        transform: rotateY(15deg);
    }

    100% {
        transform: rotateY(-70deg);
    }
}

@keyframes wing-flap-right {
    0% {
        transform: rotateY(-15deg);
    }

    100% {
        transform: rotateY(70deg);
    }
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-logo {
    opacity: 0;
    transform: scale(0.9);
    margin-bottom: 30px;
    animation: logo-entrance 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards,
        logo-glow-breathe 7s ease-in-out 2.5s infinite;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 40px rgba(212, 175, 110, 0.3));
    position: relative;
    display: inline-block;
    /* 掃光層遮罩用的 LOGO；換建案時改這裡（路徑相對於本 CSS 檔） */
    --logo-url: url('../assets/images/lamour_logo.webp');
}

.hero-logo img {
    max-width: 600px;
    height: auto;
    display: block;
}

/* 反光特效層：完全利用 PNG/SVG 透明遮罩 */
.logo-shine-layer {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 讓光層與 LOGO 圖案一模一樣 */
    -webkit-mask-image: var(--logo-url);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: var(--logo-url);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;

    /* 香檳金高光帶：白色 LOGO 上以色相變化呈現掃光（法式 白/淡粉/金 色調） */
    background: linear-gradient(-60deg,
            transparent 35%,
            rgba(244, 200, 200, 0.2) 40%,
            rgba(212, 175, 110, 0.55) 45%,
            rgba(255, 232, 190, 0.95) 50%,
            rgba(212, 175, 110, 0.55) 55%,
            rgba(244, 200, 200, 0.2) 60%,
            transparent 65%);

    /* 提升質感：放慢速度與滑動節奏 */
    background-size: 250% 100%;
    background-position: 150% 0;
    animation: logo-shine 10s ease-in-out infinite;
    animation-delay: 2.5s;
    /* 與 LOGO 淡入錯開 */
    pointer-events: none;
    z-index: 10;
}

.hero-slogan {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 28px;
    color: var(--color-text-primary);
    letter-spacing: 24px;
    margin-right: -24px;
    /* 修正字距產生視覺偏移的問題 */
    opacity: 0;
    animation: text-entrance 1.5s ease-out 1.5s forwards;
    /* 雙層陰影：近距離實影保輪廓 + 遠距離柔影壓亮背景 */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75), 0 6px 24px rgba(0, 0, 0, 0.5);
}

.hero-slogan-en {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 16px;
    color: rgba(255, 240, 220, 0.75);
    letter-spacing: 4px;
    margin-top: 14px;
    opacity: 0;
    animation: text-entrance 1.5s ease-out 1.9s forwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 5px 18px rgba(0, 0, 0, 0.45);
}

@keyframes bg-ken-burns {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

@keyframes logo-entrance {
    0% {
        opacity: 0;
        transform: scale(0.95);
        filter: drop-shadow(0 0 0px rgba(0, 0, 0, 0)) drop-shadow(0 0 0px rgba(212, 175, 110, 0));
    }

    100% {
        opacity: 1;
        transform: scale(1);
        /* 深色實體陰影營造立體懸浮感 + 香檳金環境光暈營造奢華感 */
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 40px rgba(212, 175, 110, 0.3));
    }
}

/* 珠光呼吸：金色光暈緩慢明滅，讓白色 LOGO 在暗背景上有珠光感 */
@keyframes logo-glow-breathe {
    0%,
    100% {
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 40px rgba(212, 175, 110, 0.3));
    }

    50% {
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 60px rgba(212, 175, 110, 0.5));
    }
}

@keyframes text-entrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logo-shine {
    0% {
        background-position: 150% 0;
    }

    40%,
    100% {
        background-position: -50% 0;
    }
}

/* ===== 首頁專屬 ANXI 膠囊廣告按鈕 ===== */
.anxi-home-capsule {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 8px 24px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    font-family: var(--font-english-sans), var(--font-sans, system-ui);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
    opacity: 0;
    animation: capsule-entrance 2s ease forwards 2.5s;
    pointer-events: auto;
}

.anxi-home-capsule:hover {
    background: rgba(10, 10, 10, 0.85);
    color: rgba(237, 175, 184, 0.9);
    border-color: rgba(237, 175, 184, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(237, 175, 184, 0.2);
    transform: translateX(-50%) translateY(-2px);
}

@keyframes capsule-entrance {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}