/* default to border-box */
html {
  box-sizing: border-box;
  font-size: 16px;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

/* adjust typography defaults */
body {
  margin: 1rem;
  font-family: sans-serif;
  line-height: 1.5;
  /* Added for consistency if bacgroundWrapper is used */
  position: relative;
}

/* images and videos max out at full width */
img,
video {
  height: auto;
  max-width: 100%;
}

.mainHeader {
  margin: auto;
  width: 50%;
  text-align: center;
  font-size: 50px;
}

.neon {
  /* Using standard syntax + -webkit- for broader compatibility */
  background: linear-gradient(45deg, #09009f, #00ff95 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* background-color: initial; redundant when background is set */
}

@keyframes fadeInUp {
  0% {
    transform: translateY(10vh);
    opacity: 0;
  }
  100% {
    transform: translateY(0vh);
    opacity: 1;
  }
}

@keyframes fadeInUpSlow {
  0% {
    transform: translateY(5vh);
    opacity: 0;
  }
  100% {
    transform: translateY(0vh);
    opacity: 1;
  }
}

.fadeInUp-animation {
  animation: 1.5s fadeInUp;
}

.fadeInUpSlow-animation {
  animation: 3s fadeInUpSlow;
}

@keyframes rise {
  0% {
    transform: translateY(0vh);
  }
  100% {
    transform: translateY(-0.25vh);
  }
}

@keyframes fall {
  0% {
    transform: translateY(-0.25vh);
  }
  100% {
    transform: translateY(0);
  }
}

/* Note: position: absolute might take these out of flow. 
   Consider if this is intended. Using fixed might be better for true background */
.background {
  position: absolute;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  z-index: -1; /* Ensure it's behind content */
}

.bacgroundWrapper {
  margin: 0px;
  padding: 0px;
  overflow: hidden;
  /* Ensure wrapper takes up space if background is absolute */
  min-height: 100vh;
  position: relative;
}

.links {
  padding-top: 10vh;
  margin: auto;
  width: 50%;
  text-align: center;
}

/* --- MODIFIED SECTION --- */

.link {
  font-weight: bold;

  display: inline-block;
  font-size: 1.6em;
  background: linear-gradient(
    45deg,
    #9690f5 0%,
    #857fe3 40%,
    #09009f 60%,
    #00ff95 100% /* Start of state 2 at 60% of total width */
  );
  /* Make the background twice as wide as the element */
  background-size: 200% auto;
  /* Initially show the left half (state 1) */
  background-position: 0% center;

  /* Apply the text clipping */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Add transition for background-position and transform */
  transition: background-position 0.5s ease-in-out, transform 0.5s ease-in-out;

  /* Keep the initial fall animation */
  animation: fall 0.5s forwards;
}

.link:hover {
  /* Move the background to show the right half (state 2) */
  background-position: 100% center;
  /* Apply the transform on hover */
  transform: translateY(-0.25vh);
  animation: rise 0.5s forwards;

  /* Remove the animation call - transition handles the change now */
  /* animation: 0.5s colorFlash forwards; <-- REMOVED */
}
