#word-container {
  width: 50vw;
  height: 50vh;
  position: relative;
  margin-bottom: 3em;
}

.line {
  position: absolute;
  width: 100%;
  white-space: nowrap;
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

.line:nth-child(1) {
  animation: move-left 15s linear infinite;
}

.line:nth-child(2) {
  animation: move-right 10s linear infinite;
}

.line:nth-child(3) {
  animation: move-left 20s linear infinite;
}

.line:nth-child(4) {
  animation: move-right 12s linear infinite;
}

.line:nth-child(5) {
  animation: move-left 18s linear infinite;
}

.word {
  display: inline-block;
  margin-left: 15px;
  margin-right: 15px;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 2vw;
  color: var(--word-color);
}

.word:nth-child(3n) {
  --word-color: #a00a0a;
}

.word:nth-child(3n+1) {
  --word-color: black;
}

.word:nth-child(3n+2) {
  --word-color: darkgray;
}

@keyframes move-left {
  0% { transform: translateX(100%); } /* Start off-screen to the right */
  100% { transform: translateX(-100%); } /* Move off-screen to the left */
}

@keyframes move-right {
  0% { transform: translateX(-100%); } /* Start off-screen to the left */
  100% { transform: translateX(100%); } /* Move off-screen to the right */
}