/* Site-wide motion: entrance after the loader, scroll reveals, staggered groups, the service deck, marquee, parallax and living X artwork.
   Scoped to html.motion (added in <head> only when motion is allowed: not ?qa=1, not reduced motion). Individual translate / rotate / scale
   properties are used so the Figma transforms on each element stay untouched. */

:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

@keyframes m-fade-up { from { opacity: 0; translate: 0 40px; } }
@keyframes m-fade-down { from { opacity: 0; translate: 0 -24px; } }
@keyframes m-line-up { from { opacity: 0; translate: 0 45%; clip-path: inset(0 0 100% 0); } to { clip-path: inset(-10% -10% -25% -10%); } }
@keyframes m-art-in { from { opacity: 0; scale: .82; filter: blur(14px); } }
@keyframes m-rock { 0%, 100% { rotate: -4deg; } 50% { rotate: 4deg; } }
@keyframes m-fade { from { opacity: 0; translate: 0 10px; } }
@keyframes m-marquee { to { transform: translateX(-50%); } }

/* 1. First screen, once the loader has gone. */
.motion.is-loading :is(.brand, .header-cta, .menu-toggle, .hero-art, .hero h1, .hero-copy > *) { opacity: 0; }
.motion:not(.is-loading) :is(.brand, .header-cta, .menu-toggle) { animation: m-fade-down .9s var(--ease-out) backwards; }
.motion:not(.is-loading) .header-cta { animation-delay: .1s; }
.motion:not(.is-loading) .hero-art { animation: m-art-in 1.6s var(--ease-out) backwards; }
.motion:not(.is-loading) .hero h1 { animation: m-line-up 1.1s .2s var(--ease-out) backwards; }
.motion:not(.is-loading) .hero-copy > * { animation: m-fade-up 1s calc(.45s + var(--i, 0) * .12s) var(--ease-out) backwards; }
@media (min-width: 1200px) {
  .motion.is-loading .site-nav__links a { opacity: 0; }
  .motion:not(.is-loading) .site-nav__links a { animation: m-fade-down .8s calc(.05s + var(--i, 0) * .06s) var(--ease-out) backwards; }
}

/* The hero X is alive: slow 3D sway and float, light moving through the glass, and a tilt toward the cursor (main.js). */
@keyframes m-x-sway {
  0%, 100% { transform: perspective(1400px) translateY(0) rotateY(-16deg) rotateX(4deg) rotateZ(-2deg); }
  50% { transform: perspective(1400px) translateY(-24px) rotateY(16deg) rotateX(-4deg) rotateZ(2deg); }
}
@keyframes m-x-glint {
  0%, 100% { filter: hue-rotate(0deg) brightness(1) contrast(1); }
  50% { filter: hue-rotate(20deg) brightness(1.22) contrast(1.06); }
}
.motion .hero { perspective: 1600px; }
.motion .hero-art img { transform-origin: 50% 55%; animation: m-x-sway 9s ease-in-out infinite, m-x-glint 6s ease-in-out infinite; }

/* 2. Scroll reveals. */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .3, 1); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.qa-mode [data-reveal] { opacity: 1 !important; transform: none !important; }
.motion [data-reveal] { transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transform: translateY(50px); }
.motion [data-reveal].is-visible { transform: none; }
/* Titles rise out of a mask. */
.motion :is([data-reveal] h2, h2[data-reveal]) { opacity: 0; translate: 0 45%; clip-path: inset(0 0 100% 0); transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-out), clip-path 1.1s var(--ease-out); }
.motion h2[data-reveal] { transform: none; }
.motion :is([data-reveal].is-visible h2, h2[data-reveal].is-visible) { opacity: 1; translate: none; clip-path: inset(-10% -10% -25% -10%); }

/* 3. Groups: items arrive one after another (--i is set in main.js). */
.motion [data-stagger][data-reveal] { opacity: 1; transform: none; }
.motion [data-stagger] > * { opacity: 0; translate: 0 44px; transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * .12s); }
.motion :is(.is-visible[data-stagger], .is-visible [data-stagger]) > * { opacity: 1; translate: none; }

