/* ===================================================================
   MEMORIAL WEBSITE - HOJA DE ESTILOS
   Diseño emocional, cálido, sereno y optimizado para móviles y escritorio.
   =================================================================== */

:root {
    /* Paleta alegre, cálida y de atardecer dorado */
    --sunset-sky: #ff6b6b;
    --sunset-coral: #fa7268;
    --sunset-peach: #ff9a76;
    --sunset-gold: #fec84d;
    --sunset-amber: #f59e0b;
    --sunset-purple: #795290;
    --sunset-deep: #431f4e;
    
    --gold-primary: #f59e0b;
    --gold-light: #fef08a;
    --gold-dark: #b45309;
    --gold-glow: rgba(245, 158, 11, 0.45);
    
    /* Hoja de papel blanca real para la carta */
    --paper-white: #ffffff;
    --paper-cream: #fffdf9;
    --paper-ink: #1e293b;
    --paper-ink-muted: #64748b;
    --paper-margin-line: rgba(244, 63, 94, 0.22);
    --paper-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 25px 65px -8px rgba(0, 0, 0, 0.25);
    
    --text-light: #ffffff;
    --text-muted: #fde68a;
    
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-script: 'Alex Brush', cursive;
    --font-hand: 'Caveat', cursive;
    --font-note: 'Patrick Hand', cursive;
    
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset y base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: #240b36;
    color: var(--text-light);
}

body {
    font-family: var(--font-sans);
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg, #240b36 0%, #4b1248 20%, #7c2258 45%, #b33951 70%, #d85c47 88%, #f59e0b 100%);
    color: var(--text-light);
}

/* Utilidad accesible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Contenedor off-screen para iframe de YouTube (evita que el navegador corte el audio por invisibilidad/clip) */
.youtube-player-container {
    position: fixed;
    top: -500px;
    left: -500px;
    width: 250px;
    height: 250px;
    opacity: 0.001;
    pointer-events: none;
    z-index: -9999;
}

.hidden {
    display: none !important;
}

/* ===================================================================
   COLLAGE DE FONDO: ÁLBUM SCRAPBOOK CHUECO CON NOTITAS DE CARIÑO
   =================================================================== */
.bg-collage-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-collage-grid {
    display: flex;
    justify-content: center;
    gap: 1.8rem;
    width: 125vw;
    margin-left: -12vw;
    height: 190vh;
    margin-top: -25vh;
    transform: rotate(-1.5deg) scale(1.03);
    opacity: 0.94;
    transition: opacity 1s ease;
}

.bg-collage-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 230px;
}

.bg-collage-col:nth-child(odd) {
    animation: driftColUp 50s linear infinite;
}

.bg-collage-col:nth-child(even) {
    animation: driftColDown 55s linear infinite;
}

@keyframes driftColUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes driftColDown {
    0% { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

/* Polaroids pegadas chuecas */
.scrapbook-polaroid {
    position: relative;
    background: #ffffff;
    padding: 10px 10px 22px 10px;
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: transform 0.4s ease;
}

.polaroid-photo-frame {
    width: 100%;
    height: 230px;
    border-radius: 2px;
    overflow: hidden;
    background: #f1f5f9;
}

.polaroid-photo-frame img,
.polaroid-photo-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.15) contrast(1.05) brightness(1.02);
    display: block;
}

.polaroid-caption {
    font-family: var(--font-hand);
    font-size: 1.25rem;
    font-weight: 700;
    color: #334155;
    text-align: center;
    margin-top: 8px;
    line-height: 1.2;
}

/* Notitas de cariño en papel tipo post-it de colores */
.scrapbook-note {
    position: relative;
    padding: 1.5rem 1.2rem 1.3rem;
    border-radius: 3px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    width: 100%;
}

