/* =====================================================================
   YeasinWP motion system
   - Only opacity / transform are animated (GPU friendly, no layout shift)
   - Hidden states apply only when html.yw-reveal is set (JS + motion allowed)
   - Respects prefers-reduced-motion
   - Infinite loops pause when their section is off screen (.m-off)
   ===================================================================== */

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Existing data-aos reveals: smoother easing ---------- */
html.yw-reveal [data-aos] {
  transform: translateY(20px);
  transition: opacity var(--m-dur) var(--m-ease), transform var(--m-dur) var(--m-ease);
}

/* ---------- Single element reveals: data-m="up|scale|left|right" ---------- */
html.yw-reveal [data-m] {
  opacity: 0;
  transition: opacity var(--m-dur) var(--m-ease), transform 1.1s var(--m-ease);
  transition-delay: var(--m-delay, 0ms);
}
html.yw-reveal [data-m="up"]    { transform: translateY(24px); }
html.yw-reveal [data-m="scale"] { transform: translateY(18px) scale(.965); }
html.yw-reveal [data-m="left"]  { transform: translateX(-28px); }
html.yw-reveal [data-m="right"] { transform: translateX(28px); }
html.yw-reveal [data-m].m-in    { opacity: 1; transform: none; }

/* ---------- Staggered groups: parent [data-m-stagger], items [data-m-item] ---------- */
html.yw-reveal [data-m-stagger] [data-m-item] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--m-ease), transform 1s var(--m-ease);
  transition-delay: calc(min(var(--i, 0), 10) * var(--m-step));
}
html.yw-reveal [data-m-stagger].m-in [data-m-item] { opacity: 1; transform: none; }
/* table rows live inside a scroll container: fade only, no movement (avoids a temporary scrollbar) */
html.yw-reveal [data-m-stagger] tr[data-m-item] { transform: none; }
/* once revealed, hover transitions must not wait for the stagger delay */
html.yw-reveal [data-m-stagger].m-done [data-m-item] { transition-delay: 0ms; }

/* Safety net if motion.js never loads */
html.m-fallback [data-m],
html.m-fallback [data-m-item] { opacity: 1 !important; transform: none !important; }

/* ---------- Hover polish ---------- */
.m-lift {
  transition: transform .45s var(--m-ease), box-shadow .45s var(--m-ease), border-color .3s ease !important;
}
@media (hover: hover) {
  .m-lift:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(15, 23, 42, .28); }
  .m-chip { transition: transform .35s var(--m-ease), border-color .25s ease, color .25s ease; }
  .m-chip:hover { transform: translateY(-2px); border-color: #BFDBFE; color: #1D4ED8; }
}

/* Arrow icons nudge forward on hover */
a i.ph-arrow-right, a i.ph-arrow-up-right, button i.ph-arrow-right { transition: transform .3s var(--m-ease); }
a:hover > i.ph-arrow-right, button:hover > i.ph-arrow-right { transform: translateX(3px); }
a:hover > i.ph-arrow-up-right { transform: translate(2px, -2px); }

/* Primary buttons: a soft light sweep on hover */
.ui-btn-primary, .m-sheen-btn { position: relative; overflow: hidden; isolation: isolate; }
.ui-btn-primary::after, .m-sheen-btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .28) 50%, transparent 65%);
  transform: translateX(-120%);
}
@media (hover: hover) {
  .ui-btn-primary:hover::after, .m-sheen-btn:hover::after { transform: translateX(120%); transition: transform .8s var(--m-ease-in-out); }
}

/* ---------- Header: soft shadow once the page scrolls ---------- */
#main-nav { transition: box-shadow .35s ease, background-color .35s ease; }
#main-nav.m-scrolled { box-shadow: 0 8px 30px -18px rgba(15, 23, 42, .25); }

/* ---------- Counters: no layout shift while digits change ---------- */
[data-m-count] { font-variant-numeric: tabular-nums; display: inline-block; }

/* ---------- Pop (number badges, check icons) ---------- */
@keyframes m-pop { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
html.yw-reveal [data-m-stagger] .m-pop { opacity: 0; }
html.yw-reveal [data-m-stagger].m-in .m-pop {
  animation: m-pop .6s var(--m-ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * var(--m-step) + .25s);
}
html.m-fallback .m-pop { opacity: 1 !important; }
/* check marks in comparison tables pop in after their row */
html.yw-reveal [data-m-stagger] tbody .ph-check-circle { opacity: 0; display: inline-block; }
html.yw-reveal [data-m-stagger].m-in tbody .ph-check-circle {
  animation: m-pop .55s var(--m-ease) both;
  animation-delay: calc(min(var(--i, 0), 10) * var(--m-step) + .3s);
}
html.m-fallback [data-m-stagger] tbody .ph-check-circle { opacity: 1 !important; }

/* ---------- One-time light sweep across a highlighted row ---------- */
.m-sweep { position: relative; overflow: hidden; }
.m-sweep::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(37, 99, 235, .14) 50%, transparent 70%);
  transform: translateX(-110%);
}
html.yw-reveal .m-in .m-sweep::after { animation: m-sweep 1.6s .6s var(--m-ease-in-out) both; }
@keyframes m-sweep { to { transform: translateX(110%); } }

