/* Motion for the shop chrome. It belongs to the header, the footer and the
   landing's section nav, so it loads on every page and behaves the same on all
   of them — the chrome's own --chrome-* tokens still own its looks. */

.vamora-header {
	transition: transform var(--motion-ui) var(--motion-inout);
}

.vamora-header__inner {
	transition:
		box-shadow var(--motion-ui) linear,
		background-color var(--motion-ui) linear;
}

/* Reading room on the way down; the header is back the moment you scroll up.
   It goes far enough that the pill's shadow does not hang at the top edge. */
.vamora-header.is-away {
	transform: translateY(calc(-100% - 3rem));
}

/* Once there is page beneath it the glass firms up and lifts. */
.vamora-header.is-stuck .vamora-header__inner {
	background-color: var(--chrome-glass-stuck);
	box-shadow: var(--chrome-pill-shadow-stuck);
}

/* How far down the page you are, drawn along the flat of the pill's lower
   edge, between its two rounded ends. A real element on its own layer, so moving
   it on every frame of a scroll restyles and repaints nothing else in the header. */
.vamora-header__progress {
	position: absolute;
	right: var(--chrome-pill-radius);
	bottom: -1px;
	left: var(--chrome-pill-radius);
	height: 2px;
	border-radius: 2px;
	background: var(--chrome-accent);
	opacity: 0.9;
	transform: scaleX(0);
	transform-origin: left center;
	pointer-events: none;
	will-change: transform;
}

.vamora-nav-toggle {
	transition: border-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

.vamora-nav-toggle:hover {
	border-color: var(--chrome-hover);
	color: var(--chrome-hover);
}

.vamora-nav-toggle .vamora-icon {
	transition: transform var(--motion-ui) var(--motion-spring);
}

.vamora-nav-toggle[aria-expanded="true"] .vamora-icon {
	transform: rotate(90deg);
}

.vamora-footer__cta {
	position: relative;
	overflow: hidden;
	transition:
		transform var(--motion-fast) var(--motion-out),
		filter var(--motion-fast) linear,
		background-color var(--motion-fast) linear,
		color var(--motion-fast) linear;
}

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

/* The sheen rides a pseudo-element so the button's own gradient is untouched. */
.vamora-footer__cta::after,
.vamora-header__cta-sheen::before {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 45%;
	background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.45), transparent);
	transform: translateX(-180%) skewX(-18deg);
	content: "";
	pointer-events: none;
}

/* The header button is alive at rest: a ring in the brand gradient circles it,
   and a pointer nearby draws it in. It cannot clip its own edge — the ripple
   has to leave it — so the two things that must be clipped, the ring and the
   sheen, each get a layer that clips itself.

   The ring is a frame with only its padding showing; the gradient inside it
   is a much larger square turning behind that window, so what moves is a
   rotation and the window never does. */
.vamora-header__cta {
	position: relative;
	isolation: isolate;
	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-reveal) var(--motion-elastic),
		filter var(--motion-fast) linear;
}

/* Following the pointer is immediate; only letting go is a spring. */
.vamora-header__cta:hover {
	--vamora-lift: calc(-1 * var(--motion-lift) / 2);

	transition:
		transform var(--motion-fast) var(--motion-out),
		filter var(--motion-fast) linear;
}

.vamora-header__cta-ring,
.vamora-header__cta-sheen {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	pointer-events: none;
}

.vamora-header__cta-ring {
	padding: var(--chrome-cta-ring-width);
	mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	mask-composite: exclude;
	-webkit-mask-composite: xor;
}

.vamora-header__cta-ring::before {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 200%;
	aspect-ratio: 1;
	background: var(--chrome-cta-ring);
	translate: -50% -50%;
	content: "";
}

/* The ripple leaves the button's edge, so it is a ring of its own. */
.vamora-header__cta::after {
	position: absolute;
	inset: 0;
	border: var(--chrome-cta-ring-width) solid var(--chrome-cta-ripple);
	border-radius: inherit;
	opacity: 0;
	content: "";
	pointer-events: none;
}

/* Out of sight, nothing should be turning. */
.vamora-header.is-away .vamora-header__cta-ring::before {
	animation-play-state: paused;
}

.vamora-header__cta .vamora-icon,
.vamora-footer__cta .vamora-icon {
	transition: transform var(--motion-fast) var(--motion-out);
}

.vamora-footer__cta:hover .vamora-icon,
.vamora-footer__email:hover .vamora-icon {
	transform: translateX(3px);
}

/* The header's icon is a calendar, which tips toward the date rather than
   pointing the way. */
.vamora-header__cta:hover .vamora-icon {
	transform: rotate(-8deg) scale(1.12);
}

/* Footer links: the tile fills, the icon pops. */
.vamora-footer__tile {
	transition:
		background-color var(--motion-ui) linear,
		color var(--motion-ui) linear,
		transform var(--motion-reveal) var(--motion-spring);
}

a.vamora-footer__link:hover .vamora-footer__tile,
a.vamora-footer__link:focus-visible .vamora-footer__tile {
	background-color: var(--chrome-hover);
	color: var(--chrome-surface);
	transform: rotate(-6deg) scale(1.1);
}

.vamora-footer__social {
	transition:
		background-color var(--motion-ui) linear,
		color var(--motion-ui) linear,
		transform var(--motion-reveal) var(--motion-spring);
}

a.vamora-footer__social:hover,
a.vamora-footer__social:focus-visible {
	background-color: var(--chrome-hover);
	color: var(--chrome-surface);
	transform: translateY(-4px) rotate(-6deg);
}

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

.vamora-footer__submit:hover .vamora-icon {
	transform: translateX(0.3em);
}

.vamora-footer__trust-icon {
	transition: transform var(--motion-reveal) var(--motion-spring);
}

.vamora-footer__trust-item:hover .vamora-footer__trust-icon {
	transform: scale(1.14) rotate(-6deg);
}

.vamora-nav__product {
	transition:
		border-color var(--motion-fast) linear,
		background-color var(--motion-fast) linear,
		transform var(--motion-fast) var(--motion-out);
}

.vamora-nav__product:hover {
	transform: translateY(-2px);
}

.vamora-nav__product .vamora-icon {
	transition: transform var(--motion-fast) var(--motion-out);
}

.vamora-nav__product:hover .vamora-icon {
	transform: translateX(4px);
}

/* Back to top: it springs in, a pointer fills it, and once the ring has closed on the
   page's last line it starts to call. */
.vamora-top {
	translate: 0 0.75rem;
	scale: 0.7;
	transition:
		opacity var(--motion-ui) linear,
		translate var(--motion-reveal) var(--motion-spring),
		scale var(--motion-reveal) var(--motion-spring),
		background-color var(--motion-fast) linear,
		color var(--motion-fast) linear,
		visibility 0s linear var(--motion-ui);
}

.vamora-top.is-shown {
	translate: 0 0;
	scale: 1;
	transition:
		opacity var(--motion-ui) linear,
		translate var(--motion-reveal) var(--motion-spring),
		scale var(--motion-reveal) var(--motion-spring),
		background-color var(--motion-fast) linear,
		color var(--motion-fast) linear,
		visibility 0s;
}

.vamora-top:focus-visible {
	background-color: var(--chrome-hover);
	color: var(--chrome-surface);
}

.vamora-top:focus-visible .vamora-top__track {
	stroke: rgb(255 255 255 / 0.35);
}

.vamora-top:focus-visible .vamora-top__fill {
	stroke: var(--chrome-surface);
}

/* On a touch screen hover sticks after a tap, which would leave it filled. */
@media (hover: hover) {
	.vamora-top:hover {
		background-color: var(--chrome-hover);
		color: var(--chrome-surface);
	}

	.vamora-top.is-shown:hover {
		scale: 1.08;
	}

	.vamora-top:hover .vamora-top__track {
		stroke: rgb(255 255 255 / 0.35);
	}

	.vamora-top:hover .vamora-top__fill {
		stroke: var(--chrome-surface);
	}
}

.vamora-top::after {
	position: absolute;
	inset: 0;
	border: 2px solid var(--chrome-cta-ripple);
	border-radius: 50%;
	opacity: 0;
	content: "";
	pointer-events: none;
}

