/**
 * ANIMATIONS
 * Keyframes, entrance sequences, scroll reveals
 */

/* ============================================
   KEYFRAMES
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ============================================
   SCROLL REVEAL CLASSES (for fallback)
   ============================================ */

[data-animate-in] {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s var(--ease-custom) 2.8s forwards;
}

[data-animate-in].animated {
    animation: fadeInUp 0.8s var(--ease-custom) forwards;
}

/* ============================================
   CUSTOM CURSOR (desktop only)
   ============================================ */

.cursor {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-cursor);
    mix-blend-mode: difference;
    display: none;
}

.cursor-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--orange);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
}

.cursor-outline {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 2px solid var(--orange);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.3s var(--ease-custom);
}

.cursor.link-hover .cursor-dot {
    width: 20px;
    height: 20px;
}

.cursor.link-hover .cursor-outline {
    opacity: 1;
    width: 50px;
    height: 50px;
}

/* Show cursor only on desktop */
@media (min-width: 1024px) {
    .cursor {
        display: block;
    }
    
    * {
        cursor: none !important;
    }
}

/* ============================================
   MAGNETIC HOVER (for CTAs)
   ============================================ */

[data-magnetic] {
    position: relative;
    transition: transform 0.3s var(--ease-custom);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

.shimmer-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* ============================================
   MODAL ANIMATIONS
   ============================================ */

.modal {
    animation: fadeIn 0.3s var(--ease-out);
}

.modal-content {
    animation: scaleIn 0.4s var(--ease-custom);
}

/* ============================================
   PERFORMANCE OPTIMIZATION
   ============================================ */

/* GPU acceleration for animated elements */
[data-animate-in],
[data-magnetic],
.pricing-card,
.shop-tile,
.dm-screenshot,
.hero-title,
.cursor {
    will-change: transform, opacity;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
