/* JAM Gamesstudio - Animations & Effects */

/* Glitch Effect for Hero Title */
.glitch {
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-anim-1 0.5s infinite linear alternate-reverse;
    color: var(--neon-pink);
    z-index: -1;
}

.glitch::after {
    animation: glitch-anim-2 1s infinite linear alternate-reverse;
    color: var(--neon-blue);
    z-index: -2;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
        transform: skew(0.85deg);
    }
    5% {
        clip: rect(12px, 9999px, 59px, 0);
        transform: skew(0.4deg);
    }
    10% {
        clip: rect(48px, 9999px, 29px, 0);
        transform: skew(0.7deg);
    }
    15% {
        clip: rect(42px, 9999px, 73px, 0);
        transform: skew(0.1deg);
    }
    20% {
        clip: rect(63px, 9999px, 27px, 0);
        transform: skew(0.8deg);
    }
    25% {
        clip: rect(34px, 9999px, 55px, 0);
        transform: skew(0.2deg);
    }
    30% {
        clip: rect(86px, 9999px, 73px, 0);
        transform: skew(0.5deg);
    }
    35% {
        clip: rect(20px, 9999px, 20px, 0);
        transform: skew(1deg);
    }
    40% {
        clip: rect(26px, 9999px, 60px, 0);
        transform: skew(0.3deg);
    }
    45% {
        clip: rect(25px, 9999px, 85px, 0);
        transform: skew(0.9deg);
    }
    50% {
        clip: rect(75px, 9999px, 99px, 0);
        transform: skew(0.6deg);
    }
    55% {
        clip: rect(67px, 9999px, 61px, 0);
        transform: skew(0.4deg);
    }
    60% {
        clip: rect(79px, 9999px, 27px, 0);
        transform: skew(0.7deg);
    }
    65% {
        clip: rect(67px, 9999px, 11px, 0);
        transform: skew(0.1deg);
    }
    70% {
        clip: rect(62px, 9999px, 90px, 0);
        transform: skew(0.8deg);
    }
    75% {
        clip: rect(49px, 9999px, 30px, 0);
        transform: skew(0.2deg);
    }
    80% {
        clip: rect(31px, 9999px, 75px, 0);
        transform: skew(0.5deg);
    }
    85% {
        clip: rect(15px, 9999px, 94px, 0);
        transform: skew(1deg);
    }
    90% {
        clip: rect(82px, 9999px, 81px, 0);
        transform: skew(0.3deg);
    }
    95% {
        clip: rect(2px, 9999px, 98px, 0);
        transform: skew(0.9deg);
    }
    100% {
        clip: rect(30px, 9999px, 48px, 0);
        transform: skew(0.6deg);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
        transform: skew(0.2deg);
    }
    5% {
        clip: rect(52px, 9999px, 74px, 0);
        transform: skew(0.7deg);
    }
    10% {
        clip: rect(79px, 9999px, 85px, 0);
        transform: skew(0.5deg);
    }
    15% {
        clip: rect(75px, 9999px, 5px, 0);
        transform: skew(0.1deg);
    }
    20% {
        clip: rect(67px, 9999px, 61px, 0);
        transform: skew(0.4deg);
    }
    25% {
        clip: rect(14px, 9999px, 79px, 0);
        transform: skew(0.8deg);
    }
    30% {
        clip: rect(1px, 9999px, 66px, 0);
        transform: skew(0.3deg);
    }
    35% {
        clip: rect(86px, 9999px, 30px, 0);
        transform: skew(0.9deg);
    }
    40% {
        clip: rect(23px, 9999px, 98px, 0);
        transform: skew(0.6deg);
    }
    45% {
        clip: rect(34px, 9999px, 42px, 0);
        transform: skew(0.2deg);
    }
    50% {
        clip: rect(88px, 9999px, 15px, 0);
        transform: skew(0.7deg);
    }
    55% {
        clip: rect(16px, 9999px, 95px, 0);
        transform: skew(0.5deg);
    }
    60% {
        clip: rect(49px, 9999px, 71px, 0);
        transform: skew(0.1deg);
    }
    65% {
        clip: rect(37px, 9999px, 46px, 0);
        transform: skew(0.4deg);
    }
    70% {
        clip: rect(53px, 9999px, 84px, 0);
        transform: skew(0.8deg);
    }
    75% {
        clip: rect(21px, 9999px, 17px, 0);
        transform: skew(0.3deg);
    }
    80% {
        clip: rect(76px, 9999px, 51px, 0);
        transform: skew(0.9deg);
    }
    85% {
        clip: rect(38px, 9999px, 87px, 0);
        transform: skew(0.6deg);
    }
    90% {
        clip: rect(6px, 9999px, 32px, 0);
        transform: skew(0.2deg);
    }
    95% {
        clip: rect(93px, 9999px, 68px, 0);
        transform: skew(0.7deg);
    }
    100% {
        clip: rect(41px, 9999px, 53px, 0);
        transform: skew(0.5deg);
    }
}

@keyframes glitch-skew {
    2%, 64% {
        transform: skew(0deg);
    }
    4%, 60% {
        transform: skew(2deg);
    }
    62% {
        transform: skew(0deg);
    }
}

/* Floating Animation for Hero Particles */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation for Buttons */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 255, 136, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0);
    }
}

.btn-primary:hover {
    animation: pulse 2s infinite;
}

/* Slide In Animations */
@keyframes slideInLeft {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Apply animations to elements */
.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

/* Hover Effects */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* Neon Border Animation */
@keyframes neon-border {
    0%, 100% {
        border-color: var(--neon-green);
        box-shadow: 0 0 5px var(--neon-green);
    }
    25% {
        border-color: var(--neon-blue);
        box-shadow: 0 0 5px var(--neon-blue);
    }
    50% {
        border-color: var(--neon-pink);
        box-shadow: 0 0 5px var(--neon-pink);
    }
    75% {
        border-color: var(--neon-purple);
        box-shadow: 0 0 5px var(--neon-purple);
    }
}

.neon-border-animation {
    animation: neon-border 4s infinite;
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--neon-green);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 0.15em solid var(--neon-green);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Parallax Scroll Effects */
.parallax-element {
    transition: transform 0.1s ease-out;
}

/* Loading Spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--neon-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* Stagger Animation for Lists */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* Particle Animation */
@keyframes particle-float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
        opacity: 1;
    }
    33% {
        transform: translateY(-30px) translateX(30px);
        opacity: 0.8;
    }
    66% {
        transform: translateY(-60px) translateX(-20px);
        opacity: 0.6;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-green);
    border-radius: 50%;
    animation: particle-float 6s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 0.5s; }
.particle:nth-child(8) { left: 80%; animation-delay: 1.5s; }
.particle:nth-child(9) { left: 90%; animation-delay: 2.5s; }

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* Scroll Reveal Animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Image Hover Effects */
.image-hover-effect {
    overflow: hidden;
    border-radius: 8px;
}

.image-hover-effect img {
    transition: transform 0.5s ease;
}

.image-hover-effect:hover img {
    transform: scale(1.1);
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 10px currentColor;
}

/* Border Gradient Animation */
@keyframes border-gradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-border {
    background: linear-gradient(-45deg, var(--neon-green), var(--neon-blue), var(--neon-pink), var(--neon-purple));
    background-size: 400% 400%;
    animation: border-gradient 15s ease infinite;
    padding: 2px;
    border-radius: 12px;
}

.gradient-border-content {
    background: var(--primary-bg);
    border-radius: 10px;
    padding: 1rem;
}