/* ==========================================================================
   AK & J Golden Chemicals — Scroll Reveal & Subtle Parallax
   ========================================================================== */

/* Elements are hidden ONLY when JS marks them with .akj-will-animate.
   This ensures 100% visibility when JS is disabled or inside WordPress Editors. */
[data-animate].akj-will-animate,
.is-style-fade-up.akj-will-animate,
.is-style-fade-in.akj-will-animate,
.is-style-scale-in.akj-will-animate {
	opacity: 0;
	will-change: opacity, transform;
	transition: opacity var(--wp--custom--transition--reveal, 650ms cubic-bezier(0.22, 1, 0.36, 1)),
		transform var(--wp--custom--transition--reveal, 650ms cubic-bezier(0.22, 1, 0.36, 1));
}

[data-animate="fade-up"].akj-will-animate,
.is-style-fade-up.akj-will-animate {
	transform: translate3d(0, 22px, 0);
}

[data-animate="fade-in"].akj-will-animate,
.is-style-fade-in.akj-will-animate {
	transform: translate3d(0, 0, 0);
}

[data-animate="scale-in"].akj-will-animate,
.is-style-scale-in.akj-will-animate {
	transform: scale(0.96) translate3d(0, 12px, 0);
}

[data-animate].akj-will-animate.is-visible,
.is-style-fade-up.akj-will-animate.is-visible,
.is-style-fade-in.akj-will-animate.is-visible,
.is-style-scale-in.akj-will-animate.is-visible {
	opacity: 1;
	transform: translate3d(0, 0, 0) scale(1);
}

/* Staggered reveal delays */
.akj-delay-1 {
	transition-delay: 80ms !important;
}

.akj-delay-2 {
	transition-delay: 160ms !important;
}

.akj-delay-3 {
	transition-delay: 240ms !important;
}

.akj-delay-4 {
	transition-delay: 320ms !important;
}

.akj-delay-1.akj-revealed,
.akj-delay-2.akj-revealed,
.akj-delay-3.akj-revealed,
.akj-delay-4.akj-revealed {
	transition-delay: 0ms !important;
}

/* GPU optimization for active parallax elements */
.akj-parallax-active {
	will-change: transform;
}

/* --------------------------------------------------------------------------
   Product Portfolio Carousel Animation Presets (Customizer / Theme Options)
   -------------------------------------------------------------------------- */
.akj-catalog-grid.is-carousel > .akj-product-card {
	transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1),
		opacity 380ms ease,
		box-shadow 420ms cubic-bezier(0.22, 1, 0.36, 1),
		border-color 280ms ease;
}

/* Preset 1: Smooth Slide & Scale (Default) */
body.akj-anim-slide-scale .akj-catalog-grid.is-carousel > .akj-product-card {
	transform: scale(0.95);
	opacity: 0.72;
}

body.akj-anim-slide-scale .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-active {
	transform: scale(1);
	opacity: 1;
}

body.akj-anim-slide-scale .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-center {
	transform: scale(1.025);
	box-shadow: var(--wp--preset--shadow--elevated);
}

body.akj-anim-slide-scale .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-active:hover {
	transform: translateY(-5px) scale(1.02);
}

/* Preset 2: 3D Coverflow / Perspective Tilt */
body.akj-anim-coverflow-3d .akj-carousel-viewport {
	perspective: 1200px;
}

body.akj-anim-coverflow-3d .akj-catalog-grid.is-carousel {
	transform-style: preserve-3d;
}

body.akj-anim-coverflow-3d .akj-catalog-grid.is-carousel > .akj-product-card {
	transform: scale(0.92) rotateY(14deg);
	opacity: 0.6;
}

body.akj-anim-coverflow-3d .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-left {
	transform: perspective(1000px) rotateY(7deg) scale(0.97);
	opacity: 0.96;
}

body.akj-anim-coverflow-3d .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-center {
	transform: perspective(1000px) translateZ(20px) rotateY(0deg) scale(1.02);
	opacity: 1;
	box-shadow: var(--wp--preset--shadow--elevated);
}

