/* Premium motion layer. Transform + opacity only, so there are no layout shifts.
   Everything is inside no-preference: reduced-motion visitors get the static design. */
@media (prefers-reduced-motion: no-preference) {

    :root { --ease: cubic-bezier(.22, .7, .2, 1); }

    /* ---------- Hero: plays on load, never waits on JS ---------- */
    @keyframes mFadeIn { from { opacity: 0; } }
    @keyframes mFadeUp { from { opacity: 0; transform: translate3d(0, 22px, 0); } }
    @keyframes mLineUp { from { transform: translate3d(0, 108%, 0); } }
    @keyframes mHeroArt { from { opacity: 0; transform: scale(1.06) translate3d(24px, 0, 0); } }
    @keyframes mPop { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.96); } }

    .hero .eyebrow { animation: mFadeIn .9s var(--ease) .05s backwards; }
    .hero h1 .ln { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
    .hero h1 .ln > span { display: block; animation: mLineUp 1s var(--ease) calc(.16s + var(--l, 0) * .13s) backwards; }
    .hero .lead { animation: mFadeUp .9s var(--ease) .56s backwards; }
    .hero .btn-row .btn:nth-child(1) { animation: mFadeUp .8s var(--ease) .72s backwards; }
    .hero .btn-row .btn:nth-child(2) { animation: mFadeUp .8s var(--ease) .84s backwards; }
    .hero-art img { animation: mHeroArt 1.4s var(--ease) .15s backwards; transform-origin: 70% 60%; }

    /* ---------- Scroll reveal (classes are added by motion.js; once only) ---------- */
    @keyframes rvUp { from { opacity: 0; transform: translate3d(0, 28px, 0); } }
    @keyframes rvLeft { from { opacity: 0; transform: translate3d(-36px, 0, 0); } }
    @keyframes rvRight { from { opacity: 0; transform: translate3d(36px, 0, 0); } }
    @keyframes rvFade { from { opacity: 0; } }
    @keyframes rvImg { from { opacity: 0; transform: scale(1.07); clip-path: inset(7% 7% 7% 7% round 22px); } to { opacity: 1; transform: none; clip-path: inset(0 round 22px); } }

    .js-motion .rv:not(.rv-in) { opacity: 0; will-change: opacity, transform; }
    .js-motion .rv-up:not(.rv-in) { transform: translate3d(0, 28px, 0); }
    .js-motion .rv-left:not(.rv-in) { transform: translate3d(-36px, 0, 0); }
    .js-motion .rv-right:not(.rv-in) { transform: translate3d(36px, 0, 0); }
    .js-motion .rv-img:not(.rv-in) { transform: scale(1.07); }

    /* backwards fill: after the animation ends the element returns to its own styles, so hover transforms keep working */
    .rv-in.rv-up { animation: rvUp .9s var(--ease) calc(var(--i, 0) * 90ms) backwards; }
    .rv-in.rv-left { animation: rvLeft .9s var(--ease) calc(var(--i, 0) * 90ms) backwards; }
    .rv-in.rv-right { animation: rvRight .9s var(--ease) calc(var(--i, 0) * 90ms) backwards; }
    .rv-in.rv-fade { animation: rvFade .8s ease calc(var(--i, 0) * 32ms) backwards; }
    .rv-in.rv-img { animation: rvImg 1.2s var(--ease) backwards; }
    .rv-in.rv-now { animation: none; }

    /* category badge appears after its card */
    .post.rv-in .post-img b { animation: mPop .6s var(--ease) calc(var(--i, 0) * 90ms + .35s) backwards; }

    /* ---------- Decorative motion (existing lotus / mandala art only) ---------- */
    @keyframes mFloat { from { transform: translate3d(0, 0, 0) rotate(0deg); } to { transform: translate3d(0, -14px, 0) rotate(2.5deg); } }
    @keyframes mSpin { to { transform: rotate(360deg); } }
    .decor { animation: mFloat 16s ease-in-out infinite alternate; will-change: transform; }
    .d-foot-mandala, .d-svc-mandala { animation: mSpin 220s linear infinite; }
    .np-lotus { animation: mFloat 12s ease-in-out infinite alternate; }
    .process-mtn { animation: mFadeIn 1.6s ease .2s backwards; }

    /* ---------- Buttons ---------- */
    .btn { transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s, color .3s, border-color .3s; }
    .btn .icon { transition: transform .3s var(--ease); }
    .btn:hover .icon { transform: translateX(5px); }
    .btn:active { transform: translateY(0) scale(.97); }
    .btn-outline:hover { background: var(--purple); color: #fff; }
    .btn-light:hover { background: #fdf7ea; }
    :focus-visible { outline: 2px solid var(--purple); outline-offset: 4px; box-shadow: 0 0 0 6px rgba(40, 56, 143, .14); transition: outline-offset .2s, box-shadow .2s; }
    .more .icon, .more { transition: color .25s, transform .25s; }

    /* ---------- Navigation ---------- */
    @media (min-width: 1280px) {
        .main-nav a:not(.btn) { border-bottom-color: transparent !important; }
        .main-nav a:not(.btn)::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--purple); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
        .main-nav a:not(.btn):hover::after, .main-nav a.active::after { transform: scaleX(1); }
    }
    .main-nav a:not(.btn) { position: relative; }

    /* Mobile menu: smooth open / close, burger morphs to a cross */
    @media (max-width: 1279px) {
        .main-nav { display: flex; visibility: hidden; opacity: 0; transform: translate3d(0, -10px, 0); pointer-events: none; transition: opacity .3s ease, transform .35s var(--ease), visibility 0s linear .35s; }
        .nav-toggle:checked ~ .main-nav { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition-delay: 0s; }
        .burger i, .burger i::before, .burger i::after { transition: top .25s ease, transform .3s var(--ease), background-color .2s; }
        .nav-toggle:checked ~ .burger i { background-color: transparent; }
        .nav-toggle:checked ~ .burger i::before { top: 0; transform: rotate(45deg); }
        .nav-toggle:checked ~ .burger i::after { top: 0; transform: rotate(-45deg); }
    }

    /* ---------- Services cards ---------- */
    .svc { transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
    .svc:hover { border-color: #9fb3e6; transform: translateY(-6px); box-shadow: 0 28px 56px rgba(40, 56, 143, .2); }
    .svc-photo, .svc-ico { transition: transform .5s var(--ease), box-shadow .4s; }
    .svc:hover .svc-photo, .svc:hover .svc-ico { transform: scale(1.06); }
    .svc .go .icon { transition: transform .3s var(--ease); }
    .svc:hover .go .icon { transform: translateX(1px); }

    /* ---------- Courses ---------- */
    .courses-card, .courses-photo { transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
    .courses-visual:hover .courses-card { transform: translate3d(0, -5px, 0); box-shadow: 0 24px 52px rgba(40, 56, 143, .2); }
    .courses-visual:hover .courses-photo { transform: translate3d(0, -3px, 0) scale(1.015); box-shadow: 0 22px 46px rgba(40, 56, 143, .26); }
    .courses-card a { transition: background-color .25s, padding-left .3s var(--ease), color .25s; }
    .courses-card a:hover { padding-left: 1.4rem; color: var(--purple); }
    .course-icon { transition: transform .35s var(--ease); }
    .courses-card a:hover .course-icon { transform: scale(1.12) rotate(-3deg); }

    /* ---------- Tools ---------- */
    .tool { transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s, background-color .3s; }
    .tool:hover { transform: translateY(-6px); border-color: #9fb3e6; background: #f9fbff; box-shadow: 0 0 0 4px rgba(74, 99, 196, .1), 0 22px 46px rgba(74, 99, 196, .28); }
    .tool-ico { transition: transform .4s var(--ease); }
    .tool:hover .tool-ico { transform: scale(1.18); }
    .tools-panel { transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
    .tools-panel:hover { transform: translateY(-4px); box-shadow: 0 26px 56px rgba(40, 56, 143, .36), inset 0 0 0 1px rgba(227, 189, 120, .45); }

    /* ---------- Articles & testimonials ---------- */
    .post-img img { transition: transform .8s var(--ease); }
    .post .go, .post .go .icon { transition: transform .3s var(--ease), background-color .25s, color .25s; }
    .quote { transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
    .quote:hover { transform: translateY(-5px); border-color: #d2dcf2; box-shadow: 0 22px 46px rgba(40, 56, 143, .14); }
    .tab { transition: background-color .3s, color .3s, border-color .3s, transform .25s var(--ease), box-shadow .3s; }
    .tab:hover { transform: translateY(-2px); }
    .circ { transition: background-color .25s, color .25s, transform .3s var(--ease), box-shadow .3s; }
    .circ:hover { transform: scale(1.08); box-shadow: 0 8px 20px rgba(40, 56, 143, .28); }

    /* ---------- Locations ---------- */
    .chips a { transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .3s var(--ease), box-shadow .3s; }
    .chips a:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(40, 56, 143, .22); }

    /* ---------- About & expertise ---------- */
    .exp { transition: transform .4s var(--ease); }
    .exp:hover { transform: translateY(-5px); }
    .exp-icon { transition: transform .5s var(--ease); }
    .exp:hover .exp-icon { transform: scale(1.08) rotate(-2deg); }
    .name-tag { transition: transform .4s var(--ease); }
    .about-img:hover .name-tag { transform: translateY(-4px); }

    /* ---------- Footer ---------- */
    .social a { transition: background-color .3s, color .3s, transform .35s var(--ease), box-shadow .3s; }
    .social a:hover { box-shadow: 0 8px 18px rgba(227, 189, 120, .35); }
}
