/**
 * Front page motion — hero entrance, scroll reveals, micro-interactions.
 *
 * @package Novacare
 */

/* -------------------------------------------------------------------------
   Scroll reveal (requires .novacare-reveal-init from scroll-reveal.js)
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.novacare-reveal-init .reveal-on-scroll {
		opacity: 0;
		transform: translateY(1.25rem);
		transition:
			opacity 0.6s ease,
			transform 0.6s ease;
		transition-delay: var(--reveal-delay, 0ms);
	}

	.novacare-reveal-init .reveal-on-scroll.is-inview {
		opacity: 1;
		transform: none;
	}
}

/* -------------------------------------------------------------------------
   Hero entrance
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	@keyframes nv-fade-up {
		from {
			opacity: 0;
			transform: translateY(1rem);
		}

		to {
			opacity: 1;
			transform: none;
		}
	}

	.hero__eyebrow,
	.hero__title,
	.hero__description,
	.hero__actions,
	.hero__trust {
		animation: nv-fade-up 0.65s ease both;
	}

	.hero__eyebrow {
		animation-delay: 0.08s;
	}

	.hero__title {
		animation-delay: 0.18s;
	}

	.hero__description {
		animation-delay: 0.28s;
	}

	.hero__actions {
		animation-delay: 0.38s;
	}

	.hero__trust {
		animation-delay: 0.48s;
	}
}

/* -------------------------------------------------------------------------
   Background Ken Burns (desktop only)
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
	@keyframes nv-ken-burns {
		from {
			transform: scale(1.02);
		}

		to {
			transform: scale(1.06);
		}
	}

	.hero__background,
	.cta-banner__background {
		animation: nv-ken-burns 28s ease-in-out infinite alternate;
	}
}

/* -------------------------------------------------------------------------
   Card image hover zoom
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.treatment-card__image,
	.physician-card__image,
	.journal-card__image,
	.difference-section__image {
		transition: transform 0.45s ease;
	}

	.treatment-card__link:hover .treatment-card__image,
	.treatment-card__link:focus-visible .treatment-card__image,
	.physician-card__link:hover .physician-card__image,
	.physician-card__link:focus-visible .physician-card__image,
	.journal-card__link:hover .journal-card__image,
	.journal-card__link:focus-visible .journal-card__image,
	.difference-section__media:hover .difference-section__image,
	.difference-section__media:focus-within .difference-section__image {
		transform: scale(1.05);
	}
}

.difference-section__media {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
   Sticky header transition
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.site-header__pill {
		transition:
			box-shadow 0.3s ease,
			background-color 0.3s ease,
			border-color 0.3s ease;
	}

	.site-header.is-scrolled .site-header__pill {
		box-shadow:
			0 8px 32px rgba(30, 45, 38, 0.1),
			0 2px 4px rgba(30, 45, 38, 0.06);
	}
}

/* -------------------------------------------------------------------------
   Testimonial slide entrance
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	@keyframes nv-testimonial-in {
		from {
			opacity: 0;
			transform: translateY(0.75rem);
		}

		to {
			opacity: 1;
			transform: none;
		}
	}

	.testimonial-slide.is-active {
		animation: nv-testimonial-in 0.45s ease both;
	}
}

/* -------------------------------------------------------------------------
   Reduced motion — disable all decorative motion
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.hero__eyebrow,
	.hero__title,
	.hero__description,
	.hero__actions,
	.hero__trust,
	.hero__background,
	.cta-banner__background,
	.testimonial-slide.is-active {
		animation: none !important;
	}

	.novacare-reveal-init .reveal-on-scroll {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	.treatment-card__image,
	.physician-card__image,
	.journal-card__image,
	.difference-section__image {
		transition: none !important;
	}

	.treatment-card__link:hover .treatment-card__image,
	.treatment-card__link:focus-visible .treatment-card__image,
	.physician-card__link:hover .physician-card__image,
	.physician-card__link:focus-visible .physician-card__image,
	.journal-card__link:hover .journal-card__image,
	.journal-card__link:focus-visible .journal-card__image,
	.difference-section__media:hover .difference-section__image,
	.difference-section__media:focus-within .difference-section__image {
		transform: none !important;
	}
}
