/* ============================================================
   Motion layer — site-wide animation & motion graphics.
   Loaded after style.css; driven by assets/js/motion.js.
   Everything here is switched off for prefers-reduced-motion.
   ============================================================ */
main { overflow-x: clip; }

/* ---------- page-to-page transition (View Transitions; ignored where unsupported) ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: mo-vt-out .26s ease-in both; }
::view-transition-new(root) { animation: mo-vt-in .42s cubic-bezier(.2,.8,.3,1) both; }
@keyframes mo-vt-out { to { opacity: 0; transform: translateY(-14px) scale(.99); } }
@keyframes mo-vt-in { from { opacity: 0; transform: translateY(22px); } }

/* ---------- scroll progress + header ---------- */
.mo-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 130; transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
  background: linear-gradient(90deg, var(--gold), var(--magenta), var(--pink)); box-shadow: 0 0 10px rgba(232,91,164,.6); }
.site-header { transition: box-shadow .3s, background .3s; }
.site-header.mo-scrolled { box-shadow: 0 8px 26px rgba(110,24,69,.14); background: rgba(255,255,255,.97); }
@media (min-width: 1151px) {
  .brand img { transition: height .35s cubic-bezier(.2,.8,.3,1), transform .25s; }
  .site-header.mo-scrolled .brand img { height: 56px; }
}
.mo-first .site-header { animation: mo-drop .7s cubic-bezier(.2,.9,.3,1) both; }   /* first page of the visit only */
@keyframes mo-drop { from { transform: translateY(-100%); } }
.main-nav > a, .dropdown > a { transition: color .2s, background .2s, transform .2s; }
.main-nav > a:hover, .dropdown > a:hover { transform: translateY(-1px); }
.dropdown-menu a { transition: background .18s, color .18s, padding-left .2s, border-color .18s; }
.dropdown-menu a:hover { padding-left: 24px; }
.btn-donate { animation: mo-heart 2.6s ease-in-out infinite; overflow: hidden; }
@keyframes mo-heart { 0%, 100% { box-shadow: 0 6px 16px rgba(192,41,122,.3), 0 0 0 0 rgba(232,91,164,.45); } 50% { box-shadow: 0 6px 16px rgba(192,41,122,.3), 0 0 0 9px rgba(232,91,164,0); } }

/* ---------- scroll reveals (targets tagged by motion.js) ---------- */
.mo-on :is(.section-head, .feature-card, .act-card, .book-card, .person-card, .gallery-item, .about-card, .donate-card,
  .purpose-card, .highlight-band, .cta-band, .form-card, .split > *, .embed-16x9, .tabs, .footer-grid > div, .card, .grid > *):not(.reveal):not(.mo-in):not(.mo-skip) { opacity: 0; }
.mo-t.mo-in { animation: mo-up .85s cubic-bezier(.2,.85,.25,1) backwards; animation-delay: calc(var(--mo-i, 0) * 90ms); }
.mo-t.mo-zoom.mo-in { animation-name: mo-zoom; }
.mo-t.mo-left.mo-in { animation-name: mo-left; }
.mo-t.mo-right.mo-in { animation-name: mo-right; }
.mo-t.mo-flip.mo-in { animation-name: mo-flip; }
@keyframes mo-up { from { opacity: 0; transform: translateY(46px) scale(.97); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes mo-zoom { from { opacity: 0; transform: scale(.88); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes mo-left { from { opacity: 0; transform: translateX(-60px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes mo-right { from { opacity: 0; transform: translateX(60px) rotate(1.5deg); } to { opacity: 1; transform: none; } }
@keyframes mo-flip { from { opacity: 0; transform: perspective(900px) rotateX(-24deg) translateY(40px); transform-origin: 50% 0; } to { opacity: 1; transform: none; } }

/* images inside revealed blocks wipe in */
.mo-t.mo-in img:not(.mo-noimg) { animation: mo-img .95s .15s cubic-bezier(.2,.8,.25,1) backwards; animation-delay: calc(.15s + var(--mo-i, 0) * 90ms); }
@keyframes mo-img { from { clip-path: inset(0 0 100% 0); transform: scale(1.12); } to { clip-path: inset(0); transform: none; } }

/* section heading: title rises, gold rule draws, lotus spins in */
.section-head h2 { transition: letter-spacing .6s; }
.mo-on .section-head .rule::before { transform: scaleX(0); transition: transform 1.1s .25s cubic-bezier(.2,.8,.2,1); }
.mo-on .section-head .rule::after { transform: translateX(-50%) scale(0) rotate(-180deg); transition: transform .8s .55s cubic-bezier(.2,.9,.3,1.5); }
.mo-on .section-head:is(.in, .mo-in) .rule::before { transform: scaleX(1); }
.mo-on .section-head:is(.in, .mo-in) .rule::after { transform: translateX(-50%) scale(1) rotate(0); }
.section-head h2 em { background: linear-gradient(90deg, var(--magenta), var(--gold), var(--magenta)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: mo-text-flow 6s linear infinite; padding: .12em .04em .06em; }
@keyframes mo-text-flow { to { background-position: 200% 0; } }

/* ---------- hover motion: cards tilt (JS), icons bounce, buttons ---------- */
.mo-tilt { position: relative; will-change: transform; }
.mo-tilt.mo-tilting { transition: transform .08s linear, box-shadow .25s !important; }
.mo-glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; z-index: 2;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,200,228,.38), rgba(255,255,255,0) 58%); }
.mo-tilt:hover .mo-glare { opacity: 1; }
.feature-card:hover .fc-ico, .act-card:hover .ico, .purpose-card:hover .ico { animation: mo-bounce .6s cubic-bezier(.3,1.6,.5,1); }
.feature-card .fc-ico { transition: transform .3s; }
.feature-card:hover .fc-ico { background: linear-gradient(135deg, #fbe0ee, #ffe7b8); }
.act-card:hover .num { color: var(--pink-soft); transition: color .3s; }
@keyframes mo-bounce { 0% { transform: scale(1); } 35% { transform: scale(1.25) rotate(-10deg); } 65% { transform: scale(.94) rotate(6deg); } 100% { transform: none; } }
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary { background-image: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.38) 50%, transparent 62%), linear-gradient(135deg, var(--magenta), var(--magenta-dark));
  background-size: 260% 100%, 100% 100%; background-position: 130% 0, 0 0; background-repeat: no-repeat; transition: background-position .7s ease, transform .2s, box-shadow .2s, filter .2s; }
.btn-primary:hover { background-position: -40% 0, 0 0; }
.mo-ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); pointer-events: none; animation: mo-ripple .65s ease-out forwards; z-index: -1; }
@keyframes mo-ripple { to { transform: scale(2.6); opacity: 0; } }
.gallery-item img, .book-card img, .card .thumb { transition: transform .6s cubic-bezier(.2,.8,.3,1); }

/* ---------- motion graphics: hero + inner-page banners ---------- */
.mo-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.page-banner > .container, .hero > .container { position: relative; z-index: 1; }
.mo-mandala { position: absolute; width: 520px; height: 520px; left: 50%; top: 50%; margin: -260px 0 0 -260px; opacity: .22; animation: mo-spin 80s linear infinite; }
.mo-mandala.small { width: 300px; height: 300px; margin: -150px 0 0 -150px; opacity: .3; animation-duration: 50s; animation-direction: reverse; }
.mo-mandala * { vector-effect: non-scaling-stroke; }
.mo-dot { position: absolute; bottom: -20px; width: var(--s, 6px); height: var(--s, 6px); border-radius: 50%; background: radial-gradient(circle, #ffe9a8, rgba(255,214,110,0) 70%);
  box-shadow: 0 0 12px rgba(255,214,110,.7); opacity: 0; animation: mo-rise var(--d, 9s) linear var(--delay, 0s) infinite; }
.mo-glyph { position: absolute; bottom: -40px; font-family: var(--font-dev); color: #ffd6ea; font-size: var(--s, 26px); opacity: 0; animation: mo-rise-g var(--d, 14s) linear var(--delay, 0s) infinite; }
@keyframes mo-rise { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 12% { opacity: .9; } 70% { opacity: .55; } 100% { opacity: 0; transform: translate(var(--dx, 30px), -420px) rotate(var(--r, 90deg)); } }
@keyframes mo-rise-g { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 15% { opacity: .2; } 70% { opacity: .12; } 100% { opacity: 0; transform: translate(var(--dx, 30px), -420px) rotate(var(--r, 40deg)); } }
@keyframes mo-spin { to { transform: rotate(360deg); } }
.page-banner { background-size: 160% 160%, 100% 100%; animation: mo-banner-glow 14s ease-in-out infinite alternate; }
@keyframes mo-banner-glow { from { background-position: 0% 0%, 0 0; } to { background-position: 100% 60%, 0 0; } }
.page-banner::after { animation: mo-lotus-float 7s ease-in-out infinite; }
@keyframes mo-lotus-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-16px) rotate(8deg); } }
.mo-words { perspective: 700px; }
.mo-words > span { display: inline-block; animation: mo-word .8s cubic-bezier(.2,.8,.25,1) backwards; }
@keyframes mo-word { from { opacity: 0; transform: translateY(26px) rotateX(70deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.page-banner p { animation: mo-fade-up .9s .45s cubic-bezier(.2,.8,.25,1) backwards; }
.page-banner .crumb { animation: mo-fade-up .9s .65s cubic-bezier(.2,.8,.25,1) backwards; }
@keyframes mo-fade-up { from { opacity: 0; transform: translateY(16px); } }

/* home hero */
.hero::after { animation: mo-om 16s ease-in-out infinite; transform-origin: 50% 55%; }
@keyframes mo-om { 0%, 100% { transform: rotate(0) scale(1); opacity: .07; } 50% { transform: rotate(10deg) scale(1.06); opacity: .12; } }
.hero::before { animation: mo-dots 40s linear infinite; }
@keyframes mo-dots { to { background-position: 260px 260px; } }
.hero h1 span { background-size: 220% 100%; animation: mo-text-flow 5s linear infinite; background-image: linear-gradient(90deg, #ffd66e, #ffb3d8, #ffe9a8, #ffd66e); }
.hero .mantra { animation: mo-pill 3.2s ease-in-out infinite; }
@keyframes mo-pill { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,214,110,.0); } 50% { box-shadow: 0 0 22px 2px rgba(255,214,110,.35); } }
.hero-portrait img { animation: mo-float 7s ease-in-out infinite; }
@keyframes mo-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.hero-portrait .ring { animation: mo-ring 5s ease-in-out infinite; }
@keyframes mo-ring { 0%, 100% { opacity: .85; scale: 1; } 50% { opacity: 1; scale: 1.08; } }
.hero-portrait .mo-mandala { width: 470px; height: 470px; margin: -235px 0 0 -235px; top: 44%; opacity: .32; z-index: 0; }
.hero-stats .hs { transition: transform .3s, background .3s; }
.hero-stats .hs:hover { transform: translateY(-5px); background: rgba(255,255,255,.15); }
.mo-spot { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .5s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,214,110,.13), transparent 60%); }
.hero:hover .mo-spot, .page-banner:hover .mo-spot { opacity: 1; }

/* mantra strip */
.mantra-strip { background-size: 200% 100%; animation: mo-strip 10s ease-in-out infinite alternate; }
@keyframes mo-strip { to { background-position: 100% 0; } }
.mantra-strip .m1 { background: linear-gradient(90deg, #fff 42%, #ffe39a 50%, #fff 58%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: mo-shine-text 5s linear infinite; }
@keyframes mo-shine-text { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.mantra-strip::before, .mantra-strip::after { animation: mo-lotus-spin 12s linear infinite; }
@keyframes mo-lotus-spin { to { transform: translateY(-50%) rotate(360deg); } }

/* highlight + CTA bands */
.highlight-band { background-size: 200% 200%; animation: mo-strip 12s ease-in-out infinite alternate; }
.highlight-band::after, .cta-band::before { animation: mo-lotus-float 8s ease-in-out infinite; }
.cta-band { background-size: 200% 200%; animation: mo-strip 9s ease-in-out infinite alternate; }
.highlight-grid .hi { transition: transform .3s, background .3s; }
.highlight-grid .hi:hover { transform: translateY(-6px) scale(1.03); background: rgba(255,255,255,.14); }
.highlight-band > .mo-fx, .cta-band > .mo-fx { z-index: 0; }
.highlight-band > :not(.mo-fx), .cta-band > :not(.mo-fx) { position: relative; z-index: 1; }

/* footer wave + socials */
.site-footer { position: relative; }
.mo-wave { position: absolute; left: 0; right: 0; top: -46px; height: 48px; overflow: hidden; pointer-events: none; }
.mo-wave svg { position: absolute; bottom: 0; width: 200%; height: 100%; }
.mo-wave .w1 { animation: mo-wave 14s linear infinite; fill: var(--maroon-deep); }
.mo-wave .w2 { animation: mo-wave 9s linear infinite reverse; fill: rgba(110,24,69,.45); }
@keyframes mo-wave { to { transform: translateX(-50%); } }
.site-footer .social a { transition: transform .35s cubic-bezier(.2,.9,.3,1.5), background .2s; }
.site-footer .social a:hover { transform: translateY(-4px) rotate(-12deg) scale(1.1); }
.site-footer a:not(.social a):hover { transform: translateX(4px); }
.site-footer a { transition: color .15s, transform .2s; }

/* back-to-top progress ring */
.to-top .mo-ring-svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; }
.to-top .mo-ring-svg circle { fill: none; stroke: #ffd66e; stroke-width: 3; stroke-linecap: round; }

/* ---------- reduced motion: everything calm ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mo-fx, .mo-wave, .mo-progress { display: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
