/* Motion system (ADR 0002). Light and smooth: transform + opacity only, 150-500ms, one easing, no motion when the visitor asks for none.
   Every page gets it automatically: assets/js/motion.js marks reveal targets, this file animates them. No per-page work needed. */

/* Smooth anchor scrolling, header-aware */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}
[id] { scroll-margin-top: calc(var(--cd-header-h) + var(--cd-sp-4)); }

/* Scroll reveal: .cd-js is set by an inline script in <head> (removed again if motion.js never reports ready) */
@media (prefers-reduced-motion: no-preference) {
	.cd-js [data-cd-reveal] {
		opacity: 0;
		transform: translateY(var(--cd-reveal-y));
		transition: opacity var(--cd-dur-reveal) var(--cd-ease-reveal), transform var(--cd-dur-reveal) var(--cd-ease-reveal);
		transition-delay: calc(var(--cd-i, 0) * var(--cd-stagger));
		/* stagger comes from --cd-i set by motion.js */
		will-change: opacity, transform;
	}
	/* first paint: hide section content until motion.js has marked it (class cd-marked), so the hero can animate on load */
	.cd-js:not(.cd-marked) .brxe-section:not(.cd-header):not(.cd-footer) > .brxe-container > * { opacity: 0; }
	.cd-js [data-cd-reveal].is-inview { opacity: 1; transform: none; }
	/* once revealed, motion.js removes the attribute so hover transitions on the element are not delayed */

	/* Press feedback */
	.cd-btn:active, .cd-t-btn:active, .cd-t-card:active { transform: scale(.985); transition-duration: var(--cd-dur-press); }

	/* Popup entrance (Bricks toggles display, so a keyframe plays each time it opens) */
	.brx-popup-content { animation: cd-pop var(--cd-dur) var(--cd-ease) both; }
	.cd-t-popup { animation: cd-pop var(--cd-dur) var(--cd-ease) both; }
}
@keyframes cd-pop { from { opacity: 0; transform: translateY(var(--cd-reveal-y)) scale(.98); } to { opacity: 1; transform: none; } }

/* Hover / focus transitions on every interactive component (colour only, never layout) */
.cd-btn, .cd-t-btn, .cd-btn--gradient { transition: var(--cd-tr-color), transform var(--cd-dur-press) var(--cd-ease), filter var(--cd-dur-fast) var(--cd-ease); }
.cd-header .bricks-nav-menu > li > a, .cd-footer__col a, .cd-footer__row a, .cd-t-card__link, .cd-box__link, .cd-t-card__title a { transition: color var(--cd-dur-fast) var(--cd-ease); }
.cd-t-card__img, .cd-support__img { transition: transform var(--cd-dur-slow) var(--cd-ease); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.cd-t-card:hover .cd-t-card__img { transform: scale(1.03); }
}
/* Image zoom stays inside its frame */
.cd-t-card { overflow: hidden; }

/* Smooth scrolling (Lenis, ADR 0004): hand control of scroll-behavior to the script */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent], .lenis.lenis-smooth :is(.s2__list, .s2__gmenu, .s3__chips, .s3__list, .s3__act-r) { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Kit CTA (home): a quiet attention loop, one beat every 3.5s with rest in between. A light sheen sweeps across, a soft brand-blue ring
   breathes out and the arrow nudges forward. Only transform/opacity/box-shadow; paused on hover/focus; off for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
	.brxe-button.cd-kit__cta { position: relative; overflow: hidden; isolation: isolate; animation: cd-cta-ring 3.5s var(--cd-ease) infinite; }
	.brxe-button.cd-kit__cta::before { content: ""; position: absolute; z-index: -1; inset: 0 auto 0 0; width: 45%; pointer-events: none;
		background: linear-gradient(105deg, transparent 0%, color-mix(in srgb, var(--cd-white) 38%, transparent) 50%, transparent 100%);
		transform: translateX(-120%) skewX(-18deg); animation: cd-cta-sheen 3.5s var(--cd-ease) infinite; }
	html body .brxe-button.cd-kit__cta::after { animation: cd-cta-nudge 3.5s var(--cd-ease) infinite; }
	.brxe-button.cd-kit__cta:is(:hover, :focus-visible), .brxe-button.cd-kit__cta:is(:hover, :focus-visible)::before, html body .brxe-button.cd-kit__cta:is(:hover, :focus-visible)::after { animation-play-state: paused; }
}
@keyframes cd-cta-sheen { 0%, 55% { transform: translateX(-120%) skewX(-18deg); } 85%, 100% { transform: translateX(260%) skewX(-18deg); } }
@keyframes cd-cta-ring {
	0%, 50% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--cd-blue-600) 45%, transparent); }
	85%, 100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--cd-blue-600) 0%, transparent); }
}
@keyframes cd-cta-nudge { 0%, 55%, 85%, 100% { transform: translateX(0); } 65% { transform: translateX(5px); } 75% { transform: translateX(0); } }
