/* _error.css */

/* Glitch Animation Style */
.error-glitch {
    position: relative;
    font-size: 120px;
    letter-spacing: 5px;
    animation: flicker 2s infinite;
    @apply font-bold;

    &::before,
    &::after {
        content: attr(data-text);
        position: absolute;
        inset-inline-start: 0;
        top: 0;
        width: 100%;
        overflow: hidden;
    }

    &::before {
        color: var(--color-primary);
        z-index: -1;
        animation: glitchTop 2s infinite;
    }

    &::after {
        color: var(--color-danger);
        z-index: -1;
        animation: glitchBottom 2s infinite;
    }
}

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

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

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

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

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

    100% {
        clip-path: inset(0 0 90% 0);
        transform: translate(0, 0);
    }
}

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

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

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

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

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

    100% {
        clip-path: inset(90% 0 0 0);
        transform: translate(0, 0);
    }
}

@keyframes flicker {
    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        opacity: 1;
    }

    20%,
    24%,
    55% {
        opacity: 0.6;
    }
}

/* // Wave Animation Style */
.error-wave-container {
    display: flex;
    font-size: 120px;
    font-weight: 900;
}

.error-wave-char {
    display: inline-block;
    animation: wave 2s infinite ease-in-out;
    background: linear-gradient(90deg, var(--color-primary), var(--color-purple));
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-wave-char:nth-child(1) {
    animation-delay: 0s;
}

.error-wave-char:nth-child(2) {
    animation-delay: 0.2s;
}

.error-wave-char:nth-child(3) {
    animation-delay: 0.4s;
}

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

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