/* Explain: Contains CSS animations for website elements, including header entrance and ticker scroll. */
/* ===== Animated header — entrance, brand float, nav stagger, shimmer ===== */
@keyframes headerDrop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes brandFloat {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-4px) rotate(-8deg);
    }
}

@keyframes haloPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(15, 81, 50, 0.42);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(15, 81, 50, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(15, 81, 50, 0);
    }
}

@keyframes shimmerLine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Header drops in smoothly on page load */
#siteHeader {
    animation: headerDrop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Animated accent line along the bottom edge */
#siteHeader::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 2px;
    pointer-events: none;
    opacity: 0.75;
    background: linear-gradient(90deg, transparent, var(--accent-color), var(--primary-color), transparent);
    background-size: 200% 100%;
    animation: shimmerLine 5s linear infinite;
}

/* Logo badge gently floats */
#siteHeader .brand-mark {
    animation: brandFloat 4.5s ease-in-out infinite;
}

#siteHeader a:hover .brand-mark {
    filter: drop-shadow(0 6px 12px rgba(15, 81, 50, 0.45));
}

/* Nav links fade in one after another */
#siteHeader nav .nav-link {
    animation: navFadeIn 0.6s ease both;
}

#siteHeader nav .nav-link:nth-child(1) { animation-delay: 0.18s; }
#siteHeader nav .nav-link:nth-child(2) { animation-delay: 0.26s; }
#siteHeader nav .nav-link:nth-child(3) { animation-delay: 0.34s; }
#siteHeader nav .nav-link:nth-child(4) { animation-delay: 0.42s; }
#siteHeader nav .nav-link:nth-child(5) { animation-delay: 0.50s; }
#siteHeader nav .nav-link:nth-child(6) { animation-delay: 0.58s; }

/* Call button gives a soft pulsing halo, then rests */
#siteHeader .btn-call {
    animation: haloPulse 2.6s ease-out 3;
}

@media (prefers-reduced-motion: reduce) {
    #siteHeader,
    #siteHeader::after,
    #siteHeader .brand-mark,
    #siteHeader nav .nav-link,
    #siteHeader .btn-call,
    .ticker-track {
        animation: none !important;
    }
}

/* ===== Top marquee / ticker bar ===== */
.ticker-bar {
    position: relative;
    direction: ltr;
    overflow: hidden;
    background: linear-gradient(90deg, var(--primary-color), var(--surface-dark));
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: tickerScroll 30s linear infinite;
}

.ticker-group {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding-block: 0.6rem;
    padding-inline-start: 2.5rem;
    white-space: nowrap;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    direction: rtl;
}

.ticker-item i {
    color: var(--accent-color);
}

.ticker-link {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ticker-sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.6rem;
}

.ticker-bar:hover .ticker-track,
.ticker-bar:focus-within .ticker-track {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-25%);
    }
}