/* ==========================================================================
   Jump & Sculpt motion system, v1 (2026-10-09)

   One motion language for every Jump & Sculpt page: the homepage and the
   Experience on www.jumpandsculpt.com, Sundays and Events on
   events.jumpandsculpt.com. Same tokens, same eight primitives, everywhere.

   CANONICAL COPY: jump-with-cath/frontend/public/motion/
   The events site carries an exact copy in assets/motion/, refreshed by
   `node tools/sync-motion.mjs` there. Edit here, then sync. Never edit the copy.

   Primitives (opt-in by attribute; nothing moves unless it is marked):
     data-m="up"        fade up as it scrolls in
     data-m="fade"      fade only
     data-m="image"     photo settles in from a slight zoom
     data-m="line"      pink accent line draws itself
     data-m="grow"      small bar grows from the bottom
     data-m="pop"       a check mark or icon pops in (no overshoot)
     data-m="cta"       NEVER hidden: a short nudge and one light sweep
                        (add data-m-plain on outline buttons: nudge, no sweep)
     data-m-stagger     its children fade up one after another
     data-m-hero        first screen sequence, pure CSS, starts on first paint
     data-m-parallax    slow drift inside its frame (photos only)
     data-m-count       a number counts up once
     data-m-video       muted loop that plays only while on screen
     .m-accent          heading whose ::after accent line draws itself
     .m-lift            card: lifts on desktop hover, presses on touch
     .m-press           button press feedback
     .m-sticky          mobile sticky CTA
     .m-live            softly pulsing "live" dot
     .m-progress        2px pink reading line at the top
     .m-marquee         endless strip of words (track holds two copies)
     .m-enter           one soft rise for content that appears in place
     .m-mark            pink highlight that draws itself behind a few words
     .m-arrow-x/-y      arrow between steps that nudges along its axis

   Rules this file keeps:
     - Nothing is hidden unless html has .m-on, which the boot script adds only
       when the browser can animate and the visitor has not asked for reduced
       motion. No JavaScript, old browser or reduced motion: a static page.
     - A CTA is never hidden and never waits for an animation.
     - Only opacity and transform animate, so nothing reflows.
     - .m-lite (slow connection, data saver, low-memory phone) keeps the fades
       and drops zoom, parallax and background video.
   ========================================================================== */

:root {
  --m-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --m-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --m-fast: 160ms;
  --m-base: 560ms;
  --m-slow: 900ms;
  --m-rise: 18px;
  --m-hero-step: 130ms;
  --m-accent: #ea4f9e;
}

/* ------------------------------------------------------------- hidden state */
.m-on [data-m]:not([data-m="cta"]):not([data-m="line"]):not([data-m="grow"]):not(.m-in),
.m-on [data-m-stagger] > :not(.m-in) {
  opacity: 0;
}
.m-on [data-m="up"]:not(.m-in),
.m-on [data-m-stagger] > :not(.m-in) {
  transform: translate3d(0, var(--m-rise), 0);
}
.m-on [data-m="image"]:not(.m-in) {
  transform: scale(1.05);
}
.m-on [data-m="line"]:not(.m-in) {
  transform: scaleX(0);
}
.m-on [data-m="pop"]:not(.m-in) {
  transform: scale(0.4);
}
.m-on [data-m="grow"]:not(.m-in) {
  transform: scaleY(0.15);
}
.m-on [data-m="cta"]:not(.m-in) {
  transform: translate3d(0, 8px, 0);
}
.m-on .m-accent:not(.m-in)::after {
  transform: scaleX(0);
}

/* --------------------------------------------------------------- movement */
.m-on [data-m],
.m-on [data-m-stagger] > * {
  transition:
    opacity var(--m-base) var(--m-ease),
    transform var(--m-base) var(--m-ease-out);
  transition-delay: var(--m-d, 0ms);
}
.m-on [data-m="image"] {
  transition-duration: var(--m-slow);
}
.m-on [data-m="line"] {
  transform-origin: var(--m-origin, left) center;
  transition: transform var(--m-slow) var(--m-ease-out) calc(var(--m-d, 0ms) + 140ms);
}
.m-on [data-m="grow"] {
  transform-origin: center bottom;
}
.m-on .m-accent::after {
  transform-origin: left center;
  transition: transform var(--m-slow) var(--m-ease-out) calc(var(--m-d, 0ms) + 160ms);
}
/* Once an entrance has played, hover and press feel instant again. */
.m-on [data-m].m-done,
.m-on [data-m-stagger] > .m-done {
  transition:
    transform var(--m-fast) var(--m-ease),
    box-shadow var(--m-fast) var(--m-ease),
    border-color var(--m-fast) var(--m-ease),
    opacity var(--m-fast) linear;
  transition-delay: 0ms;
}

/* One light sweep across a CTA the first time it shows. */
@keyframes m-sheen {
  from { background-position: 160% 0; }
  to { background-position: -60% 0; }
}
.m-on [data-m="cta"].m-in:not([data-m-plain]) {
  background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.36) 50%, transparent 62%);
  background-size: 250% 100%;
  background-repeat: no-repeat;
  animation: m-sheen 1.1s var(--m-ease) calc(var(--m-d, 0ms) + 260ms) 1 both;
}

/* ------------------------------------------------- first screen, CSS only */
/* The hero never waits for JavaScript: these run on first paint. Each child
   sets --i for its place in the sequence. */
@keyframes m-rise {
  from { opacity: 0; transform: translate3d(0, var(--m-rise), 0); }
  to { opacity: 1; transform: none; }
}
@keyframes m-nudge {
  from { transform: translate3d(0, 8px, 0); }
  to { transform: none; }
}
@keyframes m-settle {
  from { opacity: 0; transform: scale(1.035); }
  to { opacity: 1; transform: none; }
}
.m-on [data-m-hero] > *,
.m-on [data-m-hero-item] {
  animation: m-rise var(--m-base) var(--m-ease-out) both;
  animation-delay: calc(var(--i, 0) * var(--m-hero-step) + 60ms);
}
.m-on [data-m-hero-cta] {
  animation: m-nudge var(--m-base) var(--m-ease-out) both;
  animation-delay: calc(var(--i, 0) * var(--m-hero-step) + 60ms);
}
.m-on [data-m-hero-media] {
  animation: m-settle 1100ms var(--m-ease-out) both;
  animation-delay: 80ms;
}
/* inline pieces of a headline revealed word by word */
span[data-m-hero-item] {
  display: inline-block;
}

/* ---------------------------------------------------------- photo motion */
[data-m-frame] {
  overflow: hidden;
}
.m-on:not(.m-lite) [data-m-parallax] {
  scale: 1.08;
  will-change: translate;
}
.m-lite [data-m="image"]:not(.m-in) {
  transform: none;
}

/* ------------------------------------------------------- numbers that count */
[data-m-count] {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ hover, press */
.m-lift {
  transition:
    transform var(--m-fast) var(--m-ease),
    box-shadow var(--m-fast) var(--m-ease),
    border-color var(--m-fast) var(--m-ease);
}
@media (hover: hover) and (pointer: fine) {
  .m-lift:hover {
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 22px 44px -26px rgba(234, 79, 158, 0.55);
  }
  .m-press:hover {
    transform: translate3d(0, -2px, 0);
  }
}
.m-lift:active {
  transform: scale(0.985);
  transition-duration: 90ms;
}
.m-press {
  transition:
    transform var(--m-fast) var(--m-ease),
    box-shadow var(--m-fast) var(--m-ease),
    filter var(--m-fast) var(--m-ease),
    color var(--m-fast) var(--m-ease),
    border-color var(--m-fast) var(--m-ease),
    background-color var(--m-fast) var(--m-ease);
}
.m-press:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

/* ------------------------------------------------------- mobile sticky CTA */
.m-sticky {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  opacity: 0;
  transform: translate3d(0, 140%, 0);
  pointer-events: none;
  transition:
    transform 380ms var(--m-ease-out),
    opacity 220ms var(--m-ease);
}
.m-sticky.m-show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.m-sticky a,
.m-sticky .m-sticky-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  width: 100%;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--m-accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 14px 30px -10px rgba(234, 79, 158, 0.75);
  transition: transform var(--m-fast) var(--m-ease);
}
.m-sticky a:active {
  transform: scale(0.97);
}
@media (min-width: 768px) {
  .m-sticky {
    display: none;
  }
}

