/* Vamora Serve landing motion. Three layers, as everywhere: what arrives, what keeps playing
   while it is on screen, and what follows the pointer and the scroll. The design sheets never
   animate, so all of it lives here and all of it can go. What the redesigned pages share is
   in brand.css; the plans and questions are the pricing page's, and their motion is too. */

/* The icon tiles all answer the same way. */
.vamora-serve-way__tile,
.vamora-serve-feature__icon,
.vamora-serve-guard__icon {
	transition:
		scale var(--motion-reveal) var(--motion-spring),
		rotate var(--motion-reveal) var(--motion-spring),
		background-color var(--motion-ui) linear,
		color var(--motion-ui) linear,
		box-shadow var(--motion-ui) var(--motion-out);
}

/* The six cards: each icon lands a beat after its card, and answers the pointer. */
.vamora-serve-feature:not(.is-inview) .vamora-serve-feature__icon,
.vamora-serve-guard:not(.is-inview) .vamora-serve-guard__icon {
	scale: var(--motion-pop-from);
	rotate: -14deg;
}

.vamora-serve-feature {
	transition: box-shadow var(--motion-ui) var(--motion-out), border-color var(--motion-ui) linear;
}

.vamora-serve-feature:hover {
	box-shadow: 0 20px 38px -18px rgb(110 50 225 / 0.48);
}

.vamora-serve-feature:hover .vamora-serve-feature__icon {
	background: var(--home-button);
	color: var(--home-white);
	rotate: -8deg;
	scale: 1.1;
}

/* Two ways to order: whichever step has the turn. */
.vamora-serve-ways__phone {
	translate: 0 var(--vamora-float);
}

.vamora-serve-way__step {
	transition: translate var(--motion-ui) var(--motion-spring);
}

.vamora-serve-way__step.is-active {
	translate: 0 calc(-1 * var(--motion-lift) / 2);
}

.vamora-serve-way__step.is-active .vamora-serve-way__tile {
	scale: 1.12;
	background: var(--home-white);
	box-shadow: 0 0 0 0.25em rgb(255 255 255 / 0.2), 0 0.4em 1em rgb(60 20 140 / 0.35);
	color: var(--home-violet);
}

.vamora-serve-way--delivery .vamora-serve-way__step.is-active .vamora-serve-way__tile {
	background: var(--home-button);
	box-shadow: 0 0 0 0.25em rgb(122 40 235 / 0.16), 0 0.35em 1em rgb(122 40 235 / 0.42);
	color: var(--home-white);
}

/* The staff screens hand over by fading, and the one arriving settles as one piece. The one
   leaving goes quickly, so the two captions are never readable over each other. The bar under
   a tab is how long its screen holds: when the bar fills, the script moves on. */
.vamora-serve-screen__panel {
	transition: opacity var(--motion-fast) linear, visibility var(--motion-fast) linear;
}

.vamora-serve-screen__input:checked ~ .vamora-serve-screen__panel {
	transition: opacity var(--motion-reveal) var(--motion-out) var(--motion-fast), visibility 0s linear var(--motion-fast);
}

.vamora-serve-screen__image {
	transition: scale var(--motion-slow) var(--motion-out);
}

.vamora-serve-screen__input:not(:checked) ~ .vamora-serve-screen__panel .vamora-serve-screen__image {
	scale: var(--motion-zoom);
}

.vamora-serve-screen__tab {
	transition: color var(--motion-ui) linear, box-shadow var(--motion-ui) var(--motion-out);
}

.vamora-serve-screen__tab:hover {
	box-shadow: 0 0.75rem 1.75rem -1rem rgb(110 50 225 / 0.6);
}

.vamora-serve-screen__tab::after {
	position: absolute;
	inset: auto 1.5em 0.2em;
	height: 2px;
	border-radius: 1px;
	background: var(--home-white);
	content: "";
	transform: scaleX(0);
	transform-origin: 0 50%;
}

/* The bill floats on the panel as one piece. */
.vamora-serve-guards__bill {
	translate: 0 var(--vamora-float);
}

/* The screenshots open as they arrive, and come forward under the pointer. */
.vamora-serve-shot__image {
	transition: transform var(--motion-slow) var(--motion-out);
}

.vamora-serve-shot:not(.is-inview) .vamora-serve-shot__image {
	transform: scale(1.08);
}

.vamora-serve-shot:hover .vamora-serve-shot__image {
	transform: scale(var(--motion-zoom));
}

/* The story. The rail's second run, and how far along the order is. */
.vamora-serve-story__steps::after {
	background: var(--home-rule-bar);
	box-shadow: 0 0 10px rgb(150 80 245 / 0.55);
	clip-path: inset(calc(var(--story-tail, 0) * 100%) 0 0 0);
	content: "";
	transform: scaleY(var(--story-fill, 0));
	transform-origin: 50% 0;
}

@media (min-width: 48em) {
	.vamora-serve-story__steps::after {
		clip-path: inset(0 0 0 calc(var(--story-tail, 0) * 100%));
		transform: scaleX(var(--story-fill, 0));
		transform-origin: 0 50%;
	}
}

.vamora-serve-story__number,
.vamora-serve-story__title,
.vamora-serve-story__text {
	transition: color var(--motion-ui) linear, opacity var(--motion-ui) linear;
}

.vamora-serve-story__number {
	transition:
		scale var(--motion-ui) var(--motion-spring),
		box-shadow var(--motion-ui) var(--motion-out),
		background-color var(--motion-ui) linear,
		color var(--motion-ui) linear;
}

.vamora-serve-story__step {
	cursor: default;
}

