@keyframes rainbow {
  0% { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

/* Cosmic pulse: subtle glow and scale effect */
@keyframes cosmicPulse {
  0%, 100% {
    text-shadow: 0 0 10px rgba(59,63,140,0.6), 0 0 20px rgba(59,63,140,0.4);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 20px rgba(59,63,140,0.9), 0 0 40px rgba(59,63,140,0.7);
    transform: scale(1.05);
  }
}

/* Spin effect: a subtle one‑time rotation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}

/* Shimmer effect via pseudo‑element */
@keyframes shimmer {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* Base styling for the title */
#animatedTitle {
  transition: all 1.5s ease-out;
  color: #ffffff;
  position: relative; /* Required for pseudo‑element positioning */
  overflow: hidden;
}

/* Animated state: applies cosmic glow and spin concurrently */
.title-animated {
  opacity: 1 !important;
  transform: translateY(0) !important;
  color: #7B68EE !important;
  /* Two animations: cosmicPulse runs continuously while spin runs once */
  animation: cosmicPulse 3s ease-in-out infinite, spin 1s ease-out;
}

/* Shimmer effect: triggered by the 'shimmer' class on the title */
.shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.8), transparent);
  transform: skewX(-20deg);
  animation: shimmer 1.5s ease forwards;
}

/* Extra spacing for the container below */
#boxContainer {
  margin-top: 40px;
}