@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lora:wght@400;500;600&family=Syncopate:wght@700&display=swap');

/* --- Variables y Reset --- */
:root {
    --color-bg-main: #040405;
    /* Negro obsidiana puro */
    --color-bg-slab: #141618;
    /* Asfalto/Piedra oscura para contenedores */
    --color-text-primary: #d1d5db;
    /* Gris piedra texto general */
    --color-accent-copper: #b87333;
    /* Cobrizo de tecnología alienígena */
    --color-accent-gold: #b3975a;
    /* Dorado antiguo y apagado */
    --color-accent-stone: #4b5563;
    /* Gris piedra oscuro para bordes */
    --color-tech-glow: #202b36;
    /* Resplandor de base de datos alien */

    /* Fuentes Rúnicas y de Lore */
    --font-glitch: 'Syncopate', sans-serif;
    /* Aspecto más geométrico/alienígena */
    --font-titles: 'Cinzel', serif;
    /* Rúnico clásico, duro, monumental */
    --font-body: 'Lora', serif;
    /* Legibilidad máxima para textos largos */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-main);
    color: var(--color-text-primary);
    overflow-x: hidden;
    line-height: 1.8;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* Tipografía Rúnica y Títulos */
h1,
h2,
h3,
.title-runic,
.subtitle-runic {
    font-family: var(--font-titles);
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1.glitch-effect {
    font-family: var(--font-glitch);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-accent-gold);
    position: relative;
    text-shadow: 2px 2px 0px var(--color-tech-glow);
    margin-bottom: 2rem;
}

h2.subtitle {
    font-size: 2rem;
    color: var(--color-accent-copper);
    margin-bottom: 1.5rem;
}

/* --- Navegación Superior --- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(4, 4, 5, 0.95);
    border-bottom: 2px solid var(--color-accent-stone);
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 0 3px rgba(184, 115, 51, 0.8));
    /* Reflejo cobrizo tenue */
    transition: transform 0.3s ease;
}

.nav-logo img:hover {
    transform: scale(1.05);
}

.nav-links a {
    margin: 0 15px;
    font-weight: 600;
    font-family: var(--font-titles);
    text-transform: uppercase;
    font-size: 1rem;
    color: var(--color-accent-stone);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent-gold);
    text-shadow: 0 0 5px rgba(179, 151, 90, 0.3);
}

.lang-switch {
    font-family: var(--font-titles);
    font-weight: 700;
    color: var(--color-accent-stone);
}

.lang-active {
    color: var(--color-accent-copper);
}

/* --- Hero Section Principal --- */
.hero-section {
    min-height: calc(100vh - 120px);
    width: 100%;
    background-image: url('../img/hero_background.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    box-shadow: inset 0 0 100px #000;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(4, 4, 5, 0.2) 0%, rgba(4, 4, 5, 1) 100%);
}

.hero-content {
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.intro-text {
    font-size: 1.2rem;
    margin-bottom: 4rem;
    opacity: 0.9;
    color: var(--color-text-primary);
}

/* --- Portal Gateways (Tarjetas Centrales) --- */
.portal-gateways {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Tarjetas similares a bloques de piedra tallados */
.gateway-card {
    background: var(--color-bg-slab);
    border: 3px solid var(--color-accent-stone);
    border-radius: 0;
    /* Bordes duros rúnicos */
    box-shadow: 6px 6px 0px var(--color-bg-main), 8px 8px 0px var(--color-accent-copper);
    padding: 2.5rem 1.5rem;
    flex: 1;
    min-width: 220px;
    max-width: 300px;
    transition: all 0.2s ease;
    position: relative;
}

.gateway-card::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px dashed rgba(179, 151, 90, 0.2);
    pointer-events: none;
}

.gateway-card h3 {
    font-family: var(--font-titles);
    font-size: 1.3rem;
    color: var(--color-accent-gold);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.gateway-card p {
    font-family: var(--font-body);
}

.gateway-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0px var(--color-bg-main), 11px 11px 0px var(--color-accent-gold);
    background: #1a1d21;
}

/* --- Runic Slabs: Contenedores Internos para el Lore --- */
.runic-container {
    padding: 4rem 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.lore-article {
    margin-bottom: 6rem;
}

/* Losas de texto principal (Paneles de información Akáshica) */
.slab-content {
    background: var(--color-bg-slab);
    border-top: 5px solid var(--color-accent-copper);
    border-left: 2px solid var(--color-accent-stone);
    border-right: 2px solid var(--color-accent-stone);
    border-bottom: 5px solid var(--color-accent-copper);
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.9);
}

/* Detalle de recuadro interior */
.slab-content::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(179, 151, 90, 0.15);
    pointer-events: none;
}

.slab-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.slab-content ul,
.slab-content ol {
    margin-left: 2.5rem;
    margin-bottom: 1.5rem;
}

.slab-content li {
    margin-bottom: 0.8rem;
    color: var(--color-accent-gold);
}

.slab-content li>span,
.slab-content li>p {
    color: var(--color-text-primary);
}

.slab-content strong {
    color: var(--color-accent-gold);
    font-weight: 600;
}

/* Bloques Destacados */
.highlight-runic {
    border-color: var(--color-accent-gold);
    background: radial-gradient(circle at center, #181512, var(--color-bg-slab));
    text-align: center;
    color: var(--color-accent-gold);
    font-family: var(--font-titles);
    font-size: 1.3rem;
}

/* Sub-Títulos Internos */
.faction-title,
.era-title,
.arq-title {
    color: var(--color-accent-copper);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--color-accent-stone);
    display: inline-block;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 0 -2px var(--color-bg-main);
    font-family: var(--font-titles);
}

.era-subtitle {
    font-size: 1.3rem;
    color: var(--color-accent-gold);
    margin-bottom: 1.5rem;
    font-style: italic;
    font-family: var(--font-body);
}

/* --- Translucent Slab (For background legibility) --- */
.translucent-slab {
    background: rgba(20, 22, 24, 0.85) !important;
}

/* --- Who We Are Grid & Background --- */
.about-background {
    position: relative;
    background-color: var(--color-bg-main);
    min-height: 100vh;
    z-index: 1;
    /* Establece la base 3D */
}

/* TRUCO MAESTRO: Capa virtual fijada a la pantalla (soluciona el bug de móvil) */
.about-background::before {
    content: "";
    position: fixed;
    /* ¡CLAVE! Empieza debajo del menú. Así el navegador NUNCA tapa vuestras cabezas */
    top: 110px;
    left: 0;
    width: 100%;
    height: calc(100vh - 110px);
    background-image: url('../img/ancientrol-aka-background.webp');

    /* 100% auto fuerza a que se vea el ancho de la imagen entera, manteniendo la proporción */
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: -2;
    /* Al fondo del todo */
    pointer-events: none;
    /* Para que no bloquee el texto */
}

.about-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Un degradado sutil: transparente arriba para veros, oscuro abajo para poder leer el Lore */
    background: linear-gradient(to bottom, rgba(4, 4, 5, 0) 0%, rgba(4, 4, 5, 0.95) 70%);
    pointer-events: none;
    z-index: -1;
}

