@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes blurIn {
    from {
        filter: blur(20px);
        opacity: 0;
    }

    to {
        filter: blur(0);
        opacity: 1;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-blur-in {
    animation: blurIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Background Elements */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.grid-background {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(to right, rgba(128, 128, 128, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(128, 128, 128, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridAnimation 15s linear infinite;
    opacity: 0.6;
}

@keyframes gridAnimation {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 0 60px;
    }
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom,
            transparent,
            rgba(var(--beam-color-rgb, 0, 210, 255), 0.05) 50%,
            transparent);
    pointer-events: none;
    z-index: 10;
    animation: scan 8s linear infinite;
}

@keyframes scan {
    0% {
        transform: translateY(-100px);
    }

    100% {
        transform: translateY(100vh);
    }
}

.blob-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--accent-gradient);
    filter: blur(100px);
    opacity: 0.2;
    border-radius: 50%;
    animation: float 25s infinite alternate;
    transition: transform 0.2s ease-out;
}

.grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.05;
    pointer-events: none;
    z-index: 100;
}

.decorative-corners {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    pointer-events: none;
    z-index: 50;
    border: 1px solid rgba(var(--beam-color-rgb, 0, 210, 255), 0.1);
}

.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--beam-color);
    opacity: 0.5;
}

.corner-tl {
    top: -5px;
    left: -5px;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: -5px;
    right: -5px;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: -5px;
    left: -5px;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: -5px;
    right: -5px;
    border-left: none;
    border-top: none;
}

.ripple {
    position: fixed;
    border-radius: 50%;
    background: var(--glow-color);
    transform: scale(0);
    animation: ripple-effect 0.8s ease-out;
    pointer-events: none;
    z-index: 9999;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.blob-1 {
    top: -100px;
    left: -100px;
}

.blob-2 {
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

/* Scroll reveal helper */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Typing Text Animation */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {

    0%,
    100% {
        border-color: transparent;
    }

    50% {
        border-color: var(--text-color);
    }
}

.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 0.15em solid var(--text-color);
    animation: typing 3s steps(30, end) forwards, blink 0.7s step-end infinite;
    display: inline-block;
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

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

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 40px var(--glow-color);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 60px var(--glow-color);
    }
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Animation Classes */
.animate-slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

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

.hero-profile.animate-pulse {
    animation: pulse 4s ease-in-out infinite, heroFloat 6s ease-in-out infinite;
}

@keyframes heroFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-10px) rotate(2deg);
    }

    66% {
        transform: translateY(5px) rotate(-1deg);
    }
}

/* Particles Styles */
#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    background: var(--beam-color);
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
    filter: blur(1px);
    animation: particleFloat var(--duration) ease-in-out infinite;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }

    50% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0.6;
    }
}

/* Mouse Follow Glow */
.mouse-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    opacity: 0.4;
    filter: blur(50px);
    transition: transform 0.1s ease-out;
}

/* Glitch Effect */
.glitch {
    position: relative;
    display: inline-block;
}

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

.glitch-active::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 1s infinite linear alternate-reverse;
}

.glitch-active::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    animation: glitch-anim2 0.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(31px, 9999px, 94px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 42px, 0);
    }

    40% {
        clip: rect(16px, 9999px, 78px, 0);
    }

    60% {
        clip: rect(1px, 9999px, 13px, 0);
    }

    80% {
        clip: rect(53px, 9999px, 86px, 0);
    }

    100% {
        clip: rect(91px, 9999px, 98px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(30px, 9999px, 20px, 0);
    }

    40% {
        clip: rect(25px, 9999px, 85px, 0);
    }

    60% {
        clip: rect(75px, 9999px, 90px, 0);
    }

    80% {
        clip: rect(10px, 9999px, 5px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 45px, 0);
    }
}

/* Magnetic Element */
.magnetic {
    transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    display: inline-block;
}

.magnetic:not(:hover) {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

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

    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            transparent 25%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 75%);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

/* Hero Content Reveal */
.hero>* {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
}

.hero-ready>* {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}