/* ===== Reset & Base ===== */
body {
  margin: 0;
  padding: 0;
  background: #000;
  color: #0ff;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===== Glitch Text ===== */
.glitch {
  position: relative;
  color: #fff;
  font-size: 3rem;
  font-weight: bold;
  text-transform: uppercase;
  animation: flicker 1.5s infinite alternate;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  color: #f00;
  clip: rect(0, 900px, 0, 0);
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 cyan;
  animation: glitchTop 1.5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 red;
  animation: glitchBottom 1.5s infinite linear alternate-reverse;
}

/* ===== Animations ===== */
@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
  }
  20%, 24%, 55% {
    opacity: 0.2;
  }
}

@keyframes glitchTop {
  0% {
    clip: rect(0, 9999px, 0, 0);
  }
  5% {
    clip: rect(0, 9999px, 50px, 0);
  }
  10% {
    clip: rect(0, 9999px, 0, 0);
  }
  15% {
    clip: rect(0, 9999px, 60px, 0);
  }
  20% {
    clip: rect(0, 9999px, 0, 0);
  }
  100% {
    clip: rect(0, 9999px, 40px, 0);
  }
}

@keyframes glitchBottom {
  0% {
    clip: rect(0, 9999px, 0, 0);
  }
  5% {
    clip: rect(30px, 9999px, 100px, 0);
  }
  10% {
    clip: rect(0, 9999px, 0, 0);
  }
  15% {
    clip: rect(20px, 9999px, 80px, 0);
  }
  20% {
    clip: rect(0, 9999px, 0, 0);
  }
  100% {
    clip: rect(40px, 9999px, 100px, 0);
  }
}

/* ===== VHS Scanlines ===== */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    rgba(0, 0, 0, 0.3) 2px
  );
  pointer-events: none;
  z-index: 10;
}

/* ===== Buttons with glitch ===== */
button {
  background: transparent;
  border: 2px solid #0ff;
  color: #0ff;
  padding: 10px 20px;
  margin-top: 20px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 1.2rem;
  transition: 0.3s;
}

button:hover {
  background: #0ff;
  color: #000;
  box-shadow: 0 0 15px #0ff, 0 0 25px #f0f;
}