/* ================================
   Keyframe Animations
================================ */

/* Gradient Blob Animations */
@keyframes blob-float-1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, 50px) scale(1.1);
    }

    50% {
        transform: translate(0, 100px) scale(0.9);
    }

    75% {
        transform: translate(-50px, 50px) scale(1.05);
    }
}

@keyframes blob-float-2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(-30px, -60px) scale(1.15);
    }

    50% {
        transform: translate(60px, -30px) scale(0.95);
    }

    75% {
        transform: translate(30px, -80px) scale(1.1);
    }
}

@keyframes blob-float-3 {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    33% {
        transform: translate(-40%, -60%) scale(1.2);
    }

    66% {
        transform: translate(-60%, -40%) scale(0.8);
    }
}

/* Floating Shape Animation */
@keyframes float-rotate {
    0% {
        transform: rotate(0deg) translateY(0);
    }

    50% {
        transform: rotate(180deg) translateY(-20px);
    }

    100% {
        transform: rotate(360deg) translateY(0);
    }
}

/* Grid Movement */
@keyframes grid-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 60px;
    }
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-15px);
    }

    60% {
        transform: translateX(-50%) translateY(-7px);
    }
}

/* Scroll Wheel Animation */
@keyframes scroll-wheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
}

/* Fade Up Animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Glow Pulse */
@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ================================
   Animation Classes
================================ */

/* Initial state for scroll animations */
.animate-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-fade-up.animated {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-in {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.animate-fade-in.animated {
    opacity: 1;
}

.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-scale-in.animated {
    opacity: 1;
    transform: scale(1);
}

/* Staggered Animation Delays */
.animate-fade-up:nth-child(1) {
    transition-delay: 0.1s;
}

.animate-fade-up:nth-child(2) {
    transition-delay: 0.2s;
}

.animate-fade-up:nth-child(3) {
    transition-delay: 0.3s;
}

.animate-fade-up:nth-child(4) {
    transition-delay: 0.4s;
}

.animate-fade-up:nth-child(5) {
    transition-delay: 0.5s;
}

.animate-fade-up:nth-child(6) {
    transition-delay: 0.6s;
}

/* Service Card Stagger */
.services-grid .service-card:nth-child(1) {
    transition-delay: 0.1s;
}

.services-grid .service-card:nth-child(2) {
    transition-delay: 0.2s;
}

.services-grid .service-card:nth-child(3) {
    transition-delay: 0.3s;
}

.services-grid .service-card:nth-child(4) {
    transition-delay: 0.4s;
}

.services-grid .service-card:nth-child(5) {
    transition-delay: 0.5s;
}

/* Project Card Stagger */
.projects-grid .project-card:nth-child(1) {
    transition-delay: 0.1s;
}

.projects-grid .project-card:nth-child(2) {
    transition-delay: 0.2s;
}

.projects-grid .project-card:nth-child(3) {
    transition-delay: 0.3s;
}

.projects-grid .project-card:nth-child(4) {
    transition-delay: 0.4s;
}

/* Tech Item Stagger */
.tech-grid .tech-item:nth-child(1) {
    transition-delay: 0.05s;
}

.tech-grid .tech-item:nth-child(2) {
    transition-delay: 0.1s;
}

.tech-grid .tech-item:nth-child(3) {
    transition-delay: 0.15s;
}

.tech-grid .tech-item:nth-child(4) {
    transition-delay: 0.2s;
}

.tech-grid .tech-item:nth-child(5) {
    transition-delay: 0.25s;
}

.tech-grid .tech-item:nth-child(6) {
    transition-delay: 0.3s;
}

.tech-grid .tech-item:nth-child(7) {
    transition-delay: 0.35s;
}

.tech-grid .tech-item:nth-child(8) {
    transition-delay: 0.4s;
}

.tech-grid .tech-item:nth-child(9) {
    transition-delay: 0.45s;
}

.tech-grid .tech-item:nth-child(10) {
    transition-delay: 0.5s;
}

/* ================================
   Hover Effects
================================ */

/* Neon Underline Hover */
.neon-underline {
    position: relative;
}

.neon-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-blue), 0 0 20px var(--accent-blue);
}

.neon-underline:hover::after {
    width: 100%;
}

/* Button Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Card Glow Effect */
.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--accent-gradient);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(10px);
}

.card-glow:hover::before {
    opacity: 0.5;
}

/* ================================
   Loading Animation
================================ */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* ================================
   Text Gradient Animation
================================ */
.gradient-text-animated {
    background: linear-gradient(90deg,
            var(--accent-blue),
            var(--accent-purple),
            var(--accent-blue));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ================================
   Particle Effect (CSS Only)
================================ */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: particle-float 10s infinite;
    opacity: 0.5;
}

@keyframes particle-float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ================================
   Typewriter Effect
================================ */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-blue);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--accent-blue);
    }
}