/* Every mode's loading cover (src/ui/cinematic-loading-overlay.js) speaks the boot loading
   screen's language: the opening world's first frame (the void, the light rising from below,
   stars, motes, a breathing halo), the mode's name in the logo's lettering, a guide to breathe by
   and a progress line that follows the mode's real entry milestones. The parts are shared with
   the boot (main.css: .sb-void-*, .sb-breath-guide, .sb-progress-line); this file lays the cover
   out. Motion is transform/opacity only, so it keeps moving while the mode compiles (ADR-0020). */
.cinematic-loading {
    /* The world's breath: in 4 s, out 6 s, starting with the cover. */
    --sb-breath: 10s;
    --sb-breath-delay: 0s;
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    color: #d7e6ee;
    font-family: 'Space Mono', monospace;
    pointer-events: auto;
    user-select: none;
}
.cinematic-loading__backdrop {
    position: absolute;
    inset: 0;
    background: var(--sb-void-sky);
}
.cinematic-loading__sky { position: absolute; inset: 0; pointer-events: none; }
.cinematic-loading__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(92vw, 620px);
    transform: translateY(-8px);
    text-align: center;
}
.cinematic-loading__glow { inset: -34vh -26vw; }
/* The name arrives as the boot's logo does: a short rise into place, then a slow pulse. */
.cinematic-loading__title,
.cinematic-loading__variant,
.cinematic-loading__tagline {
    animation: cinematic-loading-arrive 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cinematic-loading__variant,
.cinematic-loading__tagline { animation-delay: 0.18s; }
.cinematic-loading__title {
    position: relative;
    margin: 0;
    width: min(360px, 74vw, 70svh);
    max-width: 100%;
    color: #e6eef4;
    font: 800 clamp(28px, 5vw, 60px) / 1.15 var(--sb-font-display, 'Orbitron', sans-serif);
    letter-spacing: 0.02em;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}
.cinematic-loading__title--wide { width: min(520px, 82vw, 108svh); }
.cinematic-loading__wordmark {
    display: block;
    width: 100%;
    height: auto;
    transform-origin: center;
    animation: sb-wordmark-pulse var(--sb-logo-pulse-duration, 2.8s) ease-in-out infinite;
    will-change: transform, opacity;
}
.cinematic-loading__tagline {
    position: relative;
    margin: 32px 0 0;
    color: #c8d6e6;
    font-size: clamp(8px, 1vw, 10px);
    letter-spacing: 0.24em;
    word-spacing: 0.12em;
    text-indent: 0.24em;
    text-transform: uppercase;
    white-space: nowrap;
}
.cinematic-loading__variant {
    position: relative;
    color: #fff6e9b8;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
    text-transform: uppercase;
}
.cinematic-loading__variant { margin: 22px 0 0; }
.cinematic-loading__variant + .cinematic-loading__tagline { margin-top: 16px; color: #aabbd0; }
.cinematic-loading__footer {
    position: absolute;
    bottom: max(9%, env(safe-area-inset-bottom));
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.cinematic-loading[data-phase='countdown'] .cinematic-loading__footer {
    opacity: 0;
    transition: opacity 220ms ease-out;
}
@keyframes cinematic-loading-arrive {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
    .cinematic-loading__glow { inset: -30vh -40vw; }
    .cinematic-loading__tagline { font-size: 9px; }
}
@media (max-height: 540px) {
    .cinematic-loading__title { width: min(280px, 60vw, 50svh); }
    .cinematic-loading__title--wide { width: min(420px, 82vw, 100svh); }
    .cinematic-loading__content { transform: translateY(-22px); }
    .cinematic-loading__tagline { margin-top: 12px; font-size: 8px; }
    .cinematic-loading__variant { margin-top: 10px; font-size: 8px; }
    .cinematic-loading__variant + .cinematic-loading__tagline { margin-top: 10px; }
    .cinematic-loading__footer { bottom: 6%; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .cinematic-loading *, .cinematic-loading *::before, .cinematic-loading *::after {
        animation: none !important;
        transition: none !important;
    }
}
