/**
 * Digital Deck Agency v3 — animations.
 *
 * Spec §5 (M-1..M-12) and §6 hover effects. Transform/opacity only —
 * no layout thrash. No external libraries. All motion is disabled under
 * prefers-reduced-motion.
 */

/* M-1 — Hero slow zoom (Ken Burns): background scales 1.00 -> 1.06 over 20s. */
@keyframes dda-ken-burns {
	from {
		transform: scale(1);
	}
	to {
		transform: scale(1.06);
	}
}

.dda-ken-burns {
	animation: dda-ken-burns 20s ease-out forwards;
}

/* Home crossfade slides are handled by the opacity transition in main.css;
   the active slide also gets a slow Ken Burns zoom. */
.dda-hero__slide.is-active {
	animation: dda-ken-burns 20s ease-out forwards;
}

/* M-2 — Fade-up on scroll: elements rise ~20px as they enter the viewport.
   JS adds .is-visible via IntersectionObserver; --dly staggers cards by 80ms.
   Scoped to html.dda-js (set by the inline script in header.php) so the
   content stays visible when JavaScript is off. */
.dda-reveal {
	opacity: 1;
	transform: none;
}

html.dda-js .dda-reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease, transform 0.6s ease;
	transition-delay: var(--dly, 0s);
}

html.dda-js .dda-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* M-3 — Count-up stats: JS-driven number change; CSS styles the number only. */
.dda-stat__number {
	font-variant-numeric: tabular-nums;
}

/* M-4 — Card lift: translateY(-6px) + soft shadow (in main.css). */
.dda-card,
.dda-step {
	will-change: transform;
}

/* M-5 — Image zoom on hover: image scales 1.05 inside its frame (main.css). */
.dda-card__image,
.dda-split__image img {
	will-change: transform;
}

/* M-6 — Mockup hover-scroll: hovering a .dda-mockup scrolls its inner
   image via translateY. The image must be taller than the frame; the
   transition is slow (6s) so the whole page preview scrolls through. */
.dda-mockup:hover img {
	transform: translateY(calc(-100% + 420px));
}

/* M-7 — Button arrow slide: arrow moves 4px on hover, button lifts 2px (main.css). */
.dda-btn-arrow {
	will-change: transform;
}

/* M-8 — Accordion smooth expand: grid-template-rows 0fr -> 1fr trick (main.css). */
.dda-faq__panel {
	overflow: hidden;
}

/* M-9 — Header state change: subtle shadow + background deepen on scroll (main.css .is-scrolled). */
.dda-site-header {
	will-change: box-shadow;
}

/* M-10 — Scroll cue bounce. */
@keyframes dda-scroll-bounce {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(6px);
	}
}

.dda-scroll-cue__chevron {
	animation: dda-scroll-bounce 1.6s ease-in-out infinite;
}

/* M-11 — Link underline slide: underline grows left -> right on hover (main.css). */
.dda-menu a::after,
.dda-footer-menu a::after {
	will-change: transform;
}

/* V-1 — Typewriter cursor blink in the hero H1. */
@keyframes dda-cursor-blink {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0;
	}
}

/* V-4/V-11 — Marquee scroll for the testimonial carousel and the
   "Powered By" strip. The track contains two copies of the same list
   and translates -50% so the loop is seamless; JS/CSS pause it on
   hover and focus (see main.css). */
@keyframes dda-marquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

/* V-13 — Rotating circular badge: one slow full rotation. */
@keyframes dda-badge-rotate {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* M-12 — Reduced motion: disable ALL motion site-wide. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
		scroll-behavior: auto !important;
	}

	html.dda-js .dda-reveal {
		opacity: 1;
		transform: none;
	}

	.dda-ken-burns,
	.dda-hero__slide.is-active,
	.dda-scroll-cue__chevron,
	.dda-typewriter__cursor,
	.dda-rotating-badge__svg,
	.dda-testimonial-carousel__track,
	.dda-powered-by__track {
		animation: none;
	}

	.dda-mockup:hover img {
		transform: none;
	}
}
