/* =====================================================================
   FAERI MODERN PRELOADER  (faeri-loader.css)
   Replaces the legacy css/loader.min.css ".cssload-loader" preloader.
   Self-contained: no external libs, no JS dependency for styling.
   Brand-styled (navy + cyan), aerospace/robotics orbital motif.
   Optimized for desktop + mobile, GPU-friendly (transform/opacity only),
   respects prefers-reduced-motion, and never blocks a JS-less page (see
   the <noscript> rule + the inline hide script in the markup).
   ===================================================================== */

.faeri-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 38%, #142255 0%, #0b1437 45%, #070b1f 100%);
    opacity: 1;
    visibility: visible;
    transition: opacity .6s ease, visibility 0s linear .6s;
    -webkit-font-smoothing: antialiased;
}

/* Hidden state — toggled by the inline script / custom.js on window load */
.faeri-loader.is-loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .6s ease, visibility 0s linear .6s;
}

.faeri-loader__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 4vw, 30px);
    padding: 24px;
    text-align: center;
}

/* ---- Orbital system (rings + logo + travelling dot) ---- */
.faeri-loader__orbit {
    position: relative;
    width: clamp(108px, 26vw, 156px);
    height: clamp(108px, 26vw, 156px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.faeri-loader__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #27c4e6;
    border-right-color: rgba(39, 196, 230, .35);
    animation: faeriSpin 1.15s linear infinite;
    box-shadow: 0 0 18px rgba(39, 196, 230, .15);
}

.faeri-loader__ring--2 {
    inset: clamp(14px, 3.4vw, 20px);
    border-top-color: transparent;
    border-bottom-color: #6ad9f0;
    border-left-color: rgba(106, 217, 240, .3);
    animation: faeriSpinRev 1.7s linear infinite;
    opacity: .85;
}

/* The orbiting "satellite" dot */
.faeri-loader__dot {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 9px;
    height: 9px;
    margin-left: -4.5px;
    border-radius: 50%;
    background: #27c4e6;
    box-shadow: 0 0 10px 2px rgba(39, 196, 230, .8);
    transform-origin: 50% calc(clamp(108px, 26vw, 156px) / 2 + 3px);
    animation: faeriSpin 1.9s linear infinite;
}

/* FAERI logo in the centre — loaded as CSS background so the path
   (../images/) resolves identically for root and /news-events/ pages. */
.faeri-loader__logo {
    width: 58%;
    height: 58%;
    background: url(../images/faeri-logo.png) center/contain no-repeat;
    filter: drop-shadow(0 0 8px rgba(39, 196, 230, .55));
    animation: faeriPulse 1.8s ease-in-out infinite;
}

/* ---- Indeterminate progress bar ---- */
.faeri-loader__bar {
    position: relative;
    width: clamp(140px, 40vw, 220px);
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .12);
    overflow: hidden;
}

.faeri-loader__bar span {
    position: absolute;
    left: -40%;
    top: 0;
    height: 100%;
    width: 40%;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, #27c4e6, #9be9f7, #27c4e6, transparent);
    animation: faeriBar 1.25s cubic-bezier(.65, .05, .36, 1) infinite;
}

/* ---- Wordmark ---- */
.faeri-loader__text {
    margin: 0;
    font-family: 'Rajdhani', 'Muli', sans-serif;
    font-weight: 700;
    letter-spacing: 6px;
    font-size: clamp(20px, 5vw, 26px);
    line-height: 1.1;
    color: #fff;
    text-indent: 6px; /* balance the letter-spacing visually */
}

.faeri-loader__text small {
    display: block;
    margin-top: 7px;
    font-family: 'Muli', sans-serif;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-indent: 1.5px;
    font-size: clamp(8.5px, 2.6vw, 10.5px);
    text-transform: uppercase;
    color: rgba(255, 255, 255, .6);
}

/* ---- Keyframes ---- */
@keyframes faeriSpin {
    to { transform: rotate(360deg); }
}
@keyframes faeriSpinRev {
    to { transform: rotate(-360deg); }
}
@keyframes faeriPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(39, 196, 230, .4)); transform: scale(1); }
    50%      { filter: drop-shadow(0 0 16px rgba(39, 196, 230, .85)); transform: scale(1.05); }
}
@keyframes faeriBar {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ---- Mobile fine-tuning ---- */
@media (max-width: 575px) {
    .faeri-loader__text { letter-spacing: 4px; }
    .faeri-loader__ring { border-width: 2px; }
}

/* ---- Accessibility: reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .faeri-loader__ring,
    .faeri-loader__ring--2,
    .faeri-loader__dot,
    .faeri-loader__logo,
    .faeri-loader__bar span {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
    .faeri-loader__ring { border-top-color: #27c4e6; border-right-color: #27c4e6; opacity: .6; }
    .faeri-loader__bar span { left: 30%; width: 40%; }
}

/* ---- No-JS fallback: never trap the user behind the overlay ---- */
.no-js .faeri-loader { display: none; }
