/* ==========================================================================
   Motion — "ink & settle". Driven by assets/js/motion.js.
   Headings are drawn in, pictures open like a curtain, cards drop in tilted
   and settle straight, blocks come up out of a soft blur. Everything
   animates once. Hidden states only apply under html.qta-anim (set by the
   script), so nothing is hidden without JavaScript.
   ========================================================================== */

:root {
	--qta-ease-draw: cubic-bezier(.65, 0, .35, 1);
	--qta-ease-settle: cubic-bezier(.34, 1.45, .64, 1);
	--qta-ease-soft: cubic-bezier(.16, 1, .3, 1);
	--qta-hover-duration: 240ms;
}

/* 1. Scroll entrances ----------------------------------------------------- */
.qta-anim .qta-in:not(.is-settled) {
	transition:
		opacity 900ms var(--qta-ease-soft),
		transform 900ms var(--qta-ease-soft),
		filter 900ms var(--qta-ease-soft),
		clip-path 1000ms var(--qta-ease-draw);
}

/* Rise: up out of a soft blur. */
.qta-anim .qta-in--rise:not(.is-in) {
	opacity: 0;
	transform: translate3d(0, 36px, 0);
	filter: blur(6px);
}

/* Fade: a focus pull, no movement. */
.qta-anim .qta-in--fade:not(.is-in) {
	opacity: 0;
	filter: blur(10px);
}

/* Wipe: headings drawn in from the left. */
.qta-anim .qta-in--wipe:not(.is-in) {
	opacity: .15;
	clip-path: inset(0 100% 0 0);
}
.qta-anim .qta-in--wipe.is-in:not(.is-settled) {
	clip-path: inset(0 0 0 0);
}

/* Unveil: a curtain opening upwards; the picture inside settles from a zoom. */
.qta-anim .qta-in--unveil:not(.is-in) {
	clip-path: inset(100% 0 0 0);
}
.qta-anim .qta-in--unveil.is-in:not(.is-settled) {
	clip-path: inset(0 0 0 0);
}
.qta-anim .qta-in--unveil:not(.is-settled) img {
	transition: transform 1400ms var(--qta-ease-soft);
}
.qta-anim .qta-in--unveil:not(.is-in) img {
	transform: scale(1.14);
}

/* Side entrances with a slight tilt. */
.qta-anim .qta-in--start:not(.is-in) {
	opacity: 0;
	transform: translate3d(-44px, 0, 0) rotate(-2deg);
}
.qta-anim .qta-in--end:not(.is-in) {
	opacity: 0;
	transform: translate3d(44px, 0, 0) rotate(2deg);
}

/* Sequence: cards drop in tilted, one by one, and settle straight. */
.qta-anim .qta-seq:not(.is-settled) > * {
	transition:
		opacity 600ms var(--qta-ease-soft) var(--qta-step, 0ms),
		transform 900ms var(--qta-ease-settle) var(--qta-step, 0ms);
}
.qta-anim .qta-seq:not(.is-in) > * {
	opacity: 0;
	transform: translate3d(0, 44px, 0) rotate(var(--qta-tilt, 2.5deg)) scale(.96);
}

/* 2. Page-load intro (banners) -------------------------------------------- */
/* Text descends into place and comes into focus. */
@keyframes qta-descend {
	from {
		opacity: 0;
		transform: translate3d(0, -16px, 0);
		filter: blur(8px);
	}
	to {
		opacity: 1;
		transform: none;
		filter: none;
	}
}
/* Banner pictures open like a curtain (fill "backwards" only, so the
   frame's outline and shadow are never clipped once it has finished). */
@keyframes qta-curtain {
	from {
		clip-path: inset(100% 0 0 0);
	}
	to {
		clip-path: inset(0 0 0 0);
	}
}
@keyframes qta-breathe {
	0%,
	100% {
		opacity: .55;
		transform: scale(1);
	}
	50% {
		opacity: 1;
		transform: scale(1.06);
	}
}

