* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  background-color: black;
}

.container {
  color: white;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: black;
  display: grid;
  place-items: center;
  gap: 10px;
}

p {
  font-family: "Rubik", sans-serif;
  font-variant: normal;
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 0.8em;
  font-weight: 700;
  transform: translateY(-100px);
}

.text-box {
  display: block;
  position: relative;
  text-align: center;
}

h1 {
  font-family: "Rubik Glitch", sans-serif;
  font-size: 10vw;
  font-weight: normal;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  color: #fff;
  letter-spacing: 10px;
  text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
    -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
    0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  z-index: 15;
}

h1:nth-child(1) {
  animation: glitch-text 0.4s infinite, change-text 4s 0s infinite;
}
h1:nth-child(2) {
  animation: glitch-text 0.4s infinite, change-text 4s 1s infinite;
}
h1:nth-child(3) {
  animation: glitch-text 0.4s infinite, change-text 4s 2s infinite;
}
h1:nth-child(4) {
  animation: glitch-text 0.4s infinite, change-text 4s 3s infinite;
}

@keyframes glitch-text {
  0% {
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
      -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
      -0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  }

  13% {
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
      -0.05em -0.025em 0 rgba(0, 255, 0, 0.75),
      -0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  }

  15% {
    text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
      0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
      -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
  }

  48% {
    text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
      0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
      -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
  }

  50% {
    text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
      0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75);
  }

  97% {
    text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
      0.05em 0 0 rgba(0, 255, 0, 0.75), 0 -0.05em 0 rgba(0, 0, 255, 0.75);
  }

  to {
    text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
      -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
      -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
  }
}

@keyframes change-text {
  0% {
    opacity: 1;
  }
  24.9% {
    opacity: 1;
  }
  26% {
    opacity: 0;
  }
}

@media screen and (min-width: 700px) {
  h1 {
    font-size: 6em;
  }
  p {
    font-size: 1.4em;
  }
}
