:root {
    --target-cursor-rest: #62f4dc;
    --target-cursor-locked: #42a5ff;
    --target-cursor-glow: rgba(80, 236, 222, 0.34);
}

:root[data-theme="light"] {
    --target-cursor-rest: #123f68;
    --target-cursor-locked: #087ee7;
    --target-cursor-glow: rgba(8, 126, 231, 0.2);
}

html.target-cursor-active,
html.target-cursor-active * {
    cursor: none !important;
}

.target-cursor-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 12000;
    width: 0;
    height: 0;
    color: var(--target-cursor-rest);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-100px, -100px, 0);
    transition: color 160ms ease, opacity 160ms ease;
    will-change: transform;
}

.target-cursor-wrapper.is-visible {
    opacity: 1;
}

.target-cursor-wrapper.is-locked {
    color: var(--target-cursor-locked);
}

.target-cursor-frame {
    position: absolute;
    inset: 0;
    animation: targetCursorSpin 2.2s linear infinite;
    filter: drop-shadow(0 0 0.45rem var(--target-cursor-glow));
    transform-origin: center;
}

.target-cursor-wrapper.is-locked .target-cursor-frame {
    animation: none;
    transform: rotate(0deg);
}

.target-cursor-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0.75rem var(--target-cursor-glow);
    transform: translate(-50%, -50%) scale(1);
    transition: transform 180ms ease, background-color 160ms ease;
}

.target-cursor-wrapper.is-pressed .target-cursor-dot {
    transform: translate(-50%, -50%) scale(0.55);
}

.target-cursor-corner {
    position: absolute;
    left: 0;
    top: 0;
    width: 0.75rem;
    height: 0.75rem;
    border: 0.125rem solid currentColor;
    transition: transform 190ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 160ms ease;
    will-change: transform;
}

.target-cursor-corner[data-corner="tl"] {
    border-right: 0;
    border-bottom: 0;
    transform: translate3d(-1.125rem, -1.125rem, 0);
}

.target-cursor-corner[data-corner="tr"] {
    border-left: 0;
    border-bottom: 0;
    transform: translate3d(0.375rem, -1.125rem, 0);
}

.target-cursor-corner[data-corner="br"] {
    border-left: 0;
    border-top: 0;
    transform: translate3d(0.375rem, 0.375rem, 0);
}

.target-cursor-corner[data-corner="bl"] {
    border-right: 0;
    border-top: 0;
    transform: translate3d(-1.125rem, 0.375rem, 0);
}

@keyframes targetCursorSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (hover: none), (pointer: coarse), (max-width: 768px) {
    html.target-cursor-active,
    html.target-cursor-active * {
        cursor: auto !important;
    }

    .target-cursor-wrapper {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .target-cursor-frame {
        animation: none;
    }

    .target-cursor-wrapper,
    .target-cursor-dot,
    .target-cursor-corner {
        transition-duration: 0.01ms;
    }
}