.note-yellow { background: #fef08a; color: #713f12; }
.note-pink { background: #fbcfe8; color: #831843; }
.note-mint { background: #bbf7d0; color: #14532d; }
.note-peach { background: #fed7aa; color: #7c2d12; }
.note-blue { background: #bae6fd; color: #0c4a6e; }
.note-lavender { background: #e9d5ff; color: #581c87; }

.scrapbook-note-text {
    font-family: var(--font-hand);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.scrapbook-note-paw {
    align-self: flex-end;
    font-size: 1.35rem;
    opacity: 0.85;
}

/* Cintas washi tape decorativas realistas */
.scrapbook-tape {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(-1.5deg);
    width: 75px;
    height: 22px;
    opacity: 0.88;
    z-index: 5;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.washi-coral {
    background: rgba(251, 113, 133, 0.88);
    border-left: 2px dashed rgba(225, 29, 72, 0.45);
    border-right: 2px dashed rgba(225, 29, 72, 0.45);
}
.washi-yellow {
    background: rgba(250, 204, 21, 0.9);
    border-left: 2px dashed rgba(202, 138, 4, 0.45);
    border-right: 2px dashed rgba(202, 138, 4, 0.45);
}
.washi-mint {
    background: rgba(74, 222, 128, 0.88);
    border-left: 2px dashed rgba(22, 163, 74, 0.45);
    border-right: 2px dashed rgba(22, 163, 74, 0.45);
}
.washi-pink {
    background: rgba(244, 114, 182, 0.88);
    border-left: 2px dashed rgba(219, 39, 119, 0.45);
    border-right: 2px dashed rgba(219, 39, 119, 0.45);
}
.washi-blue {
    background: rgba(56, 189, 248, 0.88);
    border-left: 2px dashed rgba(2, 132, 199, 0.45);
    border-right: 2px dashed rgba(2, 132, 199, 0.45);
}
.washi-lavender {
    background: rgba(192, 132, 252, 0.88);
    border-left: 2px dashed rgba(147, 51, 234, 0.45);
    border-right: 2px dashed rgba(147, 51, 234, 0.45);
}

/* Inclinaciones naturales para efecto 'pegadas chuecas' */
.tilt-1 { transform: rotate(-3.8deg); }
.tilt-2 { transform: rotate(4.2deg); }
.tilt-3 { transform: rotate(-2.2deg); }
.tilt-4 { transform: rotate(3.4deg); }
.tilt-5 { transform: rotate(-5deg); }
.tilt-6 { transform: rotate(2.6deg); }

.bg-collage-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 35%, rgba(255, 237, 213, 0.12) 0%, rgba(124, 34, 88, 0.35) 55%, rgba(36, 11, 54, 0.72) 100%);
    backdrop-filter: blur(0.3px);
    -webkit-backdrop-filter: blur(0.3px);
    z-index: 2;
}

/* Canvas de fondo ambiental */
.ambient-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
}

/* ===================================================================
   REPRODUCTOR DE AUDIO FLOTANTE
   =================================================================== */
.audio-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(14, 18, 27, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(223, 177, 91, 0.3);
    border-radius: 40px;
    padding: 6px 14px 6px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--gold-glow);
    transition: transform 0.3s var(--transition-smooth), opacity 0.3s ease;
}

.audio-widget:hover {
    border-color: var(--gold-primary);
    transform: translateY(-2px);
}

.audio-widget-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-disc-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-disc.vinyl-record {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: 
        radial-gradient(circle at center, 
            transparent 0%, transparent 33%, 
            #0a0a0d 34%, #1e1e24 38%, #0a0a0d 41%, 
            #2b2b35 48%, #0a0a0d 51%, #1d1d24 60%, 
            #0a0a0d 63%, #262631 75%, #0a0a0d 78%, 
            #1b1b21 88%, #070709 100%),
        #111116;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 0 1.5px rgba(255, 255, 255, 0.08);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: none;
    cursor: pointer;
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.audio-disc.vinyl-record:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), inset 0 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 0 1.5px rgba(251, 191, 36, 0.4);
}

.vinyl-shine {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 30deg at 50% 50%,
        rgba(255, 255, 255, 0.24) 0deg,
        transparent 35deg,
        transparent 145deg,
        rgba(255, 255, 255, 0.24) 180deg,
        transparent 215deg,
        transparent 325deg,
        rgba(255, 255, 255, 0.24) 360deg
    );
    pointer-events: none;
    z-index: 1;
}

.vinyl-label {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #fbbf24 0%, #f97316 65%, #c2410c 100%);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.vinyl-spindle-hole {
    width: 4.5px;
    height: 4.5px;
    border-radius: 50%;
    background: #09090b;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9), 0 0 0 0.5px rgba(255, 255, 255, 0.4);
}

.audio-disc.spinning {
    animation: spinVinyl 3.5s linear infinite;
}

@keyframes spinVinyl {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


.equalizer-bars {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-disc.spinning + .equalizer-bars {
    opacity: 1;
}

.equalizer-bars span {
    width: 2.5px;
    height: 3px;
    background-color: var(--gold-light);
    border-radius: 1px;
}

.audio-disc.spinning + .equalizer-bars span:nth-child(1) { animation: eqBar 0.8s ease-in-out infinite alternate; }
.audio-disc.spinning + .equalizer-bars span:nth-child(2) { animation: eqBar 0.5s ease-in-out infinite alternate 0.2s; }
.audio-disc.spinning + .equalizer-bars span:nth-child(3) { animation: eqBar 0.9s ease-in-out infinite alternate 0.4s; }
.audio-disc.spinning + .equalizer-bars span:nth-child(4) { animation: eqBar 0.6s ease-in-out infinite alternate 0.1s; }

@keyframes eqBar {
    0% { height: 3px; }
    100% { height: 12px; }
}

.audio-info {
    display: flex;
    flex-direction: column;
    max-width: 170px;
}

.audio-status {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold-primary);
}

.audio-track {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.audio-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.audio-btn:hover {
    background: rgba(223, 177, 91, 0.2);
    color: var(--gold-light);
    transform: scale(1.08);
}

.audio-btn:active {
    transform: scale(0.94);
}

/* ===================================================================
   HERO / PANTALLA INICIAL: SOBRE INTERACTIVO
   =================================================================== */
.hero-entrance {
    position: relative;
    z-index: 10;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    transition: opacity 0.8s var(--transition-smooth), transform 0.8s var(--transition-smooth);
}

.hero-entrance.fade-out {
    opacity: 0;
    transform: translateY(-40px);
    pointer-events: none;
}

.entrance-container {
    max-width: 680px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.2rem;
    position: relative;
}

.sky-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(223, 177, 91, 0.14) 0%, rgba(120, 80, 180, 0.08) 50%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: -1;
}

.badge-angel {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gold-light);
    background: rgba(223, 177, 91, 0.12);
    border: 1px solid rgba(223, 177, 91, 0.35);
    border-radius: 30px;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

.entrance-title {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 600;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.entrance-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 0.6rem;
}

/* El Sobre */
.envelope-wrapper {
    perspective: 1200px;
    margin: 1rem 0;
}

.envelope {
    width: min(390px, 92vw);
    height: 250px;
    position: relative;
    background-color: #fdfcfb;
    background-image: url('assets/cow_pattern.svg');
    background-size: 150px 150px;
    border-radius: 14px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(254, 240, 138, 0.4);
    cursor: pointer;
    transition: transform 0.4s var(--transition-smooth), box-shadow 0.4s ease;
    user-select: none;
    -webkit-user-select: none;
    border: 3px solid #ffffff;
}

.envelope:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 35px 75px rgba(0, 0, 0, 0.55), 0 0 55px rgba(254, 240, 138, 0.55);
}

.envelope-back {
    position: absolute;
    inset: 0;
    background-color: #f3f0ec;
    background-image: url('assets/cow_pattern.svg');
    background-size: 150px 150px;
    border-radius: 12px;
    filter: brightness(0.94);
}

.letter-preview {
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    bottom: 25px;
    background: #ffffff; /* HOJA DE PAPEL BLANCA */
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    transition: transform 0.6s var(--transition-smooth);
    z-index: 2;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.letter-preview::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 1.5px;
    background: rgba(244, 63, 94, 0.3);
}

.envelope.open .letter-preview {
    transform: translateY(-75px);
}

.letter-preview-content {
    text-align: center;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.letter-preview-icon {
    font-size: 2rem;
}

.letter-preview-text {
    font-family: var(--font-hand);
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.letter-preview-sub {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: #e11d48;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

/* Solapas con patrón de manchas de vaquita (el pelaje especial de Doky) */
.flap-left {
    position: absolute;
    inset: 0;
    background-color: #fdfcfb;
    background-image: url('assets/cow_pattern.svg');
    background-size: 150px 150px;
    background-position: left center;
    clip-path: polygon(0 0, 0 100%, 53% 52%);
    z-index: 3;
    pointer-events: none;
    border-radius: 12px 0 0 12px;
    filter: drop-shadow(2px 0 5px rgba(0, 0, 0, 0.12));
}

.flap-right {
    position: absolute;
    inset: 0;
    background-color: #fbfaf9;
    background-image: url('assets/cow_pattern.svg');
    background-size: 150px 150px;
    background-position: right center;
    clip-path: polygon(100% 0, 100% 100%, 47% 52%);
    z-index: 3;
    pointer-events: none;
    border-radius: 0 12px 12px 0;
    filter: drop-shadow(-2px 0 5px rgba(0, 0, 0, 0.12));
}

.flap-bottom {
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    background-image: url('assets/cow_pattern.svg');
    background-size: 150px 150px;
    background-position: center bottom;
    clip-path: polygon(0 100%, 100% 100%, 50% 46%);
    z-index: 3;
    pointer-events: none;
    border-radius: 0 0 12px 12px;
    filter: drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.18));
}

.flap-top {
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    background-image: url('assets/cow_pattern.svg');
    background-size: 150px 150px;
    background-position: center top;
    clip-path: polygon(0 0, 100% 0, 50% 55%);
    transform-origin: top center;
    transition: transform 0.6s var(--transition-smooth), z-index 0.2s step-end;
    z-index: 4;
    pointer-events: none;
    border-radius: 12px 12px 0 0;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.25));
}

.envelope.open .flap-top {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-seal {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: transform 0.4s var(--transition-bounce), opacity 0.4s ease;
    cursor: pointer;
}

.envelope.open .envelope-seal {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.seal-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffd782, #b8863b, #704b12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    border: 2px solid rgba(255, 230, 160, 0.7);
}

.seal-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.6) 0%, transparent 70%);
    animation: pulseSeal 2.4s infinite ease-in-out;
}

