/* CINEFY — motion polish layer (13/11/2026).
   Additive only: no content, no layout, no behaviour of forms/booking/cart is touched.
   Rollback = remove the two `cinefy-motion` enqueue lines in functions.php (or delete this file + motion.js).
   Uses the individual `scale` / `translate` properties on purpose, so nothing here fights the inline
   `transform` that main.js writes for tilt, magnetic buttons and the hero mouse-parallax. */

:root {
	--cfm-out: var(--ease, cubic-bezier(.22, 1, .36, 1)); /* one ease-out for the whole site (app.css --ease) */
}

/* ---------- 1. Scroll reveal (classes are added by motion.js, below-the-fold elements only) ---------- */
html.cfm .cfm-r { animation: none; } /* no will-change: 60+ pending elements each got a layer hint (audit 16/11) */

/* fade-up: body copy, cards, list rows */
html.cfm .cfm-r.cfm-u { opacity: 0; transform: translate3d(0, 30px, 0); transition: none; }
html.cfm .cfm-r.cfm-u.cfm-in {
	opacity: 1; transform: none;
	transition: opacity .7s var(--cfm-out) var(--cfm-d, 0ms), transform 1s var(--cfm-out) var(--cfm-d, 0ms);
}

/* headline: unveiled line by line while it settles */
html.cfm .cfm-r.cfm-h { opacity: 0; clip-path: inset(0 -1em 100% -1em); transform: translate3d(0, .28em, 0); transition: none; }
html.cfm .cfm-r.cfm-h.cfm-in {
	opacity: 1; clip-path: inset(-.2em -1em -.3em -1em); transform: none;
	transition: opacity .3s linear var(--cfm-d, 0ms), clip-path 1.15s var(--cfm-out) var(--cfm-d, 0ms), transform 1.15s var(--cfm-out) var(--cfm-d, 0ms);
}

/* film frames (photo / video tiles): a quiet fade, nothing opens or wipes.
   13/11/2026 — Jack: the shutter-open on every tile was too much and overused; removed. */
html.cfm .cfm-r.cfm-s { opacity: 0; transform: none; transition: none; }
html.cfm .cfm-r.cfm-s.cfm-in { opacity: 1; transition: opacity .6s var(--cfm-out) var(--cfm-d, 0ms); }

/* logo wall: logos arrive as a wave */
html.cfm .cfm-r.cfm-w { transform: none; transition: none; }
html.cfm .cfm-r.cfm-w > li { opacity: 0; translate: 0 12px; }
html.cfm .cfm-r.cfm-w.cfm-in > li {
	opacity: 1; translate: 0 0;
	transition: opacity .6s var(--cfm-out) calc(var(--i, 0) * 24ms), translate .8s var(--cfm-out) calc(var(--i, 0) * 24ms);
}

@media (max-width: 767px) {
	html.cfm .cfm-r.cfm-u { transform: translate3d(0, 18px, 0); }
	html.cfm .cfm-r.cfm-u.cfm-in { transition-duration: .5s, .7s; }
	html.cfm .cfm-r.cfm-h.cfm-in { transition-duration: .25s, .85s, .85s; }
	html.cfm .cfm-r.cfm-s.cfm-in { transition-duration: .45s; }
}

/* ---------- 2. Press + hover feedback ---------- */
.btn {
	transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease),
		border-color .3s var(--ease), box-shadow .3s var(--ease), scale .16s var(--cfm-out), background-position 0s;
}
.btn:active { scale: .97; }

/* primary button: one light sweep on hover (never on the way out) */
a.btn.btn-primary, button.btn.btn-primary {
	background-image: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .42) 50%, transparent 58%);
	background-size: 250% 100%; background-position: 100% 0; background-repeat: no-repeat;
}

.card-tilt:not(.filmframe) { transition: transform .4s var(--ease), border-color .4s var(--ease), box-shadow .5s var(--cfm-out), scale .16s var(--cfm-out); }
.filmframe[data-tilt], a.filmframe { transition: transform .4s var(--ease), border-color .4s var(--ease), scale .16s var(--cfm-out); }
.card-tilt:active, a.filmframe:active { scale: .985; }

.eq-card { transition: border-color .25s var(--cfm-out), transform .4s var(--cfm-out), box-shadow .4s var(--cfm-out); }
.eq-chip, .eq-add, .bk-slot, .bk-day, .quick-contact a { transition-timing-function: var(--cfm-out); }
.eq-add:active, .eq-chip:active, .bk-slot:active, .bk-day:active, .quick-contact a:active { scale: .95; }

.ff-label { transition: translate .45s var(--cfm-out), border-color .45s var(--cfm-out), background-color .45s var(--cfm-out); }
.cf-clients-row img { transition: opacity .35s var(--cfm-out), scale .5s var(--cfm-out); }

