/*
 * Motion layer (paired with js/motion.js).
 *
 *   html.uplift-motion       animations on (full design)
 *   html.uplift-motion-full  device asked for reduced motion but the site is set to "Always animate":
 *                            the original site.css forces `transition-duration:.01ms !important` on every
 *                            element in that case, so transitions below are re-declared with !important.
 *   html.uplift-gentle       "Gentle" mode: short, subtle fades (no pins/parallax — handled in JS)
 *   html.uplift-reduced      visitor switched motion OFF with the website control → nothing animates.
 */

/* Prevent sideways reveal offsets from creating horizontal scroll (clip keeps sticky working). */
.uplift-motion main { overflow-x: clip; }

/* 1. Reveal ------------------------------------------------------------------ */
.uplift-motion .reveal {
	opacity: 0;
	transform: translate3d(0, 24px, 0);
	transition: opacity .7s ease var(--reveal-delay, 0ms), transform .85s cubic-bezier(.16, .84, .24, 1) var(--reveal-delay, 0ms) !important;
}
.uplift-motion .reveal[data-motion="left"]  { transform: translate3d(-42px, 0, 0); }
.uplift-motion .reveal[data-motion="right"] { transform: translate3d(42px, 0, 0); }
.uplift-motion .reveal[data-motion="zoom"]  { transform: translate3d(0, 18px, 0) scale(.94); }
.uplift-motion .reveal[data-motion="rise"]  { transform: translate3d(0, 34px, 0); }
.uplift-motion .reveal.is-visible,
.uplift-motion .reveal.is-visible[data-motion] { opacity: 1; transform: none; }
html.uplift-motion-prep .reveal { transition: none !important; }

/* 2. Scrollytelling steps — numbers/icons/images dim, text always stays fully readable. */
.uplift-motion .uplift-step > span,
.uplift-motion .uplift-step > img,
.uplift-motion .uplift-step > b,
.uplift-motion .uplift-step > i { transition: opacity .45s ease, color .45s ease, box-shadow .45s ease !important; }
.uplift-motion .uplift-step:not(.is-past):not(.is-current) > span,
.uplift-motion .uplift-step:not(.is-past):not(.is-current) > img,
.uplift-motion .uplift-step:not(.is-past):not(.is-current) > i { opacity: .45; }
.uplift-motion .uplift-step h3,
.uplift-motion .uplift-step > b { transition: color .45s ease !important; }
.uplift-motion .uplift-step.is-current,
.uplift-motion .uplift-step.reveal.is-visible.is-current { transform: translateY(-6px); transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .7s ease !important; }
.uplift-motion .process-grid .uplift-step.is-current img { box-shadow: 0 0 0 5px rgba(215, 164, 65, .25), 0 12px 28px rgba(166, 108, 28, .35); }
.uplift-motion .uplift-step.is-current h3,
.uplift-motion .module-grid .uplift-step.is-current b { color: var(--gold-deep); }
.uplift-motion .dark-section .uplift-step.is-current h3,
.uplift-motion .dark-section .uplift-step.is-current { color: var(--gold-light); }

/* Original decorative loop (process "rope") and hover transitions, restored in "Always animate". */
.uplift-motion-full .process-grid:after { animation-duration: 5s !important; }
.uplift-motion-full .button,
.uplift-motion-full .process-grid img,
.uplift-motion-full .solution-card img,
.uplift-motion-full .programme-card img,
.uplift-motion-full .catalogue-card img { transition-duration: .3s !important; }

/* 3. Pinned sections (created by JS on wide screens) ------------------------- */
.uplift-pin-inner { position: sticky; top: var(--uplift-pin-top, 90px); }
.uplift-pin-spacer { pointer-events: none; }
.uplift-pin-progress { height: 2px; margin-top: 14px; background: rgba(166, 108, 28, .18); border-radius: 2px; overflow: hidden; }
.uplift-pin-progress span { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left center; transform: scaleX(var(--uplift-progress, 0)); }
.uplift-pinned .programme-rail { scroll-behavior: auto !important; scroll-snap-type: none !important; }

/* 4. Gentle: same designs, lower intensity and shorter duration. */
.uplift-gentle .reveal,
.uplift-gentle .reveal[data-motion] {
	transform: translate3d(0, 8px, 0);
	transition: opacity .4s ease var(--reveal-delay, 0ms), transform .45s ease var(--reveal-delay, 0ms) !important;
}
.uplift-gentle .reveal[data-motion="zoom"] { transform: scale(.985); }
.uplift-gentle .reveal.is-visible,
.uplift-gentle .reveal.is-visible[data-motion] { opacity: 1; transform: none; }
.uplift-gentle .uplift-step.is-current,
.uplift-gentle .uplift-step.reveal.is-visible.is-current { transform: none; }

/* 5. Website "Reduce motion" control: the visitor's choice always wins. */
html.uplift-reduced { scroll-behavior: auto !important; }
html.uplift-reduced .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
html.uplift-reduced *,
html.uplift-reduced *::before,
html.uplift-reduced *::after { --parallax-y: 0px !important; animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
html.uplift-reduced .uplift-pin-inner { position: static !important; }
html.uplift-reduced .uplift-pin-spacer,
html.uplift-reduced .uplift-pin-progress { display: none !important; }

/* Footer control — styled as footer text, keyboard and screen-reader friendly. */
.uplift-motion-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.uplift-motion-toggle:hover,
.uplift-motion-toggle:focus-visible { color: var(--gold-light); }
.uplift-motion-toggle:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.uplift-motion-toggle[aria-pressed="true"]::before { content: "✓"; }
.uplift-motion-toggle[hidden] { display: none; }

/* 6. Mobile: shorter, vertical-only movement (no sideways offsets on narrow screens). */
@media (max-width: 760px) {
	.uplift-motion .reveal[data-motion="left"],
	.uplift-motion .reveal[data-motion="right"],
	.uplift-motion .reveal[data-motion="rise"] { transform: translate3d(0, 22px, 0); }
	.uplift-motion .reveal[data-motion="zoom"] { transform: translate3d(0, 14px, 0) scale(.97); }
	.uplift-motion .reveal { transition: opacity .55s ease var(--reveal-delay, 0ms), transform .7s cubic-bezier(.16, .84, .24, 1) var(--reveal-delay, 0ms) !important; }
	.uplift-motion .reveal.is-visible[data-motion] { transform: none; }
	.uplift-motion .uplift-step.is-current,
	.uplift-motion .uplift-step.reveal.is-visible.is-current { transform: none; }
	.uplift-gentle .reveal,
	.uplift-gentle .reveal[data-motion] { transform: translate3d(0, 8px, 0); transition: opacity .4s ease var(--reveal-delay, 0ms), transform .45s ease var(--reveal-delay, 0ms) !important; }
	.uplift-gentle .reveal.is-visible,
	.uplift-gentle .reveal.is-visible[data-motion] { transform: none; }
}

/* 7. Print: everything visible, no motion artefacts. */
@media print {
	.reveal { opacity: 1 !important; transform: none !important; }
	.uplift-pin-inner { position: static !important; }
	.uplift-pin-spacer, .uplift-pin-progress, .uplift-motion-toggle { display: none !important; }
}
