:root {
    --color-primary: #2d4a3e;
    --color-primary-dark: #1a332a;
    --color-background: #f5f0eb;
    --font-primary: 'Cormorant Garamond', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--color-background);
    font-family: var(--font-primary);
    overflow: hidden; /* Revisit after real device testing */
}

.scene {
    position: relative;
    width: 90vw;
    max-width: 600px;
    height: 90vh;
    height: 90dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tap Prompt (button reset + styling) */
.tap-prompt {
    position: absolute;
    z-index: 100;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: var(--color-primary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

.tap-prompt:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 2px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Envelope Front */
.envelope-front {
    position: absolute;
    width: 85%;
    z-index: 10;
}

.envelope-front img {
    width: 100%;
    height: auto;
    display: block;
}

.guest-name {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-style: italic;
    font-weight: 300;
    color: var(--color-primary);
    text-align: center;
    white-space: normal;
    width: 80%;
    line-height: 1.4;
}

/* Envelope Back (closed) */
.envelope-back-closed {
    position: absolute;
    width: 85%;
    z-index: 9;
    opacity: 0;
    backface-visibility: hidden;
}

.envelope-back-closed img {
    width: 100%;
    height: auto;
    display: block;
}

/* Envelope Back (open) — layered */
.envelope-layer-back {
    position: absolute;
    width: 85%;
    z-index: 8;
    opacity: 0;
}

.envelope-layer-back img {
    width: 100%;
    height: auto;
    display: block;
}

.envelope-layer-front {
    position: absolute;
    width: 85%;
    z-index: 10;
    opacity: 0;
}

.envelope-layer-front img {
    width: 100%;
    height: auto;
    display: block;
}

/* Contents Bundle */
.contents-bundle {
    position: absolute;
    width: 80%;
    z-index: 9;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.vellum-wrap {
    position: absolute;
    width: 100%;
    z-index: 3;
}

.vellum-wrap img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.85;
}

.invitation {
    position: absolute;
    width: 100%;
    z-index: 2;
    opacity: 0;
}

.invitation img {
    width: 100%;
    height: auto;
    display: block;
}

.details-card {
    position: absolute;
    width: 77%;
    z-index: 1;
    opacity: 0;
}

.details-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* CTA Button */
.cta-container {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    opacity: 0;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 32px;
    background-color: var(--color-primary);
    color: var(--color-background);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: var(--color-primary-dark);
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .scene {
        width: 95vw;
        height: 95vh;
        height: 95dvh;
    }

    .contents-bundle {
        width: 90%;
    }

    .vellum-wrap {
        width: 100%;
    }

    .invitation {
        width: 75%;
    }

    .details-card {
        width: 58%;
        z-index: 3;
    }

    .cta-button {
        font-size: 1.1rem;
        padding: 10px 20px;
        white-space: nowrap;
        letter-spacing: 0.08em;
    }
}
