@charset "UTF-8";

/**
 * cursors.css 1.1.0
 * Author: hybrid.
 * Type: core
 * Load: optional
 *
 * Base of every follower cursor (cursors.js), written with :where() so consumers override it freely.
 * Needs cursors.js: it sets --cursor-x / --cursor-y and the .is-fixed / .is-visible / .is-active classes.
 * .is-active is held while the pointer is pressed.
 *
 * Shape: circle by default (min-width = height). With text or padding the box grows
 * horizontally and becomes a pill.
 *
 * Background (::after) and content (.cursor > *) are animated independently
 * with the individual `scale` property (no conflict with the centering translate).
 * Content must be an element (<span>), not a bare text node.
 *
 * Tokens
 * --cursor-size / --cursor-padding-x
 * --cursor-color / --cursor-background
 * --cursor-border-radius
 * --cursor-font-size
 * --cursor-background-scale / --cursor-active-background-scale
 * --cursor-content-scale / --cursor-active-content-scale
 * --cursor-transition / --cursor-content-transition
 *
 * Tokens that depend on another token or on the context (--cursor-color, --cursor-background,
 * --cursor-border-radius, --cursor-content-transition) are declared on :root and on .cursor,
 * so they follow an override set on a cursor or on its context.
 * All transitions live in ANIMATIONS.
 *
 * Dependencies
 * --text-color, --background-color   defined in colors.css (fallback provided)
 * --duration-fast, --ease            defined in animations.css
 *
 * Changelog 1.1.0
 * — Pressed state: active scale applied while the pointer is down
 * — --cursor-scale / --cursor-active-scale replaced by background and content scale tokens
 * — Content animated via .cursor > *, separate --cursor-content-transition
 * — Text support: min-width + --cursor-padding-x, white-space: nowrap
 * — --cursor--border-radius renamed --cursor-border-radius (pill-safe default)
 * — isolation: isolate so the ::after background stays behind the content
 */



/* ================================================================================================== */
/* ============================================= CONFIG ============================================= */
/* ================================================================================================== */

:root {
	--cursor-size: 3em;
	--cursor-padding-x: 0px;
	--cursor-font-size: 1em;

	--cursor-background-scale: 1;
	--cursor-content-scale: 1;
	--cursor-active-background-scale: .66;
	--cursor-active-content-scale: .75;

	--cursor-transition: var(--duration-fast) var(--ease);
}

/* declared on .cursor too: resolved against the cursor and its context, not frozen on :root */

:root,
:where(.cursor) {
	--cursor-color: var(--background-color, #FFF);
	--cursor-background: var(--text-color, #000);

	/* Half the height: circle when square, pill when wider (50% would give an ellipse) */
	--cursor-border-radius: calc(var(--cursor-size) / 2);

	--cursor-content-transition: var(--cursor-transition);
}



/* ===================================================================================================== */
/* ============================================ ANIMATIONS ============================================= */
/* ===================================================================================================== */

@media (hover: hover) and (pointer: fine) {

	:where(.cursor) { transition: opacity var(--cursor-transition); }
	:where(.cursor)::after { transition: scale var(--cursor-transition); }
	:where(.cursor > *) { transition: scale var(--cursor-content-transition); }

}


/* ================================================================================================== */
/* ============================================ CURSORS ============================================= */
/* ================================================================================================== */


/* ============================== DESKTOP ============================== */

@media (hover: hover) and (pointer: fine) {

	:where(.cursor) {
		position: absolute;
		isolation: isolate;
		left: var(--cursor-x, 0px);
		top: var(--cursor-y, 0px);
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: var(--cursor-size);
		height: var(--cursor-size);
		padding-inline: var(--cursor-padding-x);
		font-size: var(--cursor-font-size);
		white-space: nowrap;
		color: var(--cursor-color);
		opacity: 0;
		pointer-events: none;
		transform: translate(-50%, -50%);
	}

	/* Background */
	:where(.cursor)::after {
		content: '';
		position: absolute;
		z-index: -1;
		inset: 0;
		border-radius: var(--cursor-border-radius);
		background: var(--cursor-background);
		scale: var(--cursor-background-scale);
	}

	/* Content (icon span, text span) */
	:where(.cursor > *) {
		scale: var(--cursor-content-scale);
	}

	:where(.cursor.is-fixed) { position: fixed; }
	:where(.cursor.is-visible) { opacity: 1; }
	:where(.cursor.is-active) {
		--cursor-background-scale: var(--cursor-active-background-scale);
		--cursor-content-scale: var(--cursor-active-content-scale);
	}

	/* Hide the native cursor while the follower is shown */
	.is-cursor-over { cursor: none; }
}


/* ============================== MOBILE ============================== */

/* touch device only */

@media (pointer: coarse) {
	:where(.cursor) { display: none; }
}