/* The footer comes up in order, each time it comes into view. */
.vamora-footer.is-armed .vamora-footer__brand,
.vamora-footer.is-armed .vamora-footer__column,
.vamora-footer.is-armed .vamora-footer__updates,
.vamora-footer.is-armed .vamora-footer__subscribe,
.vamora-footer.is-armed .vamora-footer__follow,
.vamora-footer.is-armed .vamora-footer__trust-item {
	opacity: 0;
	translate: 0 var(--motion-rise);
	transition:
		opacity var(--motion-reveal) var(--motion-out) var(--vamora-footer-at, 0ms),
		translate var(--motion-reveal) var(--motion-out) var(--vamora-footer-at, 0ms);
}

.vamora-footer.is-seen .vamora-footer__brand,
.vamora-footer.is-seen .vamora-footer__column,
.vamora-footer.is-seen .vamora-footer__updates,
.vamora-footer.is-seen .vamora-footer__subscribe,
.vamora-footer.is-seen .vamora-footer__follow,
.vamora-footer.is-seen .vamora-footer__trust-item {
	opacity: 1;
	translate: 0 0;
}

.vamora-footer__column:nth-child(1) {
	--vamora-footer-at: 70ms;
}

.vamora-footer__column:nth-child(2) {
	--vamora-footer-at: 140ms;
}

.vamora-footer__column:nth-child(3) {
	--vamora-footer-at: 210ms;
}

.vamora-footer__column:nth-child(4) {
	--vamora-footer-at: 280ms;
}

.vamora-footer__updates {
	--vamora-footer-at: 200ms;
}

.vamora-footer__subscribe {
	--vamora-footer-at: 270ms;
}

.vamora-footer__follow {
	--vamora-footer-at: 340ms;
}

.vamora-footer__trust-item:nth-child(1) {
	--vamora-footer-at: 300ms;
}

.vamora-footer__trust-item:nth-child(2) {
	--vamora-footer-at: 370ms;
}

.vamora-footer__trust-item:nth-child(3) {
	--vamora-footer-at: 440ms;
}

.vamora-footer__trust-item:nth-child(4) {
	--vamora-footer-at: 510ms;
}

/* The sticky section nav follows the header out of the way, so a landing never
   shows a gap where the header was. */
.vamora-section-nav {
	transition: top var(--motion-ui) var(--motion-inout);
}

.is-chrome-away .vamora-section-nav {
	top: 0;
}

.is-chrome-away .admin-bar .vamora-section-nav {
	top: 32px;
}

@media (max-width: 782px) {
	.is-chrome-away .admin-bar .vamora-section-nav {
		top: 46px;
	}
}

.vamora-section-nav__list {
	position: relative;
}

/* Where you are on the page, as a bar that slides between the anchors. */
.vamora-section-nav__list::after {
	position: absolute;
	bottom: 0;
	left: 0;
	width: var(--vamora-ind-w, 0);
	height: 2px;
	border-radius: 2px;
	background: var(--gradient-brand);
	opacity: var(--vamora-ind-shown, 0);
	transform: translateX(var(--vamora-ind-x, 0));
	transition:
		transform var(--motion-ui) var(--motion-inout),
		width var(--motion-ui) var(--motion-inout),
		opacity var(--motion-fast) linear;
	content: "";
	pointer-events: none;
}

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

.vamora-section-nav__link.is-current {
	color: var(--color-primary);
}

