/* ==========================================================================
   Configuración general
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 20px; }

body {
    font-family: 'Lora', Georgia, serif;
    background-color: #f4f1ea;
    color: #2c3e50;
}

/* ==========================================================================
   Encabezado y logo
   ========================================================================== */
header {
    position: relative;
    background-color: #0d1b2a;
    color: #e0e1dd;
    padding: 2rem 5%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 4px solid #c8a45d;
    text-align: center;
}

.logo { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Escena: Tetragrámaton y título ocupan el mismo sitio (uno encima del otro) */
.logo-escena {
    display: grid;
    align-items: start;
    justify-items: center;
    width: 100%;
    transition: height 1.4s ease;
}
.logo-escena > * { grid-area: 1 / 1; }

.logo-titulo { text-align: center; }

.logo-titulo h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    letter-spacing: 5px;
    color: #c8a45d;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.logo-titulo p { font-style: italic; font-size: 0.9rem; color: #a2a2a2; max-width: 600px; margin: 0 auto; }

/* ==========================================================================
   Tetragrámaton animado (misma animación y tamaño que la versión 2)
   ========================================================================== */
.tetra-capa {
    display: none;                 /* sin JavaScript no se muestra */
    width: 100%;
    justify-content: center;
    transition: opacity 1s ease, visibility 0s linear 1s;
}
.js .tetra-capa { display: flex; }

.tetra-escena {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0 6px;
}

/* Resplandor dorado que "respira" detrás de las letras */
.tetra-halo {
    position: absolute;
    top: 0;
    left: 50%;
    width: min(640px, 95vw);
    height: 100%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse closest-side at 50% 42%, rgba(200, 164, 93, 0.26) 0%, rgba(200, 164, 93, 0.08) 55%, transparent 100%);
    pointer-events: none;
    animation: respirar 8s ease-in-out infinite;
}