.quienes-grid {
    display: flex;
    gap: 2rem;
    align-items: stretch;
    position: relative;
    z-index: 2;
    /* El texto por encima de todo */

    /* Empujamos las tarjetas de texto un poco hacia abajo para dejar que la imagen respire arriba */
    padding-top: 15vw;
}

.quienes-grid .perfil-arquitecto {
    flex: 1;
    min-width: 0;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.9rem;
    color: var(--color-accent-stone);
    border-top: 1px solid var(--color-tech-glow);
    background: var(--color-bg-main);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 15px;
    }

    .about-background::before {
        /* En móvil, quitamos la fijación dura para que fluya natural y no sature la RAM */
        position: absolute;
        height: 100%;
    }

    .quienes-grid {
        padding-top: 40vw;
        /* Damos más margen en vertical para ver bien la imagen antes de leer */
        flex-direction: column;
    }

    h1.glitch-effect {
        font-size: 2rem;
    }

    h2.subtitle {
        font-size: 1.2rem;
    }

    .portal-gateways {
        flex-direction: column;
        align-items: center;
    }

    .gateway-card {
        width: 100%;
        max-width: 100%;
    }

    .runic-container {
        padding: 2rem 5%;
    }

    .slab-content {
        padding: 1.5rem;
    }

    .quienes-grid {
        flex-direction: column;
    }
}

/* ============================================================
   LORE BODY (M3) — Scope para contenido Markdown renderizado.
   Reproduce el look-and-feel rúnico que tenía el lore.html
   monolítico, ahora sobre HTML generado dinámicamente.
   ============================================================ */
.lore-body {
    background-color: var(--color-bg-slab);
    border: 1px solid var(--color-accent-stone);
    border-left: 3px solid var(--color-accent-copper);
    padding: 2rem 2.5rem;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(184, 115, 51, 0.08);
    line-height: 1.8;
    color: var(--color-text-primary);
    margin-top: 1.5rem;
}

.lore-body h2 {
    font-family: var(--font-titles);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent-copper);
    border-bottom: 1px solid var(--color-accent-stone);
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.lore-body h2:first-child {
    margin-top: 0.5rem;
}

.lore-body h3 {
    font-family: var(--font-titles);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-accent-gold);
    font-size: 1.05rem;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 400;
}

.lore-body p {
    margin-bottom: 1rem;
    text-align: justify;
}

.lore-body ul {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0;
}

.lore-body li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed rgba(75, 85, 99, 0.4);
    line-height: 1.6;
}

.lore-body li:last-child {
    border-bottom: none;
}

.lore-body li strong {
    color: var(--color-accent-copper);
    display: block;
    margin-bottom: 0.2rem;
}

.lore-body li span {
    color: var(--color-text-primary);
    opacity: 0.85;
    font-size: 0.95em;
}

.lore-body hr {
    border: none;
    border-top: 1px solid var(--color-accent-stone);
    margin: 2.5rem 0;
    opacity: 0.5;
}
