/* ============================================
   ANIMATIONS - Apple-Style Smooth Animations
   ============================================ */

/* Fade Up Animation */
.animate-fade-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 1s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Staggered children animation */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

/* Scale In */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Parallax effect */
.parallax {
    will-change: transform;
}

/* Floating animation */
.float {
    animation: float 6s ease-in-out infinite;
}

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

/* Pulse glow */
.pulse-glow {
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% { 
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

/* Gradient animation */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

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

/* Line draw animation */
.line-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: lineDraw 2s ease forwards;
}

@keyframes lineDraw {
    to { stroke-dashoffset: 0; }
}

/* Counter animation (for specs) */
.count-up {
    opacity: 0;
    transform: translateY(20px);
}

.count-up.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

/* Magnetic button effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reveal mask animation */
.reveal-mask {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.reveal-mask.visible {
    clip-path: inset(0 0 0 0);
}

/* Text reveal - character by character */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: textReveal 0.6s ease forwards;
}

@keyframes textReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth image loading */
.img-loading {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.img-loading.loaded {
    opacity: 1;
}

/* Card hover effects */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.card-3d-inner {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(5deg) rotateX(5deg);
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* Smooth scroll indicator bounce */
.scroll-bounce {
    animation: scrollBounce 2s infinite;
}

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

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 25%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
}

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

/* Blur in animation */
.blur-in {
    filter: blur(20px);
    opacity: 0;
    transition: filter 0.8s ease, opacity 0.8s ease;
}

.blur-in.visible {
    filter: blur(0);
    opacity: 1;
}

/* Rotate on scroll */
.rotate-scroll {
    transition: transform 0.1s linear;
}

/* Magnetic effect for interactive elements */
@media (hover: hover) {
    .magnetic {
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

/* Page transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 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;
    }
    
    .animate-fade-up,
    .animate-on-scroll,
    .animate-scale-in {
        opacity: 1;
        transform: none;
    }
}
