.text-section {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  background-image: url("../../assets/home/IMG_1857.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
}

.text-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(48, 92, 222, 0.4),
    rgba(0, 0, 0, 0.6)
  );
  z-index: 1;
}

.text-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.trailing-wrapper {
  width: 100%;
  max-width: 1536px;
  margin-inline: auto;
  position: relative;
  height: 8rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to left,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0)
  );
  mask-image: linear-gradient(
    to left,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0)
  );
}

@keyframes scrollLeftWords {
  to {
    left: -850px;
  }
}

.trailing-text {
  width: 400px;
  height: auto;
  position: absolute;
  overflow: hidden;
  left: max(calc(400px * 6), 100%);
  top: 50%;
  transform: translateY(-50%);
  animation-name: scrollLeftWords;
  animation-duration: 40s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  text-align: center;
}

.trailing-text p {
  font-family: var(--font-body);
  font-size: var(--fs-display-2xl);
  font-weight: var(--fw-extra-bold);
  color: white;
  white-space: nowrap;
  margin: 0;
  padding: 0 2rem;
  text-transform: uppercase;
}

.trailing-text-1 p,
.trailing-text-3 p,
.trailing-text-5 p {
  color: transparent;
  -webkit-text-stroke: 2px white;
}

.trailing-text-2 p,
.trailing-text-4 p,
.trailing-text-6 p {
  color: white;
}

.trailing-text-1 {
  animation-delay: calc(35s / 6 * (6 - 1) * -1);
}

.trailing-text-2 {
  animation-delay: calc(35s / 6 * (6 - 2) * -1);
}

.trailing-text-3 {
  animation-delay: calc(35s / 6 * (6 - 3) * -1);
}

.trailing-text-4 {
  animation-delay: calc(35s / 6 * (6 - 4) * -1);
}

.trailing-text-5 {
  animation-delay: calc(35s / 6 * (6 - 5) * -1);
}

.trailing-text-6 {
  animation-delay: calc(35s / 6 * (6 - 6) * -1);
}

@media (max-width: 900px) {
  .text-section {
    min-height: 25vh;

    background-attachment: scroll;

    background-position: center center;
  }
}

@media (max-width: 768px) {
  .text-section {
    min-height: 25vh;

    background-attachment: scroll;

    background-position: center center;
  }

  .text-section::before {
    background: linear-gradient(
      135deg,
      rgba(48, 92, 222, 0.5),
      rgba(0, 0, 0, 0.7)
    );
  }

  .trailing-wrapper {
    height: 6rem;
  }

  .trailing-text p {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .text-section {
    min-height: 20vh;
  }

  .trailing-wrapper {
    height: 6rem;
  }

  .trailing-text p {
    font-size: 3rem;
    padding: 0 6rem;
  }

  .trailing-text {
    width: 850px;
    left: max(calc(850px * 2.5), 100%);
  }

  .trailing-text-1 {
    animation-delay: calc(40s / 6 * (6 - 1) * -1);
  }

  .trailing-text-2 {
    animation-delay: calc(40s / 6 * (6 - 2) * -1);
  }

  .trailing-text-3 {
    animation-delay: calc(40s / 6 * (6 - 3) * -1);
  }

  .trailing-text-4 {
    animation-delay: calc(40s / 6 * (6 - 4) * -1);
  }

  .trailing-text-5 {
    animation-delay: calc(40s / 6 * (6 - 5) * -1);
  }

  .trailing-text-6 {
    animation-delay: calc(40s / 6 * (6 - 6) * -1);
  }

  @keyframes scrollLeftWords {
    from {
      left: 100%;
    }
    to {
      left: -950px;
    }
  }
}
