.dynamic-word {
  display: inline-block;
  position: relative;
  transition: color 0.6s ease, opacity 0.5s ease, transform 0.5s ease;
}

/* Underline animation */
.dynamic-word::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s ease;
}

.dynamic-word.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.dynamic-word:not(.fade-out)::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Optional: preset colors */
.dynamic-color-0 { color: #00c6ff!important ;} /* Blue */
.dynamic-color-1 { color: #ff6b6b!important ;} /* Red */
.dynamic-color-2 { color: #ffd93d!important ;} /* Yellow */
.dynamic-color-3 { color: #4ade80!important ;} /* Green */
.dynamic-color-4 { color: #a78bfa!important ;} /* Purple */