/* Hide Ionic until it hydrates, to avoid a flash of un-upgraded components. */
body.loading ion-app {
    visibility: hidden;
}

body.ready ion-app {
    visibility: visible;
}

/*
 * Lightweight splash, rendered as plain HTML OUTSIDE ion-app so it paints
 * immediately. All real content lives inside ion-app/ion-content, which Ionic
 * (Stencil) keeps hidden until hydrated — without this, First/Largest
 * Contentful Paint would wait for the whole Ionic bundle to load and hydrate
 * (seconds under CPU/network throttling, sometimes reported as NO_FCP).
 * It shows the same hero image + logo as the page, then fades out when ready.
 */
.app-splash {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
}

/* Full-screen hero image as a real <img> so it qualifies as the LCP element
   (CSS background-images are ignored by LCP) and paints early (it is preloaded). */
.app-splash-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-splash::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.5);
}

.app-splash-logo {
    position: relative;
    z-index: 2;
    max-width: 70%;
    max-height: 40vh;
}

body.ready .app-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