@keyframes pulseSeal {
    0%, 100% { transform: scale(0.95); opacity: 0.4; }
    50% { transform: scale(1.15); opacity: 0.9; }
}

/* Botón de apertura */
.entrance-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn-open-letter {
    position: relative;
    padding: 1.15rem 2.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #e11d48 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(234, 88, 12, 0.45), 0 0 25px rgba(245, 158, 11, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s var(--transition-bounce), box-shadow 0.3s ease;
}

.btn-open-letter:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 18px 45px rgba(234, 88, 12, 0.6), 0 0 35px rgba(245, 158, 11, 0.55);
}

.btn-open-letter:active {
    transform: translateY(1px) scale(0.98);
}

.btn-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50px;
    border: 2px solid var(--gold-light);
    opacity: 0;
    animation: btnPulseGlow 2.5s infinite ease-out;
}

@keyframes btnPulseGlow {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.12); opacity: 0; }
}

.entrance-hint {
    font-size: 0.9rem;
    color: #fef08a;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ===================================================================
   SECCIÓN DE LA CARTA DESPLEGADA (HOJA DE PAPEL BLANCA REAL)
   =================================================================== */
.letter-experience {
    position: relative;
    z-index: 10;
    padding: 4rem 1.5rem 6rem;
    transition: opacity 1s var(--transition-smooth), transform 1s var(--transition-smooth);
}

.letter-experience.hidden-initial {
    display: none;
    opacity: 0;
    transform: translateY(40px);
}

.letter-experience.revealed {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: revealLetter 1s var(--transition-smooth) forwards;
}

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

.parchment-container {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4.5rem;
}

/* La Hoja de Papel Blanca */
.parchment-card {
    background: #ffffff;
    color: #1e293b;
    border-radius: 4px;
    padding: clamp(2.5rem, 6vw, 4.8rem);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 25px 65px -8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
    border: none;
    transform: rotate(-0.5deg);
}

/* Cinta washi tape decorativa en la parte superior de la hoja */
.parchment-card::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%) rotate(-1deg);
    width: 140px;
    height: 28px;
    background: rgba(251, 113, 133, 0.92);
    border-left: 3px dashed rgba(225, 29, 72, 0.5);
    border-right: 3px dashed rgba(225, 29, 72, 0.5);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
    border-radius: 2px;
}

