@keyframes background-pan {
  from {
    background-position: 0% center;
  }

  to {
    background-position: -200% center;
  }
}

@keyframes scale {
  from,
  to {
    transform: scale(0);
  }

  50% {
    transform: scale(1);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(180deg);
  }
}

.magic {
  display: inline-block;
  position: relative;
  --purple: rgb(123, 31, 162);
  --violet: rgb(103, 58, 183);
  --pink: rgb(244, 143, 177);
  --star-left: 10%;
  --star-top: 10%;
}

.magic > .magic__star {
  --size: clamp(20px, 1.5vw, 30px);
  animation: scale 700ms ease forwards;
  display: block;
  height: 20px;
  left: var(--star-left);
  position: absolute;
  top: var(--star-top);
  width: 20px;
}

.magic > .magic__star > svg {
  animation: rotate 1000ms linear infinite;
  display: block;
  opacity: 0.7;
}

.magic > .magic__star > svg > path {
  fill: var(--violet);
}

.magic > .magic__text {
  animation: background-pan 3s linear infinite;
  background: linear-gradient(
    to right,
    var(--purple),
    var(--violet),
    var(--pink),
    var(--purple)
  );
  background-size: 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
