/* ============================================
   Lively Wallpaper — Scroll & Interaction Animations
   Professional, subtle, performance-first
   ============================================ */

/* --- Scroll Reveal Base States --- */
[data-animate] {
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-animate].is-visible {
    opacity: 1;
    transform: none !important;
}

/* Fade up (default) */
[data-animate="fade-up"] { transform: translateY(32px); }
[data-animate="fade-up-sm"] { transform: translateY(16px); }

/* Fade down */
[data-animate="fade-down"] { transform: translateY(-32px); }

/* Fade left / right */
[data-animate="fade-left"] { transform: translateX(-40px); }
[data-animate="fade-right"] { transform: translateX(40px); }

/* Scale in */
[data-animate="scale-in"] { transform: scale(0.92); }

/* Zoom subtle */
[data-animate="zoom"] { transform: scale(0.96); }

/* Fade only */
[data-animate="fade"] { transform: none; }

/* --- Stagger children --- */
[data-stagger] > [data-animate]:nth-child(1) { transition-delay: 0ms; }
[data-stagger] > [data-animate]:nth-child(2) { transition-delay: 80ms; }
[data-stagger] > [data-animate]:nth-child(3) { transition-delay: 160ms; }
[data-stagger] > [data-animate]:nth-child(4) { transition-delay: 240ms; }
[data-stagger] > [data-animate]:nth-child(5) { transition-delay: 320ms; }
[data-stagger] > [data-animate]:nth-child(6) { transition-delay: 400ms; }
[data-stagger] > [data-animate]:nth-child(7) { transition-delay: 480ms; }
[data-stagger] > [data-animate]:nth-child(8) { transition-delay: 560ms; }

/* --- Stat counter glow pulse --- */
@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 20px rgba(34, 211, 238, 0.0); }
    50% { text-shadow: 0 0 30px rgba(34, 211, 238, 0.15); }
}
.stat-counted {
    animation: glow-pulse 3s ease-in-out infinite;
}

/* --- Subtle float for hero badges --- */
@keyframes badge-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
[data-animate-badge].is-visible {
    animation: badge-float 4s ease-in-out infinite;
}
[data-animate-badge]:nth-child(2).is-visible { animation-delay: 0.5s; }
[data-animate-badge]:nth-child(3).is-visible { animation-delay: 1s; }
[data-animate-badge]:nth-child(4).is-visible { animation-delay: 1.5s; }

/* --- Card shimmer on hover --- */
.card-glass::before,
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.03) 45%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.03) 55%,
        transparent 60%
    );
    background-size: 250% 100%;
    background-position: 200% 0;
    transition: background-position 0.8s ease;
    pointer-events: none;
    z-index: 1;
}
.card-glass:hover::before,
.card:hover::before {
    background-position: -50% 0;
}
.card-glass,
.card {
    position: relative;
    overflow: hidden;
}

/* --- Section divider gradient line --- */
.section-glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.3) 20%, rgba(192, 132, 252, 0.3) 80%, transparent);
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}
.section-glow-line.is-visible {
    opacity: 1;
}

/* --- Icon bounce on card hover --- */
.card-glass:hover .card-icon-animated,
.card:hover .card-icon-animated {
    animation: icon-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes icon-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* --- Gradient text shimmer for headings --- */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animate-gradient-text {
    background-size: 200% auto;
    animation: gradient-shift 6s ease-in-out infinite;
}

/* --- Download button pulse ring --- */
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.25); }
    70% { box-shadow: 0 0 0 12px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
.btn-pulse:hover {
    animation: pulse-ring 1.5s ease-out infinite;
}

/* --- Smooth underline for nav links --- */
.nav-link-animated {
    position: relative;
}
.nav-link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #22d3ee, #c084fc);
    border-radius: 1px;
    transition: width 0.3s ease, left 0.3s ease;
}
.nav-link-animated:hover::after {
    width: 60%;
    left: 20%;
}

/* --- Testimonial quote mark fade --- */
.testimonial-quote::before {
    content: '\201C';
    position: absolute;
    top: -8px;
    left: 16px;
    font-size: 4rem;
    font-family: Georgia, serif;
    color: rgba(34, 211, 238, 0.08);
    line-height: 1;
    pointer-events: none;
    transition: color 0.4s ease;
}
.testimonial-quote:hover::before {
    color: rgba(34, 211, 238, 0.15);
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    [data-animate-badge].is-visible { animation: none; }
    .stat-counted { animation: none; }
    .animate-gradient-text { animation: none; }
    .btn-pulse:hover { animation: none; }
    .card-glass::before, .card::before { transition: none; }
}