.tetra-letras {
    position: relative;
    display: flex;
    justify-content: center;
    gap: clamp(10px, 3vw, 34px);
    font-family: 'Frank Ruhl Libre', 'David Libre', 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(5rem, 19vw, 11.5rem);
    line-height: 1.1;
    color: #d4b36a;
    filter: url(#ondulacion);
    will-change: filter;
}

.tetra-letras span {
    display: block;
    text-shadow: 0 0 14px rgba(200, 164, 93, 0.3);
}

.tetra-linea {
    position: relative;
    width: 120px;
    height: 2px;
    margin: 22px 0 18px;
    background: linear-gradient(90deg, transparent, #c8a45d, transparent);
}

.tetra-titulo {
    position: relative;
    font-family: 'Cinzel', serif;
    font-weight: 400;
    font-size: 1.4rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: #c8a45d;
    margin-bottom: 0.5rem;
}

.tetra-sub {
    position: relative;
    font-style: italic;
    font-size: 0.95rem;
    color: #a2a2a2;
    max-width: 480px;
    line-height: 1.5;
}

/* Estado inicial (con JavaScript): solo se ve el Tetragrámaton, el título está oculto */
.js .tetra-letras span { opacity: 0; transform: translateY(14px); filter: blur(6px); }
.js .tetra-linea       { width: 0; }
.js .tetra-titulo,
.js .tetra-sub         { opacity: 0; }
.js .logo-titulo       { opacity: 0; transition: opacity 1.4s ease; }

/* 1) Las letras aparecen una a una y después brillan suavemente */
.js .tetra-on .tetra-letras span {
    animation: aparecer 2.2s ease-out forwards, brillo 6s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.9s + 0.3s), calc(var(--i) * 0.9s + 3s);
}
.js .tetra-on .tetra-linea  { animation: ensanchar 1.8s ease-out 3.9s forwards; }
.js .tetra-on .tetra-titulo { animation: fundir 2s ease-out 4.3s forwards; }
.js .tetra-on .tetra-sub    { animation: fundir 2s ease-out 4.9s forwards; }

/* 2) Tras unos segundos completo, el Tetragrámaton se desvanece */
.tetra-off .tetra-capa { opacity: 0; visibility: hidden; }
.tetra-fin .tetra-capa { display: none; }

/* 3) Aparece el título */
.titulo-on .logo-titulo { opacity: 1; }

@keyframes aparecer {
    from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
@keyframes brillo {
    0%, 100% { text-shadow: 0 0 14px rgba(200, 164, 93, 0.25); }
    50%      { text-shadow: 0 0 30px rgba(200, 164, 93, 0.65), 0 0 70px rgba(200, 164, 93, 0.25); }
}
@keyframes ensanchar { from { width: 0; }   to { width: 120px; } }
@keyframes fundir    { from { opacity: 0; } to { opacity: 1; } }
@keyframes respirar {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50%      { opacity: 1;   transform: translateX(-50%) scale(1.06); }
}

/* Accesibilidad: sin animaciones si el dispositivo las tiene desactivadas */
@media (prefers-reduced-motion: reduce) {
    .js .tetra-capa { display: none; }
    .js .logo-titulo { opacity: 1; transition: none; }
}

/* ==========================================================================
   Navegación
   ========================================================================== */
nav { margin-top: 1.5rem; width: 100%; }

nav ul { display: flex; justify-content: center; list-style: none; }
nav ul li { margin: 0 15px; }

nav ul li a {
    text-decoration: none;
    color: #e0e1dd;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: 0.3s;
    padding: 10px 15px;
    border-radius: 5px;
}

nav ul li a:hover,
nav ul li a.active { color: #c8a45d; background-color: rgba(200, 164, 93, 0.1); }

/* ==========================================================================
   Hero principal
   ========================================================================== */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #0d1b2a;
    background-image: linear-gradient(rgba(104, 130, 158, 0.8), rgba(13, 27, 42, 0.8)),
                      url('../img/montana-baja.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 40px 20px;
}

.content h2 { font-family: 'Cinzel', serif; font-size: 3rem; margin-bottom: 1rem; }
.content p  { font-size: 1.2rem; max-width: 700px; margin: 0 auto 2rem; line-height: 1.6; }

.btn-main {
    padding: 12px 30px;
    background-color: #c8a45d;
    color: #0d1b2a;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 2px;
    transition: 0.4s;
}
.btn-main:hover { background-color: #e0e1dd; }

/* ==========================================================================
   Secciones de contenido
   ========================================================================== */
.seccion { padding: 60px 5%; text-align: center; }
.seccion h2 { font-family: 'Cinzel', serif; color: #0d1b2a; margin-bottom: 1rem; }

/* ==========================================================================
   Sello postal (reseña biográfica)
   ========================================================================== */
.wrapper-sello-biografia { margin-top: 40px; }

.sello-contenedor {
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1;
    margin: 20px auto;
    background-image: url('https://museopostal.org/wp-content/uploads/2026/05/sello2.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sello-contenido { text-align: center; width: 65%; font-family: Georgia, serif; color: #333; }

.sello-enlace {
    display: block;
    color: #1a1a1a;
    text-decoration: none;
    font-weight: bold;
    font-size: clamp(14px, 4vw, 18px);
    line-height: 1.3;
    margin-bottom: 15px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}
.sello-enlace:hover { color: #8b0000; text-decoration: underline; }

.sello-info-inferior { border-top: 1px solid #999; padding-top: 10px; margin-top: 5px; }
.sello-info-inferior span {
    display: block;
    font-size: clamp(12px, 3vw, 14px);
    letter-spacing: 1px;
    margin: 2px 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer { background-color: #0d1b2a; color: #888; text-align: center; padding: 2rem; font-size: 0.8rem; }

/* ==========================================================================
   Menú responsive
   ========================================================================== */
.checkbtn { display: none; cursor: pointer; }
#check { display: none; }

@media (max-width: 858px) {
    .logo-titulo h1 { font-size: 1.8rem; letter-spacing: 3px; }
    .tetra-titulo { font-size: 1.1rem; letter-spacing: 5px; }
    .content h2 { font-size: 2rem; }

    .checkbtn { display: block; padding: 10px; }
    .checkbtn span { display: block; width: 25px; height: 3px; background: #c8a45d; margin: 5px; }

    nav ul {
        position: absolute;
        top: 100%;
        left: -100%;
        width: 100%;
        height: 100vh;
        background: #0d1b2a;
        flex-direction: column;
        align-items: center;
        padding-top: 20px;
        transition: left .5s;
        z-index: 1000;
    }
    nav ul li { margin: 20px 0; }
    #check:checked ~ ul { left: 0; }
}
