/* ==========================================================================
   Custom Cursor Styles - Google Colors Edition
   ========================================================================== 
   
   Features:
   - Dot follows immediately, ring with easing delay
   - Google colors cycling animation
   - Hover/click states
   - Hidden on touch devices for accessibility
   - Performance: transform only, no layout triggers
   
   ========================================================================== */

/* Hide default cursor on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    html:not(.touch-device) body {
        cursor: none;
    }
    
    html:not(.touch-device) a,
    html:not(.touch-device) button,
    html:not(.touch-device) [role="button"],
    html:not(.touch-device) input,
    html:not(.touch-device) textarea,
    html:not(.touch-device) select {
        cursor: none;
    }
}

/* ==========================================================================
   CURSOR DOT - Follows immediately
   ========================================================================== */

.cursor-dot {
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: var(--z-cursor, 9999);
    transform: translate(-50%, -50%);
    transition: 
        transform 0.15s ease,
        background 0.4s ease;
    will-change: transform;
}

/* ==========================================================================
   CURSOR RING - Follows with delay
   ========================================================================== */

.cursor-ring {
    width: 45px;
    height: 45px;
    border: 2px solid transparent;
    border-top-color: var(--color-primary);
    border-right-color: var(--color-tertiary);
    border-bottom-color: var(--color-quaternary);
    border-left-color: var(--color-secondary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: calc(var(--z-cursor, 9999) - 1);
    transform: translate(-50%, -50%);
    transition: 
        width 0.3s ease,
        height 0.3s ease,
        opacity 0.3s ease;
    animation: cursor-spin 2s linear infinite;
    will-change: transform;
}

@keyframes cursor-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   HOVER STATE - On interactive elements
   ========================================================================== */

.cursor-dot.cursor--hover {
    transform: translate(-50%, -50%) scale(2);
    background: linear-gradient(135deg, 
        var(--color-primary), 
        var(--color-tertiary), 
        var(--color-quaternary), 
        var(--color-secondary));
}

.cursor-ring.cursor--hover {
    width: 70px;
    height: 70px;
    animation-duration: 0.8s;
}

/* ==========================================================================
   CLICK STATE
   ========================================================================== */

.cursor-dot.cursor--click {
    transform: translate(-50%, -50%) scale(0.5);
}

.cursor-ring.cursor--click {
    width: 30px;
    height: 30px;
}

/* ==========================================================================
   HIDDEN STATE - When leaving window
   ========================================================================== */

.cursor-dot.cursor--hidden,
.cursor-ring.cursor--hidden {
    opacity: 0;
}

/* ==========================================================================
   ACCESSIBILITY - Hide on touch/mobile devices
   ========================================================================== */

/* Hide on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }
    
    /* Restore default cursor */
    * {
        cursor: auto !important;
    }
}


/* Hide on mobile (phones only) */
@media (max-width: 767px) {
    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .cursor-ring {
        animation: none;
    }
    
    .cursor-dot,
    .cursor-ring {
        transition: none;
    }
}

/* ==========================================================================
   CURSOR CONTAINER
   ========================================================================== */

.custom-cursor {
    /* Container is invisible but allows child elements to show */
    pointer-events: none;
}
