/* Motion. Front end only (not loaded in the editor), and only for visitors
   who haven't asked for reduced motion.

   The floating hero cards combine three independent animations without
   fighting over one property:
   - entrance: opacity, scale and blur
   - idle float: the `translate` property
   - scroll parallax: `transform` (only where scroll timelines are supported) */

.ts-progress {
	position: fixed;
	left: 0;
	top: 0;
	height: 3px;
	width: 100%;
	background: #7FB2FF;
	z-index: 60;
	transform: scaleX(0);
	transform-origin: 0 50%;
	pointer-events: none;
}

@keyframes ts-rise { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes ts-away { to { opacity: 0; transform: translateY(-50px); } }
@keyframes ts-pa { to { transform: translateY(-110px) rotate(-1deg); } }
@keyframes ts-pb { to { transform: translateY(-40px) rotate(2deg); } }
@keyframes ts-pc { to { transform: translateY(-190px) rotate(3deg); } }
@keyframes ts-grow { to { transform: scaleX(1); } }

@keyframes ts-card-in {
	from { opacity: 0; scale: .9; filter: blur(8px); }
	to { opacity: 1; scale: 1; filter: blur(0); }
}
@keyframes ts-bob-a { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes ts-bob-b { 0%, 100% { translate: 0 0; } 50% { translate: 6px -9px; } }
@keyframes ts-bob-c { 0%, 100% { translate: 0 0; } 50% { translate: -5px -14px; } }
@keyframes ts-tick-in {
	from { opacity: 0; translate: -10px 0; }
	to { opacity: 1; translate: 0 0; }
}
@keyframes ts-shine {
	0%, 60% { background-position: 150% 0; }
	100% { background-position: -50% 0; }
}
@keyframes ts-pulse {
	0% { box-shadow: 0 0 0 0 rgba(127, 178, 255, .55); }
	70%, 100% { box-shadow: 0 0 0 10px rgba(127, 178, 255, 0); }
}

@media (prefers-reduced-motion: no-preference) {
	/* Staggered entrance, then a slow, out-of-step float. */
	.ts-float-a { animation: ts-card-in .9s cubic-bezier(.2, .7, .2, 1) .15s both, ts-bob-a 6s ease-in-out 1.1s infinite; }
	.ts-float-b { animation: ts-card-in .9s cubic-bezier(.2, .7, .2, 1) .4s both, ts-bob-b 7.5s ease-in-out 1.3s infinite; }
	.ts-float-c { animation: ts-card-in .9s cubic-bezier(.2, .7, .2, 1) .65s both, ts-bob-c 5.5s ease-in-out 1.6s infinite; }

	/* "Included" ticks arrive one by one after their card. */
	.ts-float-b li { animation: ts-tick-in .45s ease-out both; }
	.ts-float-b li:nth-child(1) { animation-delay: .95s; }
	.ts-float-b li:nth-child(2) { animation-delay: 1.1s; }
	.ts-float-b li:nth-child(3) { animation-delay: 1.25s; }
	.ts-float-b li:nth-child(4) { animation-delay: 1.4s; }

	/* A light sweep across the lodge card photo now and then. */
	.ts-float-a .ts-float-photo {
		background-image: linear-gradient(110deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.55) 50%, rgba(255,255,255,0) 65%);
		background-size: 200% 100%;
		background-repeat: no-repeat;
		animation: ts-shine 5s ease-in-out 1.5s infinite;
	}

	/* Soft pulse on the "Best value" badge. */
	.ts-float-a .ts-float-title mark { animation: ts-pulse 2.8s ease-out 1.8s infinite; }

	.ts-tile { transition: box-shadow .2s, transform .2s; }
}

@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.ts-progress { animation: ts-grow linear both; animation-timeline: scroll(root); }
		.ts-hero .ts-herotext { animation: ts-away linear both; animation-timeline: scroll(root); animation-range: 60px 560px; }

		/* Same entrance + float as above, plus scroll parallax on `transform`. */
		.ts-float-a {
			animation: ts-card-in .9s cubic-bezier(.2, .7, .2, 1) .15s both, ts-bob-a 6s ease-in-out 1.1s infinite, ts-pa linear both;
			animation-timeline: auto, auto, scroll(root);
			animation-range: normal, normal, 0px 700px;
		}
		.ts-float-b {
			animation: ts-card-in .9s cubic-bezier(.2, .7, .2, 1) .4s both, ts-bob-b 7.5s ease-in-out 1.3s infinite, ts-pb linear both;
			animation-timeline: auto, auto, scroll(root);
			animation-range: normal, normal, 0px 700px;
		}
		.ts-float-c {
			animation: ts-card-in .9s cubic-bezier(.2, .7, .2, 1) .65s both, ts-bob-c 5.5s ease-in-out 1.6s infinite, ts-pc linear both;
			animation-timeline: auto, auto, scroll(root);
			animation-range: normal, normal, 0px 700px;
		}

		.ts-reveal { animation: ts-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
		.ts-stagger > * { animation: ts-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
		.ts-stagger > *:nth-child(3n+2) { animation-range: entry 12% entry 75%; }
		.ts-stagger > *:nth-child(3n) { animation-range: entry 24% entry 90%; }
	}
}
