/*
 * plan9-cursor.css
 *
 * A restrained "precision scanner" cursor: a small fixed dot plus a thin
 * ring that trails the pointer with slight easing (the easing itself is
 * done in plan9-cursor.js via lerp -- this file is purely presentational).
 *
 * Activation is class-driven, not just media-query-driven: plan9-cursor.js
 * adds `p9-cursor-active` to <html> only after confirming (a) a fine
 * pointer is available and (b) its own setup succeeded, then hides the
 * native cursor. If JS never runs (blocked, errors, etc.) this stylesheet
 * alone does nothing and the native cursor is left completely alone --
 * the custom cursor is never a hard dependency for usability.
 */

.p9-cursor-dot,
.p9-cursor-ring {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none; /* never intercepts clicks, hovers, drags, etc. */
    will-change: transform;
}

html.p9-cursor-active .p9-cursor-dot,
html.p9-cursor-active .p9-cursor-ring {
    display: block;
}

/* Native cursor is suppressed only on the elements the custom cursor
   actually covers well (body-level pointer surface). Form controls and
   text-editing surfaces opt back into the native cursor explicitly below,
   so typing/selecting never feels different. */
html.p9-cursor-active,
html.p9-cursor-active body {
    cursor: none;
}

html.p9-cursor-active input,
html.p9-cursor-active textarea,
html.p9-cursor-active select,
html.p9-cursor-active button,
html.p9-cursor-active [contenteditable="true"],
html.p9-cursor-active [role="textbox"] {
    cursor: auto;
}

.p9-cursor-dot {
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: var(--p9-accent, #37e0ff);
    transform: translate3d(var(--p9-x, -100px), var(--p9-y, -100px), 0);
}

.p9-cursor-ring {
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 1px solid rgba(55, 224, 255, 0.55);
    transform: translate3d(var(--p9-ring-x, -100px), var(--p9-ring-y, -100px), 0) scale(1);
    transition: width 0.15s ease, height 0.15s ease, margin 0.15s ease,
        border-color 0.15s ease, opacity 0.15s ease, transform 0.05s linear;
}

/* Subtle "target lock" state when hovering interactive elements -- the ring
   tightens and brightens slightly rather than growing into something
   decorative or distracting. */
html.p9-cursor-active.p9-cursor-hover .p9-cursor-ring {
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-color: rgba(55, 224, 255, 0.9);
}

html.p9-cursor-active.p9-cursor-hover .p9-cursor-dot {
    background: #ff3b56;
}

/* Slight contraction on active press, for a responsive "click registered"
   feel without any layout impact. */
html.p9-cursor-active.p9-cursor-down .p9-cursor-ring {
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
}
