/* === VARIABLES & RESET === */
:root {
    --bg-color: #f0f2eb;
    --text-color: #333;
    --gold: #bfa05f;
    --red-heart: #d92525; /* Rojo intenso */
    --btn-bg: #d4a5a5;
    --btn-text: #fff;
}

body {
    margin: 0; padding: 0;
    font-family: 'Cinzel', serif;
    color: var(--text-color);
    text-align: center;
    background-color: var(--bg-color);
    overflow-x: hidden;
}

.bg-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -99;
    background-image: url('../images/paper-bg.jpg');
    background-size: cover; opacity: 0.6;
}

/* === TIPOGRAFÍA === */
.names-main { font-family: 'Pinyon Script', cursive; font-size: 4.5rem; margin: 10px 0; line-height: 1; color: #1a1a1a; }
.names-footer { font-family: 'Pinyon Script', cursive; font-size: 3.5rem; color: #666; margin-top: 50px; }
.script-title { font-family: 'Pinyon Script', cursive; font-size: 4rem; margin-bottom: 30px; color: #444; }
.date-top { letter-spacing: 3px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; margin-top: 40px; }
.amp { font-size: 2.5rem; color: var(--gold); }
.quote { font-style: italic; margin-top: 40px; font-size: 1rem; color: #555; line-height: 1.6; padding: 0 20px; }

/* === ANIMACIÓN DEL SOBRE === */
.hero { padding-bottom: 40px; }
.envelope-wrapper { margin-top: 120px; margin-bottom: 40px; height: 220px; position: relative; display: flex; justify-content: center; }
.envelope-container { position: relative; width: 280px; height: 190px; }
.envelope-front { position: relative; width: 100%; z-index: 10; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.2)); }
.envelope-seal { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); width: 55px; z-index: 11; }
.card-photo {
    position: absolute; top: 5px; left: 15px; right: 15px; bottom: 5px; z-index: 5;
    overflow: hidden; background: #fff; border: 3px solid #fff;
    transform: translateY(20px) scale(0.9); opacity: 0;
    animation: photoZoomOut 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.5s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
@keyframes photoZoomOut {
    0% { transform: translateY(20px) scale(0.9); opacity: 0; }
    100% { transform: translateY(-90px) scale(1.3) rotate(-3deg); opacity: 1; }
}

/* === REPRODUCTOR === */
.music-player { max-width: 350px; margin: 30px auto; padding: 20px; }
.progress-container { width: 100%; height: 3px; background: #bbb; margin-bottom: 15px; border-radius: 2px; }
.progress-bar { height: 100%; width: 0%; background: #222; position: relative; }
.progress-bar::after { content: ''; position: absolute; right: -4px; top: -3px; width: 9px; height: 9px; background: #222; border-radius: 50%; }
.controls { display: flex; justify-content: center; align-items: center; gap: 25px; font-size: 1.2rem; }
.play-circle { width: 55px; height: 55px; background: #111; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; cursor: pointer; transition: transform 0.2s; }
.play-circle:active { transform: scale(0.95); }
.small-icon { font-size: 1rem; color: #888; }

/* === CALENDARIO === */
.calendar-wrapper { margin: 40px auto; max-width: 350px; }
.calendar-month { text-transform: uppercase; letter-spacing: 2px; font-size: 1.5rem; margin-bottom: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; font-weight: 600; font-size: 0.95rem; }
.day-head { font-weight: 700; margin-bottom: 5px; color: #666; }
.heart-date { position: relative; z-index: 1; color: var(--red-heart); font-weight: bold; }
.heart-date::before {
    content: '♡'; font-size: 3rem; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -55%) rotate(-8deg);
    z-index: -1; font-weight: normal; color: var(--red-heart);
}

/* === NUEVA SECCIÓN: HISTORIA DE AMOR (SCRAPBOOK) === */
.love-story-section {
    max-width: 800px; margin: 80px auto; padding: 0 20px; position: relative;
}
/* Línea conectora central */
.timeline-line {
    position: absolute; left: 50%; top: 80px; bottom: 50px;
    width: 2px; background-color: var(--gold); opacity: 0.5;
    transform: translateX(-50%); z-index: -1;
}

.story-card {
    display: flex; align-items: center; justify-content: center;
    gap: 40px; margin-bottom: 60px;
}
/* Alternar orden en móvil si es necesario */
.right-card { flex-direction: row; } 
.left-card { flex-direction: row; }

.story-text { flex: 1; text-align: left; background: rgba(255,255,255,0.6); padding: 15px; border-radius: 5px; }
.story-text h3 { font-family: 'Pinyon Script', cursive; font-size: 2.5rem; margin-bottom: 10px; color: var(--text-color); }
.story-text p { font-size: 1rem; line-height: 1.5; color: #555; }

/* Estilo Polaroid */
.polaroid {
    flex: 0 0 220px; /* Tamaño fijo imagen */
    background: #fff; padding: 10px 10px 30px 10px; /* Borde inferior más grueso */
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    position: relative;
    transition: transform 0.3s ease;
}
.polaroid img { width: 100%; height: auto; display: block; filter: sepia(0.2); }
.polaroid:hover { transform: scale(1.05) !important; z-index: 5; }

/* Rotaciones divertidas */
.rotate-left { transform: rotate(-4deg); }
.rotate-right { transform: rotate(4deg); }

/* Efecto Cinta Adhesiva */
.tape {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    width: 80px; height: 25px;
    background-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* === TIMELINE Y RSVP === */
.timeline-img { width: 100%; max-width: 550px; margin: 10px auto 30px; display: block; }
.rsvp-section { margin: 80px 0; padding: 0 20px; }
.rsvp-text { font-size: 1.1rem; margin-bottom: 30px; line-height: 1.6; }
.btn-cta {
    display: inline-block; background-color: var(--btn-bg); color: var(--btn-text);
    padding: 15px 45px; font-size: 1rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 2px; text-decoration: none; border-radius: 50px;
    box-shadow: 0 5px 15px rgba(212, 165, 165, 0.4); transition: all 0.3s ease;
}
.btn-cta:hover { background-color: #fff; color: var(--btn-bg); transform: translateY(-3px); }

.countdown-elegant { display: flex; justify-content: center; align-items: center; gap: 15px; margin-top: 50px; }
.time-unit span { font-family: 'Pinyon Script', cursive; font-size: 3rem; line-height: 1; display: block; }
.time-unit label { font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 1px; margin-top: 5px; }
.colon { font-family: 'Pinyon Script', cursive; font-size: 2.5rem; margin-bottom: 20px; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .names-main { font-size: 3.5rem; }
    .envelope-wrapper { margin-top: 100px; }
    
    /* Historia en móvil: apilar */
    .story-card { flex-direction: column !important; gap: 20px; margin-bottom: 80px; }
    .story-text { text-align: center; order: 2; width: 100%; background: none; padding: 0; }
    .polaroid { order: 1; width: 200px; transform: rotate(0deg) !important; margin: auto; }
    .timeline-line { display: none; } /* Ocultar línea en móvil para simplificar */
    
    .btn-cta { width: 85%; }
}

.fade-in { opacity: 0; transform: translateY(40px); transition: 1.2s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }