/**
 * MorphusAI TENSEI - Animations
 * Style: Aura / Ethereal Future
 */

/* Scroll Reveal - Smooth & Ethereal */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

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

.reveal--delay-1 {
    transition-delay: 0.1s;
}

.reveal--delay-2 {
    transition-delay: 0.2s;
}

.reveal--delay-3 {
    transition-delay: 0.3s;
}

/* Digital Glitch - Holographic Style */
.glitch {
    position: relative;
    display: inline-block;
    color: #fff;
}

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

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

.glitch::after {
    color: var(--accent-purple);
    z-index: -2;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(-2px, 1px);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(2px, -1px);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
        transform: translate(-2px, 2px);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(1px, -2px);
    }

    80% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(-1px, 1px);
    }

    100% {
        clip-path: inset(30% 0 40% 0);
        transform: translate(2px, -1px);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(2px, -1px);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-1px, 2px);
    }

    40% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(1px, -2px);
    }

    60% {
        clip-path: inset(15% 0 80% 0);
        transform: translate(-2px, 1px);
    }

    80% {
        clip-path: inset(55% 0 10% 0);
        transform: translate(2px, 2px);
    }

    100% {
        clip-path: inset(40% 0 30% 0);
        transform: translate(-1px, -2px);
    }
}

/* Neon Pulse - Subtle Breathing */
.neon-pulse {
    animation: neon-breath 4s ease-in-out infinite;
}

@keyframes neon-breath {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
    }

    50% {
        text-shadow: 0 0 25px rgba(0, 240, 255, 0.8), 0 0 5px rgba(255, 255, 255, 0.6);
    }
}

/* Ethereal Float */
.float {
    animation: ethereal-float 8s ease-in-out infinite;
}

@keyframes ethereal-float {

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

    50% {
        transform: translateY(-15px);
    }
}

/* Energy Beam Pulse - Left (from center to left) */
@keyframes pulse-beam-left {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-50vw);
        opacity: 0;
    }
}

.animate-pulse-beam-left {
    animation: pulse-beam-left 4s ease-out infinite;
}

/* Energy Beam Pulse - Right (from center to right) */
@keyframes pulse-beam-right {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(50vw);
        opacity: 0;
    }
}

.animate-pulse-beam-right {
    animation: pulse-beam-right 4s ease-out infinite;
}

/* Synchronized Card Glow - Left (Robot) */
@keyframes glow-left {

    0%,
    10% {
        background: linear-gradient(135deg, rgba(0, 240, 255, 0) 0%, transparent 100%);
    }

    90%,
    100% {
        background: linear-gradient(135deg, rgba(0, 240, 255, 0.6) 0%, transparent 50%);
        box-shadow: 0 0 40px rgba(0, 240, 255, 0.4), inset 0 0 30px rgba(0, 240, 255, 0.1);
    }
}

.animate-glow-left {
    animation: glow-left 4s ease-out infinite;
}

/* Synchronized Card Glow - Right (Kuroro) */
@keyframes glow-right {

    0%,
    10% {
        background: linear-gradient(225deg, rgba(112, 0, 255, 0) 0%, transparent 100%);
    }

    90%,
    100% {
        background: linear-gradient(225deg, rgba(112, 0, 255, 0.6) 0%, transparent 50%);
        box-shadow: 0 0 40px rgba(112, 0, 255, 0.4), inset 0 0 30px rgba(112, 0, 255, 0.1);
    }
}

.animate-glow-right {
    animation: glow-right 4s ease-out infinite;
}

/* Image Glow Animation - Left (Robot with Cyan) */
/* Stays grayscale for 80% of animation, only glows when beam arrives */
@keyframes image-glow-left {

    0%,
    80% {
        filter: grayscale(100%) contrast(1.2) brightness(0.8);
    }

    85% {
        filter: grayscale(50%) contrast(1.1) brightness(1);
    }

    90%,
    100% {
        filter: grayscale(0%) contrast(1) brightness(1.1) drop-shadow(0 0 40px rgba(0, 240, 255, 0.8));
    }
}

.animate-image-glow-left {
    animation: image-glow-left 4s ease-out infinite;
}

/* Image Glow Animation - Right (Kuroro with Purple) */
/* Stays grayscale for 80% of animation, only glows when beam arrives */
@keyframes image-glow-right {

    0%,
    80% {
        filter: grayscale(100%) contrast(1.2) brightness(0.8);
    }

    85% {
        filter: grayscale(50%) contrast(1.1) brightness(1);
    }

    90%,
    100% {
        filter: grayscale(0%) contrast(1) brightness(1.1) drop-shadow(0 0 40px rgba(112, 0, 255, 0.8));
    }
}

.animate-image-glow-right {
    animation: image-glow-right 4s ease-out infinite;
}

/* Ripple Out Animation (Like Topology Nodes) - More Visible */
@keyframes ripple-out {
    0% {
        transform: scale(1);
        opacity: 1;
        border-width: 3px;
        box-shadow: 0 0 20px currentColor, 0 0 40px currentColor;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        transform: scale(3);
        opacity: 0;
        border-width: 1px;
        box-shadow: 0 0 0px currentColor;
    }
}

.animate-ripple-out {
    animation: ripple-out 4s ease-out infinite;
}

/* Reduced Motion */
@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;
    }
}