:root {
    --sage: #8A9A86;
    --sage-light: #E8EDE7;
    --gold: #D4AF37;
    --text-dark: #2C3E2D;
}

body {
    font-family: 'Lora', serif;
    background-color: #FAFAFA;
    color: var(--text-dark);
    overflow-x: hidden;
}

.font-cursive { font-family: 'Great Vibes', cursive; }
.font-serif { font-family: 'Cinzel', serif; }

/* --- Envelope Opening Animation --- */
#envelope {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: linear-gradient(135deg, #E8EDE7 0%, #D1DDD0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.5s cubic-bezier(0.6, 0.05, 0.15, 0.95), opacity 1.5s ease;
}

.envelope-content {
    background: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--sage);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 90%;
    width: 350px;
    position: relative;
}

.envelope-content::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 1px dashed var(--sage);
    pointer-events: none;
    border-radius: 6px;
}

#envelope.open {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* --- Backgrounds --- */
.hero-bg {
    /* Prefer a local hero image if present (assets/images/hero.jpg). If not, fall back to the Unsplash image. */
    background: linear-gradient(rgba(240, 244, 239, 0.7), rgba(240, 244, 239, 0.9)), 
                url('assets/images/hero.jpg'),
                url('https://images.unsplash.com/photo-1515934751635-c81c6bc9a2d8?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.section-pattern {
    background-color: var(--sage-light);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238a9a86' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- Buttons --- */
.btn-sage {
    background-color: var(--sage);
    color: white;
    transition: all 0.3s ease;
}
.btn-sage:hover {
    background-color: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(138, 154, 134, 0.3);
}

/* --- Floating Leaves --- */
.leaf {
    position: fixed;
    pointer-events: none;
    z-index: 40;
    opacity: 0.6;
    animation: floatDown linear forwards;
}
@keyframes floatDown {
    0% { transform: translateY(-10vh) rotate(0deg) scale(0.8); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(110vh) rotate(360deg) scale(1.2); opacity: 0; }
}

/* --- Fade In Animation --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Music Button */
.music-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 45;
    background: white;
    border: 2px solid var(--sage);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    color: var(--sage);
    cursor: pointer;
    transition: 0.3s;
}
.music-btn:hover { background: var(--sage-light); }

/* --- Mobile-only overrides --- */
/* Constrain layout to a mobile viewport so desktop shows the phone view */
html, body {
    max-width: 420px;
    margin: 0 auto;
    box-shadow: none;
}

/* Prevent large background fixed behaviour on desktop */
.hero-bg { background-attachment: scroll !important; }

/* Force single-column grid for event details */
.section-pattern .grid { grid-template-columns: 1fr !important; }

/* Hide elements that are shown only on md+/desktop */
.md\:block, .hidden.md\:block { display: none !important; }

/* Mobile-friendly typography overrides (force mobile sizes even on desktop) */
header .font-serif { font-size: 28px !important; }
.font-cursive { font-size: 36px !important; }
.font-cursive[class*="text-6xl"] { font-size: 36px !important; }

/* Envelope content width for small screens */
.envelope-content { width: 90% !important; max-width: 360px; }

/* Make buttons touch-friendly */
.btn-sage, .music-btn, a { touch-action: manipulation; }

/* Ensure countdown items wrap nicely */
.grid.grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }


