/* Motion for the public website (with motion.js). Calm on purpose: short
   distances, one easing curve, each thing moves once. Loaded after the page's
   own <style>. */
:root { --mo-ease: cubic-bezier(.22, 1, .36, 1); }

@media (prefers-reduced-motion: no-preference) {

    /* Soft cross-fade between pages; the navbar stays put. Browsers without
       support simply load the next page as usual. */
    @view-transition { navigation: auto; }
    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; }
    .navbar { view-transition-name: cv-navbar; }

    /* Hero entrance */
    .mo:not(.mo-go) .hero-content > * { opacity: 0; }
    .mo-go .hero-content > * { animation: moUp 1.1s var(--mo-ease) backwards; }
    .mo-go .hero-content > :nth-child(1) { animation-delay: .1s; }
    .mo-go .hero-content > :nth-child(2) { animation-delay: .22s; }
    .mo-go .hero-content > :nth-child(3) { animation-delay: .4s; }
    .mo-go .hero-content > :nth-child(4) { animation-delay: .54s; }
    .mo .hero > .hero-bg { background-attachment: scroll; }
    .mo-go .hero > .hero-bg { animation: moSettle 2.6s var(--mo-ease) backwards; }
    .mo-go .inner-hero-content:not([class*="anim-fade"]) > * { animation: moUp 1s var(--mo-ease) .1s backwards; }
    .mo-go .inner-hero-content:not([class*="anim-fade"]) > * + * { animation-delay: .25s; }

    /* Reveal on scroll */
    .mo-r:not(.mo-in) { opacity: 0; }
    .mo-r.mo-in { animation: moUp .9s var(--mo-ease) backwards; }
    .mo-r.mo-img.mo-in { animation-name: moImg; animation-duration: 1.1s; }
    .mo-in .label-line { transform-origin: left; animation: moLine .9s var(--mo-ease) .15s backwards; }

    @keyframes moUp { from { opacity: 0; transform: translateY(28px); } }
    @keyframes moImg { from { opacity: 0; transform: translateY(24px) scale(.97); } }
    @keyframes moLine { from { transform: scaleX(0); } }
    @keyframes moSettle { from { scale: 1.07; } }

    /* Hover details (mouse only) */
    @media (hover: hover) {
        .navbar-links a:not(.btn-nav-register) { position: relative; }
        .navbar-links a:not(.btn-nav-register)::after {
            content: ''; position: absolute; left: 0; right: 2px; bottom: -7px; height: 2px;
            background: var(--brand-red, #d22630); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--mo-ease);
        }
        .navbar-links a:not(.btn-nav-register):hover::after { transform: scaleX(1); transform-origin: left; }

        .btn { transition: transform .35s var(--mo-ease), background-color .3s ease, box-shadow .35s ease, border-color .3s ease, color .3s ease; }
        .btn:hover { transform: translateY(-2px); }
        .btn:active { transform: none; }
        .btn-primary { position: relative; overflow: hidden; }
        .btn-primary::after {
            content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
            background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-18deg);
        }
        .btn-primary:hover::after { left: 120%; transition: left .7s ease; }

        .service-arrow svg { transition: transform .35s var(--mo-ease); }
        .service-item:hover .service-arrow svg { transform: translateX(3px); }
        .coach-main-img { transition: opacity .4s ease, transform 1.2s var(--mo-ease); }
        .coach-main-card:hover .coach-main-img { transform: scale(1.03); }
        .contact-icon-box { transition: transform .35s var(--mo-ease); }
        .contact-detail-item:hover .contact-icon-box { transform: translateY(-3px); }
        .footer-link { transition: color .3s, transform .35s var(--mo-ease); }
        .footer-link:hover { transform: translateX(4px); }
    }
}
