/* ══════════════════════════════════════════════
   ENVELOPE FADE — image-based, no flap animation
══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }

/* ── Stage ──────────────────────────────────── */
body {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    overflow: hidden;
    background: radial-gradient(ellipse 80% 58% at 50% 42%, #1e0810 0%, #080103 72%);
    opacity: 0;
    animation: stageFade 1.8s ease 0.15s forwards;
}
@keyframes stageFade { to { opacity: 1; } }

/* ── Particles ──────────────────────────────── */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: particleDrift linear infinite;
}
@keyframes particleDrift {
    0%   { transform: translateY(110vh); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { transform: translateY(-10vh); opacity: 0; }
}

/* ── Intro text ─────────────────────────────── */
.intro-label {
    z-index: 1;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(9px, 2vw, 12px);
    font-weight: 300;
    letter-spacing: 7px;
    text-transform: uppercase;
    color: rgba(220, 190, 162, 0.60);
    opacity: 0;
    animation: stageFade 1.4s ease 1.2s forwards;
    user-select: none;
}

.intro-names {
    z-index: 1;
    font-family: 'Great Vibes', cursive;
    font-size: clamp(30px, 6.5vw, 52px);
    color: rgba(242, 218, 188, 0.90);
    line-height: 1;
    opacity: 0;
    animation: stageFade 1.4s ease 1.6s forwards;
    user-select: none;
}
.intro-names em {
    font-style: italic;
    font-size: 0.82em;
    color: rgba(201, 162, 85, 0.75);
}

/* ── Envelope wrapper ───────────────────────── */
.env-wrap {
    position: relative;
    z-index: 1;
    width: clamp(280px, 80vw, 580px);
    opacity: 0;
    transform: translateY(28px) scale(0.97);
    animation: envReveal 2.2s cubic-bezier(0.34, 1.08, 0.64, 1) 0.9s forwards;
    /* warm glow under the envelope */
    filter:
        drop-shadow(0 22px 60px rgba(0,0,0,0.82))
        drop-shadow(0 0 50px rgba(90,8,20,0.38));
    transition: filter 0.7s ease, transform 0.7s ease;
}
@keyframes envReveal { to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Envelope image ─────────────────────────── */
.env-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
    user-select: none;
    pointer-events: none;
}

/* ── Wax seal hit target ────────────────────── */
/*
   The seal in Envelope.png sits at ~50% from left
   and ~56% from top of the image.
   Width ≈ 13% of the image width.
*/
.seal-btn {
    position: absolute;
    inset: 0;
    border-radius: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.seal-btn:focus-visible { outline: none; }

.seal-btn.clicked { pointer-events: none; }

/* Envelope brightens on open */
.env-wrap.opening {
    filter:
        drop-shadow(0 22px 60px rgba(0,0,0,0.82))
        drop-shadow(0 0 90px rgba(201,162,85,0.45));
    transform: scale(1.012);
}

/* ── Hint text ──────────────────────────────── */
.hint {
    z-index: 1;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(9px, 2vw, 11px);
    font-weight: 300;
    letter-spacing: 7px;
    text-transform: uppercase;
    color: rgba(212, 174, 148, 0.50);
    opacity: 0;
    animation: hintAppear 1.4s ease 4s forwards;
    user-select: none;
}
@keyframes hintAppear { to { opacity: 1; } }
.hint.hidden { opacity: 0 !important; pointer-events: none; }

/* ── Exit fade ──────────────────────────────── */
body.exit { animation: exitFade 1s ease forwards !important; }
@keyframes exitFade { to { opacity: 0; } }

/* ── Mobile ─────────────────────────────────── */
@media (max-width: 480px) {
    body { gap: 16px; }
    .hint { letter-spacing: 4px; }
}
