/*
 * Pila Pila – animacje (etap 2). Ładowane tylko gdy pila_motion() (lib/skin.php).
 * Stany startowe tylko pod html.mo-js – bez JS i przy „ogranicz ruch” treść jest od razu widoczna.
 */

/* Przejścia między stronami (@view-transition) wyłączone 26.10.2026: w Safari zawieszały nawigację
   i zostawiały na ekranie obraz poprzedniej strony. */

/* ---------- Pojawianie się przy przewijaniu ---------- */
.mo-js .mo {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
	transition-delay: var(--mo-d, 0s);
}
.mo-js .mo.mo--pop { transform: translateY(16px) scale(.92); }
.mo-js .mo.mo--tilt { transform: translateY(36px) rotate(-3deg); }
.mo-js .mo.mo-in { opacity: 1; transform: none; }

/* ---------- Obrys pigułki w nagłówkach rysuje się po pojawieniu ---------- */
.mo-js :is(.skin-home, .page-footer) :is(h1, h2, h3) b { position: relative; border-color: transparent; }
.mo-js :is(.skin-home, .page-footer) :is(h1, h2, h3) b::after {
	content: '';
	position: absolute;
	inset: -2px;
	border: 2px solid currentColor;
	border-radius: 999px;
	clip-path: inset(0 100% 0 0);
	transition: clip-path 1.1s cubic-bezier(.6, .1, .2, 1) .35s;
	pointer-events: none;
}
.mo-js :is(.skin-home, .page-footer) :is(h1, h2, h3).mo-in b::after { clip-path: inset(0 0 0 0); }

/* ---------- Odcięcia „wyrastają” z krawędzi sekcji ---------- */
.mo-js .skin-cut-top::before,
.mo-js .skin-cut-bottom::after,
.mo-js :is(#masthead + section > .container > .entry-header, #masthead + main > article.type-page > .container > .entry-header)::after {
	clip-path: inset(100% 0 0 0);
	transition: clip-path .9s cubic-bezier(.5, 0, .2, 1) .15s;
}
.mo-js .skin-cut-top.mo-in::before,
.mo-js .skin-cut-bottom.mo-in::after,
.mo-js :is(#masthead + section > .container > .entry-header, #masthead + main > article.type-page > .container > .entry-header).mo-in::after { clip-path: inset(0 0 0 0); }

.mo-js :is(.page-footer, .skin-wings, .page-template-page-contact .section-map)::before,
.mo-js :is(.page-footer, .skin-wings, .page-template-page-contact .section-map)::after {
	clip-path: inset(0 100% 0 0);
	transition: clip-path 1s cubic-bezier(.5, 0, .2, 1) .1s;
}
.mo-js :is(.page-footer, .skin-wings, .page-template-page-contact .section-map).mo-in::before,
.mo-js :is(.page-footer, .skin-wings, .page-template-page-contact .section-map).mo-in::after { clip-path: inset(0 0 0 0); }

/* ---------- Hero ---------- */
.skin .skin-hero__word { will-change: transform; }
.mo-js .skin-hero__pilates { animation: mo-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.mo-js .skin-hero__house { animation: mo-rise .9s cubic-bezier(.2, .8, .2, 1) .12s both; }
@keyframes mo-rise { from { opacity: 0; transform: translateY(40px); } }

/* ---------- Pływające przyciski wjeżdżają z boku ---------- */
.mo-js .cta-container { animation: mo-cta .8s cubic-bezier(.2, .9, .3, 1.25) 1s both; }
@keyframes mo-cta { from { opacity: 0; transform: translateX(140%); } }

/* ---------- Odręczne rysunki (SVG z motion.js) ---------- */
.mo-doodle { position: absolute; z-index: 1; overflow: visible; pointer-events: none; }
.mo-doodle path { fill: none; stroke: var(--p); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mo-doodle.is-light path { stroke: var(--y); }
.mo-doodle.is-cream path { stroke: var(--cream); }
.mo-js .mo-doodle path { transition: stroke-dashoffset 1.4s cubic-bezier(.5, 0, .2, 1); transition-delay: calc(var(--i, 0) * .25s + .2s); }
.mo-js .mo-doodle.mo-in path { stroke-dashoffset: 0 !important; }

.skin .skin-intro .block-actions { position: relative; }
.mo-doodle--arrow { top: -18px; left: calc(50% - 290px); width: 150px; height: 84px; }
.mo-doodle--sparks { top: 28px; right: calc(50% - 400px); width: 96px; height: 96px; }
.mo-doodle--squiggle { top: 150px; left: calc(50% - 560px); width: 180px; height: 54px; transform: rotate(-8deg); }
.mo-doodle--heart { top: 18%; right: calc(50% - 470px); width: 72px; height: 72px; transform: rotate(10deg); }
.mo-doodle--hero-l { left: -84px; top: 50%; width: 60px; height: 60px; margin-top: -40px; }
.mo-doodle--hero-r { right: -78px; top: 50%; width: 52px; height: 52px; margin-top: -10px; }
.skin .skin-why .container, .skin .skin-testimonials, .skin .skin-contact .container { position: relative; }
.skin #masthead + section > .container > .entry-header .entry-title,
.skin #masthead + main > article.type-page > .container > .entry-header .entry-title { position: relative; }

/* ---------- Pas z nazwami zajęć ---------- */
.mo-band {
	position: relative;
	z-index: 3;
	display: flex;
	overflow: hidden;
	margin: 24px -20px -36px;
	padding: 14px 0;
	background: var(--p);
	color: var(--y);
	transform: rotate(-2.5deg);
	user-select: none;
}
.mo-band__track {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 36px;
	padding-right: 36px;
	animation: mo-band 45s linear infinite;
	white-space: nowrap;
}
.mo-band__track span { font-size: 40px; font-weight: 800; line-height: 1.1; }
.mo-band__track span:nth-child(4n+3) { color: transparent; -webkit-text-stroke: 1.5px var(--y); }
.mo-band__track i {
	flex: 0 0 40px;
	width: 40px;
	height: 15px;
	background: var(--y);
	-webkit-mask: var(--spark) center / contain no-repeat;
	mask: var(--spark) center / contain no-repeat;
}
.mo-band:hover .mo-band__track { animation-play-state: paused; }
@keyframes mo-band { to { transform: translateX(-100%); } }

@media (max-width: 991px) {
	.mo-doodle--arrow, .mo-doodle--sparks, .mo-doodle--squiggle, .mo-doodle--heart { display: none; }
}
@media (max-width: 767px) {
	.mo-doodle--hero-l, .mo-doodle--hero-r { display: none; }
	.mo-band { margin: 16px -20px -28px; padding: 10px 0; }
	.mo-band__track { gap: 22px; padding-right: 22px; }
	.mo-band__track span { font-size: 24px; }
	.mo-band__track i { flex-basis: 28px; width: 28px; height: 11px; }
}
@media (prefers-reduced-motion: reduce) {
	.mo-band__track { animation: none; }
	.mo-band__track + .mo-band__track { display: none; }
}