/* 4. Service deck. Desktop: the cards start stacked on Strategy and fan out like a dealt hand; hovering a card brings it forward. */
@media (min-width: 1200px) {
  .motion .service-deck[data-stagger] > .service-card { translate: calc(var(--i, 0) * -55%) 0; transition: opacity 1s var(--ease-out), translate 1.4s var(--ease-out), background .5s, color .5s; transition-delay: calc(.15s + var(--i, 0) * .07s), calc(.15s + var(--i, 0) * .07s), 0s, 0s; }
  .motion .service-deck.is-visible > .service-card { translate: none; }
  .motion .service-deck.is-visible > .service-card.is-active { translate: 0 calc(-14 * var(--u)); transition-delay: 0s; }
}
@media (max-width: 1199px) {
  /* Sideways, alternating, so cards never cross the content below. */
  .motion .service-deck[data-stagger] > .service-card { translate: 70px 0; scale: .96; transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-out), scale 1.1s var(--ease-out), background .5s, color .5s; transition-delay: calc(var(--i, 0) * .09s); }
  .motion .service-deck[data-stagger] > :nth-child(even) { translate: -70px 0; }
  .motion .service-deck.is-visible > .service-card { translate: none; scale: 1; }
}
.motion .service-card .step { scale: 0; }
.motion .service-deck.is-visible .service-card .step { scale: 1; transition: scale .6s calc(.8s + var(--i, 0) * .15s) cubic-bezier(.34, 1.56, .64, 1), background .5s, color .5s; }
.motion .service-card.is-active .service-x { animation: m-rock 7s ease-in-out infinite; }

/* 5. Other sections. */
.motion .earn-visual img { scale: 1.18; transition: scale 1.8s var(--ease-out); }
.motion .earn-visual.is-visible img { scale: 1; }
.motion .earn-cards .earn-card { opacity: 0; translate: 60px 0; transition: opacity .9s var(--ease-out), translate 1.1s var(--ease-out); }
.motion .earn-cards .earn-card + .earn-card { transition-delay: .15s; }
.motion .earn-cards.is-visible .earn-card { opacity: 1; translate: none; }
.motion .earn-cards { transform: none; }
.motion .role-list:not(.role-list--card) { transform: translateX(-60px); }
.motion .role-list--card { transform: translateX(60px); }
.motion .role-list.is-visible { transform: none; }
.motion .connect-panel { transform: scale(.94); transition: opacity 1s var(--ease-out), transform 1.4s var(--ease-out); }
.motion .connect-panel.is-visible { transform: none; }
.motion .connect-content > :not(h2) { opacity: 0; translate: 0 30px; transition: opacity .9s var(--ease-out), translate 1s var(--ease-out); transition-delay: calc(.35s + var(--i, 0) * .12s); }
.motion .connect-panel.is-visible .connect-content > * { opacity: 1; translate: none; }
.motion .creator-card img { scale: 1.12; transition: scale 1.4s var(--ease-out); }
.motion .creator-track.is-visible .creator-card img { scale: 1; }
.motion .creator-track.is-visible .creator-card:hover img { scale: 1.05; transition-duration: .8s; }
.motion .footer-brand { opacity: 0; scale: .92; filter: blur(10px); transition: opacity 1.2s var(--ease-out), scale 1.4s var(--ease-out), filter 1.2s var(--ease-out); }
.motion .footer-inner.is-visible .footer-brand { opacity: 1; scale: 1; filter: none; }
.motion .footer-inner[data-reveal] { transform: none; opacity: 1; }
.motion .footer-inner > :not(.footer-brand) { opacity: 0; translate: 0 24px; transition: opacity .9s .3s var(--ease-out), translate 1s .3s var(--ease-out); }
.motion .footer-inner.is-visible > * { opacity: 1; translate: none; }

/* Trusted by: endless marquee (main.js doubles the strip), fading at both edges, paused on hover. */
.motion .partner-window { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.motion .partner-track { display: flex; width: max-content; animation: m-marquee 60s linear infinite; will-change: transform; }
.motion .partner-track img { flex: none; margin: 0; padding-right: calc(52 * var(--u)); box-sizing: content-box; }
@media (hover: hover) { .motion .partner-window:hover .partner-track { animation-play-state: paused; } }
@media (max-width: 1199px) { .motion .partner-track { animation-duration: 45s; } .motion .partner-track img { padding-right: 22px; } }

/* Floating X artwork: slow rocking on top of each element's own rotation; main.js adds scroll parallax via translate. */
.motion :is(.about-x, .role-x, .connect-x) { animation: m-rock 9s ease-in-out infinite; }
.motion .about-x--blur, .motion .connect-x--bottom { animation-duration: 11s; animation-direction: reverse; }
.motion [data-parallax] { will-change: translate; }
/* Rocking must add to the Figma rotation, not replace it. */
@keyframes m-rock-30 { 0%, 100% { rotate: -34deg; } 50% { rotate: -26deg; } }
@keyframes m-rock-46 { 0%, 100% { rotate: 42deg; } 50% { rotate: 50deg; } }
.motion .about-x--blur { animation-name: m-rock-30; }
.motion .about-x--edge { animation-name: m-rock-46; }

/* Opened FAQ answers fade in. */
.motion details[open] > p { animation: m-fade .6s var(--ease-out) backwards; }
