:root {
    /* Fondo Claro / Romántico */
    --bg-color: #faf9f5;
    --bg-card: #ffffff;
    /* Texto Oscuro para contraste */
    --text-color: #4a4a4a;
    --text-muted: #888888;
    
    /* Acentos Verde Esmeralda y Dorado */
    --accent-emerald: #046B4D;
    --accent-emerald-light: #0A8F6A;
    --accent-emerald-pale: #a8d8c8;
    --accent-gold: #d4af37;
    --accent-gold-light: #e8d5a3;
    
    --white: #ffffff;
    --dark: #2c3e38;
    --envelope-color: #ffffff;
    
    --font-script: 'Great Vibes', cursive;
    --font-serif: 'Cormorant Garamond', serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: linear-gradient(135deg, #fdfcfb 0%, #f4f1ea 50%, #fdfcfb 100%);
    color: var(--text-color);
    font-family: var(--font-serif);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ===== ENVELOPE / LETTER CARD ===== */
.envelope-wrapper {
    position: relative;
    width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    perspective: 1200px;
    z-index: 100;
    background: radial-gradient(ellipse at center, #fdfbf7 0%, #ebe7de 100%);
}

.envelope {
    position: relative;
    width: 550px; height: 380px;
    background: #ffffff;
    box-shadow:
        0 15px 40px rgba(0,0,0,0.08),
        0 0 20px rgba(212,175,55,0.1);
    transition: all 1.5s ease-in-out;
    transform-style: preserve-3d;
    z-index: 50;
    display: flex; justify-content: center; align-items: center;
    border: 1px solid rgba(212,175,55,0.3);
    border-radius: 6px;
}

/* Inner content of the envelope card */
.envelope-inner {
    position: relative; z-index: 45;
    text-align: center;
    padding: 30px;
}
.envelope-border {
    position: absolute; inset: 12px;
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 4px;
    pointer-events: none;
}
.envelope-header {
    font-family: var(--font-serif);
    font-size: 0.8rem; letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--accent-emerald);
    margin-bottom: 15px; opacity: 0.9;
}
.envelope-names {
    font-family: var(--font-script);
    font-size: 3.2rem;
    color: var(--accent-gold);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 8px; line-height: 1.2;
}
.envelope-date {
    font-family: var(--font-serif);
    font-size: 0.9rem; letter-spacing: 3px;
    color: var(--accent-emerald);
    opacity: 0.8;
}

/* Wax seal */
.wax-seal {
    width: 130px; height: 130px;
    position: absolute; bottom: -40px; left: 50%;
    transform: translateX(-50%);
    z-index: 100; cursor: pointer;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    animation: sealPulse 2.5s ease-in-out infinite;
}

@keyframes sealPulse {
    0%, 100% { filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2)); }
    50% { filter: drop-shadow(0 8px 15px rgba(212,175,55,0.4)); }
}

.wax-seal:hover { transform: translateX(-50%) scale(1.08); }

.seal-label {
    position: absolute; bottom: -75px; left: 50%;
    transform: translateX(-50%);
    color: var(--accent-emerald);
    font-size: 0.8rem; letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 101;
    animation: bounceLabel 2s ease-in-out infinite;
    font-family: var(--font-serif);
    opacity: 0.8; white-space: nowrap;
}
@keyframes bounceLabel {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-4px); }
}

.flap {
    position: absolute; top: 0; left: 0;
    width: 0; height: 0;
    border-left: 275px solid transparent;
    border-right: 275px solid transparent;
    border-top: 190px solid #f8f8f8;
    transform-origin: top;
    transition: transform 1s ease 0.5s, opacity 0.8s ease 0.5s;
    z-index: 60;
    display: none;
}

.pocket {
    position: absolute; bottom: 0; left: 0;
    width: 0; height: 0;
    border-left: 275px solid transparent;
    border-right: 275px solid transparent;
    border-bottom: 190px solid var(--envelope-color);
    z-index: 55;
    display: none;
}

/* ===== INVITATION CONTENT ===== */
.invitation-content {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: flex-start;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.8) translateY(50px);
    transition: all 1s ease 1s;
    z-index: 40;
    pointer-events: none;
}

.invitation-content::-webkit-scrollbar { width: 6px; }
.invitation-content::-webkit-scrollbar-track { background: var(--bg-color); }
.invitation-content::-webkit-scrollbar-thumb { background: var(--accent-gold); border-radius: 3px; }

/* OPEN STATES */
.envelope-wrapper.open .envelope {
    transform: scale(0.8) translateY(-60px);
    opacity: 0;
    pointer-events: none;
}
.envelope-wrapper.open .wax-seal { opacity: 0; transform: translateX(-50%) scale(0.5); }
.envelope-wrapper.open .seal-label { opacity: 0; }
.envelope-wrapper.open .envelope-inner { opacity: 0; }

.envelope-wrapper.open ~ .invitation-content {
    opacity: 1; transform: scale(1) translateY(0);
    pointer-events: auto; z-index: 200;
    position: fixed;
    background: linear-gradient(180deg, #fdfcfb 0%, #f4f1ea 100%);
    height: 100vh; padding: 0;
}

.envelope-wrapper.open ~ .invitation-content .invitation-container {
    margin: 0 auto 50px auto;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.2s;
}

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

/* ===== INVITATION CONTAINER ===== */
.invitation-container {
    background: #ffffff;
    width: 100%; max-width: 700px;
    padding: 50px 50px 60px;
    text-align: center;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0,0,0,0.03);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, .signature-names { font-family: var(--font-script); font-weight: 400; color: var(--accent-gold); }
p { font-size: 1.2rem; line-height: 1.7; margin-bottom: 20px; letter-spacing: 0.5px; color: var(--text-color); }

.section-title {
    font-family: var(--font-script);
    font-size: 2.8rem;
    color: var(--accent-emerald);
    margin-bottom: 25px; margin-top: 0;
    font-weight: 400;
}

/* ===== DECORATIVE DIVIDER ===== */
.divider {
    width: 200px; height: 1px; margin: 40px auto;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    position: relative;
}
.divider::after {
    content: '✦'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-gold); font-size: 0.8rem;
    background: var(--bg-card); padding: 0 10px;
}

/* ===== HEADER ===== */
.intro-text {
    font-family: var(--font-serif);
    font-size: 1.4rem; margin: 60px auto 20px auto;
    color: var(--accent-emerald);
    line-height: 1.6; max-width: 85%;
    position: relative; z-index: 2;
    font-style: italic;
    letter-spacing: 0.5px;
}

.sub-intro {
    text-transform: uppercase;
    letter-spacing: 4px; font-size: 0.85rem;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--accent-gold-light);
    display: inline-block; padding-bottom: 12px;
    color: var(--text-muted);
}

/* ===== NAMES ===== */
.names-section { margin-bottom: 40px; }

.names {
    font-size: 4.2rem; line-height: 1.2;
    margin: 20px 0;
    color: var(--accent-emerald);
}

.ampersand {
    font-size: 2.8rem; color: var(--accent-gold);
    display: block; margin: 15px 0;
    font-family: var(--font-script);
}

.full-names {
    font-size: 1rem; letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-color); margin-top: 10px;
    opacity: 0.9;
}

/* ===== HERO PHOTO ===== */
.hero-photo {
    width: 260px; height: 260px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 65% 25%; /* 65% horizontal para centrar al novio, 25% vertical para los rostros */
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--accent-gold), 0 10px 30px rgba(0,0,0,0.1);
    margin: 30px auto; display: block;
}