@media (min-width: 56.25em) {
	.vamora-nav__link {
		position: relative;
	}

	.vamora-nav__link::after {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: 2px;
		border-radius: 2px;
		background: var(--chrome-accent);
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform var(--motion-ui) var(--motion-out);
		content: "";
	}

	.vamora-nav__link:hover::after,
	.vamora-nav__link:focus-visible::after,
	.vamora-nav__disclosure[aria-expanded="true"]::after {
		transform: scaleX(1);
	}

	/* Laid out at all times so it can fade; visibility keeps it off the tab
	   order while it is closed. */
	.vamora-nav__panel {
		display: grid;
		gap: var(--space-2);
		visibility: hidden;
		opacity: 0;
		transform: translateX(-50%) translateY(-0.5rem) scale(0.98);
		transform-origin: top center;
		transition:
			opacity var(--motion-ui) var(--motion-out),
			transform var(--motion-ui) var(--motion-out),
			visibility 0s linear var(--motion-ui);
		pointer-events: none;
	}

	.vamora-nav__panel.is-open {
		visibility: visible;
		opacity: 1;
		transform: translateX(-50%);
		transition:
			opacity var(--motion-ui) var(--motion-out),
			transform var(--motion-ui) var(--motion-out),
			visibility 0s;
		pointer-events: auto;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.vamora-header__cta-ring::before {
		animation: vamora-ring var(--motion-ring-cycle) linear infinite;
	}

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

	.vamora-footer__plane .vamora-icon {
		animation: vamora-plane var(--motion-float-cycle) var(--motion-inout) infinite;
	}

	.vamora-top.is-full::after {
		animation: vamora-ripple-out calc(2 * var(--motion-ripple-cycle)) var(--motion-out) infinite;
	}

	/* Hover is a mouse's idea: on a touch screen it sticks after a tap, and a
	   pulse that never stops is worse than none. */
	@media (hover: hover) {
		.vamora-top:hover .vamora-icon {
			animation: vamora-top-rise var(--motion-ripple-cycle) var(--motion-inout) infinite;
		}

		.vamora-header__cta:hover {
			animation: vamora-cta-pulse var(--motion-ripple-cycle) var(--motion-inout) infinite;
		}

		.vamora-header__cta:hover::after {
			animation: vamora-ripple-out var(--motion-ripple-cycle) var(--motion-out) infinite;
		}

		.vamora-header__cta:hover .vamora-header__cta-sheen::before {
			animation: vamora-sheen var(--motion-sheen-cycle) var(--motion-inout) infinite;
		}
	}

	@media (max-width: 56.24em) {
		.vamora-nav.is-open {
			animation: vamora-menu-open var(--motion-ui) var(--motion-out) both;
		}

		.vamora-nav.is-open .vamora-nav__item,
		.vamora-nav.is-open .vamora-header__cta--panel {
			animation: vamora-menu-item var(--motion-ui) var(--motion-out) both;
		}

		.vamora-nav.is-open .vamora-nav__item:nth-child(2) {
			animation-delay: var(--motion-stagger-tight);
		}

		.vamora-nav.is-open .vamora-nav__item:nth-child(3) {
			animation-delay: calc(2 * var(--motion-stagger-tight));
		}

		.vamora-nav.is-open .vamora-nav__item:nth-child(4) {
			animation-delay: calc(3 * var(--motion-stagger-tight));
		}

		.vamora-nav.is-open .vamora-header__cta--panel {
			animation-delay: calc(4 * var(--motion-stagger-tight));
		}
	}

	.vamora-nav__panel.is-open .vamora-nav__product {
		animation: vamora-menu-item var(--motion-ui) var(--motion-out) both;
	}

	.vamora-nav__panel.is-open .vamora-nav__product:nth-child(2) {
		animation-delay: var(--motion-stagger-tight);
	}

	/* Cross-document fades between the shop's pages, where the browser offers
	   them; elsewhere navigation is simply unchanged. */
	@view-transition {
		navigation: auto;
	}
}

@keyframes vamora-plane {
	0%,
	72%,
	100% {
		transform: none;
		opacity: 1;
	}

	84% {
		transform: translate(70%, -70%) scale(0.7);
		opacity: 0;
	}

	85% {
		transform: translate(-70%, 70%) scale(0.7);
		opacity: 0;
	}
}

@keyframes vamora-top-rise {
	0%,
	12% {
		opacity: 1;
		transform: none;
	}

	50% {
		opacity: 0;
		transform: translateY(-110%);
	}

	51% {
		opacity: 0;
		transform: translateY(110%);
	}

	88%,
	100% {
		opacity: 1;
		transform: none;
	}
}

@keyframes vamora-ring {
	to {
		rotate: 360deg;
	}
}

@keyframes vamora-cta-pulse {
	50% {
		filter: brightness(var(--motion-glow));
	}
}

@keyframes vamora-ripple-out {
	from {
		opacity: 1;
		scale: 1;
	}

	to {
		opacity: 0;
		scale: var(--motion-ripple);
	}
}

@keyframes vamora-menu-open {
	from {
		opacity: 0;
		transform: translateY(-0.75rem);
	}
}

@keyframes vamora-menu-item {
	from {
		opacity: 0;
		transform: translateY(-0.5rem);
	}
}
