/* =========================
   LOGO : ลอยลงมาจากฟ้า แล้วลอยหายใจอยู่กับที่
========================= */
.anniv5thLogo {
    animation: anniv5thLogoIn 1.3s .35s cubic-bezier(.16, 1, .3, 1) both;
}

.anniv5thLogo img {
    animation:
        anniv5thFloatLogo 7s 2s ease-in-out infinite,
        anniv5thHalo 5.5s 2s ease-in-out infinite;
}

@keyframes anniv5thLogoIn {
    0% {
        opacity: 0;
        transform: translateY(-70px) scale(.82);
        filter: blur(14px);
    }

    55% {
        opacity: 1;
    }

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

@keyframes anniv5thFloatLogo {

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

    50% {
        transform: translateY(-16px) scale(1.012);
    }
}

@keyframes anniv5thHalo {

    0%,
    100% {
        filter: drop-shadow(0 0 14px rgba(252, 197, 0, 0.35));
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(240, 209, 97, 0.75));
    }
}


/* =========================
   BUTTON : โผล่ทีละปุ่มเป็นลำดับสุดท้าย แล้วลอยเบา ๆ
   (ใส่ที่ <a> ครอบปุ่ม จึงไม่ชนกับ transform ตอน hover ของปุ่ม)
========================= */
.anniv5thButtonMainLayout>div>a {
    display: inline-block;
    animation:
        anniv5thRiseIn .9s var(--d, 2.2s) cubic-bezier(.16, 1, .3, 1) both,
        anniv5thButtonFloat 5s var(--fd, 3.2s) ease-in-out infinite;
}

.anniv5thButtonMainLayout>div>a:nth-child(1) {
    --d: 1.00s;
    --fd: 2.0s;
}

.anniv5thButtonMainLayout>div>a:nth-child(2) {
    --d: 1.15s;
    --fd: 2.2s;
}

.anniv5thButtonMainLayout>div>a:nth-child(3) {
    --d: 1.30s;
    --fd: 2.4s;
}

@keyframes anniv5thRiseIn {
    0% {
        opacity: 0;
        transform: translateY(34px) scale(.9);
        filter: blur(5px);
    }

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

@keyframes anniv5thButtonFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

/* =========================
   AMBIENT : ละอองแสง + ขนนก (สร้างด้วย JS)
========================= */
.anniv5thAmbient {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    pointer-events: none;
}

.anniv5thMote {
    position: absolute;
    bottom: -6%;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, rgba(255, 246, 214, .75) 45%, rgba(255, 246, 214, 0) 72%);
    opacity: 0;
    animation-name: anniv5thMoteRise;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes anniv5thMoteRise {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(.6);
    }

    12% {
        opacity: var(--peak, .85);
    }

    50% {
        transform: translate3d(var(--sway, 30px), -55vh, 0) scale(1);
    }

    85% {
        opacity: var(--peak, .85);
    }

    100% {
        opacity: 0;
        transform: translate3d(calc(var(--sway, 30px) * -.6), -110vh, 0) scale(.5);
    }
}

.anniv5thFeather {
    position: absolute;
    top: -12%;
    width: 26px;
    height: 26px;
    opacity: 0;
    background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M54 8C33 10 18 22 13 40c-2 7-3 11-7 16 7-2 11-4 17-7 18-8 29-23 31-41z' fill='white' opacity='.92'/><path d='M50 13C36 22 25 34 17 51' stroke='rgba(190,215,255,.9)' stroke-width='2.5' fill='none' stroke-linecap='round'/></svg>");
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .6));
    animation-name: anniv5thFeatherFall;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

@keyframes anniv5thFeatherFall {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    10% {
        opacity: .85;
    }

    35% {
        transform: translate3d(var(--sway, 60px), 40vh, 0) rotate(28deg);
    }

    65% {
        transform: translate3d(calc(var(--sway, 60px) * -.8), 75vh, 0) rotate(-22deg);
    }

    90% {
        opacity: .7;
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--sway, 60px), 125vh, 0) rotate(20deg);
    }
}

/* =========================
   MOBILE : ลดแอมพลิจูดไม่ให้ภาพล้นจอ
========================= */
@media (max-width: 768px) {
    .anniv5thMainLayout {
        --anniv5th-in: .9s;
    }

    .anniv5thLogo img,
    .anniv5thporing_1 img,
    .anniv5thporing_2 img,
    .anniv5thporing_3 img,
    .anniv5thporing_4 img {
        animation-duration: 8s;
    }

    .anniv5thFeather {
        width: 18px;
        height: 18px;
    }
}