/* ============================================
   GALAXY CAFÉ — 3D CINEMATIC INTRO / PRELOADER
   Self-contained overlay. Does not affect site styles.
   Theme: gold #C9A962 / cream #F5F0E8 / black #0A0A0A
   ============================================ */

#galaxy-intro {
    position: fixed;
    inset: 0;
    z-index: 20000; /* above existing #loading-screen (10000) */
    background: radial-gradient(ellipse at 50% 42%, #16120a 0%, #0A0A0A 68%, #040404 100%);
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    /* Cinematic exit: fade + gentle push-in + soft blur */
    transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.3s cubic-bezier(0.4, 0, 0.2, 1),
                filter 1.1s ease;
    overflow: hidden;
    touch-action: none;
    will-change: opacity, transform;
}

/* Breathing central glow behind the scene for warmth/depth */
#galaxy-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 46%,
                rgba(201, 169, 98, 0.16) 0%,
                rgba(201, 169, 98, 0.05) 28%,
                transparent 58%);
    animation: giBreathe 6s ease-in-out infinite;
}

@keyframes giBreathe {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

#galaxy-intro.gi-hidden {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(6px);
    visibility: hidden;
    pointer-events: none;
}

/* The Three.js canvas fills the overlay; fades in softly (no pop) */
#galaxy-intro-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#galaxy-intro.gi-ready #galaxy-intro-canvas {
    opacity: 1;
}

/* Vignette for cinematic framing (pure CSS, cheap) */
#galaxy-intro::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.6) 100%);
}

/* Skip button — corner, matches gold/cream luxury theme */
#galaxy-intro-skip {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 3;
    padding: 11px 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #E8D5A3;
    background: rgba(10, 10, 10, 0.35);
    border: 1px solid rgba(201, 169, 98, 0.55);
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: color .35s ease, background .35s ease,
                border-color .35s ease, box-shadow .35s ease, transform .35s ease;
    opacity: 0;
    animation: giSkipIn 1s ease 1.4s forwards;
}

#galaxy-intro-skip:hover {
    color: #0A0A0A;
    background: #C9A962;
    border-color: #C9A962;
    box-shadow: 0 0 28px rgba(201, 169, 98, 0.55);
    transform: translateY(-2px);
}

#galaxy-intro-skip:focus-visible {
    outline: 2px solid #E8D5A3;
    outline-offset: 3px;
}

#galaxy-intro-skip i {
    margin-left: 8px;
    font-size: 10px;
}

@keyframes giSkipIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Elegant caption that rises and fades in with the scene */
#galaxy-intro-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 34px;
    text-align: center;
    z-index: 2;
    font-family: 'Cormorant Garamond', serif;
    font-size: 15px;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(232, 213, 163, 0.0);
    pointer-events: none;
    animation: giCaptionIn 1.8s cubic-bezier(0.4, 0, 0.2, 1) 1.8s forwards;
}

@keyframes giCaptionIn {
    from { opacity: 0; transform: translateY(14px); letter-spacing: 2px; }
    to   { opacity: 1; transform: translateY(0);    letter-spacing: 5px;
           color: rgba(232, 213, 163, 0.7); }
}

/* Use the dynamic viewport unit where supported so the overlay always covers
   the full mobile screen even as the browser's URL bar shows/hides. Falls back
   to the fixed inset:0 above on browsers without dvh support. */
@supports (height: 100dvh) {
    #galaxy-intro { height: 100dvh; }
}

/* Mobile tuning */
@media (max-width: 600px) {
    #galaxy-intro-skip {
        bottom: 20px;
        right: 16px;
        padding: 9px 18px;
        font-size: 11px;
        letter-spacing: 2px;
    }
    #galaxy-intro-caption {
        font-size: 12px;
        letter-spacing: 3px;
        bottom: 66px;
    }
}

/* Very small / narrow phones: tighten chrome so it never crowds the scene. */
@media (max-width: 380px) {
    #galaxy-intro-skip {
        bottom: 16px;
        right: 12px;
        padding: 8px 14px;
        font-size: 10px;
        letter-spacing: 1.5px;
    }
    #galaxy-intro-caption {
        font-size: 11px;
        letter-spacing: 2px;
        bottom: 58px;
        padding: 0 14px;
    }
}

/* Short landscape phones: keep caption/skip compact and out of the scene's
   vertical center so the 3D framing stays clean. */
@media (max-height: 480px) and (orientation: landscape) {
    #galaxy-intro-skip {
        bottom: 12px;
        right: 14px;
        padding: 7px 14px;
        font-size: 10px;
    }
    #galaxy-intro-caption {
        bottom: 12px;
        font-size: 11px;
        letter-spacing: 3px;
    }
}

/* Respect users who prefer reduced motion: keep it static & short */
@media (prefers-reduced-motion: reduce) {
    #galaxy-intro::before { animation: none; }
    #galaxy-intro-skip { animation: none; opacity: 1; }
    #galaxy-intro-caption { animation: none; opacity: 0.7; color: rgba(232,213,163,0.7); }
}
