/* Motion the animated pages share: buttons, cards and the FAQ disclosures.
   Transform is composed from custom properties throughout, so a hover lift, a
   pointer tilt and a magnetic pull can act on one element without any of them
   having to know about the others. */

.vamora-motion .vamora-button {
	transform: translate3d(
		calc(var(--vamora-pull-x, 0px) * var(--motion-magnet)),
		calc(var(--vamora-pull-y, 0px) * var(--motion-magnet) + var(--vamora-lift, 0px)),
		0);
	transition:
		transform var(--motion-fast) var(--motion-out),
		box-shadow var(--motion-fast) var(--motion-out),
		background-color var(--motion-fast) linear,
		border-color var(--motion-fast) linear,
		color var(--motion-fast) linear;
}

.vamora-motion .vamora-button:hover {
	--vamora-lift: calc(-1 * var(--motion-lift) / 2);
}

.vamora-motion .vamora-button:active {
	--vamora-lift: 0px;
}

.vamora-motion .vamora-button--primary:hover {
	box-shadow: 0 14px 28px rgb(var(--rgb-primary) / 0.34);
}

.vamora-motion .vamora-button--outline:hover {
	background: var(--color-lavender);
}

.vamora-motion .vamora-button__badge,
.vamora-motion .vamora-button > .vamora-icon {
	transition: transform var(--motion-fast) var(--motion-out);
}

.vamora-motion .vamora-button:hover .vamora-button__badge {
	transform: scale(1.1);
}

.vamora-motion .vamora-button:hover > .vamora-icon {
	transform: translateX(3px);
}

/* A light streak across the primary button: once as it arrives, then on hover. */
.vamora-motion .vamora-button--primary {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.vamora-motion .vamora-button--primary::after {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: -1;
	width: 40%;
	background: linear-gradient(100deg, transparent, rgb(var(--rgb-white) / 0.4), transparent);
	transform: translateX(-200%) skewX(-18deg);
	content: "";
	pointer-events: none;
}

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

/* Pointer tilt and spotlight. The class is added on first hover by the pointer
   module, so a card that is still arriving keeps its reveal transform. */
.vamora-motion .vamora-tilt {
	position: relative;
	transform:
		perspective(var(--motion-perspective))
		rotateX(calc(var(--vamora-tilt-y, 0) * var(--motion-tilt)))
		rotateY(calc(var(--vamora-tilt-x, 0) * var(--motion-tilt)))
		translate3d(0, var(--vamora-lift, 0px), 0);
	transition:
		transform var(--motion-ui) var(--motion-out),
		box-shadow var(--motion-ui) var(--motion-out);
}

.vamora-motion .vamora-tilt:hover {
	--vamora-lift: calc(-1 * var(--motion-lift));
}

.vamora-motion .vamora-tilt.is-tilting {
	transition:
		transform var(--motion-fast) linear,
		box-shadow var(--motion-ui) var(--motion-out);
}

.vamora-motion .vamora-tilt::after {
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
	background: radial-gradient(14rem circle at var(--vamora-spot-x, 50%) var(--vamora-spot-y, 50%), rgb(var(--rgb-primary) / var(--motion-spot)), transparent 62%);
	opacity: var(--vamora-spot-shown, 0);
	transition: opacity var(--motion-ui) linear;
	content: "";
	pointer-events: none;
}

.vamora-motion .vamora-tilt.is-tilting::after {
	--vamora-spot-shown: 1;
}

/* FAQ disclosures, on the landings. The answer always
   fades in; the height itself eases open where the browser can interpolate to
   auto, and snaps open where it cannot. */
.vamora-motion .vamora-faq__item {
	transition:
		border-color var(--motion-ui) linear,
		box-shadow var(--motion-ui) var(--motion-out);
}

.vamora-motion .vamora-faq__question {
	transition: color var(--motion-fast) linear;
}

@media (prefers-reduced-motion: no-preference) {
	.vamora-motion .vamora-faq__item[open] .vamora-faq__answer {
		animation: vamora-answer var(--motion-ui) var(--motion-out) both;
	}

	.vamora-motion .vamora-button--primary:hover::after {
		animation: vamora-sheen var(--motion-sheen-cycle) var(--motion-inout) infinite;
	}

	.vamora-motion .vamora-button--primary.is-inview::after {
		animation: vamora-sheen var(--motion-slow) var(--motion-out) var(--vamora-delay, 0ms) 1;
	}
}

@supports (interpolate-size: allow-keywords) {
	.vamora-motion .vamora-faq__item {
		interpolate-size: allow-keywords;
	}

	.vamora-motion .vamora-faq__item::details-content {
		block-size: 0;
		overflow: hidden;
		transition:
			block-size var(--motion-ui) var(--motion-out),
			content-visibility var(--motion-ui) allow-discrete;
	}

	.vamora-motion .vamora-faq__item[open]::details-content {
		block-size: auto;
	}
}

@keyframes vamora-answer {
	from {
		opacity: 0;
		transform: translateY(-0.35rem);
	}
}
