/* ================= TIPOGRAFÍAS ================= */
@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&display=swap');
@import url('https://fonts.cdnfonts.com/css/sharky');

/* ================= GENERAL ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    scroll-behavior: smooth;
}

body {
    font-family: "IM Fell English", serif;
    overflow-x: hidden;
    background: black;
    color: white;
    backface-visibility: hidden;
}

/* ================= PÁGINA PRINCIPAL ================= */
.pagina-titulo {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: transparent !important;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;

    will-change: opacity;
}

/* ---------- FONDO ANIMADO TITULO (p5.js) ---------- */
#anim-titulo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
    pointer-events: none;
}

/* ================= TÍTULO PRINCIPAL ================= */
.pagina-titulo h1 {
    font-family: 'Sharky', sans-serif;
    letter-spacing: 2px;
    position: relative;
    z-index: 5;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 400;
    text-decoration: none !important;
    transition: color 0.35s ease, transform 0.35s ease, text-shadow 0.35s ease;
    will-change: transform, text-shadow, color;
}

.pagina-titulo h1:hover {
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.04);
    text-shadow: 0 0 8px rgba(180, 230, 255, 0.7),
                 0 0 18px rgba(180, 230, 255, 0.5),
                 0 0 30px rgba(180, 230, 255, 0.35);
}

#titulo-wrapper {
  position: relative;
  z-index: 100000 !important; 
  pointer-events: none;        
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

#titulo-humanidad,
#titulo-humanidad a {
  font-family: 'Sharky', sans-serif !important;
  color: rgba(255,255,255,0.95) !important;
  text-decoration: none !important;
  margin: 0 !important;
  line-height: 1 !important;
  pointer-events: auto; 
}

#subtitulo-humanidad {
  font-family: "IM Fell English", serif;
  color: rgba(255,255,255,0.85) !important;
  margin-top: 0.35rem !important;
  letter-spacing: 1px;
  font-size: clamp(1.4rem, 3.6vw, 3rem);
  pointer-events: none;
}

#titulo-wrapper,
#titulo-humanidad,
#subtitulo-humanidad {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}


#anim-titulo canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;          
  pointer-events: none !important; 
}


#seamlessOverlay {
  z-index: 5000 !important;
}


.scroll-down {
  z-index: 100001 !important;
}

/* ================= SECCIÓN HISTORIA ================= */
.section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    will-change: opacity, transform;
}

.section video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    will-change: opacity;
}

/* ================= TEXTOS ================= */
.arriba,
.abajo {
    position: absolute;
    z-index: 5;
    width: 100%;
    text-align: center;
    padding: 0 5%;
    color: white;
    font-size: 1.6rem;
    line-height: 1.3;
    animation: fadeInText 1.3s ease forwards;
    will-change: opacity, transform;
}

.arriba { top: 5%; }
.abajo  { bottom: 5%; }

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


.info-btn {
    display: none;
}

.pagina-titulo #openModal.info-btn {
    display: flex;

    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 9999;

    width: 55px;
    height: 55px;
    border-radius: 50%;

    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);

    justify-content: center;
    align-items: center;

    font-size: 28px;
    font-weight: 600;
    color: white;

    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

.pagina-titulo #openModal.info-btn:hover {
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.55);
    border-color: white;
    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.55),
        0 0 26px rgba(160, 200, 255, 0.45);
}


.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}

.modal-content {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    color: white;
    padding: 25px;
    border-radius: 18px;
    width: 80%;
    max-width: 380px;
    margin: 10% auto;
    box-shadow: 0 0 20px rgba(255,255,255,0.15);
    text-align: center;
}

.close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: white;
}

.modal-content h2 {
    margin-bottom: 15px;
    font-size: 22px;
    font-weight: 600;
}

.creditos-grid {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.persona h3 {
    margin: 0;
    font-size: 22px;
    color: white;
}

.persona p {
    margin: 0;
    font-size: 19px;
    opacity: 0.8;
}

/* =====================================================
   🔥 CORRECCIÓN: TÍTULO SIEMPRE BLANCO
   ===================================================== */

.pagina-titulo h1 a,
.pagina-titulo h1 a:link,
.pagina-titulo h1 a:visited,
.pagina-titulo h1 a:hover,
.pagina-titulo h1 a:active {
    color: white !important;
    text-decoration: none !important;
}


.scroll-down {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);

    width: 28px;
    height: 28px;

    border-left: 3px solid rgba(255, 255, 255, 0.85);
    border-bottom: 3px solid rgba(255, 255, 255, 0.85);

    opacity: 0.9;
    z-index: 9999;

    animation: scrollArrow 1.8s infinite ease-in-out;
}

@keyframes scrollArrow {
    0% {
        transform: translateX(-50%) rotate(-45deg) translateY(0);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) rotate(-45deg) translateY(14px);
        opacity: 0;
    }
}


.music-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;

    width: 55px;
    height: 55px;
    border-radius: 50%;

    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    color: white;
    cursor: pointer;

    z-index: 9999;
    transition: all 0.3s ease;

    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.music-btn.playing {
    animation: pulseMusic 1.6s infinite ease-in-out;
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.55),
        0 0 22px rgba(200, 220, 255, 0.35);
}

@keyframes pulseMusic {
    0% { transform: scale(1);}
    50% { transform: scale(1.18);}
    100% { transform: scale(1);}
}


#seamlessOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 420ms ease;
  z-index: 99999;
}

