/* MMM motion - hero headline, headline + button attention, scroll effects.
   Item 86 (2026-11-13, Paulo: animate the hero headline; more text
   animations and scroll effects, especially heroes; all homepage headlines
   and buttons animated to draw attention).
   Item 91 (2026-11-13, Paulo: slow the typewriter down, 3–5 s depending
   on length): per-character delay is computed from the headline length
   (nominal 4 s total, never under 3 s, never over 5 s); the hard reveal
   fires 1 s after typing would finish. The h2 scroll reveals and the
   button sheen are unchanged.
   CSS/JS only. No stored content is edited; mmm-motion.js adds every hook
   at runtime (character spans, caret, reveal classes, sheen classes).
   Safety mirrors mmm-reveal.js: nothing is hidden unless JS runs and adds
   html.mmm-motion-on, so without JS (or if the script fails) every headline
   and button renders exactly as before. Animations use transform and
   opacity only - no layout shift. prefers-reduced-motion turns everything
   off (the script exits early and this block is the backstop). */

/* ---- Hero headlines: typewriter. JS splits the h1 into .mmm-c character
   spans (class mmm-hero-h1) and reveals them in order, 3–5 s for the
   whole headline depending on length. Unrevealed characters stay in the DOM with
   visibility:hidden, so the headline reserves its full space from the
   first paint and nothing below it shifts. The blinking caret is an
   inline span with zero net width (2px wide + 2px left margin - 4px right
   margin) so it cannot change line wrapping. Homepage hero, city/tool/hub
   heroes (.mmm-hero h1), program/service page titles
   (h1.wp-block-post-title) and tool/post titles (h1.mmm-post-h1). ---- */
html.mmm-motion-on h1.mmm-hero-h1.mmm-typing .mmm-c{visibility:hidden}
html.mmm-motion-on h1.mmm-hero-h1.mmm-typing .mmm-c.mmm-on{visibility:visible}
html.mmm-motion-on .mmm-caret{display:inline-block;width:2px;min-width:2px;height:.92em;margin-left:2px;margin-right:-4px;background:currentColor;vertical-align:-.06em;animation:mmm-caret-blink 1s steps(1) infinite}
@keyframes mmm-caret-blink{0%,49%{opacity:1}50%,100%{opacity:0}}

/* ---- Homepage hero entrance: eyebrow, subhead, CTA, lifetime line, chips,
   quiz link, caption - staggered AFTER the headline finishes typing. The
   hero CTA wrapper animates, never the button itself (the button keeps
   its beam). JS adds html.mmm-hero-typed when the hero h1 finishes (or
   after a 3 s watchdog, or at once if the page has no hero h1), so this
   group can never be left hidden. ---- */
html.mmm-motion-on.mmm-hero-typed .hero .hero-eyebrow{animation:mmm-motion-rise .6s cubic-bezier(.2,.7,.2,1) both}
html.mmm-motion-on.mmm-hero-typed .hero .sub{animation:mmm-motion-rise .6s cubic-bezier(.2,.7,.2,1) .15s both}
html.mmm-motion-on.mmm-hero-typed .hero .hero-cta{animation:mmm-motion-rise .6s cubic-bezier(.2,.7,.2,1) .3s both}
html.mmm-motion-on.mmm-hero-typed .hero .hero-life{animation:mmm-motion-fade .6s ease .42s both}
html.mmm-motion-on.mmm-hero-typed .hero .hp-chip{animation:mmm-motion-fade .6s ease .5s both}
html.mmm-motion-on.mmm-hero-typed .hero .hero-quiz{animation:mmm-motion-fade .6s ease .58s both}
html.mmm-motion-on.mmm-hero-typed .hero .hero-cap{animation:mmm-motion-fade .6s ease .66s both}
@keyframes mmm-motion-rise{from{opacity:0;transform:translateY(.55em)}to{opacity:1;transform:translateY(0)}}
@keyframes mmm-motion-fade{from{opacity:0}to{opacity:1}}

/* City switcher: when the eyebrow text changes, fade the new city name in
   (JS adds .mmm-motion-swap on each text change via MutationObserver).
   Not gated on mmm-hero-typed: swaps happen every 6 s for the life of the
   page, long after the entrance group has run. */
html.mmm-motion-on .hero .hero-eyebrow.mmm-motion-swap{animation:mmm-motion-fade .45s ease both}

/* ---- Inner heroes: tagline/intro settles in after the h1 finishes typing;
   the photo hero image settles from a slight zoom (transform + opacity
   only). The intro is gated on mmm-hero-typed for the same reason as the
   homepage group; the image zoom is not gated (it runs on load). ---- */