/* ===== DETAILS ===== */
.date-time {
    font-size: 1.3rem; margin: 40px auto;
    padding: 25px 15px;
    border-top: 1px solid var(--accent-gold-light);
    border-bottom: 1px solid var(--accent-gold-light);
    background: #faf9f5;
    border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    gap: 30px; width: 85%; color: var(--accent-emerald);
}

.dt-item { display: flex; align-items: center; gap: 8px; }
.icon { font-size: 1.2rem; opacity: 0.9; }

.venue {
    font-family: var(--font-script);
    font-size: 2.2rem !important; color: var(--accent-gold) !important;
    margin-bottom: 5px !important;
}

.address { font-size: 1rem; color: var(--text-muted); margin-bottom: 15px; }

.btn-maps {
    display: inline-block; text-decoration: none;
    color: var(--accent-emerald); border: 1px solid var(--accent-emerald);
    padding: 10px 25px; border-radius: 25px;
    font-size: 0.85rem; letter-spacing: 1px;
    transition: all 0.4s ease;
    text-transform: uppercase;
    background: transparent;
}
.btn-maps:hover { background: var(--accent-emerald); color: var(--white); }

/* ===== COUNTDOWN ===== */
.countdown-section { margin: 50px 0; }
.countdown {
    display: flex; justify-content: center; gap: 20px;
    margin-top: 25px; flex-wrap: wrap;
}
.countdown-item {
    background: #ffffff;
    border: 1px solid rgba(212,175,55,0.3);
    border-top: 3px solid var(--accent-emerald);
    border-radius: 12px; padding: 20px 15px;
    min-width: 80px; text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.countdown-number {
    font-family: var(--font-script);
    font-size: 2.5rem; color: var(--accent-emerald);
    display: block; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.countdown-label {
    font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--text-muted);
    margin-top: 8px; display: block;
}

/* ===== DRESS CODE ===== */
.dress-code { margin: 50px 0; }
.code-type {
    text-transform: uppercase; letter-spacing: 3px;
    margin-bottom: 25px; font-weight: 600;
    color: var(--accent-gold); font-size: 0.95rem;
}
.dress-icons { display: flex; justify-content: center; gap: 50px; flex-wrap: wrap; margin-bottom: 20px; }
.dress-item { text-align: center; }
.dress-item .dress-icon-img { font-size: 3rem; margin-bottom: 10px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.dress-label { font-weight: bold; margin-bottom: 5px; color: var(--accent-emerald); font-size: 1.1rem; }
.dress-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.4; }

.color-restriction {
    display: inline-block; margin-top: 15px;
    background: #fdfcfb;
    border: 1px solid rgba(212,175,55,0.4);
    padding: 12px 28px; border-radius: 20px;
    font-size: 0.9rem; color: var(--text-color);
}
.color-dots { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }
.color-dot {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* ===== GALLERY ===== */
.gallery-section { margin: 50px 0; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; margin-top: 25px;
}
.gallery-item {
    width: 100%; aspect-ratio: 1;
    object-fit: cover; border-radius: 8px;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}
.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(4,107,77,0.15);
    z-index: 2;
}
.gallery-item.featured {
    grid-column: span 2;
    aspect-ratio: 16/9;
}

/* Lightbox */
.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(255,255,255,0.95); z-index: 9999;
    justify-content: center; align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox.active { display: flex; animation: fadeIn 0.3s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
    max-width: 90%; max-height: 90vh;
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.lightbox.active img { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 20px; right: 30px;
    font-size: 2.5rem; color: var(--accent-emerald);
    cursor: pointer; z-index: 10000;
    opacity: 0.7; transition: opacity 0.3s ease;
    line-height: 1;
}
.lightbox-close:hover { opacity: 1; }

/* ===== HASHTAG ===== */
.hashtag-section { margin: 40px 0; }
.hashtag {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--accent-gold);
    letter-spacing: 1px;
}

/* ===== FOOTER ===== */
.footer { position: relative; z-index: 10; margin-top: 50px; }

.signature-intro {
    font-family: var(--font-script);
    font-size: 2rem; margin-bottom: 5px;
    color: var(--accent-emerald);
}
.signature-names { font-size: 3rem; margin-bottom: 20px; color: var(--accent-gold); }

.final-msg {
    font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 2px; margin-bottom: 40px;
    color: var(--text-muted);
}

.closing-phrase {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--accent-emerald);
    max-width: 85%;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.actions { display: flex; justify-content: center; gap: 15px; margin-top: 30px; flex-wrap: wrap; }

.btn {
    text-decoration: none; color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald);
    padding: 14px 28px; border-radius: 30px;
    transition: all 0.4s ease;
    text-transform: uppercase; letter-spacing: 2px;
    font-size: 0.8rem; background: transparent;
    font-family: var(--font-serif);
}
.btn:hover { background: var(--accent-emerald); color: var(--white); }
.btn-primary {
    background: var(--accent-emerald);
    color: var(--white); border-color: var(--accent-emerald);
    font-weight: 600;
}
.btn-primary:hover {
    background: #035c42;
    box-shadow: 0 4px 15px rgba(4,107,77,0.2);
}
.btn-gold { border-color: var(--accent-gold); color: var(--accent-gold); }
.btn-gold:hover { background: var(--accent-gold); color: var(--white); }