/* ---------- Video play button: gentle ping ---------- */
.m-ping { position: absolute; inset: 0; border-radius: 9999px; border: 2px solid rgba(255, 255, 255, .7); pointer-events: none; animation: m-ping 2.6s var(--m-ease) infinite; }
@keyframes m-ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(1.65); opacity: 0; } }

/* ---------- Tab switch (guides) ---------- */
@keyframes m-fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.m-switched [data-guide-panel]:not(.hidden) > * {
  animation: m-fade-up .55s var(--m-ease) both;
}
.m-switched [data-guide-panel]:not(.hidden) > *:nth-child(2) { animation-delay: 60ms; }
.m-switched [data-guide-panel]:not(.hidden) > *:nth-child(3) { animation-delay: 120ms; }

/* ---------- FAQ: smooth open / close where the browser supports it ---------- */
@supports (interpolate-size: allow-keywords) {
  .m-faq details { interpolate-size: allow-keywords; }
  .m-faq details::details-content {
    height: 0; overflow: clip;
    transition: height .45s var(--m-ease), content-visibility .45s allow-discrete;
  }
  .m-faq details[open]::details-content { height: auto; }
}
.m-faq details { transition: border-color .3s ease, box-shadow .3s ease; }
.m-faq details[open] { box-shadow: 0 14px 34px -24px rgba(37, 99, 235, .35); }

/* ---------- Final CTA: slow drifting light (no blur filter, transform only) ---------- */
.m-cta { position: relative; overflow: hidden; isolation: isolate; }
.m-cta-glow { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.m-cta-glow span { position: absolute; width: 760px; height: 760px; border-radius: 50%; }
.m-cta-glow span:nth-child(1) { left: -220px; top: -380px; background: radial-gradient(circle, rgba(37, 99, 235, .32), transparent 62%); animation: m-drift-a 18s ease-in-out infinite; }
.m-cta-glow span:nth-child(2) { right: -260px; bottom: -420px; background: radial-gradient(circle, rgba(124, 58, 237, .22), transparent 62%); animation: m-drift-b 22s ease-in-out infinite; }
@keyframes m-drift-a { 50% { transform: translate(120px, 60px) scale(1.08); } }
@keyframes m-drift-b { 50% { transform: translate(-110px, -50px) scale(.94); } }

/* ---------- Hero refinements (lighter on the GPU) ---------- */
/* light sweeps across the muted words once instead of looping forever */
.yh .yh-shine { animation: yhShine 2.8s .9s var(--m-ease-in-out) 1 both; }
/* the glow behind the demo breathes with opacity instead of re-painting a spinning blurred gradient */
.yh .yh-ring { animation: m-breathe 5s ease-in-out infinite alternate; }
@keyframes m-breathe { from { opacity: .2; } to { opacity: .38; } }

/* Pause looping animations while their section is off screen */
.m-off .yh-blob, .m-off .yh-ring, .m-off .yh-chip,
.m-off .m-ping, .m-off .m-cta-glow span { animation-play-state: paused !important; }

/* ---------- Above-the-fold entrance: pure CSS, starts with the first paint (no wait for JS) ---------- */
@keyframes m-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.m-enter > * { animation: m-enter .8s var(--m-ease) both; }
.m-enter > *:nth-child(2) { animation-delay: .07s; }
.m-enter > *:nth-child(3) { animation-delay: .14s; }
.m-enter > *:nth-child(4) { animation-delay: .21s; }
.m-enter > *:nth-child(5) { animation-delay: .28s; }
.m-enter > *:nth-child(6) { animation-delay: .35s; }
.m-enter-late { animation: m-enter 1s .25s var(--m-ease) both; }
/* screenshot gallery: soft fade when the big image changes */
@keyframes m-fade-in { from { opacity: .25; } to { opacity: 1; } }
[data-gallery-main].m-swap { animation: m-fade-in .45s ease both; }
@media (prefers-reduced-motion: reduce) { .m-enter > *, .m-enter-late, [data-gallery-main].m-swap { animation: none !important; } }

/* ---------- Reduced motion: everything visible and still ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-m], [data-m-item], .m-pop { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  .m-ping, .m-cta-glow span, .m-sweep::after, .ui-btn-primary::after { animation: none !important; display: none; }
  .m-lift, .m-chip { transition: none !important; }
  .m-faq details::details-content { transition: none !important; }
  .m-switched [data-guide-panel] > * { animation: none !important; }
  a i.ph-arrow-right, a i.ph-arrow-up-right, button i.ph-arrow-right { transition: none !important; }
}

/* product proof strip: right column aligned right on 2-col layout */
@media (max-width:1023px){.pf-r{text-align:right}.pf-r .flex{justify-content:flex-end}}
