:root {
  --wax-cursor-accent: var(--active-svg-color, #4e7dff);
  --wax-cursor-text: #ffffff;
  --wax-cursor-dot-size: 18px;
  --wax-cursor-active-size: 86px;
  --wax-cursor-ease: cubic-bezier(.22, .61, .36, 1);
  --wax-cursor-letter-ease: cubic-bezier(.16, 1, .3, 1);
  --wax-cursor-letter-duration: 520ms;
  --wax-cursor-letter-stagger: 58ms;
  --wax-cursor-scale: 1;
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .wax-custom-cursor {
    display: none !important;
  }
}

.wax-custom-cursor {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  overflow: visible;
}

.wax-custom-cursor.is-visible {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  body.wax-cursor-text-active,
  body.wax-cursor-text-active * {
    cursor: none !important;
  }
}

.wax-custom-cursor__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--wax-cursor-dot-size);
  height: var(--wax-cursor-dot-size);
  border-radius: 999px;
  background: var(--wax-cursor-accent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--wax-cursor-accent) 28%, transparent);
  opacity: 1;
  filter: saturate(1.1);
  transform: translate3d(var(--wax-cursor-x, -100px), var(--wax-cursor-y, -100px), 0) translate(-50%, -50%) scale(var(--wax-cursor-scale));
  will-change: transform, width, height;
  transition:
    width 280ms var(--wax-cursor-ease),
    height 280ms var(--wax-cursor-ease),
    box-shadow 280ms var(--wax-cursor-ease),
    opacity 160ms ease,
    filter 280ms var(--wax-cursor-ease);
}

.wax-custom-cursor.is-pressed {
  --wax-cursor-scale: .9;
}

@supports not (color: color-mix(in srgb, black 50%, transparent)) {
  .wax-custom-cursor__dot {
    box-shadow: 0 8px 24px rgba(78, 125, 255, .28);
  }
}

.wax-custom-cursor__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wax-cursor-text);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(11px, 18%, 16px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0;
  text-align: center;
  text-transform: uppercase;
  transform: scale(.98);
  transition:
    opacity 160ms ease,
    transform 260ms var(--wax-cursor-ease);
  user-select: none;
  white-space: nowrap;
}

.wax-custom-cursor.is-active .wax-custom-cursor__dot,
.wax-custom-cursor.is-typing .wax-custom-cursor__dot,
.wax-custom-cursor.is-copying .wax-custom-cursor__dot {
  width: var(--wax-cursor-active-size);
  height: var(--wax-cursor-active-size);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--wax-cursor-accent) 24%, transparent);
  opacity: 1;
}

.wax-custom-cursor.is-active .wax-custom-cursor__label,
.wax-custom-cursor.is-typing .wax-custom-cursor__label,
.wax-custom-cursor.is-copying .wax-custom-cursor__label {
  opacity: 1;
  transform: scale(1);
}

.wax-custom-cursor__letter {
  display: inline-block;
  min-width: .35em;
  opacity: 0;
  text-shadow: 0 1px 10px color-mix(in srgb, var(--wax-cursor-text) 22%, transparent);
  transform: translateY(135%);
  transform-origin: 50% 50%;
}

.wax-custom-cursor__letter.is-space {
  min-width: .28em;
}

.wax-custom-cursor.is-active .wax-custom-cursor__letter,
.wax-custom-cursor.is-typing .wax-custom-cursor__letter,
.wax-custom-cursor.is-copying .wax-custom-cursor__letter {
  animation: wax-cursor-letter-scroll var(--wax-cursor-letter-duration) var(--wax-cursor-letter-ease) forwards;
  animation-delay: calc(var(--wax-letter-index, 0) * var(--wax-cursor-letter-stagger));
}

.wax-custom-cursor.is-copying .wax-custom-cursor__dot {
  filter: saturate(1.2) brightness(1.05);
}

@keyframes wax-cursor-letter-scroll {
  0% {
    opacity: 0;
    transform: translateY(135%);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wax-custom-cursor__letter {
    opacity: 1;
    transform: none;
  }

  .wax-custom-cursor.is-active .wax-custom-cursor__letter,
  .wax-custom-cursor.is-typing .wax-custom-cursor__letter,
  .wax-custom-cursor.is-copying .wax-custom-cursor__letter {
    animation: none;
  }
}