/* ------------------------------------------------------------ live dot */
@keyframes m-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}
.m-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.m-live::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: m-pulse 2.4s var(--m-ease) infinite;
}
/* a number that just changed gets one soft highlight */
@keyframes m-blink {
  from { background-color: color-mix(in srgb, var(--m-accent) 22%, transparent); }
  to { background-color: transparent; }
}
.m-changed {
  border-radius: 4px;
  animation: m-blink 1.4s var(--m-ease) 1;
}

/* ---------------------------------------------------------- marquee strip */
/* <div class="m-marquee"><div class="m-marquee-track">…items… then the same
   items again with aria-hidden</div></div>. The track holds two copies, so a
   -50% slide loops with no seam. Reduced motion: it simply stands still. */
@keyframes m-marquee {
  to { transform: translate3d(-50%, 0, 0); }
}
.m-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.m-marquee-track {
  display: flex;
  width: max-content;
  animation: m-marquee var(--m-marquee-time, 28s) linear infinite;
}
.m-lite .m-marquee-track {
  animation-duration: calc(var(--m-marquee-time, 28s) * 1.6);
}

/* ------------------------------------------------- content that appears */
/* For something that replaces itself on the spot, like a form turning into
   its confirmation: one soft rise, no scroll needed. */
.m-enter {
  animation: m-rise var(--m-base) var(--m-ease-out) both;
}

/* ------------------------------------------------------ highlighted word */
/* <span class="m-mark">a few words</span>: a pink highlight draws itself
   behind the words once their block is revealed, or on the hero's own timer.
   Painted as a background so it follows the words across line breaks. */
@keyframes m-mark {
  to { background-size: 100% 0.38em; }
}
.m-mark {
  background-image: linear-gradient(
    color-mix(in srgb, var(--m-mark-color, #fe87df) 55%, transparent),
    color-mix(in srgb, var(--m-mark-color, #fe87df) 55%, transparent)
  );
  background-size: 100% 0.38em;
  background-position: 0 92%;
  background-repeat: no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.06em;
}
.m-on .m-mark {
  background-size: 0% 0.38em;
}
.m-on .m-in .m-mark,
.m-on .m-mark.m-in {
  animation: m-mark 700ms var(--m-ease-out) calc(var(--m-d, 0ms) + 350ms) both;
}
.m-on [data-m-hero-item] .m-mark,
.m-on [data-m-hero] > * .m-mark {
  animation: m-mark 700ms var(--m-ease-out) calc(var(--i, 0) * var(--m-hero-step) + 560ms) both;
}

/* -------------------------------------------------------- living arrow */
/* An arrow between two steps nudges along its axis, slowly, once it is on
   screen. Tiny, transform only, and still under reduced motion. */
@keyframes m-arrow-x {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(6px, 0, 0); }
}
@keyframes m-arrow-y {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 6px, 0); }
}
.m-arrow-x,
.m-arrow-y {
  display: inline-block;
}
.m-on .m-in .m-arrow-x {
  animation: m-arrow-x 1.8s var(--m-ease) 700ms infinite;
}
.m-on .m-in .m-arrow-y {
  animation: m-arrow-y 1.8s var(--m-ease) 700ms infinite;
}

/* --------------------------------------------------------- reading line */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes m-progress {
      to { transform: scaleX(1); }
    }
    .m-progress {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 70;
      height: 2px;
      background: var(--m-accent);
      transform: scaleX(0);
      transform-origin: left center;
      pointer-events: none;
      animation: m-progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .m-live::before,
  .m-changed,
  .m-marquee-track,
  .m-enter,
  .m-mark,
  .m-arrow-x,
  .m-arrow-y,
  [data-m="cta"] {
    animation: none !important;
  }
  .m-sticky {
    transition: none;
  }
}
