/* Royal Capital Solutions, design system v2: site loader
   A plain deep-green curtain with the name, a short hairline progress bar
   and one status line. Built by js/loader.js, which only creates it on the
   first page of a visit. Never blocks loading: the page renders underneath.

   CONTENTS
   1. Curtain
   2. Name, bar and status
   3. Exit
   4. Preview note (?loader=loop only)
   5. Reduced motion
   ============================================================ */

html.rc-loading { overflow: hidden; }

/* ============================================================
   1. CURTAIN
   ============================================================ */
.rcl {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: var(--surface-deep, #062A19);
    color: var(--text-on-deep, #fff);
    font-family: var(--font, "Geist", "Helvetica Neue", Helvetica, sans-serif);
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   2. NAME, BAR AND STATUS
   ============================================================ */
.rcl-box {
    display: grid;
    justify-items: center;
    gap: 0.875rem;
    padding: 0 var(--gutter, 1.5rem);
    text-align: center;
}
.rcl-name {
    margin: 0;
    font-size: clamp(1.125rem, 0.95rem + 0.8vw, 1.5rem);
    font-weight: 500;
    letter-spacing: var(--tr-ui, -0.01em);
    line-height: 1.2;
}
.rcl-bar {
    position: relative;
    width: 8rem;
    height: 1px;
    background: rgb(255 255 255 / 0.14);
    overflow: hidden;
}
.rcl-bar i {
    position: absolute;
    inset: 0;
    background: var(--g-400, #5BC48A);
    transform-origin: 0 50%;
    /* --p is 0 to 100, set by js/loader.js */
    transform: scaleX(calc(var(--p, 0) / 100));
}
.rcl-status {
    margin: 0;
    min-height: 1.2em;
    font-size: var(--fs-xs, 0.8125rem);
    color: var(--text-on-deep-2, #B9C9BF);
    transition: opacity 160ms var(--ease, cubic-bezier(0.23, 1, 0.32, 1));
}
.rcl-status.is-swap { opacity: 0; }

/* ============================================================
   3. EXIT: a quiet fade
   ============================================================ */
.rcl.is-out {
    opacity: 0;
    transition: opacity 320ms var(--ease, cubic-bezier(0.23, 1, 0.32, 1));
    pointer-events: none;
}

/* ============================================================
   4. PREVIEW NOTE: only in ?loader=loop, says what is being simulated
   ============================================================ */
.rcl-note {
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 10001;
    transform: translateX(-50%);
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.72);
    color: #fff;
    font: 500 0.75rem/1.3 var(--font-mono, ui-monospace, Menlo, monospace);
    white-space: nowrap;
    pointer-events: none;
}

/* ============================================================
   5. REDUCED MOTION: no bar movement or fades between words
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .rcl-status { transition: none; }
    .rcl.is-out { transition: opacity 120ms linear; }
}
