/**
 * C2S — Custom Cursor CSS
 *
 * Curseur personnalisé (dot + cercle + label).
 * Utilise les variables du design system (global.css).
 */

/* Masquer le curseur natif sur desktop */
@media (hover: hover) and (pointer: fine) {
    body.c2s-body {
        cursor: none;
    }

    body.c2s-body a,
    body.c2s-body button,
    body.c2s-body [role="button"],
    body.c2s-body input[type="submit"] {
        cursor: none;
    }
}

.c2s-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-cursor);
    pointer-events: none;
    mix-blend-mode: difference;
}

/* Dot */
.c2s-cursor__dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--dark);
    transform: translate(-50%, -50%);
    transition: transform 80ms ease, opacity 200ms ease;
}

/* Circle */
.c2s-cursor__circle {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--dark);
    transform: translate(-50%, -50%);
    transition: width var(--duration-base) var(--ease-out-expo),
                height var(--duration-base) var(--ease-out-expo),
                border-color var(--duration-fast) ease,
                background-color var(--duration-fast) ease,
                opacity var(--duration-fast) ease;
}

/* Label */
.c2s-cursor__label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dark);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
}

/* ============================================
   États
   ============================================ */

/* Hover lien / bouton.
   IMPORTANT : on désactive `mix-blend-mode: difference` (déclaré
   sur .c2s-cursor pour rester visible sur fonds dark) dès qu'on
   passe en état hovering / has-label. Sans ça, `difference` inverse
   l'orange `rgba(255, 113, 32, …)` sur fond clair et le rend
   visuellement bleu/turquoise (255-255, 255-113, 255-32 ≈ 0,142,223).
   Le orange du design system reste ainsi PUR au hover. */
.c2s-cursor.is-hovering,
.c2s-cursor.has-label {
    mix-blend-mode: normal;
}

.c2s-cursor.is-hovering .c2s-cursor__circle {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 113, 32, 0.1);
    border-color: var(--color-primary);
}

.c2s-cursor.is-hovering .c2s-cursor__dot {
    transform: translate(-50%, -50%) scale(0.5);
    background-color: var(--color-primary);
}

/* Hover avec label */
.c2s-cursor.has-label .c2s-cursor__circle {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 113, 32, 0.15);
    border-color: var(--color-primary);
}

.c2s-cursor.has-label .c2s-cursor__label {
    opacity: 1;
    color: var(--color-primary);
}

.c2s-cursor.has-label .c2s-cursor__dot {
    opacity: 0;
}

/* Clic */
.c2s-cursor.is-clicking .c2s-cursor__circle {
    width: 30px;
    height: 30px;
}

/* Masqué */
.c2s-cursor.is-hidden {
    opacity: 0;
}

/* Masquer sur mobile */
@media (hover: none), (pointer: coarse) {
    .c2s-cursor {
        display: none !important;
    }
}
