:root {
  --transition: 0.25s;
  --spark: 1.8s;
  --hue: 245;
}

.btn_ex {
  position: fixed;
  display: none;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  z-index: 1000;
}
.btn_ex button {
  --cut: 0.1em;
  --active: 0;
  --bg: radial-gradient(120% 120% at 126% 126%, hsl(var(--hue) calc(var(--active) * 97%) 98% / calc(var(--active) * 0.9)) 40%, transparent 50%) calc(100px - (var(--active) * 100px)) 0 / 100% 100% no-repeat, radial-gradient(120% 120% at 120% 120%, hsl(var(--hue) calc(var(--active) * 97%) 70% / calc(var(--active) * 1)) 30%, transparent 70%) calc(100px - (var(--active) * 100px)) 0 / 100% 100% no-repeat, hsl(var(--hue) calc(var(--active) * 100%) calc(12% - (var(--active) * 8%)));
  background: var(--bg);
  font-size: 14px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  padding: 14px 46px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  border-radius: 20px;
  position: relative;
  box-shadow: 0 0 calc(var(--active) * 3em) calc(var(--active) * 20px) hsl(var(--hue), 97%, 61%, 0.5), 0 3px 0 0 hsl(var(--hue), calc(var(--active) * 97%), calc(var(--active) * 50% + 30%)) inset, 0 -3px 0 0 hsl(var(--hue), calc(var(--active) * 97%), calc(var(--active) * 10%)) inset;
  transition: box-shadow var(--transition), scale var(--transition), background var(--transition);
  scale: calc(1 + var(--active) * 0.1);
  transform-style: preserve-3d;
  perspective: 100vmin;
  overflow: hidden;
}
.btn_ex button:active {
  scale: 1;
}
.btn_ex .star {
  height: calc(var(--size) * 1px);
  aspect-ratio: 1;
  background: white;
  border-radius: 50%;
  /*  filter: blur(4px);*/
  position: absolute;
  opacity: var(--alpha);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(10deg) rotate(0deg) translateY(calc(var(--distance) * 1px));
  animation: orbit calc(var(--duration) * 1s) calc(var(--delay) * -1s) infinite linear;
}
.btn_ex .galaxy {
  position: absolute;
  width: 100%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  overflow: hidden;
  opacity: var(--active);
  transition: opacity var(--transition);
  /*transform-style: preserve-3d;
  perspective: 100vmin;*/
  /*  opacity: 0.25;*/
}
.btn_ex .galaxy__ring {
  height: 200%;
  width: 200%;
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-28%, -40%) rotateX(-24deg) rotateY(-30deg) rotateX(90deg);
  transform-style: preserve-3d;
  /*  background: red;*/
}
.btn_ex .galaxy__container {
  position: absolute;
  inset: 0;
  opacity: var(--active);
  transition: opacity var(--transition);
  mask: radial-gradient(white, transparent);
}
.btn_ex .star--static {
  animation: none;
  top: 50%;
  left: 50%;
  transform: translate(0, 0);
  max-height: 4px;
  filter: brightness(4);
  opacity: 0.9;
  animation: move-x calc(var(--duration) * 0.1s) calc(var(--delay) * -0.1s) infinite linear, move-y calc(var(--duration) * 0.2s) calc(var(--delay) * -0.2s) infinite linear;
}
.btn_ex button:hover .star--static {
  animation-play-state: paused;
}
.btn_ex .spark {
  position: absolute;
  inset: 0;
  border-radius: 2rem;
  rotate: 0;
  overflow: hidden;
  mask: linear-gradient(white, transparent 50%);
  animation: flip calc(var(--spark) * 2) infinite steps(2, end);
}
.btn_ex .spark:before {
  content: "";
  position: absolute;
  width: 200%;
  aspect-ratio: 1;
  top: 0%;
  left: 50%;
  z-index: -1;
  translate: -50% -15%;
  rotate: 0;
  transform: rotate(-90deg);
  opacity: calc((var(--active)) + 0.4);
  background: conic-gradient(from 0deg, transparent 0 340deg, white 360deg);
  transition: opacity var(--transition);
  animation: rotate var(--spark) linear infinite both;
}
.btn_ex .spark:after {
  content: "";
  position: absolute;
  inset: var(--cut);
  border-radius: 2rem;
}
.btn_ex .backdrop {
  position: absolute;
  inset: var(--cut);
  background: var(--bg);
  border-radius: 2rem;
  transition: background var(--transition);
}
.btn_ex .text {
  translate: 2% -6%;
  letter-spacing: 0.01ch;
  /*background: linear-gradient(90deg, hsl(0 0% calc((var(--active) * 100%) + 65%)), hsl(0 0% calc((var(--active) * 100%) + 26%)));
  -webkit-background-clip: text;*/
  color: hsl(0, 0%, calc(60% + var(--active) * 26%));
}
.btn_ex button:is(:hover, :focus-visible) {
  --active: 1;
  --play-state: running;
}
.btn_ex button:is(:hover, :focus-visible) ~ :is(.bodydrop, .particle-pen) {
  --active: 1;
  --play-state: running;
}
.btn_ex .bodydrop {
  background: hsl(260, calc(var(--active) * 97%), 6%);
  position: fixed;
  inset: 0;
  z-index: -1;
}
.btn_ex .galaxy-button {
  position: relative;
}
.btn_ex button svg {
  width: 14px;
  translate: -25% -5%;
}

@keyframes orbit {
  to {
    transform: translate(-50%, -50%) rotate(10deg) rotate(360deg) translateY(calc(var(--distance) * 1px));
  }
}
@keyframes move-x {
  0% {
    translate: -100px 0;
  }
  100% {
    translate: 100px 0;
  }
}
@keyframes move-y {
  0% {
    transform: translate(0, -50px);
  }
  100% {
    transform: translate(0, 50px);
  }
}
@keyframes flip {
  to {
    rotate: 360deg;
  }
}
@keyframes rotate {
  to {
    transform: rotate(90deg);
  }
}
@supports (selector(:has(:is(+ *)))) {
  body:has(button:is(:hover, :focus-visible)) {
    --active: 1;
    --play-state: running;
  }
  .bodydrop {
    display: none;
  }
}
@keyframes float-out {
  to {
    rotate: 360deg;
  }
}
