/**
 * Site motion: the home page and the service pages.
 *
 * Everything here is scoped to html.zc-motion, which is only set when the
 * browser supports IntersectionObserver and the visitor has not asked for
 * reduced motion. Without it, the page renders exactly as designed, static.
 *
 * Reveals use animation with fill-mode "backwards" rather than transitions,
 * so once an element has arrived its own hover transforms work normally.
 */

@keyframes zc-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes zc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zc-from-left { from { opacity: 0; transform: translateX(-40px) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes zc-from-right { from { opacity: 0; transform: translateX(40px) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes zc-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes zc-pop { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes zc-sun-in { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zc-drift { from { translate: 0 0; } to { translate: -14px 10px; } }

:root {
	--zc-ease: cubic-bezier(.2, .7, .2, 1);
	--zc-dur: .8s;
}

/* ---------- Hero entrance, on load ---------- */
.zc-motion .zc-hero::before { animation: zc-sun-in 1.1s var(--zc-ease) .1s backwards, zc-drift 9s ease-in-out 1.2s infinite alternate; }
.zc-motion .zc-hero .zc-eyebrow { animation: zc-rise var(--zc-dur) var(--zc-ease) .05s backwards; }
.zc-motion .zc-hero-statement { animation: zc-rise var(--zc-dur) var(--zc-ease) .05s backwards; }
.zc-motion .zc-hero-media { animation: zc-rise var(--zc-dur) var(--zc-ease) .2s backwards; }
.zc-motion .zc-hero-tagline { animation: zc-rise var(--zc-dur) var(--zc-ease) .3s backwards; }
.zc-motion .zc-hero h1 { animation: zc-rise var(--zc-dur) var(--zc-ease) .35s backwards; }
.zc-motion .zc-hero h1 em { display: inline-block; animation: zc-rise var(--zc-dur) var(--zc-ease) .55s backwards; }
.zc-motion .zc-hero-sub { animation: zc-rise var(--zc-dur) var(--zc-ease) .45s backwards; }
.zc-motion .zc-hero-actions .wp-block-button { animation: zc-rise var(--zc-dur) var(--zc-ease) backwards; }
.zc-motion .zc-hero-actions .wp-block-button:nth-child(1) { animation-delay: .55s; }
.zc-motion .zc-hero-actions .wp-block-button:nth-child(2) { animation-delay: .65s; }

/* ---------- Service page hero entrance, on load ---------- */
.zc-motion .zc-page-hero::before { animation: zc-sun-in 1.1s var(--zc-ease) .1s backwards, zc-drift 9s ease-in-out 1.2s infinite alternate; }
.zc-motion .zc-crumbs { animation: zc-fade .6s ease .05s backwards; }
.zc-motion .zc-ph-icon { animation: zc-pop .6s var(--zc-ease) .1s backwards; }
.zc-motion .zc-page-hero h1 { animation: zc-rise var(--zc-dur) var(--zc-ease) .15s backwards; }
.zc-motion .zc-tagline { animation: zc-rise var(--zc-dur) var(--zc-ease) .3s backwards; }
.zc-motion .zc-intro { animation: zc-rise var(--zc-dur) var(--zc-ease) .4s backwards; }
.zc-motion .zc-page-hero .wp-block-buttons { animation: zc-rise var(--zc-dur) var(--zc-ease) .5s backwards; }

/* ---------- Scroll reveals ---------- */
.zc-motion :is(
	.zc-why .zc-big, .zc-why-text, .zc-stat,
	.zc-pov .zc-big, .zc-prophet, .zc-founder,
	.zc-head, .zc-quote, .zc-pillar, .zc-foundation, .zc-service,
	.zc-about-side, .zc-about-text,
	.zc-how .zc-eyebrow, .zc-how-title, .zc-how-item,
	.zc-case,
	.zc-signal, .zc-svc-item, .zc-start, .zc-cta-card, .zc-other,
	.zc-booking-info, .zc-booking-form
):not(.is-in) { opacity: 0; }

.zc-motion :is(
	.zc-why .zc-big, .zc-why-text, .zc-stat,
	.zc-pov .zc-big, .zc-prophet, .zc-founder,
	.zc-head, .zc-quote, .zc-pillar, .zc-foundation, .zc-service,
	.zc-about-side, .zc-about-text,
	.zc-how .zc-eyebrow, .zc-how-title, .zc-how-item,
	.zc-case,
	.zc-signal, .zc-svc-item, .zc-start, .zc-cta-card, .zc-other,
	.zc-booking-info, .zc-booking-form
).is-in { animation: zc-rise var(--zc-dur) var(--zc-ease) var(--zc-delay, 0s) backwards; }

/* Point of view eyebrow: the orange bar draws in. */
.zc-motion .zc-eyebrow-bar:not(.is-in) { opacity: 0; }
.zc-motion .zc-eyebrow-bar.is-in { animation: zc-fade .5s ease backwards; }
.zc-motion .zc-eyebrow-bar.is-in::before { transform-origin: left; animation: zc-grow-x .7s var(--zc-ease) .15s backwards; }

/* Point of view rows: sketch slides in from its own side, text rises, bar draws. */
.zc-motion .zc-pov-row:not(.is-in) > * { opacity: 0; }
.zc-motion .zc-pov-row.is-in .zc-pov-photo { animation: zc-from-left .9s var(--zc-ease) .1s backwards; }
.zc-motion .zc-pov-row.zc-flip.is-in .zc-pov-photo { animation-name: zc-from-right; }
.zc-motion .zc-pov-row.is-in .zc-pov-text { animation: zc-rise var(--zc-dur) var(--zc-ease) .25s backwards; }
.zc-motion .zc-pov-row.is-in .zc-pov-text::before { transform-origin: left; animation: zc-grow-x .7s var(--zc-ease) .45s backwards; }

/* Big quote marks pop in after their card lands. */
.zc-motion :is(.zc-prophet, .zc-founder).is-in .zc-pull-quote::before { animation: zc-pop .6s var(--zc-ease) calc(var(--zc-delay, 0s) + .35s) backwards; transform-origin: left bottom; }
.zc-motion .zc-quote.is-in::before { animation: zc-pop .6s var(--zc-ease) calc(var(--zc-delay, 0s) + .3s) backwards; transform-origin: left bottom; }

/* Pillar and service icons pop once their card is in. */
.zc-motion :is(.zc-pillar, .zc-service, .zc-svc-item, .zc-start, .zc-other).is-in .zc-ico { animation: zc-pop .6s var(--zc-ease) calc(var(--zc-delay, 0s) + .3s) backwards; }

/* Signal ticks pop after their card lands. */
.zc-motion .zc-signal.is-in::before { animation: zc-pop .6s var(--zc-ease) calc(var(--zc-delay, 0s) + .3s) backwards; }

/* Service-page call to action: the button follows the card in. */
.zc-motion .zc-cta-card.is-in .wp-block-buttons { animation: zc-rise .7s var(--zc-ease) .3s backwards; }

/* Foundation chips follow the orange bar in, one at a time. */
.zc-motion .zc-foundation.is-in .zc-chips li { animation: zc-rise .6s var(--zc-ease) backwards; }
.zc-motion .zc-foundation.is-in .zc-chips li:nth-child(1) { animation-delay: .3s; }
.zc-motion .zc-foundation.is-in .zc-chips li:nth-child(2) { animation-delay: .4s; }
.zc-motion .zc-foundation.is-in .zc-chips li:nth-child(3) { animation-delay: .5s; }

/* Booking list numbers tick in. */
.zc-motion .zc-booking-info.is-in .zc-gets li { animation: zc-rise .6s var(--zc-ease) backwards; }
.zc-motion .zc-booking-info.is-in .zc-gets li:nth-child(1) { animation-delay: .35s; }
.zc-motion .zc-booking-info.is-in .zc-gets li:nth-child(2) { animation-delay: .45s; }
.zc-motion .zc-booking-info.is-in .zc-gets li:nth-child(3) { animation-delay: .55s; }
.zc-motion .zc-booking-info.is-in .zc-gets li:nth-child(4) { animation-delay: .65s; }

/* ---------- Hover details (always on, but respect reduced motion) ---------- */
.zc-service .zc-ico, .zc-pillar .zc-ico { transition: transform .3s var(--zc-ease); }
.zc-service:hover .zc-ico { transform: rotate(-8deg) scale(1.06); }
.zc-svc-item .zc-ico, .zc-start .zc-ico, .zc-other .zc-ico { transition: transform .3s var(--zc-ease); }
.zc-svc-item:hover .zc-ico, .zc-other:hover .zc-ico { transform: rotate(-8deg) scale(1.06); }
.zc-start:hover .zc-ico { transform: translateY(-3px); }
.zc-pillar:hover .zc-ico { transform: translateY(-3px); }
.zc-pillar, .zc-quote:not(.zc-quote-feature), .zc-case, .zc-svc-item, .zc-start { transition: transform .25s var(--zc-ease), box-shadow .25s var(--zc-ease); }
.zc-pillar:hover, .zc-quote:not(.zc-quote-feature):hover, .zc-case:hover, .zc-svc-item:hover, .zc-start:hover { transform: translateY(-3px); box-shadow: var(--wp--custom--shadow-menu); }
.zc-pov-photo img { transition: transform .5s var(--zc-ease); }
.zc-pov-row:hover .zc-pov-photo img { transform: scale(1.04) rotate(-1deg); }

@media (prefers-reduced-motion: reduce) {
	.zc-service:hover .zc-ico, .zc-pillar:hover .zc-ico,
	.zc-pillar:hover, .zc-quote:hover, .zc-case:hover,
	.zc-svc-item:hover, .zc-start:hover, .zc-svc-item:hover .zc-ico, .zc-other:hover .zc-ico, .zc-start:hover .zc-ico,
	.zc-pov-row:hover .zc-pov-photo img { transform: none; }
}
