/* Dedicated cursor styles so the main stylesheet stays untouched. Only apply when pointer is fine. */
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
    html body.custom-cursor-enabled,
    html body.custom-cursor-enabled *,
    html body.custom-cursor-enabled *::before,
    html body.custom-cursor-enabled *::after,
    .custom-cursor-enabled,
    .custom-cursor-enabled * {
        cursor: none !important;
    }
}

.cursor {
    position: fixed;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 9999999;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cursor::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(124, 91, 255, 0.48);
    box-shadow: 0 0 8px rgba(124, 91, 255, 0.16), 0 0 10px var(--brand-primary, #7c5bff);
    animation: cursor-pulse 2s infinite ease-in-out;
}

.cursor-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-primary, #7c5bff);
    box-shadow: 0 0 8px var(--brand-primary, #7c5bff), 0 0 14px rgba(124, 91, 255, 0.22);
    pointer-events: none !important;
}

.cursor-ring {
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border-top: 2px solid var(--brand-primary, #7c5bff);
    border-right: 1px solid transparent;
    border-bottom: 1px solid transparent;
    border-left: 1px solid transparent;
    box-shadow: 0 0 10px rgba(124, 91, 255, 0.1);
    animation: cursor-rotate 2.5s linear infinite, cursor-ring-pulse 1.8s ease-in-out infinite;
    pointer-events: none !important;
}

.cursor.hover {
    transform: translate(-50%, -50%) scale(1.4);
}

.cursor.text {
    width: 14px;
    height: 28px;
}

.cursor.text::before {
    width: 10px;
    height: 24px;
    border-radius: 4px;
}

.cursor.text .cursor-ring {
    opacity: 0;
}

.cursor.text .cursor-dot {
    width: 2px;
    height: 18px;
    border-radius: 999px;
    box-shadow: 0 0 8px var(--brand-primary, #7c5bff), 0 0 14px rgba(124, 91, 255, 0.22);
}

.cursor.click {
    transform: translate(-50%, -50%) scale(0.82);
}

.trail {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(124, 91, 255, 0.18);
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
}

@keyframes cursor-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes cursor-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

@keyframes cursor-ring-pulse {
    0%, 100% {
        opacity: 0.65;
        box-shadow: 0 0 8px rgba(124, 91, 255, 0.08);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 14px rgba(124, 91, 255, 0.22);
    }
}

@media (max-width: 768px), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .cursor,
    .trail {
        display: none !important;
    }

    .custom-cursor-enabled,
    .custom-cursor-enabled * {
        cursor: auto !important;
    }
}