.qta-home-hero__text > *,
.qta-course-hero__text > *,
.qta-hero__narrow > * {
	animation: qta-descend 800ms var(--qta-ease-soft) both;
}
.qta-home-hero__text > :nth-child(1),
.qta-course-hero__text > :nth-child(1),
.qta-hero__narrow > :nth-child(1) { animation-delay: 80ms; }
.qta-home-hero__text > :nth-child(2),
.qta-course-hero__text > :nth-child(2),
.qta-hero__narrow > :nth-child(2) { animation-delay: 200ms; }
.qta-home-hero__text > :nth-child(3),
.qta-course-hero__text > :nth-child(3),
.qta-hero__narrow > :nth-child(3) { animation-delay: 320ms; }
.qta-home-hero__text > :nth-child(4),
.qta-course-hero__text > :nth-child(4),
.qta-hero__narrow > :nth-child(4) { animation-delay: 440ms; }
.qta-home-hero__text > :nth-child(5),
.qta-course-hero__text > :nth-child(5),
.qta-hero__narrow > :nth-child(5) { animation-delay: 560ms; }
.qta-home-hero__text > :nth-child(n+6),
.qta-course-hero__text > :nth-child(n+6),
.qta-hero__narrow > :nth-child(n+6) { animation-delay: 680ms; }

.qta-home-hero__media,
.qta-course-hero__media {
	animation: qta-curtain 1200ms var(--qta-ease-draw) 250ms backwards;
}

/* Brand motif in banners breathes slowly. */
.qta-hero__pattern {
	animation: qta-breathe 10s ease-in-out infinite;
}

/* Hero facts follow the text. */
.qta-facts > div {
	animation: qta-descend 700ms var(--qta-ease-soft) both;
}
.qta-facts > div:nth-child(1) { animation-delay: 600ms; }
.qta-facts > div:nth-child(2) { animation-delay: 700ms; }
.qta-facts > div:nth-child(3) { animation-delay: 800ms; }

/* 3. Hover ---------------------------------------------------------------- */
/* Buttons: no lift — a soft orange halo and a firm press. */
.qta-btn {
	transition:
		background-color var(--qta-hover-duration) ease,
		color var(--qta-hover-duration) ease,
		border-color var(--qta-hover-duration) ease,
		box-shadow var(--qta-hover-duration) ease,
		transform 120ms ease;
}
.qta-btn:hover,
.qta-btn:focus-visible {
	box-shadow: 0 0 0 4px rgba(243, 152, 0, .28);
}
.qta-btn:active {
	transform: scale(.97);
}

/* Cards: an orange edge grows along the bottom; the picture tilts a touch. */
.qta-feature,
.qta-track,
.qta-course-card,
.qta-summary-card,
.qta-check-grid > li,
.qta-stages > li {
	transition:
		box-shadow var(--qta-hover-duration) ease,
		border-color var(--qta-hover-duration) ease;
}
.qta-feature:hover,
.qta-track:hover,
.qta-course-card:hover {
	box-shadow: inset 0 -3px 0 var(--qta-orange), var(--qta-shadow-lg);
}
.qta-check-grid > li:hover,
.qta-stages > li:hover {
	border-color: var(--qta-purple);
}
.qta-track__media,
.qta-course-card__media {
	overflow: hidden;
}
.qta-track__media img,
.qta-course-card__media img {
	transition: transform 700ms var(--qta-ease-soft);
}
.qta-track:hover .qta-track__media img,
.qta-course-card:hover .qta-course-card__media img {
	transform: scale(1.06) rotate(-1deg);
}
.qta-feature .qta-icon {
	transition: transform 500ms var(--qta-ease-settle);
}
.qta-feature:hover .qta-icon {
	transform: translateY(-3px);
}

@media (hover: none) {
	.qta-track:hover .qta-track__media img,
	.qta-course-card:hover .qta-course-card__media img,
	.qta-feature:hover .qta-icon {
		transform: none;
	}
}

/* 4. Reduced motion / print ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.qta-in,
	.qta-seq > *,
	.qta-in img,
	.qta-home-hero__text > *,
	.qta-course-hero__text > *,
	.qta-hero__narrow > *,
	.qta-home-hero__media,
	.qta-course-hero__media,
	.qta-hero__pattern,
	.qta-facts > div {
		opacity: 1 !important; /* Never keep content hidden. */
		transform: none !important;
		filter: none !important;
		clip-path: none !important;
		animation: none !important;
		transition: none !important;
	}
}
@media print {
	.qta-in,
	.qta-seq > * {
		opacity: 1 !important;
		transform: none !important;
		filter: none !important;
		clip-path: none !important;
	}
}