/* Línea de margen de cuaderno tenue en el borde izquierdo */
.parchment-border-decor {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 45px;
    width: 2px;
    background: rgba(244, 63, 94, 0.18);
    pointer-events: none;
}

@media (max-width: 600px) {
    .parchment-border-decor {
        left: 20px;
    }
}

.parchment-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header-stamp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 63, 94, 0.08);
    color: #be123c;
    border: 1.5px dashed #fb7185;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.letter-salutation {
    font-family: var(--font-serif);
    font-size: clamp(1.9rem, 4.5vw, 2.7rem);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.letter-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 1.5rem auto 0;
    max-width: 260px;
    color: #e11d48;
}

.letter-divider span {
    flex: 1;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(225, 29, 72, 0.35), transparent);
}

.divider-heart-paw {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #e11d48;
}

.divider-heart {
    width: 22px;
    height: 22px;
    display: block;
    animation: gentlePulse 2s infinite ease-in-out;
}

.divider-paw {
    font-size: 1.45rem;
    line-height: 1;
    display: inline-block;
    transform: translateY(-5px);
    filter: drop-shadow(0 2px 4px rgba(225, 29, 72, 0.2));
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.parchment-body {
    font-family: var(--font-serif);
    font-size: clamp(1.18rem, 2.5vw, 1.38rem);
    line-height: 1.95;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    text-align: justify;
}

.parchment-body p:first-of-type::first-letter {
    font-family: var(--font-serif);
    font-size: 3.6rem;
    float: left;
    line-height: 0.8;
    padding-right: 12px;
    padding-top: 4px;
    color: #e11d48;
    font-weight: 700;
}

.parchment-footer {
    margin-top: 3.5rem;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.letter-signature-intro {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    color: #64748b;
    font-weight: 600;
}

.letter-signature {
    font-family: var(--font-hand);
    font-size: clamp(2.8rem, 6vw, 3.8rem);
    color: #be123c;
    line-height: 1.1;
    font-weight: 700;
    margin-top: 4px;
}

.letter-date {
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-top: 6px;
}

/* ===================================================================
   HOMENAJE CON VELA INTERACTIVA (TARJETA SCRAPBOOK CÁLIDA)
   =================================================================== */
.candle-section {
    text-align: center;
}

.candle-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(254, 243, 199, 0.96) 100%);
    border-radius: 8px;
    padding: clamp(2.2rem, 5vw, 3.2rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    border: 2px dashed #f59e0b;
    position: relative;
    transform: rotate(0.6deg);
}

.candle-card::before {
    content: '';
    position: absolute;
    top: -12px;
    right: 40px;
    width: 80px;
    height: 24px;
    background: rgba(74, 222, 128, 0.88);
    transform: rotate(4deg);
    border-left: 2px dashed rgba(22, 163, 74, 0.45);
    border-right: 2px dashed rgba(22, 163, 74, 0.45);
    z-index: 5;
    border-radius: 2px;
}

.candle-title {
    font-family: var(--font-hand);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #92400e;
}

.candle-desc {
    color: #475569;
    font-size: 1.05rem;
    max-width: 480px;
}

.candle-visual-wrapper {
    height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0.5rem 0;
}

.candle-container {
    position: relative;
    width: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.candle-wax {
    width: 44px;
    height: 70px;
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 6px 6px 4px 4px;
    box-shadow: inset -4px 0 8px rgba(0, 0, 0, 0.1), 0 4px 15px rgba(245, 158, 11, 0.35);
}

.candle-wick {
    width: 3px;
    height: 12px;
    background: #3a3225;
    border-radius: 2px 2px 0 0;
}

.candle-flame {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 30px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.candle-container.lit .candle-flame {
    opacity: 1;
}

.flame-core {
    width: 14px;
    height: 24px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffbe3b 60%, #ff5e00 100%);
    border-radius: 50% 50% 35% 35% / 60% 60% 40% 40%;
    margin: 0 auto;
    animation: flameFlicker 1.8s infinite ease-in-out alternate;
}

.flame-glow {
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(255, 186, 68, 0.7) 0%, rgba(255, 120, 20, 0.3) 50%, transparent 80%);
    border-radius: 50%;
    pointer-events: none;
    animation: glowPulse 2s infinite ease-in-out alternate;
}

@keyframes flameFlicker {
    0% { transform: scale(1) rotate(-1deg); }
    25% { transform: scale(1.05, 0.96) rotate(1.5deg); }
    50% { transform: scale(0.97, 1.04) rotate(-0.5deg); }
    75% { transform: scale(1.03, 0.98) rotate(1deg); }
    100% { transform: scale(1) rotate(-1deg); }
}

@keyframes glowPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.15); opacity: 1; }
}