@media (hover: hover) and (pointer: fine) {
	a.btn.btn-primary:hover, button.btn.btn-primary:hover {
		background-position: 0 0;
		transition: transform .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease),
			border-color .3s var(--ease), box-shadow .3s var(--ease), scale .16s var(--cfm-out), background-position .85s var(--cfm-out);
	}
	.card-tilt:not(.filmframe):hover { box-shadow: 0 30px 60px -34px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 140, 63, .06); }
	.eq-card:hover { box-shadow: 0 22px 44px -28px rgba(0, 0, 0, .85); }
	.filmframe:hover > .ff-label { translate: 0 -3px; border-color: rgba(255, 140, 63, .55); background-color: rgba(8, 8, 9, .86); }
	.cf-clients-row li:hover img { scale: 1.06; }
}

/* ---------- 3. Scroll-linked depth (compositor-driven, no JS; older browsers simply skip it) ---------- */
.cfm-prog {
	position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 105; pointer-events: none;
	background: linear-gradient(90deg, var(--orange-deep, #d6480a), var(--orange, #ff6b1a) 60%, var(--orange-bright, #ff8c3f));
	transform-origin: 0 50%; scale: 0 1; opacity: 0;
}
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.cfm-prog { opacity: 1; animation: cfmProg linear both; animation-timeline: scroll(root block); }

		/* Named timelines: #home / .page-hero / .filmframe are overflow:hidden, i.e. scroll containers,
		   so an anonymous view() inside them would bind to the box itself and never move. */
		html.cfm #home, html.cfm .page-hero { view-timeline: --cfm-hero block; }

		/* hero: picture drifts slower than the page, copy lets go as it leaves */
		html.cfm #home .hero-img, html.cfm .page-hero .hero-bg {
			animation: cfmHeroImg linear both; animation-timeline: --cfm-hero; animation-range: exit 0% exit 100%;
		}
		/* hero picture also settles once on load (see cfmHeroSettle below) — both animations must be listed together */
		html.cfm body.ready #home .hero-img, html.cfm body.ready .page-hero .hero-bg {
			animation: cfmHeroImg linear both, cfmHeroSettle 1.8s var(--cfm-out) both;
			animation-timeline: --cfm-hero, auto; animation-range: exit 0% exit 100%, normal;
		}
		html.cfm #home > .relative.z-10 {
			animation: cfmHeroCopy linear both; animation-timeline: --cfm-hero; animation-range: exit 30% exit 95%;
		}
		html.cfm #home > a[href="#about"] {
			animation: cfmFadeOut linear both; animation-timeline: scroll(root block); animation-range: 0px 220px;
		}
	}
	@media (prefers-reduced-motion: no-preference) and (min-width: 1024px) {
		/* film frames: the picture slides a few percent inside its frame as it crosses the screen */
		html.cfm .filmframe:not(.orbit-hub) { view-timeline: --cfm-ff block; }
		html.cfm .filmframe:not(.orbit-hub) > .ff-glow {
			scale: 1.1;
			animation: cfmDrift linear both; animation-timeline: --cfm-ff; animation-range: cover 0% cover 100%;
		}
	}
}
@keyframes cfmHeroSettle { from { scale: 1.05; } }
@keyframes cfmProg { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes cfmHeroImg { to { translate: 0 16%; } }
@keyframes cfmHeroCopy { to { translate: 0 -48px; opacity: 0; } }
@keyframes cfmFadeOut { to { opacity: 0; } }
@keyframes cfmDrift { from { translate: 0 -4%; } to { translate: 0 4%; } }

/* ---------- 3b. Hero picture settles once on load (16/11/2026). `scale` only: the image is painted from frame one. ---------- */
@media (prefers-reduced-motion: no-preference) {
	body:not(.ready) #home .hero-img, body:not(.ready) .page-hero .hero-bg { scale: 1.05; }
	body.ready #home .hero-img, body.ready .page-hero .hero-bg { animation: cfmHeroSettle 1.8s var(--cfm-out) both; }
}

/* ---------- 4. Page-to-page cross-fade (browsers with cross-document view transitions) ---------- */
@media (prefers-reduced-motion: no-preference) {
	@view-transition { navigation: auto; }
	::view-transition-old(root) { animation: cfmVtOut .18s var(--cfm-out) both; }
	::view-transition-new(root) { animation: cfmVtIn .5s var(--cfm-out) both; }
}
@keyframes cfmVtOut { to { opacity: 0; } }
@keyframes cfmVtIn { from { opacity: 0; } }

/* ---------- 5. Safety ---------- */
@media (prefers-reduced-motion: reduce) {
	html.cfm .cfm-r, html.cfm .cfm-r.cfm-w > li { opacity: 1 !important; transform: none !important; translate: none !important; clip-path: none !important; transition: none !important; }
	.btn:active, .card-tilt:active, a.filmframe:active { scale: none; }
	.cfm-prog { display: none; }
}
@media print {
	html.cfm .cfm-r, html.cfm .cfm-r.cfm-w > li { opacity: 1 !important; transform: none !important; translate: none !important; clip-path: none !important; }
	.cfm-prog { display: none; }
}
