/*
 * Front-end motion (P26). Every rule is scoped to html.psh-motion, which the head script adds only
 * when the visitor has not asked to reduce motion. Only opacity and transform move, so nothing
 * shifts the layout. Not loaded in the block editor.
 */

@keyframes psh-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes psh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes psh-settle { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes psh-pop { 0% { opacity: 0; transform: scale(0); } 70% { opacity: 1; transform: scale(1.25); } 100% { opacity: 1; transform: none; } }

/* Scroll reveal (classes added by motion.js; removed again once the element has appeared). */
.psh-motion .psh-reveal {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
	transition-delay: calc(var(--psh-i, 0) * 90ms);
}
.psh-motion .psh-reveal.is-visible { opacity: 1; transform: none; }
.psh-motion .media-split__img.psh-reveal,
.psh-motion .h-price-card.psh-reveal { transform: translateY(22px) scale(.98); }
.psh-motion .media-split__img.psh-reveal.is-visible,
.psh-motion .h-price-card.psh-reveal.is-visible { transform: none; }

/* Homepage hero: text rises line by line, the map settles in, then the cities pop in one by one. */
.psh-motion .h-hero__text > * { animation: psh-rise .75s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .h-hero__text > :nth-child(2) { animation-delay: .08s; }
.psh-motion .h-hero__text > :nth-child(3) { animation-delay: .16s; }
.psh-motion .h-hero__text > :nth-child(4) { animation-delay: .24s; }
.psh-motion .h-hero__text > :nth-child(5) { animation-delay: .34s; }
.psh-motion .h-hero__media { animation: psh-settle .9s .15s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .h-map__city .h-map__dot { transform-box: fill-box; transform-origin: center; animation: psh-pop .55s calc(.55s + var(--psh-i, 0) * 70ms) cubic-bezier(.3, 1.3, .5, 1) both; }
.psh-motion .h-map__city text { animation: psh-fade .5s calc(.7s + var(--psh-i, 0) * 70ms) ease-out both; }
.psh-motion .h-map__stats li { animation: psh-rise .6s .9s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .h-map__stats li + li { animation-delay: 1s; }

/* Inner-page banner. */
.psh-motion .page-hero__inner > * { animation: psh-rise .65s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .page-hero__inner > :nth-child(2) { animation-delay: .07s; }
.psh-motion .page-hero__inner > :nth-child(3) { animation-delay: .14s; }
.psh-motion .page-hero__inner > :nth-child(4) { animation-delay: .21s; }

/* Steps: the dashed line draws from the first step (right, RTL) to the last. */
@media (min-width: 1024px) {
	.psh-motion .h-steps__list.psh-line::before { transform: scaleX(0); transform-origin: right center; transition: transform 1.3s .35s cubic-bezier(.45, 0, .2, 1); }
	.psh-motion .h-steps__list.psh-line.is-drawn::before { transform: none; }
}

/* Touch feedback on buttons and cards. */
.psh-motion .psh-button { transition: background-color var(--motion), color var(--motion), border-color var(--motion), transform .12s ease-out; }
.psh-motion .psh-button:active { transform: translateY(1px) scale(.98); }

/* ── P26 round 2: every public page ─────────────────────────────────────────── */

/* Smooth cross-page transitions (Chrome/Edge/Safari 18+); the header stays put while the page fades. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: psh-vt-out .22s ease-in both; }
	::view-transition-new(root) { animation: psh-vt-in .38s cubic-bezier(.2, .7, .2, 1) both; }
	.site-header { view-transition-name: psh-header; }
}
@keyframes psh-vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes psh-vt-in { from { opacity: 0; transform: translateY(10px); } }

/* Header: deeper shadow and a slightly smaller logo once the page is scrolled (no layout change). */
.psh-motion .site-header { transition: box-shadow .3s ease, background-color .3s ease; }
.psh-motion .site-header.is-scrolled { box-shadow: 0 10px 30px rgba(15, 30, 51, .28); }
.psh-motion .site-header .custom-logo { transition: transform .3s cubic-bezier(.2, .7, .2, 1); transform-origin: right center; }
.psh-motion .site-header.is-scrolled .custom-logo { transform: scale(.88); }

/* Main menu: a gold line grows under the hovered item. */
@media (min-width: 1024px) {
	.psh-motion .site-header .site-nav a { position: relative; }
	.psh-motion .site-header .site-nav a::after { content: ""; position: absolute; inset-inline: var(--s-3); inset-block-end: 0; height: 3px; background: var(--brand-gold); transform: scaleX(0); transform-origin: right center; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
	.psh-motion .site-header .site-nav a:hover::after { transform: scaleX(1); }
	.psh-motion .site-header .site-nav .current-menu-item > a::after,
	.psh-motion .site-header .site-nav a[aria-current="page"]::after { display: none; }
}

/* Inner pages (booking, tracking, branches, account, staff, 404): the body rises in after the banner. */
.psh-motion .page-body > .entry-content > :not(.psh-branches-wrap),
.psh-motion .error404 .site-main > .page-section { animation: psh-rise .7s .22s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .page-body > .entry-content > :nth-child(2) { animation-delay: .3s; }
.psh-motion .page-body > .entry-content > :nth-child(n+3) { animation-delay: .38s; }

/* Booking: service choices and tiles come in one after another; wizard steps slide in when they change. */
.psh-motion .psh-services__item,
.psh-motion .psh-tile { animation: psh-rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .psh-services__item:nth-child(1), .psh-motion .psh-tile:nth-child(1) { animation-delay: .35s; }
.psh-motion .psh-services__item:nth-child(2), .psh-motion .psh-tile:nth-child(2) { animation-delay: .42s; }
.psh-motion .psh-services__item:nth-child(3), .psh-motion .psh-tile:nth-child(3) { animation-delay: .49s; }
.psh-motion .psh-services__item:nth-child(4), .psh-motion .psh-tile:nth-child(4) { animation-delay: .56s; }
.psh-motion .psh-services__item:nth-child(n+5), .psh-motion .psh-tile:nth-child(n+5) { animation-delay: .63s; }
.psh-motion .is-wizard [data-wizard-step]:not([hidden]) { animation: psh-step-in .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes psh-step-in { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.psh-motion [data-wizard-dot] { transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease, transform .3s cubic-bezier(.3, 1.3, .5, 1); }
.psh-motion [data-wizard-dot].is-current { transform: scale(1.06); }

/* Account: login / register panels fade across when the tab changes. */
.psh-motion .psh-auth__panel:not([hidden]) { animation: psh-rise .4s cubic-bezier(.2, .7, .2, 1) both; }

/* Tracking result: the card rises, then the timeline steps appear one by one. */
.psh-motion .psh-tracking__result { animation: psh-rise .6s .2s cubic-bezier(.2, .7, .2, 1) both; }
.psh-motion .psh-timeline__item { animation: psh-step-in .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: .45s; }
.psh-motion .psh-timeline__item:nth-child(2) { animation-delay: .55s; }
.psh-motion .psh-timeline__item:nth-child(3) { animation-delay: .65s; }
.psh-motion .psh-timeline__item:nth-child(4) { animation-delay: .75s; }
.psh-motion .psh-timeline__item:nth-child(5) { animation-delay: .85s; }
.psh-motion .psh-timeline__item:nth-child(n+6) { animation-delay: .95s; }

/* Hover polish: cards lift, photos zoom gently, icons tilt, arrows nudge forward (left in RTL). */
@media (hover: hover) {
	.psh-motion .service-card__media { overflow: hidden; }
	.psh-motion .service-card__media > img,
	.psh-motion .service-card__img { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
	.psh-motion .service-card:hover .service-card__media > img,
	.psh-motion .service-card:hover .service-card__img { transform: scale(1.05); }
	.psh-motion .service-card__icon,
	.psh-motion .svc-more__icon,
	.psh-motion .h-value .h-proof__icon { transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
	.psh-motion .service-card:hover .service-card__icon,
	.psh-motion .svc-more__card:hover .svc-more__icon,
	.psh-motion .h-value:hover .h-proof__icon { transform: rotate(-8deg) scale(1.08); }
	.psh-motion .service-card__link span,
	.psh-motion .svc-more__go span { position: relative; left: 0; transition: left .25s ease; }
	.psh-motion .service-card:hover .service-card__link span,
	.psh-motion .svc-more__card:hover .svc-more__go span { left: -5px; }
	.psh-motion .h-value,
	.psh-motion .rule-card,
	.psh-motion .contact-card,
	.psh-motion .psh-branch { transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s ease; }
	.psh-motion .h-value:hover,
	.psh-motion .rule-card:hover,
	.psh-motion .contact-card:hover,
	.psh-motion .psh-branch:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15, 30, 51, .10); }
	.psh-motion .coverage li { transition: background-color .25s ease, border-color .25s ease, transform .25s ease; }
	.psh-motion .coverage li:hover { background: var(--brand-gold-50); border-color: var(--brand-gold); transform: translateY(-2px); }
	.psh-motion .psh-button--primary { transition: background-color var(--motion), color var(--motion), border-color var(--motion), transform .2s ease, box-shadow .2s ease; }
	.psh-motion .psh-button--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(244, 176, 38, .35); }
	.psh-motion .h-map__stats a { transition: background-color .25s ease, transform .25s ease; }
	.psh-motion .h-map__stats a:hover { transform: translateY(-2px); }
}

/* Hero: a soft gold glow over the map breathes slowly. */
.psh-motion .h-map { position: relative; }
.psh-motion .h-map::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 42%, rgba(244, 176, 38, .16), transparent 62%); animation: psh-breathe 6s ease-in-out infinite; pointer-events: none; }
@keyframes psh-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ── P26 round 3: on-screen elements animate too (short pages such as contact and branches) ─────── */

/*
 * Until motion.js has sorted every element into "enter now" or "reveal on scroll", the animated
 * elements stay hidden so nothing flickers. motion.js then adds `psh-ready`; if it never does, the
 * head script removes `psh-motion` after 3 s and everything shows. Keep this list in step with the
 * GROUPS and SINGLES lists in motion.js.
 */
html.psh-motion:not(.psh-ready) :is(
	.h-proof__list, .services, .svc-more, .h-steps__list, .h-values, .rule-grid, .contact-cards,
	.contact-list, .coverage, .h-checks, .psh-branches, .site-footer__grid, .psh-journey__list,
	.psh-trackhelp__list, .psh-trackcta__actions, .psh-ordercontact__lines, .contact-actions
) > *,
html.psh-motion:not(.psh-ready) main :is(
	.page-section .eyebrow, .page-section .display-title, .media-split__img, .media-split > div,
	.h-prices__grid > div, .h-price-card, .price-split__card, .h-steps__cta, .svc-more__note,
	.cta-band__inner > *, .psh-tracking__form, .psh-trackhelp, .psh-trackcta__inner > div:first-child
) { opacity: 0; }

/* Entrance for elements visible when the page opens (removed again when it ends). */
.psh-motion .psh-enter { animation: psh-rise .75s calc(.25s + var(--psh-i, 0) * 90ms) cubic-bezier(.2, .7, .2, 1) both; }

/* Each kind of element moves its own way. */
@keyframes psh-from-start { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes psh-from-end { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes psh-lift { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes psh-chip { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }

/* Contact details slide in from the reading side (right); the action cards from the other side. */
.psh-motion .contact-list > .psh-enter { animation-name: psh-from-start; }
.psh-motion .contact-cards > .psh-enter { animation-name: psh-from-end; }
.psh-motion .contact-list > .psh-reveal { transform: translateX(28px); }
.psh-motion .contact-cards > .psh-reveal { transform: translateX(-28px); }
.psh-motion .contact-item__icon { transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.psh-motion .contact-list > .psh-enter .contact-item__icon { animation: psh-chip .45s calc(.4s + var(--psh-i, 0) * 90ms) both; }

/* Branch cards, service cards, values and rules lift and settle. */
.psh-motion :is(.psh-branches, .psh-ordercontact__lines, .contact-actions, .services, .h-values, .rule-grid, .h-steps__list) > .psh-enter { animation-name: psh-lift; }
.psh-motion :is(.psh-branches, .psh-ordercontact__lines, .contact-actions, .services, .h-values, .rule-grid, .h-steps__list) > .psh-reveal { transform: translateY(26px) scale(.96); }

/* City names pop in like chips. */
.psh-motion .coverage > .psh-enter { animation-name: psh-chip; animation-duration: .45s; }
.psh-motion .coverage > .psh-reveal { transform: scale(.7); transition-duration: .45s; }

/* Whatever the variant, a revealed element ends in place. */
.psh-motion .psh-reveal.is-visible.is-visible { opacity: 1; transform: none; }

/* Branch card buttons: phone and map links light up on hover. */
@media (hover: hover) {
	.psh-motion .contact-item:hover .contact-item__icon { transform: rotate(-8deg) scale(1.08); }
}

/* P28 tracking page: journey icons pop in; the latest timeline step keeps a soft pulse. */
.psh-motion .psh-journey__list > .psh-enter,
.psh-motion .psh-journey__list > .psh-reveal.is-visible .psh-journey__icon { animation-name: psh-chip; }
.psh-motion .psh-trackhelp__list > .psh-enter { animation-name: psh-from-end; }
.psh-motion .psh-trackpage .psh-timeline__item:first-child::after { animation: psh-ring 2.2s ease-out 1.2s infinite; }
@keyframes psh-ring { 0% { box-shadow: 0 0 0 0 rgba(244, 176, 38, .55); } 70% { box-shadow: 0 0 0 12px rgba(244, 176, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(244, 176, 38, 0); } }
