/**
 * Service content image effects (tqs_service singles only).
 * Independent of homepage Lenis/GSAP cinematic scroll.
 */

.tqs-service-hero-media {
	--mx: 50%;
	--my: 50%;
	isolation: isolate;
}

.tqs-service-hero-media img {
	display: block;
	transform-origin: center center;
}

/* --- Dual-Layer Color Reveal --- */

.tqs-img-fx-dual-layer-reveal {
	overflow: hidden;
}

.tqs-img-fx-dual-duotone {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 20%;
	z-index: 1;
	pointer-events: none;
	filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(0.95);
	-webkit-mask-image: radial-gradient(circle at var(--mx) var(--my), #000 0%, transparent 40%);
	mask-image: radial-gradient(circle at var(--mx) var(--my), #000 0%, transparent 40%);
}

/* --- Slice Reveal --- */

.tqs-img-fx-slice-reveal {
	overflow: hidden;
}

.tqs-img-fx-slices {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	display: flex;
}

.tqs-img-fx-slice {
	flex: 1 1 12.5%;
	height: 100%;
	background: var(--tqs-dark, #1a0533);
	transform: scaleY(1);
	transform-origin: center bottom;
	transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s ease;
}

.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice {
	transform: scaleY(0);
	opacity: 0;
}

.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(1) { transition-delay: 0ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(2) { transition-delay: 50ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(3) { transition-delay: 100ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(4) { transition-delay: 150ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(5) { transition-delay: 200ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(6) { transition-delay: 250ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(7) { transition-delay: 300ms; }
.tqs-img-fx-slice-reveal.is-in-view .tqs-img-fx-slice:nth-child(8) { transition-delay: 350ms; }

/* --- 3D Tilt --- */

.tqs-img-fx-tilt-3d {
	transform-style: preserve-3d;
	transition: transform 0.25s ease-out;
	will-change: transform;
}

.tqs-img-fx-tilt-3d img {
	transition: transform 0.25s ease-out;
}

/* --- Spotlight Follow --- */

.tqs-img-fx-spotlight-follow::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: radial-gradient(
		circle at var(--mx) var(--my),
		rgba(201, 151, 58, 0.35),
		transparent 60%
	);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.tqs-img-fx-spotlight-follow:hover::after,
.tqs-img-fx-spotlight-follow.is-tracking::after {
	opacity: 1;
}

/* --- Wave Distortion --- */

.tqs-img-fx-wave-distort img {
	transition: filter 0.2s ease;
}

.tqs-img-fx-wave-svg {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* --- Particle Sparkle --- */

.tqs-img-fx-particle {
	position: absolute;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--tqs-gold, #c9973a);
	box-shadow: 0 0 8px rgba(201, 151, 58, 0.8);
	pointer-events: none;
	z-index: 4;
	animation: tqsParticleSparkle 0.7s ease-out forwards;
}

@keyframes tqsParticleSparkle {
	0% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	100% {
		opacity: 0;
		transform: translateY(-28px) scale(0.3);
	}
}

/* --- Glass Shatter --- */

.tqs-img-fx-glass-shatter {
	overflow: hidden;
}

.tqs-img-fx-glass-grid {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	grid-template-rows: repeat(4, 1fr);
	pointer-events: none;
}

.tqs-img-fx-glass-tile {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(201, 151, 58, 0.15);
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.2s ease, transform 0.25s ease, background 0.2s ease;
}

.tqs-img-fx-glass-tile.is-near {
	opacity: 0.55;
	transform: scale(1);
	background: rgba(201, 151, 58, 0.18);
}

/* --- Security Scanline --- */

.tqs-img-fx-security-scanline::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 3px;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(201, 151, 58, 0.15) 20%,
		rgba(201, 151, 58, 0.95) 50%,
		rgba(201, 151, 58, 0.15) 80%,
		transparent 100%
	);
	box-shadow: 0 0 12px rgba(201, 151, 58, 0.55);
	animation: tqsSecurityScan 3.2s linear infinite;
}

@keyframes tqsSecurityScan {
	0% {
		top: 0;
		opacity: 0;
	}
	8% {
		opacity: 1;
	}
	92% {
		opacity: 1;
	}
	100% {
		top: calc(100% - 3px);
		opacity: 0;
	}
}

/* --- Clarity Focus --- */

.tqs-img-fx-clarity-focus img {
	filter: blur(10px);
	opacity: 0;
	transition: filter 1.2s ease, opacity 1.2s ease;
}

.tqs-img-fx-clarity-focus.is-in-view img {
	filter: blur(0);
	opacity: 1;
}

/* --- Badge --- */

.tqs-img-fx-has-badge {
	overflow: visible;
}

.tqs-img-fx-has-badge > img,
.tqs-img-fx-has-badge .tqs-img-fx-dual-duotone {
	border-radius: 16px;
}

.tqs-img-fx-badge {
	position: absolute;
	top: -10px;
	right: -10px;
	z-index: 5;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--tqs-gold);
	color: var(--tqs-dark, #1a0533);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
	pointer-events: none;
	transform: scale(0);
	transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
	will-change: transform;
}

.tqs-img-fx-badge.is-in-view {
	transform: scale(1);
}

.tqs-img-fx-badge.is-magnetic {
	transition: transform 0.12s ease-out;
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
	.tqs-service-hero-media img,
	.tqs-img-fx-dual-duotone,
	.tqs-img-fx-slice,
	.tqs-img-fx-tilt-3d,
	.tqs-img-fx-clarity-focus img,
	.tqs-img-fx-badge,
	.tqs-img-fx-glass-tile,
	.tqs-img-fx-particle {
		animation: none !important;
		transition: none !important;
		transform: none !important;
		opacity: 1 !important;
		filter: none !important;
		will-change: auto;
	}

	.tqs-img-fx-security-scanline::after {
		animation: none !important;
		display: none;
	}

	.tqs-img-fx-slices {
		display: none;
	}

	.tqs-img-fx-dual-duotone {
		display: none;
	}

	.tqs-img-fx-spotlight-follow::after {
		display: none;
	}

	.tqs-img-fx-badge {
		transform: scale(1) !important;
	}
}
