/**
 * Micro-interactions globales, curseur personnalisé, scroll fluide, utilitaires perf.
 *
 * @package Djizhub_Theme
 */

/* Scroll fluide (alternative légère à ScrollSmoother, payant) */
html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* will-change uniquement pendant les tweens GSAP (classe ajoutée / retirée en JS) */
.djizhub-will-change-transform {
	will-change: transform;
}

/* ——— Curseur personnalisé (pointer fin uniquement, activé par JS) ——— */
body.djizhub-cursor-active {
	cursor: none;
}

body.djizhub-cursor-active a,
body.djizhub-cursor-active button,
body.djizhub-cursor-active input,
body.djizhub-cursor-active textarea,
body.djizhub-cursor-active select,
body.djizhub-cursor-active [role="button"],
body.djizhub-cursor-active label {
	cursor: none;
}

.djizhub-cursor-dot,
.djizhub-cursor-ring {
	position: fixed;
	left: 0;
	top: 0;
	pointer-events: none;
	z-index: 2147483646;
	border-radius: 50%;
	mix-blend-mode: normal;
}

.djizhub-cursor-dot {
	width: 12px;
	height: 12px;
	margin: -6px 0 0 -6px;
	background: #00c6ff;
	box-shadow: 0 0 12px rgba(0, 198, 255, 0.65);
}

.djizhub-cursor-ring {
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 2px solid rgba(0, 198, 255, 0.55);
	background: transparent;
	transition:
		width 0.25s ease,
		height 0.25s ease,
		margin 0.25s ease,
		border-color 0.25s ease,
		border-radius 0.25s ease;
}

body.djizhub-cursor--clickable .djizhub-cursor-ring {
	width: 52px;
	height: 52px;
	margin: -26px 0 0 -26px;
	border-color: rgba(0, 198, 255, 0.85);
}

body.djizhub-cursor--chart .djizhub-cursor-dot {
	opacity: 0.35;
}

body.djizhub-cursor--chart .djizhub-cursor-ring {
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border-radius: 2px;
	border-color: transparent;
	background:
		linear-gradient(#00c6ff, #00c6ff) center/11px 2px no-repeat,
		linear-gradient(#00c6ff, #00c6ff) center/2px 11px no-repeat;
	box-shadow: none;
}

/* Shimmer CTA principal (header + bouton primaire hero) */
.djizhub-cta-shimmer,
.djizhub-hero__btn--primary {
	position: relative;
	overflow: hidden;
}

.djizhub-cta-shimmer::after,
.djizhub-hero__btn--primary::after {
	content: "";
	position: absolute;
	inset: 0;
	left: -100%;
	background: linear-gradient(
		105deg,
		transparent 0%,
		rgba(255, 255, 255, 0.22) 45%,
		rgba(255, 255, 255, 0.35) 50%,
		rgba(255, 255, 255, 0.22) 55%,
		transparent 100%
	);
	transform: skewX(-18deg);
	opacity: 0;
	pointer-events: none;
}

.djizhub-cta-shimmer:hover::after,
.djizhub-cta-shimmer:focus-visible::after,
.djizhub-hero__btn--primary:hover::after,
.djizhub-hero__btn--primary:focus-visible::after {
	animation: djizhub-cta-shimmer-sweep 0.85s ease-out forwards;
}

@keyframes djizhub-cta-shimmer-sweep {
	0% {
		left: -100%;
		opacity: 0;
	}
	15% {
		opacity: 1;
	}
	100% {
		left: 120%;
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.djizhub-cta-shimmer::after,
	.djizhub-hero__btn--primary::after {
		animation: none !important;
	}
}
