/* ==========================================================================
   Custom Magnetic Cursor (Awwwards SOTD UX - Refined)
   ========================================================================== */

#custom-cursor {
    --cursor-size: 30px;
    --cursor-label-offset: 23px;
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 15000;
    opacity: 0;
    transition: opacity 160ms ease;
    will-change: transform;
}

.cursor-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--accent-gold, #d4af37);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 180ms ease, opacity 180ms ease;
}

.cursor-ring {
    position: absolute;
    width: var(--cursor-size);
    height: var(--cursor-size);
    border: 1px solid rgba(212, 175, 55, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(10, 10, 14, 0.08);
    box-sizing: border-box;
    transition:
        width 240ms cubic-bezier(0.22, 1, 0.36, 1),
        height 240ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease;
}

.cursor-label {
    position: absolute;
    top: var(--cursor-label-offset);
    left: 0;
    font-family: var(--premium-font-ui, 'Outfit', sans-serif);
    font-size: 0.56rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.13em;
    color: #ffffff;
    text-transform: uppercase;
    opacity: 0;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -4px);
    transform-origin: center top;
    transition:
        opacity 160ms ease,
        transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
        top 240ms cubic-bezier(0.22, 1, 0.36, 1),
        color 160ms ease;
    pointer-events: none;
    text-align: center;
}

#custom-cursor.is-hovering-artwork .cursor-label,
#custom-cursor.is-hovering-interactive .cursor-label {
    opacity: 1;
    transform: translate(-50%, 0);
}

#custom-cursor.is-hovering-artwork {
    --cursor-size: 50px;
    --cursor-label-offset: 34px;
}

#custom-cursor.is-hovering-artwork .cursor-ring {
    background-color: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.95);
}

#custom-cursor.is-hovering-artwork .cursor-label {
    color: var(--accent-gold, #d4af37);
}

#custom-cursor.is-hovering-interactive {
    --cursor-size: 44px;
    --cursor-label-offset: 31px;
}

#custom-cursor.is-hovering-interactive .cursor-ring {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(212, 175, 55, 0.82);
}

#custom-cursor.is-hovering-artwork .cursor-dot,
#custom-cursor.is-hovering-interactive .cursor-dot {
    transform: translate(-50%, -50%) scale(0.9);
}

/* Dragging State */
#custom-cursor.is-dragging {
    --cursor-size: 46px;
    --cursor-label-offset: 32px;
}

#custom-cursor.is-dragging .cursor-ring {
    background-color: rgba(212, 175, 55, 0.16);
    border-color: var(--accent-gold, #d4af37);
}

#custom-cursor.is-dragging .cursor-label {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Active Click Feedback */
#custom-cursor.is-click-down .cursor-ring {
    transform: translate(-50%, -50%) scale(0.86);
}

/* The cursor owns desktop feedback; avoid a second, contradictory tooltip layer. */
@media (hover: hover) and (pointer: fine) {
    body.has-custom-cursor [data-tooltip]::after,
    body.has-custom-cursor .floating-tooltip {
        display: none !important;
    }
}

/* Global Unified Custom Cursor: Hide native OS cursor ONLY when CustomCursor is active on desktop */
@media (hover: hover) and (pointer: fine) {
    body.has-custom-cursor,
    body.has-custom-cursor #sitio,
    body.has-custom-cursor #galeria-sala,
    body.has-custom-cursor #galeria-sala canvas,
    body.has-custom-cursor #dossier-expo,
    body.has-custom-cursor nav,
    body.has-custom-cursor button,
    body.has-custom-cursor a,
    body.has-custom-cursor summary,
    body.has-custom-cursor [role="button"] {
        cursor: none !important;
    }
}

@media (hover: none), (pointer: coarse) {
    #custom-cursor {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #custom-cursor,
    .cursor-ring,
    .cursor-dot,
    .cursor-label {
        transition-duration: 0.01ms !important;
    }
}
