/*
 * GAAQ Global motion system.
 *
 * Every movement comes from the logo:
 * - the Q's yellow tail strikes in at 45 degrees (Q-bar, labels, step numbers, ticks),
 * - photos open with a 45-degree diagonal wipe, the angle of that tail,
 * - cards and floating panels arrive along the same diagonal and cascade
 *   from top-left to bottom-right, like the tail's stroke.
 *
 * Only active when <html> has .gaaq-motion (set in <head> unless the visitor
 * prefers reduced motion, or inside the Elementor editor). Add the CSS class
 * "gaaq-no-anim" to any Elementor element to keep it still.
 */

:root {
	--m-ease: cubic-bezier(.16, 1, .3, 1);      /* expo-out: fast strike, soft landing */
	--m-ease-in-out: cubic-bezier(.65, 0, .35, 1);
	--m-dur: .9s;
}

@keyframes gaaqRise   { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }
@keyframes gaaqDiagIn { from { opacity: 0; transform: translate3d(-22px, 22px, 0); } to { opacity: 1; transform: none; } }
@keyframes gaaqDiagTR { from { opacity: 0; transform: translate3d(22px, -22px, 0); } to { opacity: 1; transform: none; } }
@keyframes gaaqDiagBR { from { opacity: 0; transform: translate3d(22px, 22px, 0); } to { opacity: 1; transform: none; } }
@keyframes gaaqWipe   { from { clip-path: polygon(0 0, 0 0, 0 0); } to { clip-path: polygon(0 0, 200% 0, 0 200%); } }
@keyframes gaaqSettle { from { transform: scale(1.09); } to { transform: none; } }
@keyframes gaaqStrike { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes gaaqTick   { 0% { transform: scale(0) rotate(-45deg); } 70% { transform: scale(1.12) rotate(0); } 100% { transform: none; } }
@keyframes gaaqFade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes gaaqBob    { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -6px, 0); } }

