.cf-rotator__heading {
	display: block;
}

/* Inline grid stacks all words in one cell and auto-sizes to the widest word */
.cf-rotator__wrap {
	display: inline-grid;
	grid-template-rows: 1fr;
	overflow: hidden;
	vertical-align: bottom;
	justify-items: start !important; /* words always left-anchor within their slot; heading text-align centres the line */
}

/* All words share the same grid cell */
.cf-rotator__word {
	grid-area: 1 / 1;
	opacity: 0;
	transform: translateY( 110% );
	transition: transform var( --cf-rotator-transition, 400ms ) ease,
	            opacity   var( --cf-rotator-transition, 400ms ) ease;
	white-space: nowrap;
}

/* Visible / current word */
.cf-rotator__word--active {
	opacity: 1;
	transform: translateY( 0 );
}

/* Word scrolling up and out */
.cf-rotator__word--exit {
	opacity: 0;
	transform: translateY( -110% );
	transition: transform var( --cf-rotator-transition, 400ms ) ease,
	            opacity   var( --cf-rotator-transition, 400ms ) ease;
}

/* Word waiting below, ready to enter — no transition so it snaps back instantly */
.cf-rotator__word--enter {
	opacity: 0;
	transform: translateY( 110% );
	transition: none;
}
