/* ==================== NEURAL SOFTWARE – ADVANCED ANIMATIONS ==================== */
/* Hardware-Accelerated, Performance-Optimized, Accessibility-Compliant */

/* ==================== KEYFRAME ANIMATIONS ==================== */

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate Animations */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pulse & Glow */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

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

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(0, 217, 255, 0.8));
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(5px, -10px);
    }
    50% {
        transform: translate(0, -20px);
    }
    75% {
        transform: translate(-5px, -10px);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Animations */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(2deg);
    }
    75% {
        transform: translateY(5px) rotate(-2deg);
    }
}

/* Morph */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Text Reveal */
@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary-500); }
}

/* Line Draw */
@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Particle Float */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(10px, -20px) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-5px, -40px) scale(1);
        opacity: 0.6;
    }
    75% {
        transform: translate(15px, -20px) scale(0.9);
        opacity: 0.7;
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ==================== ANIMATION CLASSES ==================== */

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spinSlow {
    animation: spinSlow 10s linear infinite;
}

.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.animate-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-morph {
    animation: morph 8s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* Delayed Animations */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Animation Durations */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* ==================== HERO ANIMATIONS ==================== */

.hero-title .word {
    opacity: 0;
    transform: translateY(100%);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-title .word:nth-child(1) { animation-delay: 0.2s; }
.hero-title .word:nth-child(2) { animation-delay: 0.3s; }
.hero-title .word:nth-child(3) { animation-delay: 0.4s; }
.hero-title .word:nth-child(4) { animation-delay: 0.5s; }

.hero-badge {
    opacity: 0;
    animation: fadeInDown 0.6s ease-out forwards;
    animation-delay: 0.1s;
}

.hero-subtitle {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.6s;
}

.hero-ctas {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.8s;
}

.hero-stats {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 1s;
}

/* ==================== CARD HOVER EFFECTS ==================== */

.feature-card,
.service-card,
.portfolio-card,
.pricing-card,
.process-step {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card::after,
.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.05), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

.feature-card:hover::after,
.service-card:hover::after {
    opacity: 1;
}

/* 3D Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

.tilt-card-content {
    transform: translateZ(30px);
}

/* ==================== BUTTON ANIMATIONS ==================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    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, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    position: relative;
    z-index: 1;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-400), var(--secondary-500));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
    border-radius: inherit;
}

.btn-primary:hover::after {
    opacity: 1;
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== SCROLL ANIMATIONS ==================== */

.scroll-progress {
    transition: transform 0.1s linear;
}

/* Parallax Elements */
[data-parallax] {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ==================== TEXT ANIMATIONS ==================== */

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: charReveal 0.5s ease forwards;
}

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

.split-text .char:nth-child(1) { animation-delay: 0.02s; }
.split-text .char:nth-child(2) { animation-delay: 0.04s; }
.split-text .char:nth-child(3) { animation-delay: 0.06s; }
.split-text .char:nth-child(4) { animation-delay: 0.08s; }
.split-text .char:nth-child(5) { animation-delay: 0.1s; }
.split-text .char:nth-child(6) { animation-delay: 0.12s; }
.split-text .char:nth-child(7) { animation-delay: 0.14s; }
.split-text .char:nth-child(8) { animation-delay: 0.16s; }
.split-text .char:nth-child(9) { animation-delay: 0.18s; }
.split-text .char:nth-child(10) { animation-delay: 0.2s; }

/* ==================== COUNTER ANIMATION ==================== */

.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.counter.counting {
    animation: pulse 0.3s ease-in-out;
}

/* ==================== LOADING STATES ==================== */

.skeleton {
    background: linear-gradient(90deg, var(--neutral-800) 25%, var(--neutral-700) 50%, var(--neutral-800) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==================== INTERSECTION OBSERVER TRIGGERS ==================== */

[data-animate] {
    opacity: 0;
}

[data-animate="fadeIn"].animated { animation: fadeIn 0.6s ease-out forwards; }
[data-animate="fadeInUp"].animated { animation: fadeInUp 0.6s ease-out forwards; }
[data-animate="fadeInDown"].animated { animation: fadeInDown 0.6s ease-out forwards; }
[data-animate="fadeInLeft"].animated { animation: fadeInLeft 0.6s ease-out forwards; }
[data-animate="fadeInRight"].animated { animation: fadeInRight 0.6s ease-out forwards; }
[data-animate="scaleIn"].animated { animation: scaleIn 0.6s ease-out forwards; }
[data-animate="bounceIn"].animated { animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }

/* ==================== 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;
    }
    
    .animate-float,
    .animate-pulse,
    .animate-spin,
    .animate-bounce,
    .animate-glow,
    .animate-morph {
        animation: none !important;
    }
}

/* ==================== INTERACTIVE STATES ==================== */

/* Focus Ring Animation */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(0, 217, 255, 0);
    }
}

button:focus-visible,
a:focus-visible {
    animation: focusRing 0.3s ease-out;
}

/* ==================== GRADIENT BACKGROUNDS ==================== */

.gradient-bg {
    background: linear-gradient(-45deg, var(--neutral-950), var(--neutral-900), var(--neutral-850), var(--neutral-900));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.gradient-text-animated {
    background: linear-gradient(90deg, var(--primary-400), var(--secondary-400), var(--accent-500), var(--primary-400));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

/* ==================== NOISE OVERLAY ==================== */

.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}