/* ===== FLORAL CORNERS ===== */
.floral-corner {
    position: absolute; width: 280px; height: 280px;
    pointer-events: none; z-index: 1;
    overflow: hidden;
}
.floral-corner img {
    width: 100%; height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply; /* Crucial para fondo claro */
    opacity: 0.9;
}
.top-left { top: -10px; left: -10px; }
.top-right { display: none; }
.bottom-left { display: none; }
.bottom-right {
    bottom: -10px; right: -10px;
    transform: rotate(180deg);
}

/* ===== PARTICLES ===== */
.particles {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute; width: 4px; height: 4px;
    background: var(--accent-gold); border-radius: 50%;
    opacity: 0;
    animation: floatUp linear infinite;
    box-shadow: 0 0 6px rgba(212,175,55,0.4);
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1.5); }
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== MUSIC CONTROL ===== */
.music-control {
    position: fixed; bottom: 20px; right: 20px;
    width: 50px; height: 50px;
    background: #ffffff;
    color: var(--accent-emerald); border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(4,107,77,0.2);
    cursor: pointer; font-size: 1.5rem;
    opacity: 0; transition: opacity 1s ease, transform 0.3s ease;
    pointer-events: none;
}
.music-control.visible { opacity: 1; pointer-events: auto; }
.music-control:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(4,107,77,0.15); }

.hidden-player {
    position: fixed; top: -9999px; left: -9999px;
    width: 1px; height: 1px; overflow: hidden;
    opacity: 0.001; pointer-events: none;
    z-index: -9999; visibility: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .names { font-size: 3.2rem; }
    .invitation-container { padding: 40px 20px 50px; }
    .floral-corner { width: 200px; height: 200px; }
    .top-left { top: -10px; left: -10px; }
    .bottom-right { bottom: -10px; right: -10px; }
    .date-time { flex-direction: column; gap: 10px; }
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item.featured { grid-column: span 1; }
    .countdown { gap: 12px; }
    .countdown-item { min-width: 65px; padding: 15px 10px; }
    .countdown-number { font-size: 2rem; }
    .hero-photo { width: 200px; height: 200px; }
    .intro-text { font-size: 1.2rem; }
    .section-title { font-size: 2.2rem; }

    .envelope { width: 85vw; height: auto; min-height: 280px; padding: 15px; }
    .envelope-names { font-size: 2.2rem; }
    .envelope-header { font-size: 0.7rem; letter-spacing: 3px; }
    .wax-seal { width: 100px; height: 100px; bottom: -30px; }
    .seal-label { bottom: -60px; font-size: 0.75rem; }
}