/* Webdoor Motion keyframes (module motion). Loaded only where an element uses an effect; the per-element timing is
   written by motion.twig. Entrances animate translate / scale / opacity / clip-path, loops animate transform, so an
   element can enter and then float. */

@keyframes wd-motion-fade-up {
	from { opacity: 0; translate: 0 var(--wd-distance, 28px); }
}

@keyframes wd-motion-fade {
	from { opacity: 0; }
}

/* Rise from mask, without a wrapper: the element slides up by its own height while the clip moves the other way, so
   the visible edge stays put (the clip's insets give descenders room). */
@keyframes wd-motion-rise {
	from { translate: 0 100%; clip-path: inset(-0.25em -0.25em 100% -0.25em); }
	to { translate: 0 0; clip-path: inset(-0.25em -0.25em -0.25em -0.25em); }
}

@keyframes wd-motion-scale {
	from { opacity: 0; scale: 0.92; }
}

@keyframes wd-motion-float {
	to { transform: translateY(var(--wd-idle-distance, 10px)) rotate(var(--wd-idle-angle, 1.5deg)); }
}

@keyframes wd-motion-sway {
	from { transform: rotate(calc(var(--wd-idle-angle, 1.4deg) * -1)); }
	to { transform: rotate(var(--wd-idle-angle, 1.4deg)); }
}

/* Split text (phase 3): light up dims each word, rise lifts each letter or word. */
@keyframes wd-motion-dim {
	from { opacity: var(--wd-dim, 0.14); }
}

@keyframes wd-motion-letter {
	from { opacity: 0; translate: 0 0.8em; }
}

/* Split text > Mask: a clipping box round each word or letter. The padding and the negative margin keep descenders and
   accents inside the clip without moving the line. */
.wd-motion-mask {
	display: inline-block;
	overflow: hidden;
	overflow: clip;
	vertical-align: top;
	padding-block: 0.12em;
	margin-block: -0.12em;
}

/* A piece inside a mask must be a box for a timeline's translate / yPercent to move it (an inline span ignores both):
   found on the lab, beta.88, where a masked headline did nothing. */
.wd-motion-mask .wd-motion-item {
	display: inline-block;
}

.wd-motion-word,
.wd-motion-chars {
	display: inline-block;
	white-space: nowrap;
}

/* The word for screen readers when letters are split (the letters are aria-hidden). */
.wd-motion-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Waiting for the runtime (wd-motion.js) to add .wd-in: only once the head script has marked JS on, never in the
   builder canvas (body.wd-builder), and scroll-linked ones only where the browser has no scroll timelines. */
.wd-motion-js body:not(.wd-builder) [data-wd-play="view"]:not(.wd-in),
.wd-motion-js body:not(.wd-builder) [data-wd-stagger-play="view"]:not(.wd-in) > *,
.wd-motion-no-timeline body:not(.wd-builder) [data-wd-reveal]:not(.wd-in),
.wd-motion-no-timeline body:not(.wd-builder) [data-wd-split="light"]:not(.wd-in) .wd-motion-item,
.wd-motion-no-timeline body:not(.wd-builder) [data-wd-split="rise"]:not(.wd-in) .wd-motion-item {
	animation-play-state: paused;
}