/* While it runs, a step the order has not reached yet waits, unlit. */
.vamora-serve-story__steps.is-running .vamora-serve-story__step:not(.is-active, .is-done) .vamora-serve-story__number {
	background: #fff;
	box-shadow: inset 0 0 0 2px #cfb8f8;
	color: #6a4bb0;
}

.vamora-serve-story__steps.is-running .vamora-serve-story__step:not(.is-active, .is-done) .vamora-serve-story__text {
	opacity: 0.72;
}

.vamora-serve-story__step.is-active .vamora-serve-story__number {
	scale: 1.16;
	box-shadow: 0 0 0 0.3em rgb(122 40 235 / 0.16), 0 0.35em 1em rgb(122 40 235 / 0.45);
}

.vamora-serve-story__step.is-active .vamora-serve-story__title {
	color: var(--home-violet);
}

.vamora-serve-story__now.is-running .vamora-serve-story__now-item {
	opacity: 0;
	transition: opacity var(--motion-ui) linear;
}

.vamora-serve-story__now.is-running .vamora-serve-story__now-item.is-active {
	opacity: 1;
}

/* What the routes draw when something is on its way. */
html.vamora-motion .vamora-serve-story__route {
	stroke: #fff;
	stroke-width: 3;
	stroke-linecap: round;
	filter: drop-shadow(0 0 3px #d9b8ff) drop-shadow(0 0 8px #a040ff);
	opacity: 0;
}

/* Each screen floats on its own clock, and the ribbon behind them drifts as one piece. */
.vamora-serve-story__device {
	translate: 0 var(--vamora-float);
}

.vamora-serve-story__tent {
	transform-origin: 50% 100%;
}

/* What keeps the takings: a ring of light round the panel's edge. */
.vamora-serve-guards__panel::after {
	position: absolute;
	inset: 0;
	padding: 1.5px;
	border-radius: inherit;
	background: conic-gradient(from var(--vamora-angle), transparent 0 62%, #fff 76%, #f0b8ff 84%, transparent 96%);
	mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	mask-composite: exclude;
	-webkit-mask-composite: xor;
	content: "";
	pointer-events: none;
}

.vamora-serve-guard:hover .vamora-serve-guard__icon {
	background: var(--home-white);
	color: var(--home-violet);
	rotate: -8deg;
	scale: 1.1;
}

/* What it does, and doesn't */
.vamora-motion .vamora-scope__item .vamora-icon {
	transform: scale(var(--vamora-icon-scale, 1));
	transition: transform var(--motion-reveal) var(--motion-spring) calc(var(--vamora-i, 0) * var(--motion-stagger-tight) + var(--motion-stagger));
}

.vamora-motion .vamora-scope__item:not(.is-inview) .vamora-icon {
	--vamora-icon-scale: 0.3;
}

.vamora-motion .vamora-scope__badge {
	transition: transform var(--motion-ui) var(--motion-spring);
}

.vamora-motion .vamora-scope__card:hover .vamora-scope__badge {
	transform: scale(1.1) rotate(-6deg);
}

@media (prefers-reduced-motion: no-preference) {
	.vamora-serve-hero.is-live .vamora-serve-hero__eyebrow-icon {
		animation: vamora-serve-clink var(--motion-pulse-cycle) var(--motion-inout) infinite;
	}

	.vamora-serve-ways.is-live .vamora-serve-ways__phone--start {
		animation: vamora-float var(--motion-float-cycle) var(--motion-inout) infinite alternate;
	}

	.vamora-serve-ways.is-live .vamora-serve-ways__phone--end {
		animation: vamora-float calc(var(--motion-float-cycle) + 1.5s) var(--motion-inout) infinite alternate-reverse;
	}

	.vamora-serve-story.is-live .vamora-serve-story__device--phone {
		animation: vamora-float var(--motion-float-cycle) var(--motion-inout) infinite alternate;
	}

	.vamora-serve-story.is-live .vamora-serve-story__device--board {
		animation: vamora-float calc(var(--motion-float-cycle) + 2s) var(--motion-inout) infinite alternate-reverse;
	}

	.vamora-serve-story.is-live .vamora-serve-story__ribbon {
		animation: vamora-serve-drift var(--motion-drift-cycle) var(--motion-inout) infinite alternate;
	}

	.vamora-serve-guards.is-live .vamora-serve-guards__panel::after {
		animation: vamora-turn var(--motion-ring-cycle) linear infinite;
	}

	.vamora-serve-guards.is-live .vamora-serve-guards__bill {
		animation: vamora-float var(--motion-float-cycle) var(--motion-inout) infinite alternate;
	}

	.vamora-serve-screens.is-playing .vamora-serve-screen__input:checked + .vamora-serve-screen__tab::after {
		animation: vamora-serve-screen-turn var(--motion-screen-cycle) linear;
	}

	.vamora-serve-screens.is-playing:is(:hover, :focus-within) .vamora-serve-screen__input:checked + .vamora-serve-screen__tab::after {
		animation-play-state: paused;
	}
}

@keyframes vamora-serve-screen-turn {
	to {
		transform: scaleX(1);
	}
}

@keyframes vamora-serve-clink {
	50% {
		scale: 1.16;
		rotate: -10deg;
		filter: drop-shadow(0 0 4px rgb(160 90 245 / 0.8));
	}
}

@keyframes vamora-serve-drift {
	from {
		translate: -2.5% 2%;
		rotate: -1.5deg;
	}

	to {
		translate: 2.5% -2%;
		rotate: 1.5deg;
	}
}
