/* ══════════════════════════════════════════════════════
   Navbar Animations
   ══════════════════════════════════════════════════════ */

/* ── Entrance animation ── */
@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav {
    animation: navSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Burger entrance ── */
@keyframes burgerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.nav-burger {
    animation: burgerFadeIn 0.4s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Mobile topbar entrance ── */
@keyframes topbarSlide {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .nav-mobile-topbar {
        animation: topbarSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
}

/* ── Mobile menu link stagger ── */
@keyframes mobileLinkFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-mobile.open .nav-mobile-link {
    opacity: 0;
    animation: mobileLinkFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nav-mobile.open .nav-mobile-link:nth-child(1) { animation-delay: 0.05s; }
.nav-mobile.open .nav-mobile-link:nth-child(2) { animation-delay: 0.1s; }
.nav-mobile.open .nav-mobile-link:nth-child(3) { animation-delay: 0.15s; }
.nav-mobile.open .nav-mobile-link:nth-child(4) { animation-delay: 0.2s; }
.nav-mobile.open .nav-mobile-link:nth-child(5) { animation-delay: 0.25s; }

/* ── Mobile CTA stagger ── */
.nav-mobile.open .nav-mobile-cta {
    opacity: 0;
    animation: mobileLinkFadeIn 0.4s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── CTA button pulse on idle ── */
@keyframes ctaPulse {
    0%, 100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                    0 2px 12px rgba(39, 174, 96, 0.3);
    }
    50% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18),
                    0 2px 20px rgba(39, 174, 96, 0.45);
    }
}

.btn-nav {
    animation: ctaPulse 3s ease-in-out infinite;
}

.btn-nav:hover {
    animation: none;
}

/* ── Nav link underline reveal ── */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: #27ae60;
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: calc(100% - 1.6rem);
}
