*,
*::after,
*::before {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

:root {
  --yangColor: #d8c21e;
  --yinColor: #111111;
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  font-family: 'Space Mono', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--yangColor);
  background-color: var(--yinColor);
  width: 100%;
  height: 100vh;
  overflow: hidden auto;
}

.text {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  width: 835px;
  border-right: 2px solid var(--yinColor);
  animation: typewriter 4s steps(42) 1s normal both,
    textCursor 500ms steps(42) infinite normal;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 835px;
  }
}

@keyframes textCursor {
  from {
    border-right-color: rgba var(--yangColor);
  }
  to {
    border-right-color: transparent;
  }
}

@media (min-width: 651px) and (max-width: 920px) {
  .text {
    font-size: 1.5rem;
    width: 630px;
    animation: typewriter 2s steps(30) 1s normal both,
      textCursor 500ms steps(30) infinite normal;
  }

  @keyframes typewriter {
    from {
      width: 0;
    }
    to {
      width: 630px;
    }
  }
}

@media (max-width: 650px) {
  .text {
    font-size: 1rem;
    width: 270px;
    animation: typewriter 2s steps(20) 1s normal both,
      textCursor 500ms steps(42) infinite normal;
  }

  @keyframes typewriter {
    from {
      width: 0;
    }
    to {
      width: 270px;
    }
  }
}
