@media (hover: hover) and (pointer: fine) {
  body.miralles-custom-cursor-enabled,
  body.miralles-custom-cursor-enabled * {
    cursor: none !important;
  }

  .miralles-cursor {
    --cursor-x: 50vw;
    --cursor-y: 50vh;
    --cursor-scale: 1;
    position: fixed;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    pointer-events: none;
    z-index: 2147483647;
    opacity: 0;
    transform: translate3d(var(--cursor-x), var(--cursor-y), 0)
      translate(-50%, -50%) scale(var(--cursor-scale));
    transition: opacity 180ms ease, filter 220ms ease;
    will-change: transform;
  }

  .miralles-cursor.is-visible {
    opacity: 1;
  }

  .miralles-cursor.is-hovering {
    --cursor-scale: 1.45;
    filter: drop-shadow(0 0 12px rgba(228, 210, 138, 0.32));
  }

  .miralles-cursor.is-pressed {
    --cursor-scale: 0.82;
  }

  .miralles-cursor__sphere {
    position: absolute;
    inset: 6px;
    border-radius: 999px;
    background:
      radial-gradient(circle at 34% 28%, rgba(255, 253, 232, 0.98) 0 13%, transparent 14%),
      radial-gradient(circle at 42% 36%, #e4d28a 0 26%, #b5a76e 48%, #4c3b22 100%);
    box-shadow:
      0 0 0 1px rgba(76, 59, 34, 0.18),
      0 8px 24px rgba(76, 59, 34, 0.28),
      inset -4px -5px 8px rgba(76, 59, 34, 0.32),
      inset 3px 3px 5px rgba(255, 255, 235, 0.42);
  }

  .miralles-cursor::before,
  .miralles-cursor::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(228, 210, 138, 0.72);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(181, 167, 110, 0.16);
  }

  .miralles-cursor::before {
    transform: rotate(31deg) scaleX(1.48) scaleY(0.58);
    animation: miralles-cursor-orbit-a 3.8s linear infinite;
  }

  .miralles-cursor::after {
    border-color: rgba(76, 59, 34, 0.5);
    transform: rotate(-42deg) scaleX(1.34) scaleY(0.66);
    animation: miralles-cursor-orbit-b 4.6s linear infinite;
  }

  @keyframes miralles-cursor-orbit-a {
    from {
      transform: rotate(31deg) scaleX(1.48) scaleY(0.58);
    }
    to {
      transform: rotate(391deg) scaleX(1.48) scaleY(0.58);
    }
  }

  @keyframes miralles-cursor-orbit-b {
    from {
      transform: rotate(-42deg) scaleX(1.34) scaleY(0.66);
    }
    to {
      transform: rotate(-402deg) scaleX(1.34) scaleY(0.66);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .miralles-cursor::before,
  .miralles-cursor::after {
    animation: none;
  }
}