.btn-candle {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    border: none;
    color: #ffffff;
    padding: 0.85rem 2rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.35);
    transition: all 0.3s ease;
}

.btn-candle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(234, 88, 12, 0.5);
}

.candle-status {
    font-size: 0.95rem;
    color: #b45309;
    min-height: 1.4rem;
    font-style: italic;
    font-weight: 600;
}

/* ===================================================================
   GALERÍA DE FOTOS Y VIDEOS: ÁLBUM SCRAPBOOK HERO
   =================================================================== */
.section-title-wrap {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fef08a;
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.section-heading {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 2.7rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
}

.section-subtext {
    font-size: 1.05rem;
    color: #fde68a;
    margin-top: 0.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.photos-grid.single-hero-grid {
    display: flex;
    justify-content: center;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

/* Gran Polaroid Scrapbook Destacada */
.scrapbook-hero-polaroid {
    position: relative;
    background: #ffffff;
    padding: 16px 16px 36px 16px;
    border-radius: 6px;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.35), 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: rotate(-1.5deg);
    transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s ease;
    cursor: pointer;
    width: 100%;
}

.scrapbook-hero-polaroid:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.45), 0 8px 25px rgba(0, 0, 0, 0.2);
}

.tape-corner-left {
    position: absolute;
    top: -12px;
    left: -15px;
    transform: rotate(-35deg);
    width: 85px;
    height: 26px;
    z-index: 10;
}

