/**
 * PixelPitara - Modern Fluid Cursor System
 * Hardware-accelerated, lerp-damped elastic cursor & dynamic ambient spotlight.
 */

/* Hide default cursor on desktop when custom cursor is active */
@media (pointer: fine) and (min-width: 992px) {
    body.has-custom-cursor,
    body.has-custom-cursor a,
    body.has-custom-cursor button,
    body.has-custom-cursor [role="button"],
    body.has-custom-cursor input[type="submit"],
    body.has-custom-cursor .clickable {
        cursor: none !important;
    }
}

/* Base Cursor Canvas Elements */
.cursor-dot,
.cursor-aura {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    will-change: transform, width, height, opacity;
    transform: translate3d(-100px, -100px, 0);
    transition: opacity 0.3s ease, border-color 0.25s ease, background-color 0.25s ease;
}

/* Precision Inner Dot */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: #6366f1;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.9), 0 0 24px rgba(6, 182, 212, 0.4);
    margin-left: -4px;
    margin-top: -4px;
    opacity: 1;
}

/* Trailing Elastic Aura Ring */
.cursor-aura {
    width: 38px;
    height: 38px;
    margin-left: -19px;
    margin-top: -19px;
    border: 1.5px solid rgba(139, 92, 246, 0.6);
    background: rgba(99, 102, 241, 0.04);
    backdrop-filter: blur(1px);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.25s ease,
                border-color 0.25s ease,
                transform 0.1s linear;
}

/* Text label container inside the aura */
.cursor-aura .cursor-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-family: 'Outfit', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ffffff;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

/* Hover State - Links, Buttons & Interactive Elements */
.cursor-aura.cursor--hover {
    width: 60px;
    height: 60px;
    margin-left: -30px;
    margin-top: -30px;
    border-color: rgba(6, 182, 212, 0.85);
    background: rgba(6, 182, 212, 0.12);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.35);
}

.cursor-dot.cursor--hover {
    transform: translate3d(-100px, -100px, 0) scale(1.4);
    background: #06b6d4;
    box-shadow: 0 0 16px #06b6d4;
}

/* Card / Project View State */
.cursor-aura.cursor--view {
    width: 84px;
    height: 84px;
    margin-left: -42px;
    margin-top: -42px;
    border-color: rgba(244, 63, 94, 0.8);
    background: rgba(15, 20, 34, 0.88);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(244, 63, 94, 0.35);
}

.cursor-aura.cursor--view .cursor-label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cursor-dot.cursor--view {
    opacity: 0;
}

/* Active / Click Contraction */
.cursor-aura.cursor--active {
    width: 30px;
    height: 30px;
    margin-left: -15px;
    margin-top: -15px;
    background: rgba(99, 102, 241, 0.3);
    border-color: #6366f1;
}

.cursor-dot.cursor--active {
    transform: translate3d(-100px, -100px, 0) scale(0.7);
}

/* Ambient Cursor Spotlight Glow */
.cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 700px;
    height: 700px;
    margin-left: -350px;
    margin-top: -350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.03) 40%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    will-change: transform, opacity;
    transition: opacity 0.5s ease;
}

body.has-custom-cursor .cursor-spotlight {
    opacity: 1;
}

/* Card Local Glow Follower */
.card-spotlight {
    position: relative;
    overflow: hidden;
}

.card-spotlight::before {
    content: '';
    position: absolute;
    top: var(--mouse-y, -200px);
    left: var(--mouse-x, -200px);
    width: 260px;
    height: 260px;
    margin-left: -130px;
    margin-top: -130px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.16) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.card-spotlight:hover::before {
    opacity: 1;
}

/* Accessibility & Touch Fallbacks */
@media (pointer: coarse), (max-width: 991px), (prefers-reduced-motion: reduce) {
    .cursor-dot,
    .cursor-aura,
    .cursor-spotlight {
        display: none !important;
    }
    body, a, button, input, textarea, select {
        cursor: auto !important;
    }
}