html.mmm-motion-on.mmm-hero-typed .mmm-hero .mmm-hero-intro{animation:mmm-motion-rise .6s cubic-bezier(.2,.7,.2,1) .15s both}
html.mmm-motion-on .mmm-hero--photo img.ph{animation:mmm-motion-hero-img 1.1s ease both}
@keyframes mmm-motion-hero-img{from{opacity:.25;transform:scale(1.04)}to{opacity:1;transform:scale(1)}}

/* ---- Headline scroll reveals (h2). JS adds .mmm-motion-h2 and .is-in on
   scroll (IntersectionObserver, 1.5s watchdog, same pattern as
   mmm-reveal.js). Excluded: h2s in header/footer/nav/aside and h2s already
   animated by mmm-reveal ([data-mmm-reveal]). ---- */
html.mmm-motion-on h2.mmm-motion-h2{opacity:0;transform:translateY(12px);transition:opacity .55s ease,transform .55s cubic-bezier(.2,.7,.2,1)}
html.mmm-motion-on h2.mmm-motion-h2.is-in{opacity:1;transform:none}

/* ---- Primary-button attention: a soft white sheen that sweeps across the
   button face every few seconds, only once the button is in view (JS adds
   .mmm-motion-sheen-on via IntersectionObserver). Targets .btn-pink,
   .v2-btn (non-ghost) and .mmm-sq (non-off). Beamed buttons are excluded by
   the JS: the hero CTA and every Plan button on the homepage already carry
   the rotating beam, whose ::after is the button face - a sheen ::after
   would fight it. ---- */
html.mmm-motion-on .mmm-motion-sheen{position:relative;overflow:hidden}
html.mmm-motion-on .mmm-motion-sheen::after{content:"";position:absolute;top:0;bottom:0;left:0;width:38%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.38),transparent);transform:translateX(-320%) skewX(-18deg);pointer-events:none}
html.mmm-motion-on .mmm-motion-sheen.mmm-motion-sheen-on::after{animation:mmm-motion-sheen 6.5s ease-in-out infinite}
@keyframes mmm-motion-sheen{0%{transform:translateX(-320%) skewX(-18deg)}32%{transform:translateX(420%) skewX(-18deg)}100%{transform:translateX(420%) skewX(-18deg)}}

/* ---- Reduced motion: everything visible at once, no animation. The JS
   exits before adding html.mmm-motion-on; this is the backstop. ---- */
@media (prefers-reduced-motion:reduce){
  html.mmm-motion-on h1.mmm-hero-h1.mmm-typing .mmm-c{visibility:visible !important}
  html.mmm-motion-on .mmm-caret{display:none !important}
  html.mmm-motion-on .hero .hero-eyebrow,
  html.mmm-motion-on .hero .sub,
  html.mmm-motion-on .hero .hero-cta,
  html.mmm-motion-on .hero .hero-life,
  html.mmm-motion-on .hero .hp-chip,
  html.mmm-motion-on .hero .hero-quiz,
  html.mmm-motion-on .hero .hero-cap,
  html.mmm-motion-on .mmm-hero .mmm-hero-intro,
  html.mmm-motion-on .mmm-hero--photo img.ph{animation:none !important;opacity:1 !important;transform:none !important}
  html.mmm-motion-on h2.mmm-motion-h2{opacity:1 !important;transform:none !important;transition:none !important}
  html.mmm-motion-on .mmm-motion-sheen::after{display:none !important}
  html.mmm-motion-on .mmm-nav>a.mmm-wm{animation:none !important;opacity:1 !important;transform:none !important}
}

/* ---- Header wordmark: polish + entrance (item 92, Paulo 2026-11-13 05:41 CST).
   Polish: at desktop widths only, the nav wordmark gets a slightly stronger
   weight (600 → 700) and a touch more tracking (.01em → .02em); "Mexico"
   (the <i>) matches the weight so the gold accent reads as the accent word.
   Phone sizes/weights are untouched — the 390px header is tight and the
   wordmark must never widen, wrap, or squeeze the ticket/MENU. The
   dashboard keeps its own 800/−.01em rule (body.mj-body excluded).
   Entrance: a soft fade with a slight rise (0.6 s, once per page load),
   transform + opacity only, on the header wordmark link only
   (.mmm-nav > a.mmm-wm) — not the menu-overlay span, not the footer
   wordmark. The wordmark keeps its full box from first paint, so the
   ticket and MENU never move. The html.mmm-motion-on class is added in
   <head> (functions.php, item 92) so the animation starts before first
   paint and never flashes; without JS the class is never added and the
   wordmark is static. ---- */
@media (min-width:761px){
  body:not(.mj-body) .mmm-nav>a.mmm-wm{font-weight:700;letter-spacing:.02em}
  body:not(.mj-body) .mmm-nav>a.mmm-wm i{font-weight:700}
}
html.mmm-motion-on .mmm-nav>a.mmm-wm{animation:mmm-wm-in .6s ease-out both}
@keyframes mmm-wm-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
