body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
}

.glitch-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.glitch-text {
    font-size: 48px;
    color: white;
    text-align: center;
    text-transform: uppercase;
    font-family: Arial, sans-serif;
    position: relative;
    animation: glitch 0.3s infinite linear alternate-reverse;
}

.glitch-text.glitch-404 {
    font-size: 200px;
}

.glitch-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%; /* Double the width to create a repeating effect */
    height: 100%;
    background-image: url('glitch-bg.jpg'); /* Replace 'glitch-bg.jpg' with your glitchy background image */
    z-index: -1;
    animation: glitch-background 5s infinite linear alternate;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0, 0);
    }
    94%, 96%, 98% {
        transform: translate(-15px, -5px);
    }
    95%, 97%, 99% {
        transform: translate(15px, 5px);
    }
}

@keyframes glitch-background {
    0% {
        background-position: 0 0; /* Initial position */
    }
    25% {
        background-position: var(--pos-1); /* Random jump position */
    }
    50% {
        background-position: var(--pos-2); /* Random jump position */
    }
    75% {
        background-position: var(--pos-3); /* Random jump position */
    }
    100% {
        background-position: var(--pos-4); /* Random jump position */
    }
}
