/* ==========================
   ANIMATIONS.CSS — Automation Expo 2026
   Full site — scroll reveals, text entries,
   image placements, hover micro-interactions
========================== */


/* ══════════════════════════════════════
   1. SCROLL REVEAL — BASE STATES
   JS adds .visible when element enters view
══════════════════════════════════════ */

/* Fade up (default — text, cards, headings) */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.70s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.70s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide in from left (about-left, section labels) */
.reveal-left {
    opacity: 0;
    transform: translateX(-48px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Slide in from right (about-right video, images) */
.reveal-right {
    opacity: 0;
    transform: translateX(48px);
    transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale in (icons, pills, tags, small elements) */
.reveal-scale {
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.60s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.60s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Clip reveal — text lines wipe in from bottom (headline words) */
.reveal-clip {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transition: opacity 0.01s,
                clip-path 0.70s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-clip.visible {
    opacity: 1;
    clip-path: inset(0 0 0% 0);
}

/* Blur in (stat numbers, large display text) */
.reveal-blur {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(20px);
    transition: opacity 0.65s ease,
                filter 0.65s ease,
                transform 0.65s ease;
}
.reveal-blur.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}


/* ══════════════════════════════════════
   2. STAGGER DELAYS
   KEY: delay only applies when .visible is present (scroll IN).
   Without .visible (scroll OUT / reset), delay = 0 so elements
   vanish instantly and are ready to re-animate next scroll-in.
══════════════════════════════════════ */

/* Exit state — no delay, instant hide */
.stagger-1, .stagger-2, .stagger-3,
.stagger-4, .stagger-5, .stagger-6,
.stagger-7, .stagger-8 { transition-delay: 0s; }

/* Entry state — stagger delay only when .visible applied */
.stagger-1.visible { transition-delay: 0.06s; }
.stagger-2.visible { transition-delay: 0.13s; }
.stagger-3.visible { transition-delay: 0.20s; }
.stagger-4.visible { transition-delay: 0.27s; }
.stagger-5.visible { transition-delay: 0.34s; }
.stagger-6.visible { transition-delay: 0.41s; }
.stagger-7.visible { transition-delay: 0.48s; }
.stagger-8.visible { transition-delay: 0.55s; }


/* ══════════════════════════════════════
   3. SECTION TAG BOUNCE
══════════════════════════════════════ */
@keyframes tagBounce {
    0%   { opacity: 0; transform: scale(0.75) translateY(8px); }
    65%  { transform: scale(1.06) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.section-tag.visible {
    animation: tagBounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}


/* ══════════════════════════════════════
   4. STAT NUMBER — ROLL-UP FLASH
   Fires when counter finishes counting
══════════════════════════════════════ */
@keyframes statFlash {
    0%   { color: #ffffff; }
    40%  { color: var(--accent-gold); text-shadow: 0 0 24px rgba(255,215,0,0.6); }
    100% { color: #ffffff; }
}

.stat-block .stat-num.count-done {
    animation: statFlash 0.6s ease forwards;
}

/* Stat block entrance — scale + fade */
.stat-block {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
    transition: opacity 0.60s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.60s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.35s ease;
}

.stat-block.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* ══════════════════════════════════════
   5. ABOUT SECTION — VIDEO REVEAL
   Video panel slides in from right
══════════════════════════════════════ */
.about-right {
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

.about-right:hover {
    box-shadow: 0 20px 60px rgba(7,9,26,0.22);
}


/* ══════════════════════════════════════
   6. ZONE CARD — SHIMMER + HOVER
══════════════════════════════════════ */
.zone-card {
    position: relative;
    overflow: hidden;
}

.zone-card .shimmer {
    position: absolute;
    top: -60%;
    left: -80%;
    width: 50%;
    height: 220%;
    background: linear-gradient(
        105deg,
        transparent 38%,
        rgba(255,255,255,0.12) 50%,
        transparent 62%
    );
    transform: skewX(-15deg);
    transition: left 0.60s ease;
    pointer-events: none;
    z-index: 3;
}

.zone-card:hover .shimmer { left: 135%; }


/* ══════════════════════════════════════
   7. SPEAKER CARD — ENTRANCE + HOVER
══════════════════════════════════════ */
.speaker-card img {
    transition: transform 0.55s ease, filter 0.4s ease;
}

.speaker-card:hover img {
    transform: scale(1.06);
    filter: brightness(0.92);
}

/* Gold line underline on speaker name */
.speaker-content h3 {
    position: relative;
    padding-bottom: 8px;
}

.speaker-content h3::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
    border-radius: 2px;
    transition: width 0.35s ease;
}

.speaker-card:hover .speaker-content h3::after { width: 40px; }


/* ══════════════════════════════════════
   8. LOGO ITEM HOVER
══════════════════════════════════════ */
.logo-item {
    transition: color 0.3s ease, transform 0.3s ease,
                border-color 0.3s ease, background 0.3s ease,
                box-shadow 0.3s ease;
}

.logo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(255,215,0,0.12);
}


/* ══════════════════════════════════════
   9. MEMORY CARD — GOLD LINE EXPAND
══════════════════════════════════════ */
.card-title::before {
    transition: width 0.35s ease;
}

.memory-card:hover .card-title::before { width: 52px; }


/* ══════════════════════════════════════
   10. BENTO GALLERY — STAGGERED ENTRANCE
   Delays only on .visible (entry).
   No delay on exit = instant reset, clean re-entry.
══════════════════════════════════════ */
.bento-item {
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.55s ease,
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 0s;
}

.bento-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger only when entering (.visible present) */
.bento-item:nth-child(1).visible  { transition-delay: 0.00s; }
.bento-item:nth-child(2).visible  { transition-delay: 0.06s; }
.bento-item:nth-child(3).visible  { transition-delay: 0.12s; }
.bento-item:nth-child(4).visible  { transition-delay: 0.18s; }
.bento-item:nth-child(5).visible  { transition-delay: 0.24s; }
.bento-item:nth-child(6).visible  { transition-delay: 0.30s; }
.bento-item:nth-child(7).visible  { transition-delay: 0.36s; }
.bento-item:nth-child(8).visible  { transition-delay: 0.42s; }
.bento-item:nth-child(9).visible  { transition-delay: 0.48s; }
.bento-item:nth-child(10).visible { transition-delay: 0.54s; }
.bento-item:nth-child(11).visible { transition-delay: 0.60s; }
.bento-item:nth-child(12).visible { transition-delay: 0.66s; }
.bento-item:nth-child(n+13).visible { transition-delay: 0.70s; }


/* ══════════════════════════════════════
   11. STATS FRONTIER — HEADLINE CHAR SPLIT
   Headline words animate in sequentially
══════════════════════════════════════ */
@keyframes wordRise {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.stats-headline h2 .word {
    display: inline-block;
    opacity: 0;
}

.stats-headline h2 .word.visible {
    animation: wordRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}


/* ══════════════════════════════════════
   12. NAVBAR SCROLL ENTRANCE
══════════════════════════════════════ */
@keyframes navbarDrop {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.navbar {
    animation: navbarDrop 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}


/* ══════════════════════════════════════
   13. ABOUT PILL — POP IN
══════════════════════════════════════ */
@keyframes pillPop {
    0%   { opacity: 0; transform: scale(0.75); }
    70%  { transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

.about-pill.visible {
    animation: pillPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* pill starts hidden */
.about-pill {
    opacity: 0;
}


/* ══════════════════════════════════════
   14. SECTION HEADER H2 — UNDERLINE WIPE
══════════════════════════════════════ */
.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -6px; left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.section-header.visible h2::after { width: 60px; }

/* Exhibitors dark section override */
.exhibitors-section .section-header h2::after {
    background: linear-gradient(90deg, var(--accent-gold), rgba(255,215,0,0.3));
}


/* ══════════════════════════════════════
   15. REDUCED MOTION FALLBACK
══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right,
    .reveal-scale, .reveal-clip, .reveal-blur {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        clip-path: none !important;
        transition: none !important;
    }

    .stat-block {
        opacity: 1 !important;
        transform: none !important;
        transition: background 0.2s ease !important;
    }

    .bento-item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .about-pill {
        opacity: 1 !important;
        animation: none !important;
    }

    .section-tag.visible { animation: none !important; }

    .hero-tag,
    .hero-content h1,
    .hero-content > p,
    .hero-buttons,
    .hero-countdown,
    .hero-scroll {
        animation: none !important;
        opacity: 1 !important;
    }

    .zone-card .shimmer { display: none; }
    .section-header h2::after { width: 60px; transition: none; }
}