/* Advanced Animations - Razer Style */

/* Kinetic Typography */
.kinetic-text {
    overflow: hidden;
}

.kinetic-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(-90deg);
    animation: charReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

/* Staggered animations */
.kinetic-text .char:nth-child(1) {
    animation-delay: 0.05s;
}

.kinetic-text .char:nth-child(2) {
    animation-delay: 0.1s;
}

.kinetic-text .char:nth-child(3) {
    animation-delay: 0.15s;
}

.kinetic-text .char:nth-child(4) {
    animation-delay: 0.2s;
}

.kinetic-text .char:nth-child(5) {
    animation-delay: 0.25s;
}

.kinetic-text .char:nth-child(6) {
    animation-delay: 0.3s;
}

.kinetic-text .char:nth-child(7) {
    animation-delay: 0.35s;
}

.kinetic-text .char:nth-child(8) {
    animation-delay: 0.4s;
}

.kinetic-text .char:nth-child(9) {
    animation-delay: 0.45s;
}

.kinetic-text .char:nth-child(10) {
    animation-delay: 0.5s;
}

/* Glitch Effect - Green */
.glitch {
    position: relative;
}

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

.glitch:hover::before {
    opacity: 0.8;
    color: #00ff00;
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.glitch:hover::after {
    opacity: 0.8;
    color: #44ff00;
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

@keyframes glitch-1 {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-3px, 3px);
    }

    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(3px, -3px);
    }

    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-3px, 3px);
    }

    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(3px, -3px);
    }

    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(-3px, 3px);
    }

    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(3px, -3px);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(65% 0 30% 0);
        transform: translate(3px, -3px);
    }

    20% {
        clip-path: inset(10% 0 85% 0);
        transform: translate(-3px, 3px);
    }

    40% {
        clip-path: inset(60% 0 15% 0);
        transform: translate(3px, -3px);
    }

    60% {
        clip-path: inset(5% 0 70% 0);
        transform: translate(-3px, 3px);
    }

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

    100% {
        clip-path: inset(20% 0 65% 0);
        transform: translate(-3px, 3px);
    }
}

/* Neon Flicker - Green */
.neon-flicker {
    animation: neonFlicker 3s infinite alternate;
}

@keyframes neonFlicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        text-shadow:
            0 0 5px #00ff00,
            0 0 10px #00ff00,
            0 0 20px #00ff00,
            0 0 40px #44ff00,
            0 0 80px #44ff00;
    }

    20%,
    24%,
    55% {
        text-shadow: none;
    }
}

/* Scan Effect */
.scan-effect {
    position: relative;
    overflow: hidden;
}

.scan-effect::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(180deg, transparent, #00ff00, transparent);
    animation: scanDown 3s linear infinite;
    opacity: 0.5;
}

@keyframes scanDown {
    0% {
        top: -5px;
    }

    100% {
        top: 100%;
    }
}

/* Floating Animation */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

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

    25% {
        transform: translateY(-10px) rotate(1deg);
    }

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

    75% {
        transform: translateY(-15px) rotate(-1deg);
    }
}

/* Data Stream Animation */
.data-stream {
    position: relative;
    overflow: hidden;
}

.data-stream::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
    animation: dataFlow 2s linear infinite;
}

@keyframes dataFlow {
    to {
        left: 200%;
    }
}

/* Matrix Rain Effect Background */
.matrix-bg {
    position: relative;
}

.matrix-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(0, 255, 0, 0.05) 0%,
            transparent 20%,
            transparent 80%,
            rgba(0, 255, 0, 0.05) 100%);
    pointer-events: none;
}

/* Scan Lines */
.scanlines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15) 0px,
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    animation: scanMove 10s linear infinite;
}

@keyframes scanMove {
    0% {
        background-position: 0 0;
    }

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

/* Box Border Animation */
.border-anim {
    position: relative;
}

.border-anim::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    background: linear-gradient(90deg, #00ff00, #44ff00, #00ff00) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    animation: borderRotate 4s linear infinite;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }

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

/* Cursor Glow Trail - Green */
.cursor-glow {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #00ff00, transparent);
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
    mix-blend-mode: screen;
    transition: width 0.3s, height 0.3s, opacity 0.3s;
}

.cursor-glow.active {
    width: 50px;
    height: 50px;
    opacity: 0.8;
}

/* Ripple Effect - Green */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.4);
    transform: scale(0);
    animation: rippleExpand 0.6s linear;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Typewriter Effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #00ff00;
    white-space: nowrap;
    animation:
        typing 3s steps(30, end),
        blink 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #00ff00;
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

/* Scale Pop */
.pop {
    animation: pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
    0% {
        transform: scale(0.9);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Slide Reveal */
.slide-reveal {
    clip-path: inset(0 100% 0 0);
    animation: slideReveal 1s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes slideReveal {
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* Power-Up Effect */
.power-up {
    position: relative;
}

.power-up::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, #00ff00, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.power-up:hover::before {
    opacity: 0.1;
    animation: powerPulse 1s ease-in-out infinite;
}

@keyframes powerPulse {

    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.2;
    }
}

/* Circuit Lines */
.circuit {
    position: relative;
}

.circuit::before,
.circuit::after {
    content: '';
    position: absolute;
    background: #00ff00;
    opacity: 0.2;
}

.circuit::before {
    width: 100%;
    height: 1px;
    top: 50%;
    animation: circuitH 3s linear infinite;
}

.circuit::after {
    width: 1px;
    height: 100%;
    left: 50%;
    animation: circuitV 3s linear infinite 1.5s;
}

@keyframes circuitH {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }

    50% {
        transform: scaleX(1);
        transform-origin: left;
    }

    50.01% {
        transform-origin: right;
    }

    100% {
        transform: scaleX(0);
        transform-origin: right;
    }
}

@keyframes circuitV {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    50.01% {
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-top-color: #00ff00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Entrance Animations */
.animate-in {
    opacity: 0;
    animation: animateIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes animateIn {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

/* Mobile Touch Haptic Feedback */
@media (hover: none) {
    .touch-feedback {
        -webkit-tap-highlight-color: transparent;
    }

    .touch-feedback:active {
        animation: touchPulse 0.2s ease;
    }

    @keyframes touchPulse {
        0% {
            transform: scale(1);
        }

        50% {
            transform: scale(0.95);
        }

        100% {
            transform: scale(1);
        }
    }
}

/* Corner Cut Animation */
.corner-cut-anim {
    position: relative;
}

.corner-cut-anim::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-top: 2px solid #00ff00;
    border-right: 2px solid #00ff00;
    animation: cornerPulse 2s ease-in-out infinite;
}

.corner-cut-anim::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid #00ff00;
    border-left: 2px solid #00ff00;
    animation: cornerPulse 2s ease-in-out infinite 1s;
}

@keyframes cornerPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Hexagon Spinner */
.hex-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.hex-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, transparent, #00ff00, transparent);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: hexSpin 2s linear infinite;
}

@keyframes hexSpin {
    to {
        transform: rotate(360deg);
    }
}