/* ============================================================
   ANIMATIONS.CSS — All @keyframes + scroll-triggered classes
   ============================================================ */

/* ======================== SCROLL ANIMATIONS ======================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Direction variants */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.fade-up.visible,
.fade-left.visible,
.fade-right.visible,
.fade-scale.visible {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* ======================== STAGGER CHILDREN ======================== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.6s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.7s; }

/* ======================== NAVBAR ENTRANCE ======================== */
.navbar {
    animation: navSlideDown 0.6s ease-out;
}

@keyframes navSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ======================== SCROLL INDICATOR ======================== */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-arrow {
    display: block;
    width: 28px;
    height: 28px;
    border-right: 3px solid var(--white);
    border-bottom: 3px solid var(--white);
    transform: rotate(45deg);
    animation: scrollBounce 2s infinite;
    opacity: 0.7;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% { transform: rotate(45deg) translateY(0); }
    40% { transform: rotate(45deg) translateY(10px); }
    60% { transform: rotate(45deg) translateY(5px); }
}

/* ======================== FLOATING DECORATIVE ELEMENTS ======================== */
.floating-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: floatShape 8s ease-in-out infinite;
}

.floating-shape:nth-child(1) {
    width: 80px;
    height: 80px;
    background: var(--gold);
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-shape:nth-child(2) {
    width: 120px;
    height: 120px;
    background: var(--saffron);
    top: 60%;
    right: 10%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.floating-shape:nth-child(3) {
    width: 60px;
    height: 60px;
    background: var(--maroon);
    bottom: 15%;
    left: 30%;
    animation-delay: 4s;
    animation-duration: 12s;
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* ======================== TYPING CURSOR ======================== */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--gold);
    margin-left: 4px;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ======================== PARTICLE CONTAINER ======================== */
.hero-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: particleRise 4s ease-in infinite;
}

@keyframes particleRise {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    20% {
        opacity: 0.8;
        transform: translateY(-30px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0.5);
    }
}

/* ======================== PULSING CTA GLOW ======================== */
.btn-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 111, 0, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(255, 111, 0, 0.7), 0 0 60px rgba(255, 111, 0, 0.3); }
}

/* ======================== 3D TILT CARDS ======================== */
.tilt-card {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* ======================== KEN BURNS ======================== */
.ken-burns {
    animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* ======================== TIMELINE LINE DRAW ======================== */
.timeline-draw {
    position: absolute;
    left: 15px;
    top: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(to bottom, var(--saffron), var(--gold), var(--maroon));
    border-radius: 3px;
    transition: height 1.5s ease-out;
    z-index: 1;
}

.timeline-draw.visible {
    height: 100%;
}

/* ======================== COUNTER POP ======================== */
.counter-pop {
    animation: counterPop 0.4s ease-out;
}

@keyframes counterPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ======================== CURTAIN REVEAL ======================== */
.curtain-reveal {
    position: relative;
    overflow: hidden;
}

.curtain-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--maroon);
    transform: translateX(0);
    transition: transform 0.8s ease-out;
}

.curtain-reveal.visible::after {
    transform: translateX(100%);
}

/* ======================== LETTER ANIMATION ======================== */
.letter-animate span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.letter-animate.visible span {
    opacity: 1;
    transform: translateY(0);
}

/* ======================== GLOWING BORDER ======================== */
.glow-border {
    position: relative;
    overflow: hidden;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--gold), transparent, var(--saffron));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glow-border:hover::before {
    opacity: 1;
}

