/* Text Scramble Animation Styles */
.text-scramble {
  display: inline-block;
  position: relative;
  font-weight: normal;
  color: #fff;
  min-width: 1px; /* Ensure element has width even when empty */
  visibility: visible !important; /* Ensure visibility */
}

/* Prevent layout shift by using a transparent placeholder */
.text-scramble::before {
  content: attr(data-text);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

.text-scramble .dud {
  opacity: 0.9;
  color: #3DF9A4;
  text-shadow: 0 0 10px rgba(61, 249, 164, 0.6);
  position: relative;
  display: inline-block;
  transform-origin: center;
}

.text-scramble .dud.active {
  animation: glitch 0.3s ease-in-out;
}

@keyframes glitch {
  0% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(61, 249, 164, 0.6);
  }
  20% {
    transform: translate(-2px, 2px);
    text-shadow: 0 0 15px rgba(61, 249, 164, 0.8);
  }
  40% {
    transform: translate(-2px, -2px);
    text-shadow: 0 0 20px rgba(61, 249, 164, 1);
  }
  60% {
    transform: translate(2px, 2px);
    text-shadow: 0 0 15px rgba(61, 249, 164, 0.8);
  }
  80% {
    transform: translate(2px, -2px);
    text-shadow: 0 0 10px rgba(61, 249, 164, 0.6);
  }
  100% {
    transform: translate(0);
    text-shadow: 0 0 10px rgba(61, 249, 164, 0.6);
  }
}

.scramble-wrapper {
  display: inline-block;
  position: relative;
}
