/* =========================================================
   MYFUNADS — SITE LOADER
   Full-screen loader shown while a page loads (markup at the
   top of each page's <body>, behaviour in js/loader.js).

   1. running   orbit + running light while the page loads
   2. is-ready  the orbit collapses and the logo appears
   3. is-zooming the logo zooms in while a hole opens from the
                centre of the screen onto the page
   It is only visible while <html> has .mfa-loading (set by
   js/loader.js), so without JavaScript it never shows.
========================================================= */

/* animatable radius for the reveal hole */
@property --mfa-hole {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
}

.mfa-loader {
    display: none;
}

html.mfa-loading .mfa-loader,
.mfa-loader.is-zooming {
    display: grid;
}

.mfa-loader {
    --mfa-reveal: .9s;
    --mfa-zoom: .95s;
    position: fixed;
    inset: 0;
    z-index: 100010;            /* above the navbar (99999) and its menu */
    place-items: center;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse 46% 38% at 50% 48%, rgba(244, 123, 32, .17), transparent 70%),
        radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.4px) 0 0 / 26px 26px,
        #070505;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.mfa-loader-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(560px, 80vw);
    aspect-ratio: 2048 / 768;
}

/* ---- 1. running ---- */

.mfa-loader-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 116px;
    height: 116px;
    margin: -58px 0 0 -58px;
    transition: opacity .4s ease, transform .5s cubic-bezier(.16, 1, .3, 1);
}

.mfa-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
}

.mfa-loader-ring--inner {
    inset: 24px;
    border: 1.5px dashed rgba(244, 123, 32, .5);
}

.mfa-loader-comet {
    position: absolute;
    inset: -1px;
}

/* the running arc: a conic gradient kept to a thin ring */
.mfa-loader-comet i {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 58%, rgba(244, 123, 32, .18) 70%, #f47b20 92%, #ffd2a6 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}

/* its glowing head */
.mfa-loader-comet b {
    position: absolute;
    left: 50%;
    top: -3px;
    width: 9px;
    height: 9px;
    margin-left: -4.5px;
    border-radius: 50%;
    background: #fff1e0;
    box-shadow: 0 0 14px 3px rgba(244, 123, 32, .9);
}

.mfa-loader-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: #f47b20;
    box-shadow: 0 0 0 6px rgba(244, 123, 32, .15), 0 0 24px rgba(244, 123, 32, .8);
}

.mfa-loader-status {
    position: absolute;
    left: 50%;
    top: calc(50% + 92px);
    display: grid;
    justify-items: center;
    gap: 14px;
    translate: -50% 0;
    transition: opacity .3s ease, transform .4s ease;
}

.mfa-loader-bar {
    position: relative;
    width: min(200px, 50vw);
    height: 2px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, .1);
}

.mfa-loader-bar i {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, #f47b20, #ffd2a6, transparent);
    transform: translateX(-100%);
}

.mfa-loader-label {
    margin: 0;
    font: 700 10.5px/1 Inter, Arial, sans-serif;
    letter-spacing: .42em;
    text-indent: .42em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

/* ---- 2. logo ---- */

.mfa-loader-flare {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    translate: -50% -50%;
    background: radial-gradient(circle, rgba(244, 123, 32, .45), transparent 65%);
    opacity: 0;
    transform: scale(.4);
}

.mfa-loader-logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* the logo artwork sits on black: screen blending lets the
       loader background show through it, and the soft mask
       hides the faint glow along the artwork's edges */
    mix-blend-mode: screen;
    filter: contrast(1.3);
    -webkit-mask-image:
        linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%),
        linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%),
        linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-composite: intersect;
    opacity: 0;
    transform: scale(.86);
}

.mfa-loader.is-ready .mfa-loader-orbit {
    opacity: 0;
    transform: scale(.5);
}

.mfa-loader.is-ready .mfa-loader-status {
    opacity: 0;
    transform: translateY(8px);
}

.mfa-loader.is-ready .mfa-loader-logo {
    opacity: 1;
    transform: scale(1);
    transition:
        opacity calc(var(--mfa-reveal) * .7) ease calc(var(--mfa-reveal) * .12),
        transform var(--mfa-reveal) cubic-bezier(.16, 1, .3, 1) calc(var(--mfa-reveal) * .12);
}

.mfa-loader.is-ready .mfa-loader-flare {
    opacity: 1;
    transform: scale(1);
    transition:
        opacity calc(var(--mfa-reveal) * .6) ease,
        transform var(--mfa-reveal) cubic-bezier(.16, 1, .3, 1);
}

/* ---- 3. zoom through the logo onto the page ---- */

.mfa-loader.is-zooming {
    --mfa-hole: 150vmax;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--mfa-hole), #000 calc(var(--mfa-hole) + 1px));
    mask-image: radial-gradient(circle at 50% 50%, transparent var(--mfa-hole), #000 calc(var(--mfa-hole) + 1px));
    opacity: 0;
    pointer-events: none;
    /* the logo starts zooming first; the hole opens a beat later */
    transition:
        --mfa-hole calc(var(--mfa-zoom) * .7) cubic-bezier(.55, 0, .2, 1) calc(var(--mfa-zoom) * .3),
        opacity calc(var(--mfa-zoom) * .3) ease calc(var(--mfa-zoom) * .7);
}

.mfa-loader.is-zooming .mfa-loader-logo {
    opacity: 0;
    transform: scale(7);
    transition:
        transform var(--mfa-zoom) cubic-bezier(.6, 0, .15, 1),
        opacity calc(var(--mfa-zoom) * .4) ease calc(var(--mfa-zoom) * .5);
}

.mfa-loader.is-zooming .mfa-loader-flare {
    opacity: 0;
    transform: scale(3);
    transition:
        transform var(--mfa-zoom) cubic-bezier(.7, 0, .2, 1),
        opacity calc(var(--mfa-zoom) * .5) ease;
}

/* ---- motion ---- */

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

    .mfa-loader-comet {
        animation: mfaSpin 1.1s linear infinite;
    }

    .mfa-loader-ring--inner {
        animation: mfaSpin 3.2s linear infinite reverse;
    }

    .mfa-loader-core {
        animation: mfaPulse 1.2s ease-in-out infinite alternate;
    }

    .mfa-loader-bar i {
        animation: mfaRun 1.15s cubic-bezier(.6, 0, .4, 1) infinite;
    }
}

@keyframes mfaSpin {
    to {
        rotate: 360deg;
    }
}

@keyframes mfaPulse {
    to {
        transform: scale(1.35);
        opacity: .75;
    }
}

@keyframes mfaRun {
    to {
        transform: translateX(250%);
    }
}

/* reduced motion: no zoom or hole, just a short fade */
@media (prefers-reduced-motion: reduce) {

    .mfa-loader *,
    .mfa-loader {
        transition-duration: .01ms !important;
    }

    .mfa-loader.is-zooming {
        -webkit-mask-image: none;
        mask-image: none;
        transition: opacity .3s ease !important;
    }

    .mfa-loader.is-zooming .mfa-loader-logo,
    .mfa-loader.is-zooming .mfa-loader-flare {
        transform: none;
    }
}


/* =====================================================
   HOLD HERO ENTRANCES UNTIL THE LOADER LEAVES
   The homepage hero and the inner-page heroes animate in
   on load; pause them while the loader covers the page so
   they play as it zooms away.
===================================================== */

html.mfa-loading .hero,
html.mfa-loading .hero *,
html.mfa-loading .pg-hero,
html.mfa-loading .pg-hero * {
    animation-play-state: paused !important;
}