/* ------------------------------------------------------------------ */
/* 1. The logo writes itself (first page view of a visit)              */
/* ------------------------------------------------------------------ */
.gaaq-brand__svg { display: block; overflow: visible; }
.gaaq-brand__svg .gl-mark, .gaaq-brand__svg .gl-tail, .gaaq-brand__svg .gl-rule, .gaaq-brand__svg .gl-word { transform-box: fill-box; }
.gaaq-brand__svg .gl-tail { transform-origin: 0 0; }
.gaaq-intro .gaaq-brand__svg .gl-mark { animation: gaaqMarkIn .8s var(--m-ease) .05s both; }
.gaaq-intro .gaaq-brand__svg .gl-rule { transform-origin: 50% 0; animation: gaaqRuleIn .5s var(--m-ease) .4s both; }
.gaaq-intro .gaaq-brand__svg .gl-word { animation: gaaqWordIn .8s var(--m-ease) .5s both; }
.gaaq-intro .gaaq-brand__svg .gl-tail { animation: gaaqTailIn .6s var(--m-ease) .75s both; }
/* (SVG units: the logo is 4803 units wide, so 260 units is about 14px on screen.) */
@keyframes gaaqMarkIn { from { opacity: 0; transform: translate3d(0, 180px, 0); } to { opacity: 1; transform: none; } }
@keyframes gaaqRuleIn { from { transform: scaleY(0); } to { transform: none; } }
@keyframes gaaqWordIn { from { opacity: 0; transform: translate3d(-260px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes gaaqTailIn { from { transform: scale(0); } to { transform: none; } }
@keyframes gaaqTailAgain { 0% { transform: none; } 35% { transform: scale(0); } 100% { transform: none; } }
/* Hover: the tail strikes again. */
.gaaq-motion .gaaq-brand:hover .gaaq-brand__svg .gl-tail,
.gaaq-motion .gaaq-brand:focus-visible .gaaq-brand__svg .gl-tail { animation: gaaqTailAgain .7s var(--m-ease-in-out); }

/* ------------------------------------------------------------------ */
/* 2. Hero: one choreographed entrance on load (no JS needed)          */
/* ------------------------------------------------------------------ */
.gaaq-motion .gaaq-hero2 .e-con-inner > .e-con > .e-con:not(.gaaq-media) > * { animation: gaaqRise var(--m-dur) var(--m-ease) .1s both; }
.gaaq-motion .gaaq-hero2 .e-con-inner > .e-con > .e-con:not(.gaaq-media) > :nth-child(2) { animation-delay: .2s; }
.gaaq-motion .gaaq-hero2 .e-con-inner > .e-con > .e-con:not(.gaaq-media) > :nth-child(3) { animation-delay: .3s; }
.gaaq-motion .gaaq-hero2 .e-con-inner > .e-con > .e-con:not(.gaaq-media) > :nth-child(4) { animation-delay: .4s; }
.gaaq-motion .gaaq-hero2 .e-con-inner > .e-con > .e-con:not(.gaaq-media) > :nth-child(n+5) { animation-delay: .5s; }

/* Photo opens on the tail's diagonal, then settles. */
.gaaq-motion .gaaq-hero2 .gaaq-media .elementor-widget-image { animation: gaaqWipe 1.1s var(--m-ease-in-out) .12s both; }
.gaaq-motion .gaaq-hero2 .gaaq-media .elementor-widget-image img { animation: gaaqSettle 1.8s var(--m-ease) .12s both; }
/* The Q-bar strikes behind it. */
.gaaq-motion .gaaq-hero2 .gaaq-media::before { animation: gaaqStrike .8s var(--m-ease) .75s both; }
/* Floating panels arrive along the diagonal, then breathe. */
.gaaq-motion .gaaq-hero2 .gaaq-float--bl { animation: gaaqDiagIn .9s var(--m-ease) 1s both; }
.gaaq-motion .gaaq-hero2 .gaaq-float--tr { animation: gaaqDiagTR .9s var(--m-ease) 1.15s both; }
.gaaq-motion .gaaq-hero2 .gaaq-float--br { animation: gaaqDiagBR .9s var(--m-ease) 1.15s both; }
.gaaq-motion .gaaq-hero2 .gaaq-fcard li i,
.gaaq-motion .gaaq-hero2 .gaaq-fcard--badge b { animation: gaaqTick .5s var(--m-ease) 1.35s both; }
.gaaq-motion .gaaq-hero2 .gaaq-fcard li:nth-child(2) i { animation-delay: 1.5s; }
.gaaq-motion .gaaq-hero2 .gaaq-fcard li:nth-child(3) i { animation-delay: 1.65s; }
.gaaq-motion .gaaq-hero2 .gaaq-fcard li:nth-child(4) i { animation-delay: 1.8s; }

/* Floating panels keep a slow, slight drift everywhere. */
.gaaq-motion .gaaq-float .gaaq-fcard { animation: gaaqBob 7s ease-in-out 2.2s infinite; }
.gaaq-motion .gaaq-float--tr .gaaq-fcard, .gaaq-motion .gaaq-float--br .gaaq-fcard { animation-duration: 8s; animation-delay: 2.6s; }

/* ------------------------------------------------------------------ */
/* 3. Scroll reveals (motion.js adds the m-* classes, then .is-in)      */
/* ------------------------------------------------------------------ */
.gaaq-motion .m-rise:not(.is-in),
.gaaq-motion .m-diag:not(.is-in),
.gaaq-motion .m-list > li:not(.is-in) { opacity: 0; }
.gaaq-motion .m-rise.is-in { animation: gaaqRise var(--m-dur) var(--m-ease) var(--d, 0ms) both; }
.gaaq-motion .m-diag.is-in { animation: gaaqDiagIn var(--m-dur) var(--m-ease) var(--d, 0ms) both; }
.gaaq-motion .is-done { animation: none !important; }

/* Photos in split sections: diagonal wipe, settle, Q-bar strike, panels. */
.gaaq-motion .m-media:not(.is-in) .elementor-widget-image { clip-path: polygon(0 0, 0 0, 0 0); }
.gaaq-motion .m-media:not(.is-in)::before { clip-path: inset(0 100% 0 0); }
.gaaq-motion .m-media:not(.is-in) > .gaaq-float { opacity: 0; }
.gaaq-motion .m-media.is-in .elementor-widget-image { animation: gaaqWipe 1.1s var(--m-ease-in-out) both; }
.gaaq-motion .m-media.is-in .elementor-widget-image img { animation: gaaqSettle 1.8s var(--m-ease) both; }
.gaaq-motion .m-media.is-in::before { animation: gaaqStrike .8s var(--m-ease) .6s both; }
.gaaq-motion .m-media.is-in > .gaaq-float--bl { animation: gaaqDiagIn .9s var(--m-ease) .8s both; }
.gaaq-motion .m-media.is-in > .gaaq-float--tr { animation: gaaqDiagTR .9s var(--m-ease) .9s both; }
.gaaq-motion .m-media.is-in > .gaaq-float--br { animation: gaaqDiagBR .9s var(--m-ease) .9s both; }
.gaaq-motion .m-media.is-in .gaaq-fcard li i,
.gaaq-motion .m-media.is-in .gaaq-fcard--badge b { animation: gaaqTick .5s var(--m-ease) 1.1s both; }
.gaaq-motion .m-media.is-in .gaaq-fcard li:nth-child(2) i { animation-delay: 1.25s; }
.gaaq-motion .m-media.is-in .gaaq-fcard li:nth-child(3) i { animation-delay: 1.4s; }

/* Labels: the little Q-tail strikes, then the words. */
.gaaq-motion .gaaq-label.m-rise.is-in .elementor-heading-title::before,
.gaaq-motion .gaaq-label.m-rise.is-in p::before { animation: gaaqStrike .5s var(--m-ease) calc(var(--d, 0ms) + 200ms) both; }
.gaaq-motion .gaaq-hero2 .gaaq-label .elementor-heading-title::before,
.gaaq-motion .gaaq-hero2 .gaaq-label p::before { animation: gaaqStrike .5s var(--m-ease) .45s both; }

/* Tick and cross lists: each mark strikes in, row by row. */
.gaaq-motion .m-list > li.is-in { animation: gaaqDiagIn .8s var(--m-ease) var(--d, 0ms) both; }
.gaaq-motion .m-list > li.is-in::before { animation: gaaqTick .55s var(--m-ease) calc(var(--d, 0ms) + 160ms) both; }

/* Step numbers: the 0 grows the Q's tail, so 01 reads as a Q. */
.gaaq-bignum { position: relative; }
.gaaq-bignum::after {
	content: ""; position: absolute; left: 25px; top: 35px; width: 23px; height: 7px; border-radius: 1px;
	background: var(--g-yellow); transform: rotate(45deg); transform-origin: 0 50%; pointer-events: none;
}
.gaaq-motion :is(.m-diag, .m-rise):not(.is-in) .gaaq-bignum::after,
.gaaq-motion .gaaq-bignum.m-rise:not(.is-in)::after { clip-path: inset(0 100% 0 0); }
.gaaq-motion .m-diag.is-in .gaaq-bignum::after,
.gaaq-motion .gaaq-bignum.m-rise.is-in::after { animation: gaaqStrike .55s var(--m-ease) calc(var(--d, 0ms) + 450ms) both; }

/* Big quote mark in testimonials. */
.gaaq-motion .gaaq-tcard.is-in .gaaq-quote-mark { animation: gaaqTick .7s var(--m-ease) calc(var(--d, 0ms) + 250ms) both; }

/* ------------------------------------------------------------------ */
/* 4. Hover: the tail angle again                                      */
/* ------------------------------------------------------------------ */
/* Card arrows turn to 45 degrees, pointing where the tail points. */
.gaaq-motion a:hover .gaaq-go p::after,
.gaaq-motion a:focus-visible .gaaq-go p::after { transform: translateX(3px) rotate(45deg); }
/* Buttons: a diagonal light passes across, on the tail's angle. */
.gaaq-motion .elementor-widget-button .elementor-button,
.gaaq-motion .gaaq-btn { position: relative; overflow: hidden; isolation: isolate; }
.gaaq-motion .elementor-widget-button .elementor-button::after,
.gaaq-motion .gaaq-btn::after {
	content: ""; position: absolute; z-index: -1; top: -50%; bottom: -50%; left: 0; width: 36%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
	transform: translateX(-180%) skewX(-45deg); transition: transform .75s var(--m-ease); pointer-events: none;
}
.gaaq-motion .elementor-widget-button .elementor-button:hover::after,
.gaaq-motion .gaaq-btn:hover::after { transform: translateX(380%) skewX(-45deg); }
/* Tiles lift slightly toward the top-right, along the diagonal. */
.gaaq-motion .gaaq-tile { transition: transform .45s var(--m-ease), box-shadow .45s var(--m-ease); }
.gaaq-motion .gaaq-tile:hover { transform: translate3d(3px, -3px, 0); box-shadow: -10px 14px 34px -22px rgba(40, 40, 40, .45); }

/* ------------------------------------------------------------------ */
/* Opt-outs                                                            */
/* ------------------------------------------------------------------ */
.gaaq-motion .gaaq-no-anim, .gaaq-motion .gaaq-no-anim * { animation: none !important; opacity: 1 !important; clip-path: none !important; }
@media (prefers-reduced-motion: reduce) {
	.gaaq-motion *, .gaaq-motion *::before, .gaaq-motion *::after { animation: none !important; transition: none !important; }
	.gaaq-motion .m-rise, .gaaq-motion .m-diag, .gaaq-motion .m-list > li { opacity: 1 !important; }
	.gaaq-motion .m-media .elementor-widget-image, .gaaq-motion .m-media::before, .gaaq-motion .gaaq-bignum::after, .gaaq-motion .gaaq-label ::before { clip-path: none !important; }
	.gaaq-motion .m-media > .gaaq-float { opacity: 1 !important; }
}