.tape-corner-right {
    position: absolute;
    top: -12px;
    right: -15px;
    transform: rotate(35deg);
    width: 85px;
    height: 26px;
    z-index: 10;
}

.hero-polaroid-frame {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
    background: #f1f5f9;
}

.hero-polaroid-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.22) contrast(1.06) brightness(1.04);
    transition: transform 0.5s var(--transition-smooth);
}

.scrapbook-hero-polaroid:hover .hero-polaroid-frame img {
    transform: scale(1.03);
}

.hero-polaroid-tag {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-polaroid-caption-area {
    padding: 1.5rem 1rem 0.5rem;
    text-align: center;
}

.hero-polaroid-caption {
    font-family: var(--font-hand);
    font-size: clamp(1.5rem, 3.5vw, 1.9rem);
    color: #1e293b;
    line-height: 1.35;
    font-weight: 700;
}

.hero-polaroid-footer-notes {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.scrapbook-handwritten {
    font-family: var(--font-note);
    font-size: 1.15rem;
    color: #64748b;
}

.scrapbook-sticker {
    font-size: 1.4rem;
}

/* ===================================================================
   MENSAJE PERSONAL DEDICADO (TARJETA SCRAPBOOK DE CARIÑO)
   =================================================================== */
.personal-note-section {
    margin-top: 1rem;
}

.personal-note-card {
    position: relative;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 8px;
    padding: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
    border: 2px dashed #fbbf24;
    transform: rotate(0.8deg);
}

.personal-note-card::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 40px;
    width: 85px;
    height: 25px;
    background: rgba(251, 191, 36, 0.88);
    transform: rotate(-3deg);
    border-left: 2px dashed rgba(180, 83, 9, 0.45);
    border-right: 2px dashed rgba(180, 83, 9, 0.45);
    z-index: 5;
    border-radius: 2px;
}

.note-quote-icon {
    font-family: var(--font-serif);
    font-size: 4.5rem;
    line-height: 1;
    color: #f59e0b;
    opacity: 0.6;
    margin-bottom: -1rem;
}

.note-title {
    font-family: var(--font-hand);
    font-size: clamp(2rem, 3.8vw, 2.5rem);
    color: #78350f;
    margin-bottom: 1rem;
    font-weight: 700;
}

.note-text {
    font-family: var(--font-serif);
    font-size: clamp(1.15rem, 2.4vw, 1.35rem);
    line-height: 1.85;
    color: #334155;
    max-width: 640px;
    margin: 0 auto;
    font-style: italic;
}

.note-decor-line {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #ea580c);
    margin: 2rem auto 0;
    border-radius: 3px;
}

/* Footer global */
.memorial-global-footer {
    text-align: center;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-scroll-top {
    background: transparent;
    border: 1px solid rgba(223, 177, 91, 0.3);
    color: var(--gold-light);
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-scroll-top:hover {
    background: rgba(223, 177, 91, 0.15);
    border-color: var(--gold-primary);
}

/* ===================================================================
   LIGHTBOX MODAL
   =================================================================== */
.photo-lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 10, 0.88);
    backdrop-filter: blur(16px);
    border: none;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.photo-lightbox[open] {
    display: flex;
    animation: fadeInModal 0.3s ease forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-dialog-inner {
    position: relative;
    max-width: min(900px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-close-lightbox {
    position: absolute;
    top: -45px;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-close-lightbox:hover {
    background: rgba(223, 177, 91, 0.4);
}

.lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 82vh;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(223, 177, 91, 0.3);
}

.lightbox-figure figcaption {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--gold-light);
    margin-top: 1rem;
    text-align: center;
}

/* ===================================================================
   RESPONSIVIDAD Y PREFERS-REDUCED-MOTION
   =================================================================== */
@media (max-width: 600px) {
    .audio-widget {
        top: auto;
        bottom: 15px;
        right: 15px;
        left: 15px;
        border-radius: 25px;
        justify-content: space-between;
    }
    
    .audio-widget-content {
        width: 100%;
        justify-content: space-between;
    }
    
    .audio-info {
        max-width: 130px;
    }
    
    .parchment-card {
        padding: 2rem 1.2rem;
    }
    
    .envelope {
        height: 190px;
    }
    
    .envelope-seal {
        top: 85px;
    }
    
    .seal-inner {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .audio-disc.spinning {
        animation: none;
    }
}
