/* =====================
   VARIABLES
   ===================== */
:root {
    --color-bg: #F9F6EE;
    --color-bg-alt: #F2EDE3;
    --color-text: #4A4443;
    --color-primary: #C5A880;
    --color-primary-hover: #b0936b;
    --color-white: #FFFFFF;
    --font-titles: 'Lora', serif;
    --font-text: 'Montserrat', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    background-color: var(--color-bg-alt);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 15px;
}

/* =====================
   CARTA (el marco dorado)
   Aplica a hero y a todas las secciones
   ===================== */
.carta {
    position: relative;
    background-color: var(--color-bg);
    border: 2px solid var(--color-primary);
    margin: 16px;
    padding: 40px 20px;
}

/* Línea interior sutil — el doble marco */
.carta::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(197, 168, 128, 0.35);
    pointer-events: none;
    z-index: 0;
}

/* Asegurar que el contenido quede sobre el ::before */
.carta > * {
    position: relative;
    z-index: 1;
}

/* =====================
   ROSA DECORATIVA
   ===================== */
.rosa-deco {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.rosa-top-right {
    top: -2px;
    right: -2px;
    width: 80px;
}

/* =====================
   PORTADA (Hero)
   ===================== */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px 50px;
}

.hero-content {
    width: 100%;
}

.hero-content h1 {
    font-family: var(--font-titles);
    font-size: 1.35rem;
    color: var(--color-text);
    letter-spacing: 0.02em;
    margin-bottom: 6px;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
}

.hero-content .subtitle {
    font-family: var(--font-titles);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.hero-content .dates {
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--color-text);
    padding: 0 10px;
}

.hero-content .dates-small {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 28px;
}

/* FOTO CON MARCO DE BRILLOS */
.hero-photo-wrapper {
    display: block;
    margin: 22px auto 28px;
}

.hero-img {
    width: 85%;
    max-width: 380px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* =====================
   BOTÓN
   ===================== */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 13px 28px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: background 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-block;
    letter-spacing: 0.04em;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

/* =====================
   SECCIONES
   ===================== */
section {
    padding: 0;
}

.section-alt .carta {
    background-color: var(--color-white);
}

.text-center {
    text-align: center;
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.section-title {
    font-family: var(--font-titles);
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--color-text);
    line-height: 1.3;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background-color: var(--color-primary);
    margin: 10px auto 0;
}

/* =====================
   CAPÍTULOS
   ===================== */
.chapter {
    background: var(--color-white);
    padding: 24px 20px;
    border-radius: 3px;
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-top: 3px solid var(--color-primary);
    margin-bottom: 20px;
}

.chapter h3 {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(197, 168, 128, 0.2);
    line-height: 1.4;
}

.chapter p {
    margin-bottom: 12px;
    text-align: justify;
    font-size: 0.92rem;
}



.chapter-img {
    width: 100%;
    max-height: 400px; /* Volvemos a los 400px de altura máxima */
    object-fit: contain; /* Esto obliga a que la foto se vea completa sin cortarse */
    border-radius: 3px;
    margin-bottom: 16px;
    border: 1px solid rgba(197, 168, 128, 0.2);
}


/* =====================
   FRASES / DICCIONARIO
   ===================== */
.dictionary-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dictionary-item {
    background: var(--color-bg);
    padding: 22px 18px;
    border-radius: 3px;
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-top: 3px solid var(--color-primary);
}

.dictionary-item h4 {
    font-family: var(--font-titles);
    font-size: 1.05rem;
    color: var(--color-text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(197, 168, 128, 0.2);
}

.dictionary-item p {
    font-size: 0.9rem;
    text-align: justify;
}

.item-img {
    width: 100%;
    height: auto; /* Esto permite que la altura se adapte a la foto */
    max-height: 400px; /* Un límite para que no sea inmensa */
    object-fit: contain; /* Para que se vea completa sin cortes */
    border-radius: 3px;
    margin-bottom: 12px;
}



/* =====================
   GALERÍA
   ===================== */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gallery-item {
    width: 100%;
    height: 160px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(197, 168, 128, 0.25);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.placeholder {
    width: 100%;
    height: 100%;
    background-color: #EDE9E0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0936b;
    font-family: var(--font-titles);
    font-style: italic;
    font-size: 0.85rem;
}

/* =====================
   MURO DE RECUERDOS
   ===================== */
.tribute-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.tribute-form-area p {
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.88rem;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(197, 168, 128, 0.4);
    border-radius: 3px;
    font-family: var(--font-text);
    font-size: 0.9rem;
    background: var(--color-bg);
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.tribute-wall-area h3 {
    font-family: var(--font-titles);
    margin-bottom: 16px;
    font-size: 1.3rem;
    color: var(--color-text);
}

/* VELA REALISTA — móvil (base) */
.vela {
    position: relative;
    flex-shrink: 0;
    width: 28px;
    height: 85px;
    overflow: visible;
}

.vela-cuerpo {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #e8d0a9 0%, #fef4e1 30%, #fef4e1 70%, #d6ba8d 100%);
    border-radius: 2px 2px 6px 6px;
    box-shadow: inset 0 -6px 12px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.35);
    z-index: 2;
}

.vela-top {
    position: absolute;
    top: -4px;
    left: 0;
    width: 28px;
    height: 10px;
    background: radial-gradient(ellipse at center, #fff2cc 0%, #e8d0a9 100%);
    border-radius: 50%;
    z-index: 3;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.vela-mecha {
    position: absolute;
    top: -13px;
    left: calc(50% - 1px);
    width: 2px;
    height: 10px;
    background: linear-gradient(to bottom, #111 0%, #555 100%);
    border-radius: 2px 2px 0 0;
    z-index: 4;
}

.llama {
    position: absolute;
    top: -35px;
    left: calc(50% - 6px);
    width: 12px;
    height: 22px;
    background: radial-gradient(ellipse at bottom, #ffffff 10%, #ffeb3b 40%, #ff9800 80%, rgba(255,0,0,0) 100%);
    border-radius: 50% 50% 20% 20% / 60% 60% 40% 40%;
    z-index: 5;
    animation: flicker-real 0.4s infinite alternate;
    filter: blur(0.5px);
    box-shadow: 0 0 10px 2px rgba(255, 150, 0, 0.6);
    transform-origin: center bottom;
}

.vela-glow {
    position: absolute;
    top: -57px;
    left: calc(50% - 27px);
    width: 54px;
    height: 54px;
    background: radial-gradient(circle, rgba(255,160,50,0.25) 0%, rgba(255,160,50,0) 70%);
    border-radius: 50%;
    z-index: 1;
    animation: glow-flicker-real 1.5s infinite alternate;
    pointer-events: none;
}

@keyframes flicker-real {
    0%   { transform: scale(1)    rotate(-1deg); opacity: 0.9;  }
    25%  { transform: scale(1.05) rotate(1deg);  opacity: 1;    }
    50%  { transform: scale(0.95) rotate(-2deg); opacity: 0.85; }
    75%  { transform: scale(1.03) rotate(2deg);  opacity: 0.95; }
    100% { transform: scale(1)    rotate(0deg);  opacity: 1;    }
}

@keyframes glow-flicker-real {
    0%   { transform: scale(1);    opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 0.75; }
}

/* MÓVIL — lista horizontal (Opción D) */
.memory-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: var(--color-bg);
    padding: 16px 18px;
    border-radius: 3px;
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-left: 4px solid var(--color-primary);
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.memory-card {
    align-items: center;
    padding-top: 24px;
}

.vela-texto {
    flex: 1;
    min-width: 0;
}

.memory-card h4 {
    font-family: var(--font-titles);
    color: var(--color-primary);
    margin-bottom: 4px;
    font-size: 1rem;
}

.vela-msg-inline {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--color-text);
}

.vela-leer-mas-mobile {
    display: inline;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.82rem;
    font-family: var(--font-text);
    cursor: pointer;
    padding: 0 0 0 4px;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.vela-leer-mas-mobile:hover { opacity: 1; }

/* =====================
   CONTADOR Y FRASE
   ===================== */
.contador-dias {
    font-size: 0.85rem;
    color: var(--color-text);
    opacity: 0.75;
    margin-bottom: 12px;
    line-height: 1.5;
}

.contador-dias span {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 600;
}

.frase-rotativa {
    font-family: var(--font-titles);
    font-style: italic;
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 24px;
    min-height: 1.5em;
    transition: opacity 0.5s;
}

/* =====================
   FAMILIA
   ===================== */
.familia-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.familia-card {
    background: var(--color-white);
    padding: 24px 20px;
    border-radius: 3px;
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-top: 3px solid var(--color-primary);
    text-align: center;
}

.familia-card-destacada {
    border-top-color: #b0936b;
    background: #fffdf8;
}

.familia-foto {
    width: 70%; /* Ocupa el 70% del ancho, dejando 15% libre a cada lado */
    aspect-ratio: 1 / 1; /* Esto asegura que siempre sea un círculo perfecto sin importar la pantalla */
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 3px solid var(--color-primary);
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Nota: Ya no necesitas el bloque @media (max-width: 767px) para .familia-foto, 
   puedes borrar el que tenías antes, ya que aspect-ratio hace todo el trabajo de adaptación automáticamente. */

.familia-card h4 {
    font-family: var(--font-titles);
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: 2px;
}

.familia-rol {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.familia-card p:last-child {
    font-size: 0.9rem;
    text-align: justify;
    line-height: 1.6;
}

/* =====================
   VIDEO
   ===================== */
.video-placeholder {
    background: #EDE9E0;
    border: 2px dashed rgba(197, 168, 128, 0.5);
    border-radius: 4px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-family: var(--font-titles);
    font-style: italic;
    font-size: 1rem;
}

/* =====================
   MÚSICA FLOTANTE
   ===================== */
.music-btn {
    position: fixed;
    bottom: 80px;
    right: 18px;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(197,168,128,0.5);
    transition: transform 0.2s;
}

.music-btn:hover { transform: scale(1.1); }

.music-player {
    position: fixed;
    bottom: 140px;
    right: 18px;
    width: 280px;
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
    border-radius: 6px;
    z-index: 999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
}

.music-player.hidden { display: none; }

.music-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-primary);
    color: white;
    font-size: 0.8rem;
    font-family: var(--font-titles);
    font-style: italic;
}

.music-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

/* =====================
   WHATSAPP FLOTANTE
   ===================== */
.whatsapp-btn {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 50px;
    height: 50px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(37,211,102,0.4);
    transition: transform 0.2s;
}

.whatsapp-btn:hover { transform: scale(1.1); }

/* =====================
   FOOTER
   ===================== */
footer {
    position: relative;
    background-color: #2E2A29;
    color: #e8ddd0;
    text-align: center;
    padding: 50px 20px;
    font-family: var(--font-titles);
    border-top: 3px solid var(--color-primary);
    overflow: hidden;
}

footer p {
    font-size: 1.1rem;
    font-style: italic;
}

footer .small-text {
    font-family: var(--font-text);
    font-size: 0.78rem;
    font-style: normal;
    margin-top: 10px;
    opacity: 0.55;
    letter-spacing: 0.05em;
}

/* =====================
   TABLET (600px+)
   ===================== */
@media (min-width: 600px) {

    body { font-size: 16px; }

    .carta {
        margin: 20px;
        padding: 50px 35px;
    }

    .rosa-top-right { width: 120px; }

    .familia-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .familia-grid-dos {
        max-width: 600px;
        margin: 0 auto;
    }

    .hero-content h1 { font-size: 2rem; }
    .hero-content .subtitle { font-size: 1.5rem; }
    .hero-content .dates { font-size: 0.95rem; }
    .hero-img { width: 270px; }

    .section-title { font-size: 1.8rem; }

    .dictionary-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-item { height: 200px; }

    .tribute-container {
        flex-direction: row;
    }
}

/* =====================
   DESKTOP (900px+)
   ===================== */
@media (min-width: 900px) {

    .carta {
        max-width: 900px;
        margin: 24px auto;
        padding: 60px 55px;
    }

    .hero {
        min-height: 100vh;
    }

    .hero-content h1 { font-size: 2.6rem; }
    .hero-content .subtitle { font-size: 1.7rem; }
    .hero-img { width: 290px; }

    .section-title { font-size: 2rem; }

    .dictionary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chapter p, .dictionary-item p {
        font-size: 0.95rem;
    }
}

/* =====================
   VIDEOS FAMILIARES (MODAL Y GALERÍA)
   ===================== */
.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media (min-width: 600px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); }
}

.video-card {
    background: var(--color-bg);
    padding: 18px;
    border-radius: 3px;
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-top: 3px solid var(--color-primary);
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(197, 168, 128, 0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid rgba(197, 168, 128, 0.2);
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.video-card:hover .video-thumbnail img {
    filter: brightness(0.85);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    color: var(--color-white);
    background: rgba(197, 168, 128, 0.85);
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.video-card h4 {
    font-family: var(--font-titles);
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 4px;
}

.video-card p {
    font-size: 0.85rem;
    color: var(--color-text);
    opacity: 0.8;
}

/* MODAL OSCURO */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100svh;
    background-color: rgba(46, 42, 41, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.hidden {
    display: none !important;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: transparent;
}

.close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-white);
    font-family: var(--font-text);
    font-size: 32px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
}

.close-btn:hover {
    opacity: 1;
    color: var(--color-primary);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* Proporción 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    border: 2px solid var(--color-primary);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#modal-video {
    display: none;
    background: #000;
}

.video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =====================
   SOBRE / ENVELOPE
   ===================== */
.sobre-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #1a1614 0%, #2E2A29 55%, #3d2e1e 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    overflow: hidden;
    transition: opacity 0.9s ease;
}

.sobre-overlay.saliendo {
    opacity: 0;
    pointer-events: none;
}

/* Floating particles */
.sobre-estrella {
    position: absolute;
    background: rgba(197, 168, 128, 0.55);
    border-radius: 50%;
    pointer-events: none;
    animation: titilar ease-in-out infinite alternate;
}

@keyframes titilar {
    from { opacity: 0.1; transform: scale(0.7); }
    to   { opacity: 0.9; transform: scale(1.3); }
}

/* Scene container */
.sobre-escena {
    position: relative;
    width: 300px;
    height: auto;
    overflow: visible;
    animation: aparece-sobre 1.2s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes aparece-sobre {
    from { opacity: 0; transform: translateY(50px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Letter that rises */
.carta-sobre {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 244px;
    background: url('imagenes/carta-papel.png') center center / cover no-repeat;
    border: none;
    padding: 22px 18px 18px;
    text-align: center;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.85s cubic-bezier(0.34, 1.15, 0.64, 1) 0.55s,
                opacity 0.65s ease 0.5s;
}

.sobre-escena.abierto .carta-sobre {
    transform: translateX(-50%) translateY(-130px);
    opacity: 1;
    pointer-events: all;
    z-index: 5;
}

.carta-rosa {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    animation: latido 2.5s ease-in-out infinite;
}

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

.carta-saludo {
    font-family: var(--font-titles);
    font-style: italic;
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: 16px;
}

/* Envelope shell */
.sobre-shell {
    position: relative;
    width: 100%;
    z-index: 2;
    transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1) 0.45s,
                opacity 0.7s ease 0.5s;
}

.sobre-escena.abierto .sobre-shell {
    transform: translateY(130px);
    opacity: 0.5;
}

/* Base completa — siempre visible */
.sobre-imagen-base {
    width: 100%;
    height: auto;
    display: block;
}

/* Flap encima, alineada con la base */
.sobre-flap-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    font-size: 0;
    line-height: 0;
}

.sobre-solapa {
    width: 100%;
    height: auto;
    display: block;
    transform-origin: top center;
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
                opacity 0.5s ease 0.3s;
}

.sobre-solapa.abierta {
    transform: perspective(600px) rotateX(-160deg);
    opacity: 0.1;
}

/* Wax seal — posicionado sobre el sobre completo */
.sello-cera {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 3px 12px rgba(0,0,0,0.55),
                0 0 22px rgba(197,168,128,0.4);
    cursor: pointer;
    animation: brillo-sello 2.5s ease-in-out infinite;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    z-index: 6;
}

@keyframes brillo-sello {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,0.55), 0 0 22px rgba(197,168,128,0.35); }
    50%       { box-shadow: 0 3px 12px rgba(0,0,0,0.55), 0 0 38px rgba(197,168,128,0.75); }
}

.sello-cera.roto {
    transform: translate(-50%, -50%) scale(0) rotate(30deg);
    opacity: 0;
    pointer-events: none;
}


/* Hint */
.sobre-hint {
    font-family: var(--font-titles);
    font-style: italic;
    color: rgba(197, 168, 128, 0.5);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-align: center;
    animation: fadein-hint 1s ease 2s both;
    transition: opacity 0.3s ease;
}

@keyframes fadein-hint {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sobre-hint.oculto {
    opacity: 0 !important;
    pointer-events: none;
}

/* Responsive sobre */
@media (max-width: 340px) {
    .sobre-escena { width: 260px; }
    .carta-sobre  { width: 212px; }
    .sobre-escena.abierto .carta-sobre { transform: translateX(-50%) translateY(-130px); }
    .sobre-escena.abierto .sobre-shell { transform: translateY(110px); }
}

@media (min-width: 600px) {
    .sobre-escena { width: 380px; }
    .carta-sobre  { width: 308px; }
    .sello-cera   { width: 70px; height: 70px; }
    .sobre-escena.abierto .carta-sobre { transform: translateX(-50%) translateY(-160px); }
    .sobre-escena.abierto .sobre-shell { transform: translateY(160px); }
}

/* Button inside letter */
.sobre-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-family: var(--font-text);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    letter-spacing: 0.04em;
}

.sobre-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.04);
}

/* =====================
   HERO FADE-IN
   ===================== */
.hero-content {
    animation: fade-in-hero 1.4s ease 0.2s both;
}

@keyframes fade-in-hero {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* =====================
   LÍNEA DE TIEMPO
   ===================== */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-primary), rgba(197,168,128,0.15));
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -31px;
    top: 22px;
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 50%;
    border: 2px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-primary);
    z-index: 1;
}

/* =====================
   POLAROIDS
   ===================== */
.gallery-item.polaroid {
    background: white;
    padding: 10px 10px 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.08);
    border-radius: 2px;
    height: auto;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.gallery-item.polaroid:hover {
    box-shadow: 0 10px 28px rgba(0,0,0,0.2);
    transform: scale(1.04) rotate(0deg) !important;
}

.gallery-item.polaroid:nth-child(1) { transform: rotate(-2deg);   }
.gallery-item.polaroid:nth-child(2) { transform: rotate(1.5deg);  }
.gallery-item.polaroid:nth-child(3) { transform: rotate(-1deg);   }
.gallery-item.polaroid:nth-child(4) { transform: rotate(2.5deg);  }

.polaroid-img-wrap {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.polaroid-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.polaroid-caption {
    font-family: var(--font-titles);
    font-style: italic;
    font-size: 0.8rem;
    text-align: center;
    color: var(--color-text);
    margin-top: 10px;
    opacity: 0.7;
}

/* =====================
   GALERÍA LIGHTBOX
   ===================== */
.gallery-modal-content {
    position: relative;
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.gallery-modal-img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border: 3px solid var(--color-primary);
    border-radius: 3px;
}

.gallery-modal-caption-text {
    font-family: var(--font-titles);
    font-style: italic;
    color: #e8ddd0;
    margin-top: 14px;
    font-size: 1rem;
}

/* (llama y animaciones definidas en VELA REALISTA) */

/* =====================
   BURBUJA DE MENSAJE — panel full-width
   ===================== */
.burbuja {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(14, 11, 9, 0.97);
    border-top: 1px solid rgba(197, 168, 128, 0.4);
    border-radius: 16px 16px 0 0;
    padding: 12px 24px 32px;
    z-index: 500;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
    text-align: left;
    animation: panel-sube 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Barra de handle arriba */
.burbuja::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(197, 168, 128, 0.35);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.burbuja.visible { display: block; }

@keyframes panel-sube {
    from { transform: translateY(100%); }
    to   { transform: translateY(0);    }
}

.burbuja-cerrar {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(232,221,208,0.4);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}
.burbuja-cerrar:hover { color: var(--color-primary); }

.burbuja-nombre {
    display: block;
    font-family: var(--font-titles);
    color: var(--color-primary);
    font-size: 0.9rem;
    margin-bottom: 6px;
    padding-right: 16px;
}

.burbuja-msg {
    font-family: var(--font-titles);
    font-style: italic;
    color: rgba(232,221,208,0.85);
    font-size: 0.82rem;
    line-height: 1.65;
    margin: 0 0 6px;
}

.burbuja-leer-mas {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.76rem;
    font-family: var(--font-text);
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.burbuja-leer-mas:hover { opacity: 1; }

/* =====================
   ALTAR DE VELAS (DESKTOP)
   ===================== */
@media (min-width: 600px) {

    .tribute-wall-area {
        background: linear-gradient(180deg, #1c1816 0%, #110e0c 100%);
        border-radius: 4px;
        padding: 24px 20px 28px;
        box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
        flex: 1;
    }

    .tribute-wall-area h3 {
        color: #e8ddd0;
        text-align: center;
        border-bottom: 1px solid rgba(197,168,128,0.2);
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .counter-text {
        color: rgba(197,168,128,0.65) !important;
    }

    #memory-wall {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px 14px;
        padding: 16px 8px;
    }

    /* Aureola de luz acumulada */
    #memory-wall::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 80%;
        height: 60%;
        background: radial-gradient(ellipse, rgba(245,158,11,0.06) 0%, transparent 70%);
        pointer-events: none;
    }

    /* Cada vela en el altar */
    .memory-card {
        flex-direction: column;
        align-items: center;
        background: transparent;
        border: none;
        border-left: none;
        padding: 8px 4px 10px;
        margin-bottom: 0;
        width: 68px;
        gap: 6px;
        transition: transform 0.2s ease;
    }

    .memory-card:hover {
        transform: translateY(-4px);
    }

    /* Vela altar: más pequeña */
    .memory-card .vela {
        width: 22px;
        height: 60px;
    }

    .memory-card .vela-top {
        width: 22px;
        height: 8px;
        top: -3px;
    }

    .memory-card .vela-mecha {
        height: 8px;
        top: -10px;
    }

    .memory-card .llama {
        width: 10px;
        height: 18px;
        top: -27px;
        left: calc(50% - 5px);
    }

    .memory-card .vela-glow {
        width: 44px;
        height: 44px;
        top: -44px;
        left: calc(50% - 22px);
    }

    .memory-card.seleccionada .llama {
        box-shadow: 0 0 16px rgba(255,150,0,0.95), 0 0 32px rgba(255,150,0,0.5);
        width: 13px;
        height: 22px;
    }

    .memory-card.seleccionada .vela-glow {
        opacity: 1;
        transform: scale(1.3);
    }

    .vela-texto h4 {
        font-size: 0.7rem;
        color: rgba(232,221,208,0.65);
        text-align: center;
        font-family: var(--font-titles);
        font-style: italic;
        font-weight: 400;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 68px;
        margin-bottom: 0;
    }

    .memory-card.seleccionada .vela-texto h4 {
        color: var(--color-primary);
    }

    .vela-msg-inline { display: none; }

}

/* =====================
   FEEDBACK DE FORMULARIO
   ===================== */
.form-feedback {
    margin-top: 14px;
    padding: 11px 16px;
    border-radius: 3px;
    font-size: 0.88rem;
    text-align: center;
    font-family: var(--font-titles);
    font-style: italic;
}

.form-feedback.exito {
    background: rgba(197, 168, 128, 0.12);
    border: 1px solid var(--color-primary);
    color: var(--color-text);
}

.form-feedback.error {
    background: rgba(180, 60, 60, 0.07);
    border: 1px solid rgba(180, 60, 60, 0.35);
    color: #7a3535;
}

.form-feedback.hidden { display: none; }

/* =====================
   CONTADOR DE RECUERDOS
   ===================== */
.counter-text {
    font-family: var(--font-titles);
    font-style: italic;
    text-align: center;
    color: var(--color-primary);
    font-size: 0.88rem;
    margin-bottom: 16px;
    opacity: 0.85;
    min-height: 1.2em;
}

/* =====================
   PÉTALOS
   ===================== */
.petalo {
    position: fixed;
    top: -40px;
    pointer-events: none;
    z-index: 9998;
    user-select: none;
    animation: caer-petalo linear forwards;
}

@keyframes caer-petalo {
    0%   { top: -40px;  opacity: 1; transform: rotate(0deg)   translateX(0);   }
    100% { top: 110vh;  opacity: 0; transform: rotate(360deg) translateX(25px); }
}

/* =====================
   SECCIÓN VIDEO ESPECIAL — EL BESO
   ===================== */
.seccion-beso {
    background: linear-gradient(180deg, #1c1816 0%, #0e0c0b 100%);
    padding: 0;
}

.beso-contenedor {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 20px;
    gap: 36px;
}

.beso-video-wrap {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(197, 168, 128, 0.45);
    box-shadow: 0 0 60px rgba(197, 168, 128, 0.12),
                0 20px 50px rgba(0, 0, 0, 0.7);
}

.beso-video {
    width: 100%;
    height: auto;
    display: block;
}

.beso-historia {
    color: #e8ddd0;
}

.beso-titulo {
    font-family: var(--font-titles);
    font-size: 2rem;
    font-style: italic;
    color: var(--color-primary);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.beso-titulo::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: rgba(197, 168, 128, 0.5);
    margin: 14px 0 0;
}

.beso-texto p {
    font-family: var(--font-titles);
    font-size: 0.95rem;
    line-height: 1.9;
    color: rgba(232, 221, 208, 0.8);
    margin-bottom: 16px;
    text-align: justify;
}

.beso-texto em {
    color: var(--color-primary);
    font-style: italic;
}

.beso-cierre {
    color: rgba(232, 221, 208, 0.55) !important;
    font-size: 0.88rem !important;
    font-style: italic;
    margin-top: 8px;
}

@media (min-width: 700px) {
    .beso-contenedor {
        flex-direction: row;
        align-items: center;
        gap: 50px;
        padding: 70px 40px;
    }

    .beso-video-wrap {
        flex: 0 0 340px;
    }

    .beso-titulo {
        font-size: 2.4rem;
    }

    .beso-texto p {
        font-size: 1rem;
    }
}

@media (min-width: 900px) {
    .beso-video-wrap {
        flex: 0 0 400px;
    }
}

/* =====================
   POSTDATA
   ===================== */
.postdata {
    background: #2E2A29;
    text-align: center;
    padding: 18px 20px;
    border-top: 1px solid rgba(197,168,128,0.12);
}

.postdata p {
    font-family: var(--font-titles);
    font-style: italic;
    color: rgba(232, 221, 208, 0.35);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

/* =====================
   CARRUSEL DE FOTOS
   ===================== */
.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.carousel-track-container {
    overflow: hidden;
    width: 100%;
    border-radius: 3px;
    border: 1px solid rgba(197, 168, 128, 0.25);
}

.carousel-track {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
    transition: transform 0.4s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
}

.carousel-img {
    width: 100%;
    height: 400px; /* Puedes ajustar esta altura */
    object-fit: contain; 
    object-position: center;
    display: block;
}

/* Botones Flechas */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, color 0.3s;
}

.carousel-btn:hover {
    background: var(--color-primary);
    color: white;
}

.prev-btn {
    left: -20px;
}

.next-btn {
    right: -20px;
}

@media (max-width: 600px) {
    .prev-btn { left: 5px; }
    .next-btn { right: 5px; }
    .carousel-img { height: 300px; }
}

/* Puntos de navegación inferiores */
.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.carousel-indicator {
    border: 1px solid var(--color-primary);
    border-radius: 50%;
    width: 12px;
    height: 12px;
    background: transparent;
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-indicator.current-indicator {
    background: var(--color-primary);
}

