/* Custom Artistic Cursor */
body:not(.touch-device) {
    cursor: none !important;
}

body:not(.touch-device) a,
body:not(.touch-device) button,
body:not(.touch-device) input,
body:not(.touch-device) textarea,
body:not(.touch-device) select,
body:not(.touch-device) .interactive-element {
    cursor: none !important;
}

/* Modal and Top-Layer Exceptions: Restore native cursor so user can interact */
body:not(.touch-device) dialog,
body:not(.touch-device) dialog *,
body:not(.touch-device) dialog::backdrop {
    cursor: auto !important;
}
body:not(.touch-device) dialog a,
body:not(.touch-device) dialog button,
body:not(.touch-device) dialog input,
body:not(.touch-device) dialog textarea,
body:not(.touch-device) dialog select {
    cursor: pointer !important;
}
body:not(.touch-device) dialog input[type="text"],
body:not(.touch-device) dialog input[type="url"],
body:not(.touch-device) dialog textarea {
    cursor: text !important;
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 12px;
    height: 12px;
    background-color: var(--text-color, #f8f9fa);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), height 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease, border-color 0.3s ease, border-radius 0.3s ease;
    mix-blend-mode: difference;
    box-sizing: border-box;
}

/* Hover States - transforms into a camera AF (Auto-Focus) point */
body:not(.touch-device) .cursor-hover #custom-cursor {
    width: 36px;
    height: 36px;
    background-color: transparent;
    border: 1.5px solid var(--text-color, #f8f9fa);
    border-radius: 4px;
}

/* Center dot for the AF point on hover */
body:not(.touch-device) .cursor-hover #custom-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: var(--text-color, #f8f9fa);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
}

/* Default state has no center dot */
#custom-cursor::after {
    content: '';
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Hide on touch devices */
@media (pointer: coarse), (hover: none) {
    #custom-cursor {
        display: none !important;
    }
}