/* ======================== BOBBING ICON ======================== */
.bob {
    animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ======================== ANIMATED DARK GRADIENT BG ======================== */
.animated-gradient-bg {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 30%, #0f3460 60%, #1a1a2e 100%);
    background-size: 400% 400%;
    animation: gradientMove 12s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ======================== MASONRY STAGGER ======================== */
.masonry-stagger .gallery-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.masonry-stagger.visible .gallery-item:nth-child(1) { transition-delay: 0.05s; }
.masonry-stagger.visible .gallery-item:nth-child(2) { transition-delay: 0.1s; }
.masonry-stagger.visible .gallery-item:nth-child(3) { transition-delay: 0.15s; }
.masonry-stagger.visible .gallery-item:nth-child(4) { transition-delay: 0.2s; }
.masonry-stagger.visible .gallery-item:nth-child(5) { transition-delay: 0.25s; }
.masonry-stagger.visible .gallery-item:nth-child(6) { transition-delay: 0.3s; }
.masonry-stagger.visible .gallery-item:nth-child(7) { transition-delay: 0.35s; }
.masonry-stagger.visible .gallery-item:nth-child(8) { transition-delay: 0.4s; }
.masonry-stagger.visible .gallery-item:nth-child(9) { transition-delay: 0.45s; }
.masonry-stagger.visible .gallery-item:nth-child(10) { transition-delay: 0.5s; }

.masonry-stagger.visible .gallery-item {
    opacity: 1;
    transform: translateY(0);
}

/* ======================== VIDEO PLAY BUTTON PULSE ======================== */
.video-play-pulse {
    animation: playPulse 2s ease-in-out infinite;
}

@keyframes playPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 111, 0, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(255, 111, 0, 0); }
}

/* ======================== BOUNCE IN ======================== */
.bounce-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bounce-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======================== CHECKMARK ANIMATE ======================== */
.check-animate li {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.check-animate.visible li:nth-child(1) { transition-delay: 0.1s; }
.check-animate.visible li:nth-child(2) { transition-delay: 0.2s; }
.check-animate.visible li:nth-child(3) { transition-delay: 0.3s; }
.check-animate.visible li:nth-child(4) { transition-delay: 0.4s; }
.check-animate.visible li:nth-child(5) { transition-delay: 0.5s; }
.check-animate.visible li:nth-child(6) { transition-delay: 0.6s; }
.check-animate.visible li:nth-child(7) { transition-delay: 0.7s; }
.check-animate.visible li:nth-child(8) { transition-delay: 0.8s; }

.check-animate.visible li {
    opacity: 1;
    transform: translateX(0);
}

/* ======================== TABLE ROW SLIDE ======================== */
.table-animate tr {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.table-animate.visible tr:nth-child(1) { transition-delay: 0.05s; }
.table-animate.visible tr:nth-child(2) { transition-delay: 0.1s; }
.table-animate.visible tr:nth-child(3) { transition-delay: 0.15s; }
.table-animate.visible tr:nth-child(4) { transition-delay: 0.2s; }
.table-animate.visible tr:nth-child(5) { transition-delay: 0.25s; }
.table-animate.visible tr:nth-child(6) { transition-delay: 0.3s; }

.table-animate.visible tr {
    opacity: 1;
    transform: translateX(0);
}

/* ======================== CARD PARALLAX IMAGE ======================== */
.parallax-img {
    transition: transform 0.3s ease;
}

/* ======================== DISTANCE BADGE PULSE ======================== */
.badge-pulse {
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ======================== NO-JS FALLBACK ========================
   If JS never runs, the IntersectionObserver can't add .visible, so
   reveal everything by default to avoid a permanently-blank page. */
.no-js .animate-on-scroll,
.no-js .fade-up,
.no-js .fade-left,
.no-js .fade-right,
.no-js .fade-scale,
.no-js .stagger-children > *,
.no-js .bounce-in,
.no-js .check-animate li,
.no-js .table-animate tr,
.no-js .masonry-stagger .gallery-item,
.no-js .letter-animate span {
    opacity: 1 !important;
    transform: none !important;
}

.no-js .curtain-reveal::after {
    display: none !important;
}

.no-js .timeline-draw {
    height: 100%;
}

/* Show the hero tagline text (normally typed in by JS) */
.no-js [data-typing]::before {
    content: attr(data-typing);
}

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

    .animate-on-scroll,
    .fade-up,
    .fade-left,
    .fade-right,
    .fade-scale,
    .stagger-children > *,
    .bounce-in,
    .check-animate li,
    .table-animate tr,
    .masonry-stagger .gallery-item {
        opacity: 1 !important;
        transform: none !important;
    }

    .curtain-reveal::after {
        display: none !important;
    }

    .letter-animate span {
        opacity: 1 !important;
        transform: none !important;
    }
}
