/* =========================================================
   WEDDING INTRO → HERO
   Refined transition
   ========================================================= */

.wedding-opening--hero-transition {
    position: fixed;

    inset: 0;

    z-index: 5000;

    display: grid;

    place-items: center;

    width: 100%;
    height: 100dvh;

    overflow: hidden;

    /*
     * Stesso nero presente ai bordi
     * dell'immagine della busta.
     */
    background: #010103;

    color: #eee9e4;

    isolation: isolate;

    will-change: opacity;
}

body.invitation-active .theme-toggle {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}

/* =========================================================
   TRIGGER
   ========================================================= */

.wedding-opening__trigger {
    position: relative;

    z-index: 10;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    width: min(100vw, 1664px);

    height: 100dvh;

    margin: 0;

    padding: 0;

    border: 0 !important;

    border-radius: 0;

    background: transparent !important;

    box-shadow: none !important;

    color: inherit;

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
}

html[data-theme="dark"] .wedding-opening__trigger,
html[data-theme="dark"] .wedding-opening__trigger:hover,
html[data-theme="dark"] .wedding-opening__trigger:active {
    border: 0 !important;

    background: transparent !important;

    box-shadow: none !important;
}

.wedding-opening__trigger:focus-visible {
    outline: 2px solid rgba(184, 162, 143, 0.75);

    outline-offset: -12px;
}

/* =========================================================
   ENVELOPE ART
   ========================================================= */

.wedding-opening__envelope-art {
    position: absolute;

    inset: 0;

    z-index: 1;

    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    object-position: center;

    pointer-events: none;

    user-select: none;

    -webkit-user-drag: none;

    will-change: transform, opacity, filter;
}

/* =========================================================
   SEAL GLOW
   ========================================================= */

.wedding-opening__seal-glow {
    position: absolute;

    z-index: 3;

    top: 53%;
    left: 50%;

    width: clamp(86px, 9vw, 138px);

    aspect-ratio: 1;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(255, 236, 194, 0.8) 0%,
        rgba(224, 177, 105, 0.34) 30%,
        rgba(224, 177, 105, 0) 70%
    );

    filter: blur(6px);

    transform: translate(-50%, -50%);

    mix-blend-mode: screen;

    pointer-events: none;

    will-change: transform, opacity;
}

/* =========================================================
   HINT
   ========================================================= */

.wedding-opening__hint {
    position: absolute;

    z-index: 4;

    left: 50%;

    bottom: max(34px, env(safe-area-inset-bottom));

    transform: translateX(-50%);

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 44px;

    padding: 9px 18px;

    border: 1px solid rgba(184, 162, 143, 0.24);

    border-radius: 999px;

    background: rgba(20, 19, 18, 0.72);

    color: #b8a28f;

    font-size: clamp(0.92rem, 1.5vw, 1.05rem);

    font-weight: 600;

    letter-spacing: 0.055em;

    line-height: 1;

    white-space: nowrap;

    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);

    backdrop-filter: blur(8px);

    -webkit-backdrop-filter: blur(8px);

    pointer-events: none;

    will-change: transform, opacity;
}

/* =========================================================
   CINEMATIC BLOOM
   ========================================================= */

/*
 * Rispetto alla versione precedente la luce parte
 * più piccola, più chiara e meno "marrone".
 *
 * La sua funzione è nascondere il cambio scena,
 * non colorare l'intero schermo.
 */

.wedding-opening__bloom {
    position: absolute;

    z-index: 20;

    top: 53%;
    left: 50%;

    width: 18vmin;

    aspect-ratio: 1;

    border-radius: 50%;

    background: radial-gradient(
        circle,
        rgba(255, 253, 246, 1) 0%,
        rgba(255, 236, 194, 0.98) 18%,
        rgba(232, 190, 122, 0.72) 42%,
        rgba(210, 159, 91, 0.22) 66%,
        rgba(210, 159, 91, 0) 82%
    );

    filter: blur(8px);

    transform: translate(-50%, -50%);

    pointer-events: none;

    will-change: transform, opacity;

    mix-blend-mode: screen;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {
    .wedding-opening__trigger {
        width: 100vw;
    }

    .wedding-opening__envelope-art {
        object-fit: contain;
    }

    .wedding-opening__seal-glow {
        top: 52.5%;

        width: clamp(70px, 18vw, 98px);
    }

    .wedding-opening__hint {
        bottom: max(22px, calc(env(safe-area-inset-bottom) + 10px));

        min-height: 42px;

        padding: 9px 16px;

        font-size: 0.9rem;
    }

    .wedding-opening__bloom {
        top: 52.5%;

        width: 24vmin;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .wedding-opening__envelope-art,
    .wedding-opening__hint,
    .wedding-opening__seal-glow,
    .wedding-opening__bloom {
        transition: none;
    }
}
