/* vibrant blue–purple underline that skips under the 'g' letter */

.rainbow-underline {
  position: relative;
  text-decoration: none;
}

/* each underlined section (before and after the g) */
.underline-part {
  position: relative;
  display: inline-block;
}

.underline-part::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 0.08em;
  top: 1.02em; /* controls how low the line sits */
  border-radius: 2px;

  /* main gradient – bright blue fading into purple */
  background: linear-gradient(
    90deg,
    #3dc8ff,  /* light cyan blue */
    #0088ff,  /* electric blue */
    #0044ff,  /* royal blue */
    #5a00ff,  /* violet */
    #9d00ff,  /* purple/magenta */
    #3dc8ff   /* loops back to blue */
  );

  background-size: 400% 100%;
  animation: rainbow-flow 11s linear infinite;
  will-change: background-position;
  pointer-events: none;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* offset the second underline a bit so both ends line up smoothly */
.no-underline + .underline-part::after {
  animation-delay: 2.5s;
  opacity: 0.96; /* slight fade helps hide the seam */
}

/* the letter g stays clean (no underline through it) */
.no-underline {
  position: relative;
  z-index: 1;
}

/* add a soft glow when hovering over the underline */
.underline-part:hover::after {
  filter: drop-shadow(0 0 6px rgba(77,153,255,0.35));
}

/* smooth, continuous left-to-right color motion */
@keyframes rainbow-flow {
  0%   { background-position:   0% 50%; }
  100% { background-position: 400% 50%; }
}

/* disables animation if the user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .underline-part::after {
    animation: none;
    background-size: 100% 100%;
  }
}