body.akj-anim-coverflow-3d .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-right {
	transform: perspective(1000px) rotateY(-7deg) scale(0.97);
	opacity: 0.96;
}

/* Preset 3: Staggered Fade & Lift */
@keyframes akjCardCascade {
	0% {
		opacity: 0;
		transform: translate3d(0, 22px, 0) scale(0.97);
	}
	100% {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
}

body.akj-anim-stagger-lift .akj-catalog-grid.is-carousel > .akj-product-card.is-slide-cascade {
	animation: akjCardCascade 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.akj-anim-stagger-lift .akj-catalog-grid.is-carousel > .akj-product-card.is-cascade-1 {
	animation-delay: 40ms;
}

body.akj-anim-stagger-lift .akj-catalog-grid.is-carousel > .akj-product-card.is-cascade-2 {
	animation-delay: 120ms;
}

body.akj-anim-stagger-lift .akj-catalog-grid.is-carousel > .akj-product-card.is-cascade-3 {
	animation-delay: 200ms;
}

/* --------------------------------------------------------------------------
   Hero Entrance & Industrial B2B Status Pulse
   -------------------------------------------------------------------------- */
@keyframes akjHeroFadeUp {
	0% {
		opacity: 0;
		translate: 0 16px;
	}
	100% {
		opacity: 1;
		translate: 0 0;
	}
}

@keyframes akjStockPulse {
	0% {
		transform: scale(1);
		opacity: 0.58;
	}
	70% {
		transform: scale(2.35);
		opacity: 0;
	}
	100% {
		transform: scale(2.35);
		opacity: 0;
	}
}

.akj-hero-copy > *,
.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > * {
	animation: akjHeroFadeUp 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.akj-hero-copy > *:nth-child(1),
.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *:nth-child(1) {
	animation-delay: 60ms;
}

.akj-hero-copy > *:nth-child(2),
.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *:nth-child(2) {
	animation-delay: 140ms;
}

.akj-hero-copy > *:nth-child(3),
.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *:nth-child(3) {
	animation-delay: 220ms;
}

.akj-hero-copy > *:nth-child(4),
.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *:nth-child(4) {
	animation-delay: 300ms;
}

.akj-hero-copy > *:nth-child(5),
.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *:nth-child(5) {
	animation-delay: 380ms;
}

.akj-hero-visual .akj-ledger {
	animation: akjHeroFadeUp 720ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both;
}

.akj-hero-visual .akj-float-badge {
	animation: akjHeroFadeUp 680ms cubic-bezier(0.22, 1, 0.36, 1) 280ms both;
}

.akj-hero-visual .akj-hero-photos {
	animation: akjHeroFadeUp 680ms cubic-bezier(0.22, 1, 0.36, 1) 380ms both;
}

/* --------------------------------------------------------------------------
   WordPress Block Editor & Site Editor Safety Overrides
   -------------------------------------------------------------------------- */
body.wp-admin [data-animate],
body.wp-admin .is-style-fade-up,
body.wp-admin .is-style-fade-in,
body.wp-admin .is-style-scale-in,
body.wp-admin .akj-parallax,
body.wp-admin .is-style-parallax-slow,
body.wp-admin .is-style-parallax-medium,
body.block-editor-page [data-animate],
body.block-editor-page .is-style-fade-up,
body.block-editor-page .is-style-fade-in,
body.block-editor-page .is-style-scale-in,
body.block-editor-page .akj-parallax,
body.block-editor-page .is-style-parallax-slow,
body.block-editor-page .is-style-parallax-medium,
.editor-styles-wrapper [data-animate],
.editor-styles-wrapper .is-style-fade-up,
.editor-styles-wrapper .is-style-fade-in,
.editor-styles-wrapper .is-style-scale-in,
.editor-styles-wrapper .akj-parallax,
.editor-styles-wrapper .is-style-parallax-slow,
.editor-styles-wrapper .is-style-parallax-medium,
.block-editor-block-list__layout [data-animate],
.block-editor-block-list__layout .is-style-fade-up,
.block-editor-block-list__layout .is-style-fade-in,
.block-editor-block-list__layout .is-style-scale-in,
body.wp-admin .akj-stat-card,
body.wp-admin .akj-stat-card:hover,
body.wp-admin .wp-block-column:has(.is-style-kpi-metric),
body.wp-admin .wp-block-column:has(.is-style-kpi-metric):hover,
body.block-editor-page .akj-stat-card,
body.block-editor-page .akj-stat-card:hover,
body.block-editor-page .wp-block-column:has(.is-style-kpi-metric),
body.block-editor-page .wp-block-column:has(.is-style-kpi-metric):hover,
.editor-styles-wrapper .akj-stat-card,
.editor-styles-wrapper .akj-stat-card:hover,
.editor-styles-wrapper .wp-block-column:has(.is-style-kpi-metric),
.editor-styles-wrapper .wp-block-column:has(.is-style-kpi-metric):hover,
.block-editor-block-list__layout .akj-stat-card,
.block-editor-block-list__layout .akj-stat-card:hover,
.block-editor-block-list__layout .wp-block-column:has(.is-style-kpi-metric),
.block-editor-block-list__layout .wp-block-column:has(.is-style-kpi-metric):hover,
body.wp-admin .akj-hero-copy > *,
body.wp-admin .akj-hero-visual .akj-ledger,
body.wp-admin .akj-hero-visual .akj-float-badge,
body.wp-admin .akj-hero-visual .akj-hero-photos,
body.block-editor-page .akj-hero-copy > *,
body.block-editor-page .akj-hero-visual .akj-ledger,
body.block-editor-page .akj-hero-visual .akj-float-badge,
body.block-editor-page .akj-hero-visual .akj-hero-photos,
.editor-styles-wrapper .akj-hero-copy > *,
.editor-styles-wrapper .wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *,
.editor-styles-wrapper .akj-hero-visual .akj-ledger,
.editor-styles-wrapper .akj-hero-visual .akj-float-badge,
.editor-styles-wrapper .akj-hero-visual .akj-hero-photos,
.editor-styles-wrapper .akj-status-dot::after {
	opacity: 1 !important;
	translate: none !important;
	transform: none !important;
	transition: none !important;
	animation: none !important;
}

/* --------------------------------------------------------------------------
   Accessibility: Respect Reduced Motion Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	[data-animate],
	[data-animate].akj-will-animate,
	.is-style-fade-up,
	.is-style-fade-in,
	.is-style-scale-in,
	.akj-parallax,
	.is-style-parallax-slow,
	.is-style-parallax-medium,
	.is-style-hover-lift,
	.akj-stat-card,
	.akj-stat-card:hover,
	.akj-stat-card:focus-within,
	.wp-block-column:has(.is-style-kpi-metric),
	.wp-block-column:has(.is-style-kpi-metric):hover,
	.wp-block-column:has(.is-style-kpi-metric):focus-within,
	.akj-hero-copy > *,
	.wp-block-columns:has(.akj-hero-visual) > .wp-block-column:first-child > *,
	.akj-hero-visual .akj-ledger,
	.akj-hero-visual .akj-float-badge,
	.akj-hero-visual .akj-hero-photos,
	.akj-ledger-row,
	.akj-ledger-row:hover,
	.akj-status-dot::after,
	.akj-hero-photos .akj-gold-circle,
	.akj-hero-photos .akj-gold-circle:hover,
	.akj-catalog-grid.is-carousel,
	.akj-catalog-grid.is-carousel > .akj-product-card,
	.akj-product-media img,
	.wp-block-button .wp-block-button__link {
		opacity: 1 !important;
		translate: none !important;
		transform: none !important;
		transition: none !important;
		animation: none !important;
	}
}
