/* Pendulum: signature motions for homes 2 to 5. Behavior lives in signature-motions.js. */

/* Word lists are the editable source. Once enhanced they stay available to screen readers only. */
.pnd-clock.is-enhanced .pnd-clock-words,
.pnd-clap.is-enhanced .pnd-clap-words,
.pnd-clap.is-enhanced .pnd-clap__lead,
.pnd-flap.is-enhanced .pnd-flap-words,
.pnd-orbit.is-enhanced .pnd-orbit-words {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Without JavaScript, show just the first word. */
.pnd-clock:not(.is-enhanced) li:not(:first-child),
.pnd-clap:not(.is-enhanced) li:not(:first-child),
.pnd-flap:not(.is-enhanced) li:not(:first-child),
.pnd-orbit:not(.is-enhanced) .pnd-orbit-words {
	display: none;
}

.pnd-clock-words,
.pnd-clap-words,
.pnd-flap-words,
.pnd-orbit-words {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- Clock (Home 2) ---------- */

.pnd-clock {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.pnd-clock__svg {
	flex: none;
	width: clamp(6.5rem, 9vw, 9rem);
	height: auto;
	overflow: visible;
	filter: drop-shadow(6px 8px 8px rgb(18 26 31 / 0.28));
}

.pnd-clock__face {
	fill: var(--wp--preset--color--accent);
	stroke: var(--wp--preset--color--ink);
	stroke-width: 6;
}

.pnd-clock__tick {
	stroke: var(--wp--preset--color--ink);
	stroke-width: 3;
	stroke-linecap: round;
}

.pnd-clock__tick.is-major {
	stroke-width: 6;
}

.pnd-clock__hand {
	transform-origin: 100px 100px;
	transition: transform 0.75s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.pnd-clock__hand line {
	stroke: var(--wp--preset--color--ink);
	stroke-width: 9;
	stroke-linecap: round;
}

.pnd-clock__second {
	transform-origin: 100px 100px;
	animation: pnd-second 60s steps(60) infinite;
}

.pnd-clock__second line {
	stroke: var(--wp--preset--color--primary);
	stroke-width: 3;
	stroke-linecap: round;
}

.pnd-clock__pin {
	fill: var(--wp--preset--color--ink);
	stroke: var(--wp--preset--color--accent);
	stroke-width: 3;
}

.pnd-clock__label {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.pnd-clock__label.is-in {
	animation: pnd-rise 0.45s ease-out both;
}

@keyframes pnd-second {
	to {
		transform: rotate(360deg);
	}
}

@keyframes pnd-rise {
	from {
		opacity: 0;
		transform: translateY(0.5em);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Clapperboard (Home 3) ---------- */

.pnd-clap {
	/* Room above for the open clapstick. */
	margin-top: 3.25rem;
	margin-bottom: var(--wp--preset--spacing--40);
}

.pnd-clap__board {
	position: relative;
	width: min(100%, 17rem);
	color: #fff;
}

.pnd-clap__stick {
	height: 1.15rem;
	margin-bottom: 3px;
	border: 3px solid #fff;
	border-radius: 4px 4px 0 0;
	background: repeating-linear-gradient(115deg, #fff 0 14px, var(--wp--preset--color--ink) 14px 28px);
	transform-origin: 0 100%;
	transform: rotate(-15deg);
	transition: transform 0.4s ease-out;
}

.pnd-clap__board.is-closed .pnd-clap__stick {
	transform: rotate(0deg);
	transition-duration: 0.09s;
	transition-timing-function: ease-in;
}

.pnd-clap__slate {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.15rem 0.75rem;
	padding: 0.7rem 0.95rem 0.85rem;
	border: 3px solid #fff;
	border-radius: 0 0 6px 6px;
	background: var(--wp--preset--color--ink);
}

.pnd-clap__lead-text {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: rgb(255 255 255 / 0.75);
}

.pnd-clap__take {
	font-size: 0.75rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: rgb(255 255 255 / 0.75);
}

.pnd-clap__word {
	grid-column: 1 / -1;
	font-size: 1.5rem;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--accent);
}

.pnd-clap__flash {
	position: absolute;
	inset: 0;
	background: #fff;
	opacity: 0;
	pointer-events: none;
}

.pnd-clap__flash.is-on {
	opacity: 0.85;
}

/* ---------- Split-flap board (Home 4) ---------- */

.pnd-flap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.5rem;
	margin-bottom: var(--wp--preset--spacing--50);
}

.pnd-flap__lead {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--muted);
}

.pnd-flap__board {
	display: flex;
	flex-wrap: wrap;
	gap: 0.14em;
	/* Shrinks on phones so a 16-letter word fits on one line. */
	font-size: min(clamp(1.4rem, 0.8rem + 2.8vw, 3.5rem), calc((100vw - 2.5rem) / 17.4));
	font-weight: 800;
}

.pnd-cell {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 0.95em;
	height: 1.35em;
	border-radius: 0.16em;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	line-height: 1;
}

.pnd-cell::after {
	content: "";
	position: absolute;
	inset: 50% 0 auto;
	height: 2px;
	background: var(--wp--preset--color--base);
}

.pnd-cell.is-flip {
	color: var(--wp--preset--color--accent);
}

.pnd-cell.is-space {
	width: 0.4em;
	background: transparent;
}

.pnd-cell.is-space::after,
.pnd-cell.is-pad {
	display: none;
}

/* ---------- Orbit badge (Home 5) ---------- */

.pnd-orbit {
	position: relative;
}

.pnd-orbit__svg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	animation: pnd-spin 30s linear infinite;
}

.pnd-orbit__text {
	fill: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 800;
}

.pnd-orbit.is-enhanced figure {
	position: relative;
	z-index: 1;
	width: min(54%, 7.5rem);
}

@keyframes pnd-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Reduced motion: everything holds still ---------- */

@media (prefers-reduced-motion: reduce) {
	.pnd-clock__second,
	.pnd-orbit__svg {
		animation: none;
	}

	.pnd-clock__hand,
	.pnd-clap__stick {
		transition: none;
	}

	.pnd-clock__label.is-in {
		animation: none;
	}
}

/* Display type for the motion pieces. */
.pnd-clock__label,
.pnd-clap__word,
.pnd-flap__board,
.pnd-edit-mail {
	font-family: var(--wp--preset--font-family--bricolage);
}

.pnd-orbit__text {
	font-family: "Bricolage Grotesque", sans-serif;
}
