/* ==========================================================
   SAGRA — WEB
   Diseño oscuro / fantasía / editorial
========================================================== */

:root{
  --bg:#050a0d;
  --bg2:#081319;
  --cream:#eadbc0;
  --muted:#929897;
  --gold:#c99a5b;
  --gold2:#e3c087;
  --line:rgba(203,161,94,.28);
  --serif:"Cinzel", Georgia, serif;
  --sans:"Inter", Arial, sans-serif;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--cream);font-family:var(--sans);overflow-x:hidden}
img{max-width:100%;display:block}
a{text-decoration:none;color:inherit}
button{font:inherit}

.site-header{
  position:fixed;z-index:1000;top:0;left:0;width:100%;
  height:82px;padding:0 5vw;display:flex;align-items:center;
  justify-content:space-between;
  background:linear-gradient(180deg,rgba(3,8,11,.9),transparent);
  transition:.35s;
}
.site-header.scrolled{background:rgba(3,8,11,.92);backdrop-filter:blur(12px)}
.brand{display:flex;flex-direction:column;gap:2px}
.brand-main{font-family:var(--serif);font-size:22px;letter-spacing:3px;color:var(--gold2)}
.brand-sub{font-size:6px;letter-spacing:1.8px;color:var(--gold);white-space:nowrap}
.main-nav{display:flex;gap:30px}
.main-nav a,.header-cta,.footer-links a{
  font-size:9px;text-transform:uppercase;letter-spacing:1.5px;color:#bbbcb6
}
.main-nav a:hover,.footer-links a:hover{color:var(--gold2)}
.header-cta{border:1px solid var(--gold);padding:13px 18px;color:var(--gold2)}
.menu-toggle{display:none;background:none;border:0;color:var(--gold2);font-size:24px}

/* shared */
.kicker{display:block;color:var(--gold);font-size:9px;letter-spacing:3px;text-transform:uppercase;margin-bottom:18px}
.section-no{display:block;color:var(--gold);font-size:10px;letter-spacing:2px;margin-bottom:25px}
.gold-btn{
  display:inline-flex;align-items:center;gap:22px;
  background:linear-gradient(135deg,#e2bf80,#b57d3e);
  color:#1b130a;padding:16px 22px;font-size:9px;font-weight:600;
  letter-spacing:1.3px;text-transform:uppercase;transition:.3s;
}
.gold-btn:hover{transform:translateY(-3px);box-shadow:0 15px 35px rgba(197,146,70,.18)}
.line-link{display:inline-block;color:var(--gold2);font-size:9px;text-transform:uppercase;letter-spacing:1.7px;padding-bottom:8px;border-bottom:1px solid var(--gold)}
em{font-style:normal;color:var(--gold2)}
.reveal{opacity:0;transform:translateY(35px);transition:opacity .8s ease,transform .8s ease}
.reveal.visible{opacity:1;transform:none}

/* Color exclusivo del botón Conocer al autor */
.author-link {
    color: #805B2D;
    border-bottom-color: #805B2D;
}

.author-link:hover {
    color: #A87937;
    border-bottom-color: #A87937;
}

/* hero */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

/* Vídeo como background */
.hero-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Capa oscura / iluminación sobre el vídeo */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      circle at 70% 45%,
      rgba(207,151,67,.15),
      transparent 28%
    ),
    linear-gradient(
      0deg,
      #050a0d,
      transparent 28%
    );
}

/* Título */
.hero-title-image {
  position: absolute;
  z-index: 3;
  width: clamp(320px, 43vw, 590px);
  left: 10vw;
  top: 18%;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, .5));
}

.hero-title-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* Personajes */
.hero-character {
  position: absolute;
  z-index: 4;
  right: 4%;
  bottom: -10%;
  height: 88%;
  width: 47%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hero-character img {
  height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 25px 35px rgba(0,0,0,.65));
}

/* Quetzal */
.hero-quetzal {
  position: absolute;
  z-index: 5;
  right: 12%;
  top: 16%;
  width: 210px;
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 12px 25px rgba(224,161,61,.25));
}

/* Texto */
.hero-copy {
  position: absolute;
  z-index: 6;
  left: 10vw;
  bottom: 11%;
  width: min(500px, 42vw);
}

.hero-copy p {
  font-family: var(--serif);
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.6;
  color: #c9c4b8;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 25px;
}

.play-btn {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold2);
  display: flex;
  gap: 10px;
  align-items: center;
}

.play-btn i {
  font-style: normal;

  width: 34px;
  height: 34px;

  border: 1px solid var(--gold);
  border-radius: 50%;

  display: grid;
  place-items: center;

  position: relative;

  flex-shrink: 0;
}

/* Triángulo de reproducción dorado */
.play-btn i::before {
  content: "";

  width: 0;
  height: 0;

  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--gold2);

  margin-left: 3px;
}

/* Scroll */
.scroll-hint {
  position: absolute;
  z-index: 8;
  bottom: 28px;
  left: 50%;
  font-size: 7px;
  letter-spacing: 3px;
  color: #777;
  display: flex;
  gap: 12px;
}

/* Número */
.hero-mark {
  position: absolute;
  z-index: 8;
  right: 5vw;
  bottom: 30px;
  color: var(--gold);
  font-size: 9px;
}

/* intro */
.intro{min-height:820px;display:grid;grid-template-columns:46% 54%;background:var(--bg2);border-bottom:1px solid var(--line)}
.intro-copy{padding:130px 5vw 100px 12vw;display:flex;flex-direction:column;justify-content:center}
.intro h2{font:400 clamp(31px,3.4vw,54px)/1.25 var(--serif);max-width:570px}
.intro p{font-size:13px;line-height:1.85;color:var(--muted);max-width:520px;margin-top:28px}
.actions{display:flex;align-items:center;gap:25px;margin-top:35px}
.book-stage{position:relative;display:grid;place-items:center;overflow:hidden}
/* =========================================================
   LIBRO 3D
========================================================= */

    .book-3d {
    position: relative;
    z-index: 3;

    width: 330px;
    height: 470px;

    max-width: 100%;
    box-sizing: border-box;

    transform-style: preserve-3d;
    perspective: 1800px;

    transform:
        rotateY(-18deg)
        rotateX(5deg)
        rotateZ(-4deg);

    transition:
        transform 1s cubic-bezier(.2,.8,.2,1);

    filter:
        drop-shadow(25px 25px 28px rgba(0,0,0,.4));
}


/* =========================================================
   INTERIOR DEL LIBRO
========================================================= */

.book-inside{
    position:absolute;
    inset:0;

    display:flex;

    transform-style:preserve-3d;

    z-index:1;

    overflow:hidden;

    border-radius:3px;

    box-shadow:
        inset 0 0 30px rgba(0,0,0,.18);
}


.inside-page{
    position:relative;

    width:50%;
    height:100%;

    box-sizing:border-box;

    background:
        linear-gradient(
            90deg,
            #d8c7a8,
            #f7ecd5 12%,
            #fff8e9 100%
        );

    color:#392817;

    padding:55px 35px;

    overflow:hidden;
}


/* PÁGINA IZQUIERDA */

.inside-left{
    text-align:center;

    border-right:
        1px solid rgba(80,50,20,.25);

    box-shadow:
        inset -12px 0 20px rgba(0,0,0,.08);
}


/* PÁGINA DERECHA */

.inside-right{
    box-shadow:
        inset 12px 0 20px rgba(0,0,0,.08);
}


/* TEXTO */

.inside-left h3{
    margin-top:100px;

    font-family:var(--serif);

    font-size:28px;

    letter-spacing:5px;
}

.inside-left p{
    margin-top:25px;

    font-family:var(--serif);

    font-size:12px;

    line-height:1.8;

    opacity:.7;
}


/* DECORACIÓN */

.page-decoration{
    position:absolute;

    inset:25px;

    border:
        1px solid rgba(100,65,30,.3);

    pointer-events:none;
}


/* IMAGEN INTERIOR */

.inside-right img{
    width:75%;

    position:absolute;

    left:12%;
    top:17%;

    transform:rotate(-4deg);

    filter:
        drop-shadow(
            8px 12px 15px rgba(0,0,0,.35)
        );
}


/* LÍNEAS */

.page-lines{
    position:absolute;

    left:15%;
    right:15%;

    bottom:50px;

    height:80px;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 13px,
            rgba(80,50,20,.12) 14px
        );
}


/* =========================================================
   PORTADA
========================================================= */

.book-cover{
    position:absolute;

    inset:0;

    z-index:5;

    overflow:hidden;

    transform-origin:left center;

    transform:
        translateZ(18px)
        rotateY(0deg);

    transition:
        transform 1.35s cubic-bezier(.2,.75,.15,1);

    border-radius:
        2px 6px 6px 2px;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.15),
        inset -15px 0 25px rgba(0,0,0,.3);
}


.book-cover img{
    width:100%;
    height:100%;

    object-fit:cover;

    display:block;
}


/* =========================================================
   LOMO
========================================================= */

.book-spine{
    position:absolute;

    left:-35px;
    top:0;

    width:35px;
    height:100%;

    background:
        linear-gradient(
            90deg,
            #3c2412,
            #8a5b2f 35%,
            #3b2110
        );

    transform:
        rotateY(90deg);

    transform-origin:right center;

    border-radius:
        4px 0 0 4px;

    z-index:3;
}


/* =========================================================
   PÁGINAS
========================================================= */

.book-pages{
    position:absolute;

    right:-18px;
    top:8px;

    width:20px;
    height:calc(100% - 16px);

    transform-style:preserve-3d;

    transform-origin:left center;

    transform:
        rotateY(90deg);

    z-index:4;
}


.book-pages span{
    position:absolute;

    left:0;
    top:0;

    width:100%;
    height:100%;

    background:
        linear-gradient(
            90deg,
            #cdb995,
            #fff7e7 45%,
            #d8c6a6
        );

    transform-origin:left center;

    backface-visibility:hidden;

    box-shadow:
        1px 0 3px rgba(0,0,0,.2);
}


.book-pages span:nth-child(1){
    transform:translateZ(0);
}

.book-pages span:nth-child(2){
    transform:translateZ(3px);
}

.book-pages span:nth-child(3){
    transform:translateZ(6px);
}

.book-pages span:nth-child(4){
    transform:translateZ(9px);
}

.book-pages span:nth-child(5){
    transform:translateZ(12px);
}


/* =========================================================
   ABRIR EL LIBRO
========================================================= */

.book-3d:hover{
    transform:
        rotateY(-3deg)
        rotateX(2deg)
        rotateZ(-1deg)
        translateY(-15px)
        scale(1.04);
}


/* PORTADA GIRANDO */

.book-3d:hover .book-cover{
    transform:
        translateZ(18px)
        rotateY(-145deg);
}


/* =========================================================
   MOVIMIENTO DE LAS PÁGINAS
========================================================= */

.book-3d:hover .book-pages span:nth-child(1){
    animation:
        pageMove1
        1.8s
        ease-in-out
        infinite
        alternate;
}

.book-3d:hover .book-pages span:nth-child(2){
    animation:
        pageMove2
        2s
        ease-in-out
        infinite
        alternate;
}

.book-3d:hover .book-pages span:nth-child(3){
    animation:
        pageMove3
        1.6s
        ease-in-out
        infinite
        alternate;
}

.book-3d:hover .book-pages span:nth-child(4){
    animation:
        pageMove4
        2.2s
        ease-in-out
        infinite
        alternate;
}

.book-3d:hover .book-pages span:nth-child(5){
    animation:
        pageMove5
        1.9s
        ease-in-out
        infinite
        alternate;
}



/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes pageMove1{
    from{
        transform:
            translateZ(0)
            rotateY(0deg);
    }

    to{
        transform:
            translateZ(0)
            rotateY(-10deg);
    }
}

@keyframes pageMove2{
    from{
        transform:
            translateZ(3px)
            rotateY(0deg);
    }

    to{
        transform:
            translateZ(3px)
            rotateY(7deg);
    }
}

@keyframes pageMove3{
    from{
        transform:
            translateZ(6px)
            rotateY(0deg);
    }

    to{
        transform:
            translateZ(6px)
            rotateY(-8deg);
    }
}

@keyframes pageMove4{
    from{
        transform:
            translateZ(9px)
            rotateY(0deg);
    }

    to{
        transform:
            translateZ(9px)
            rotateY(6deg);
    }
}

@keyframes pageMove5{
    from{
        transform:
            translateZ(12px)
            rotateY(0deg);
    }

    to{
        transform:
            translateZ(12px)
            rotateY(-5deg);
    }
}


/* =========================================================
   BRILLO
========================================================= */

.book-shine{
    position:absolute;

    inset:0;

    z-index:10;

    pointer-events:none;

    background:
        linear-gradient(
            120deg,
            transparent 35%,
            rgba(255,255,255,.13) 48%,
            transparent 60%
        );

    transform:
        translateZ(22px);

    opacity:.5;

    mix-blend-mode:screen;
}


/* =========================================================
   SOMBRA
========================================================= */

.book-3d::after{
    content:"";

    position:absolute;

    left:5%;
    right:-15%;

    bottom:-50px;

    height:65px;

    background:
        rgba(0,0,0,.65);

    filter:
        blur(25px);

    transform:
        rotate(-4deg);

    z-index:-1;
}


/* =========================================
   LIBRO 3D — ADAPTACIÓN RESPONSIVE
   ========================================= */

/* Evitar que la escena recorte la apertura */
.book-3d {
    flex-shrink: 0;
}

/* Portátil y pantallas medianas */
@media (max-width: 1200px) {
    .book-3d {
        transform:
            rotateY(-12deg)
            rotateX(3deg)
            rotateZ(-3deg)
            scale(.88);
    }

    .book-3d:hover {
        transform:
            rotateY(-2deg)
            rotateX(1deg)
            rotateZ(-1deg)
            translateY(-8px)
            scale(.91);
    }
}

/* Móviles */
@media (max-width: 700px) {
    .book-3d {
        transform:
            rotateY(-8deg)
            rotateX(2deg)
            rotateZ(-2deg)
            scale(.72);
    }

    .book-3d:hover {
        transform:
            rotateY(-2deg)
            rotateX(1deg)
            rotateZ(0deg)
            translateY(-5px)
            scale(.75);
    }
}

/* Reducir movimiento si el usuario lo solicita */
@media (prefers-reduced-motion: reduce) {
    .book-3d,
    .book-cover {
        transition-duration: .01ms;
    }

    .book-3d:hover .book-pages span {
        animation: none;
    }
}

/* =========================================
   ESCENA DEL LIBRO — ESPACIO PARA ABRIRSE
   ========================================= */

.book-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 620px;

    /* Deja salir la portada al girar */
    overflow: visible;
    perspective: 1800px;
}

/* El libro mantiene su volumen 3D */
.book-3d {
    position: relative;
    flex: 0 0 330px;
    width: 330px;
    height: 470px;

    transform-style: preserve-3d;
    transform-origin: center center;
}

/* La portada debe conservar su propio recorte */
.book-cover {
    overflow: hidden;
}

/* El interior conserva las páginas dentro del libro */
.book-inside {
    overflow: hidden;
}

/* Evita que el contenedor de la sección corte el libro */
.intro {
    overflow: visible;
}

/* Ajustes para pantallas medianas */
@media (max-width: 1100px) {
    .book-stage {
        min-height: 550px;
    }

    .book-3d {
        transform: scale(.85);
    }

    .book-3d:hover {
        transform:
            rotateY(-3deg)
            rotateX(2deg)
            rotateZ(-1deg)
            translateY(-10px)
            scale(.88);
    }
}

/* Móviles */
@media (max-width: 700px) {
    .book-stage {
        min-height: 430px;
    }

    .book-3d {
        transform: scale(.68);
    }

    .book-3d:hover {
        transform:
            rotateY(-3deg)
            rotateX(2deg)
            rotateZ(-1deg)
            translateY(-5px)
            scale(.70);
    }
}



/* =========================================================
   MAPA Y ELEMENTOS DEL LIBRO
========================================================= */

.paper-map{
    position:absolute;

    inset:9% 4%;

    background:
        url("assets/MAPA DE SAGRA.png")
        center/cover;

    opacity:.24;

    filter:sepia(.8);

    transform:
        rotate(-4deg)
        scale(1.1);
}

.book-detail{
    position:absolute;

    z-index:4;

    width:180px;

    right:13%;
    bottom:16%;

    transform:rotate(6deg);

    filter:
        drop-shadow(10px 15px 20px #000);
}

.floating-label{
    position:absolute;

    color:var(--gold2);

    font-size:8px;

    letter-spacing:2px;
}

.label-a{
    left:14%;
    top:22%;
}

.label-b{
    right:10%;
    top:28%;
}

.label-c{
    left:16%;
    bottom:25%;
}
/* world */
.world{min-height:720px;display:grid;grid-template-columns:57% 43%;background:#080f12}
.map-panel{position:relative;overflow:hidden;display:grid;place-items:center}
.map-panel img{width:90%;height:80%;object-fit:contain;filter:sepia(.35) brightness(.75);transition:transform 1s}
.map-panel:hover img{transform:scale(1.04)}
.map-frame{position:absolute;inset:10%;border:1px solid var(--line);pointer-events:none}
.world-copy{padding:100px 10vw 100px 5vw;display:flex;flex-direction:column;justify-content:center;border-left:1px solid var(--line)}
.world h2{font:400 54px/1.1 var(--serif)}
.world p{max-width:420px;color:var(--muted);font-size:13px;line-height:1.8;margin:25px 0}
.symbols{display:flex;align-items:center;gap:20px;margin-bottom:30px}
.symbols img{width:75px;height:75px;object-fit:contain}
.symbols strong{display:block;color:var(--gold2);font:500 12px var(--serif);letter-spacing:1px}
.symbols small{display:block;color:#747b79;font-size:10px;margin-top:6px;max-width:230px}


/* =========================================
   MAPA DE SAGRA — ZOOM SEGURO
   ========================================= */

.map-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    cursor: zoom-in;
}

/* Imagen del mapa */
.map-panel > img {
    width: 90%;
    height: 80%;
    object-fit: contain;
    transform: translate3d(0, 0, 0) scale(1);
    transform-origin: center center;
    transition: filter .35s ease;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

/* Efecto al acercar */
.map-panel.is-zoomed {
    cursor: crosshair;
}

.map-panel.is-zoomed > img {
    filter: sepia(.18) brightness(.92) contrast(1.05);
}

/* Marco decorativo */
.map-panel .map-frame {
    position: absolute;
    inset: 10%;
    z-index: 2;
    border: 1px solid var(--line);
    pointer-events: none;
    transition: border-color .3s ease;
}

.map-panel.is-zoomed .map-frame {
    border-color: rgba(218, 178, 105, .8);
}

/* Botones de zoom */
.map-panel .map-zoom-controls {
    position: absolute;
    z-index: 5;
    right: 7%;
    bottom: 7%;
    display: flex;
    gap: 8px;
}

.map-panel .map-zoom-controls button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(196, 157, 91, .65);
    background: rgba(5, 13, 18, .92);
    color: var(--gold2);
    font-size: 22px;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
}

.map-panel .map-zoom-controls button:hover {
    background: var(--gold);
    color: #050d12;
}

.map-panel .map-zoom-controls button:focus-visible {
    outline: 2px solid var(--gold2);
    outline-offset: 3px;
}

/* Móviles */
@media (max-width: 700px) {
    .map-panel {
        min-height: 390px;
    }

    .map-panel > img {
        width: 94%;
        height: 86%;
    }

    .map-panel .map-frame {
        inset: 5%;
    }

    .map-panel .map-zoom-controls {
        right: 8%;
        bottom: 8%;
    }
}

/* =========================================================
   PERSONAJES — CARRUSEL
========================================================= */

.characters{
    padding:110px 5vw 120px;

    background:#050d12;

    border-bottom:1px solid var(--line);

    overflow:hidden;
}


.characters-heading{
    margin-left:7vw;

    margin-bottom:55px;
}


.characters-heading h2{
    font:
        400
        clamp(36px,4vw,58px)
        /1.15
        var(--serif);
}


.characters-heading p{
    color:var(--muted);

    font-size:12px;

    line-height:1.7;

    max-width:390px;

    margin-top:20px;
}


/* =========================================================
   CONTENEDOR
========================================================= */

.characters-carousel{

    position:relative;

    display:flex;

    align-items:center;

    gap:20px;

    padding:0 4vw;
}


/* =========================================================
   VENTANA
========================================================= */

.character-viewport{

    width:100%;

    overflow:hidden;
}


/* =========================================================
   CARRIL
========================================================= */

.character-track{

    display:flex;

    gap:13px;

    transition:
        transform
        .8s
        cubic-bezier(.2,.8,.2,1);

    will-change:transform;
}


/* =========================================================
   TARJETA
========================================================= */

.character-card{

    flex:
        0 0
        calc((100% - 39px) / 4);

    height:500px;

    position:relative;

    overflow:hidden;

    background:#101a1d;

    border:1px solid var(--line);

    cursor:pointer;
}


/* =========================================================
   IMAGEN
========================================================= */

.character-image{

    position:absolute;

    inset:0;

    overflow:hidden;
}


.character-image img{

    width:100%;
    height:100%;

    object-fit:contain;

    object-position:center center;

    display:block;

    transition:
        transform
        .9s
        cubic-bezier(.2,.8,.2,1),

        filter
        .9s;
}


/* OSCURECER PARTE INFERIOR */

.character-image::after{

    content:"";

    position:absolute;

    inset:0;

    background:
        linear-gradient(
            0deg,
            rgba(0,0,0,.9),
            rgba(0,0,0,.05) 60%,
            transparent 80%
        );
}


/* HOVER */

.character-card:hover
.character-image img{

    transform:
        scale(1.07);

    filter:
        saturate(1.08)
        contrast(1.05);
}


/* =========================================================
   TEXTO
========================================================= */

.character-info{

    position:absolute;

    z-index:3;

    left:22px;

    right:22px;

    bottom:22px;
}


.character-info span{

    font-size:8px;

    color:var(--gold);
}


.character-info h3{

    font:
        400
        13px
        var(--serif);

    letter-spacing:1.5px;

    color:var(--gold2);

    margin-top:5px;
}


/* =========================================================
   FLECHAS
========================================================= */

.character-arrow{

    flex:
        0 0 48px;

    width:48px;
    height:48px;

    border:1px solid
        rgba(196,157,91,.45);

    background:
        rgba(5,13,18,.75);

    color:var(--gold2);

    font-size:22px;

    display:grid;

    place-items:center;

    cursor:pointer;

    z-index:5;

    transition:
        background .3s,
        color .3s,
        transform .3s,
        opacity .3s;
}


.character-arrow:hover{

    background:
        var(--gold);

    color:#050d12;

    transform:
        scale(1.08);
}


.character-arrow:disabled{

    opacity:.25;

    cursor:default;

    transform:none;
}


/* =========================================================
   CONTADOR
========================================================= */

.character-counter{

    display:flex;

    align-items:center;

    justify-content:center;

    gap:14px;

    margin-top:28px;

    color:
        rgba(220,205,175,.45);

    font-size:9px;

    letter-spacing:3px;
}


.character-current{

    color:var(--gold2);
}


.character-line{

    width:70px;

    height:1px;

    background:
        rgba(196,157,91,.35);
}

/* legend */
.legend{min-height:700px;display:grid;grid-template-columns:56% 44%;background:radial-gradient(circle at 25% 45%,rgba(185,122,44,.18),transparent 35%),#070d10}
.legend-art{display:grid;place-items:center;overflow:hidden}
.legend-art img{height:90%;width:auto;filter:drop-shadow(0 30px 35px rgba(0,0,0,.55));animation:float 6s ease-in-out infinite}
.legend-copy{padding:80px 11vw 80px 4vw;display:flex;flex-direction:column;justify-content:center}
.legend h2{font:400 53px/1.12 var(--serif)}
.legend p{color:var(--muted);font-size:13px;line-height:1.8;max-width:410px;margin:25px 0}

/* gallery */
.gallery-section{padding:110px 6vw;background:#e0d1b7;color:#211b14}
.gallery-head{display:flex;justify-content:space-between;align-items:end;margin:0 4vw 45px}
.gallery-head .section-no,.gallery-head .kicker{color:#82633c}
.gallery-head h2{font:400 clamp(34px,4vw,55px)/1.15 var(--serif)}
.gallery-head p{max-width:310px;color:#756d62;font-size:11px;line-height:1.7}
.gallery{display:grid;grid-template-columns:repeat(3,1fr);grid-auto-rows:260px;gap:14px}
.gallery-item{position:relative;overflow:hidden;background:#b7aa94}
.gallery-item.tall{grid-row:span 2}
.gallery-item.wide{grid-column:span 2}
.gallery-item img{width:100%;height:100%;object-fit:cover;transition:.6s}
.gallery-item:hover img{transform:scale(1.05)}
.gallery-item:after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,rgba(0,0,0,.7),transparent 50%)}
.gallery-item figcaption{position:absolute;z-index:2;left:18px;bottom:16px;color:#eee0c7;font:400 11px var(--serif);letter-spacing:.7px}

/* =========================================
   PERSONAJES — CARTAS MÁGICAS
   ========================================= */

.characters {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 50% 35%,
            rgba(26, 75, 66, .20), transparent 65%),
        #050d12;
}

/* Un poco más de presencia en el encabezado */

.characters-heading {
    position: relative;
}

.characters-heading .kicker {
    color: var(--gold2);
    letter-spacing: 5px;
}

.characters-heading h2 em {
    color: var(--gold2);
    font-weight: 400;
}

/* Espacio para que las cartas puedan elevarse */

.characters-carousel {
    padding-top: 18px;
    padding-bottom: 22px;
}

.character-viewport {
    overflow: hidden;
    padding: 4px 2px 12px;
}

.character-track {
    align-items: stretch;
}

/* La carta */

.character-card {
    isolation: isolate;
    height: 520px;
    background:
        radial-gradient(ellipse at 50% 35%,
            rgba(37, 83, 72, .25), transparent 65%),
        linear-gradient(180deg, #101a1d, #060b0d 90%);
    border: 1px solid rgba(196, 157, 91, .48);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
    transition:
        transform .45s cubic-bezier(.2, .8, .2, 1),
        border-color .45s ease,
        box-shadow .45s ease;
}

/* Marco ornamental interior */

.character-card::before {
    content: "";
    position: absolute;
    inset: 9px;
    z-index: 2;
    border: 1px solid rgba(196, 157, 91, .22);
    pointer-events: none;
    transition:
        inset .45s ease,
        border-color .45s ease;
}

/* Brillo ambiental inferior */

.character-card::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 35% 0 0;
    pointer-events: none;
    opacity: .5;
    background: linear-gradient(
        0deg,
        rgba(196, 157, 91, .10),
        transparent 65%
    );
    transition: opacity .45s ease;
}

/* Imagen y profundidad */

.character-image {
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 50% 42%,
            rgba(196, 157, 91, .10), transparent 65%);
}

.character-image img {
    position: relative;
    z-index: 0;
    object-fit: contain;
    object-position: center center;
    padding: 12px 5px 0;
    transform: scale(.96);
    transform-origin: center 45%;
    filter: saturate(.94) brightness(.94);
    transition:
        transform .75s cubic-bezier(.2, .8, .2, 1),
        filter .75s ease;
}

/* Degradado para integrar la figura con el texto */

.character-image::after {
    z-index: 1;
    background: linear-gradient(
        0deg,
        rgba(3, 7, 8, .98) 0%,
        rgba(3, 7, 8, .78) 15%,
        rgba(3, 7, 8, .12) 43%,
        transparent 68%
    );
}

/* Número de colección */

.character-info {
    left: 23px;
    right: 18px;
    bottom: 25px;
    z-index: 3;
}

.character-info span {
    display: inline-block;
    color: var(--gold2);
    font-size: 10px;
    letter-spacing: 2px;
}

.character-info span::after {
    content: "  ✦";
    color: rgba(196, 157, 91, .75);
    font-size: 9px;
}

.character-info h3 {
    position: relative;
    margin-top: 9px;
    padding-top: 11px;
    color: var(--gold2);
    font-size: clamp(11px, 1vw, 14px);
    line-height: 1.5;
    letter-spacing: 1.5px;
}

.character-info h3::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 38px;
    height: 1px;
    background: var(--gold);
}

/* Interacción */

@media (hover: hover) and (pointer: fine) {
    .character-card:hover {
        transform: translateY(-9px);
        border-color: var(--gold2);
        box-shadow:
            0 20px 42px rgba(0, 0, 0, .38),
            0 0 24px rgba(196, 157, 91, .09);
    }

    .character-card:hover::before {
        inset: 6px;
        border-color: rgba(220, 184, 116, .62);
    }

    .character-card:hover::after {
        opacity: 1;
    }

    .character-card:hover .character-image img {
        transform: scale(1.045);
        filter: saturate(1.08) brightness(1.04);
    }
}

/* Accesibilidad: respetar movimiento reducido */

@media (prefers-reduced-motion: reduce) {
    .character-card,
    .character-card::before,
    .character-card::after,
    .character-image img {
        transition: none !important;
    }
}

/* Adaptación a pantallas pequeñas */

@media (max-width: 1050px) {
    .character-card {
        flex: 0 0 calc((100% - 13px) / 2);
        height: 480px;
    }
}

@media (max-width: 600px) {
    .characters {
        padding: 80px 4vw 85px;
    }

    .characters-heading {
        margin-left: 3vw;
        margin-bottom: 30px;
    }

    .characters-carousel {
        gap: 8px;
        padding-left: 0;
        padding-right: 0;
    }

    .character-arrow {
        flex-basis: 34px;
        width: 34px;
        height: 42px;
        font-size: 18px;
    }

    .character-card {
        flex: 0 0 100%;
        height: 490px;
    }

    .character-info {
        left: 22px;
        bottom: 24px;
    }
}

/* =========================================
   CARTAS DE PERSONAJES — GIRO 3D
   ========================================= */

.character-card {
    height: 520px;
    perspective: 1200px;
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
}

.character-card::before,
.character-card::after {
    content: none;
}

.character-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .8s cubic-bezier(.2, .75, .25, 1);
}

/* Girar al pasar el ratón */
@media (hover: hover) and (pointer: fine) {
    .character-card:hover .character-card-inner {
        transform: rotateY(180deg);
    }
}

/* Las dos caras */
.character-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid rgba(196, 157, 91, .65);
    background:
        radial-gradient(ellipse at 50% 35%,
            rgba(32, 77, 65, .3), transparent 65%),
        #07100f;
}

/* Marco fino interior */
.character-face::before {
    content: "";
    position: absolute;
    inset: 9px;
    z-index: 6;
    border: 1px solid rgba(196, 157, 91, .25);
    pointer-events: none;
}

/* Frontal */
.character-front {
    transform: rotateY(0deg);
}

.character-front .character-image {
    z-index: 0;
}

.character-front .character-info {
    z-index: 3;
    bottom: 24px;
}

.character-hint {
    margin-top: 12px;
    color: rgba(220, 190, 130, .7);
    font-size: 8px;
    letter-spacing: 1.8px;
}

/* Reverso */
.character-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 24px;
    background:
        radial-gradient(ellipse at 50% 25%,
            rgba(95, 71, 38, .25), transparent 65%),
        linear-gradient(160deg, #12201d, #05090b 85%);
}

.back-number,
.back-kicker,
.back-footer {
    position: relative;
    z-index: 2;
    color: var(--gold2);
    text-align: center;
    letter-spacing: 3px;
    font-size: 9px;
}

.back-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.back-content h3 {
    margin-top: 15px;
    color: var(--gold2);
    font: 400 clamp(17px, 1.5vw, 23px)/1.4 var(--serif);
    letter-spacing: 1px;
}

.back-divider {
    margin: 22px 0;
    color: var(--gold);
    font-size: 19px;
}

.back-content p {
    color: rgba(235, 226, 207, .85);
    font: 400 12px/1.9 var(--serif);
}

.back-footer {
    font-size: 8px;
}

/* Evitar que las cartas se eleven al girar */
@media (hover: hover) and (pointer: fine) {
    .character-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Móvil: giro al tocar mediante una clase */
.character-card.is-flipped .character-card-inner {
    transform: rotateY(180deg);
}

@media (max-width: 600px) {
    .character-card {
        height: 490px;
    }

    .character-back {
        padding: 28px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .character-card-inner {
        transition: none;
    }
}


/* =========================================================
   AUTOR
========================================================= */

.author{

    min-height:700px;

    padding:
        100px 10vw;

    display:grid;

    grid-template-columns:
        48% 52%;

    align-items:center;

    background:
        #cbbda4;

    color:#231e17;

    overflow:hidden;
}


.author-copy{

    padding-right:7vw;
}


.author-copy .section-no,
.author-copy .kicker{

    color:#755b39;
}


.author h2{

    font:
        400
        clamp(42px,5vw,68px)
        /1.08
        var(--serif);

    margin-top:15px;
}


.author p{

    font-size:13px;

    line-height:1.8;

    max-width:450px;

    margin:25px 0;
}


/* FOTO */

.author-image{

    position:relative;

    justify-self:center;

    width:min(430px,80%);

    transform:
        rotate(2deg);
}


/* MARCO */

.author-frame{

    position:relative;

    padding:12px;

    background:
        #e8dcc5;

    box-shadow:
        0 30px 50px
        rgba(0,0,0,.25);
}


/* BORDE DECORATIVO */

.author-frame::before{

    content:"";

    position:absolute;

    inset:-12px;

    border:
        1px solid
        rgba(76,57,34,.45);

    transform:
        rotate(-4deg);

    pointer-events:none;
}


/* FOTO */

.author-frame img{

    display:block;

    width:100%;

    aspect-ratio:
        3 / 4;

    object-fit:cover;

    object-position:
        center top;
}


/* NOMBRE BAJO LA FOTO */

.author-caption{

    display:block;

    margin-top:22px;

    text-align:right;

    font-size:8px;

    letter-spacing:3px;

    color:#6d5436;
}

/* CTA/footer */
.cta{min-height:620px;position:relative;display:grid;place-items:center;text-align:center;overflow:hidden}
.cta-bg{position:absolute;inset:0;background:linear-gradient(rgba(3,8,11,.5),#03080b),url("assets/JAULA DE HIELO.png") center/cover;filter:saturate(.65)}
.cta-content{position:relative;z-index:2}
.cta-symbol{width:95px;margin:0 auto 25px;opacity:.8}
.cta h2{font:400 clamp(45px,6vw,75px)/1 var(--serif)}
.cta p{color:#6d5436;margin:20px 0 30px;font-size:12px}
footer{padding:55px 6vw;display:flex;align-items:center;justify-content:space-between;background:#03080b;border-top:1px solid var(--line)}
.footer-links{display:flex;gap:25px}

/* animation */
@keyframes float{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-16px) rotate(2deg)}}

/* responsive */
@media(max-width:1050px){
  .main-nav{display:none}.menu-toggle{display:block}
  .header-cta{display:none}
  .hero-title-image{left:7vw;width:52vw}.hero-character{width:58%;right:-7%}
  .intro{grid-template-columns:1fr}.intro-copy{padding:100px 8vw 40px}.book-stage{min-height:650px}
  .world{grid-template-columns:1fr}.map-panel{height:550px}.world-copy{border-left:0;padding:80px 10vw}
  .character-grid{grid-template-columns:repeat(2,1fr)}
  .gallery{grid-template-columns:repeat(2,1fr)}
  .gallery-item.wide{grid-column:span 2}
}
@media(max-width:650px){
  .site-header{height:70px;padding:0 6vw}
  .brand-main{font-size:18px}
  .hero{min-height:820px;align-items:flex-start;padding-top:150px}
  .hero-title-image{top:140px;left:7vw;width:82vw}
  .hero-character{height:58%;width:90%;right:-22%;bottom:0;opacity:.85}
  .hero-quetzal{width:135px;right:4%;top:31%}
  .hero-copy{left:7vw;bottom:8%;max-width:330px}
  .hero-copy p{font-size:12px}
  .hero-actions{align-items:flex-start;flex-direction:column;gap:18px}
  .intro-copy{padding:85px 8vw 20px}
  .book-stage{min-height:520px}.book{width:55%}.book-detail{width:130px}
  .map-panel{height:430px}.map-frame{inset:6%}
  .world-copy{padding:70px 8vw}
  .characters{padding:80px 7vw}.characters-heading{margin-left:0}
  .character-grid{grid-template-columns:repeat(2,1fr);gap:9px}.character{height:360px}
  .legend{grid-template-columns:1fr}.legend-art{height:450px}.legend-copy{padding:70px 8vw}
  .gallery-section{padding:80px 6vw}.gallery-head{display:block;margin:0 2vw 30px}.gallery-head p{margin-top:20px}
  .gallery{grid-template-columns:1fr;grid-auto-rows:300px}.gallery-item.tall,.gallery-item.wide{grid-row:auto;grid-column:auto}
  .author{grid-template-columns:1fr;padding:80px 8vw;gap:50px}.author-copy{padding:0}.author h2{font-size:38px}
  footer{flex-direction:column;gap:28px;text-align:center}.footer-links{flex-wrap:wrap;justify-content:center}
}


/* ==========================================================
   V2 — MÁS CINEMÁTICA / PARALLAX / SECCIONES ENTRELAZADAS
========================================================== */

body{background:#04090c}
main{position:relative;isolation:isolate}

.hero-bg{will-change:transform}
.hero-character{will-change:transform}
.hero-quetzal{will-change:transform}
.hero-title-image{will-change:transform}

.ambient-particles{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:20;
  opacity:.55;
  background-image:
    radial-gradient(circle,rgba(225,190,125,.65) 0 1px,transparent 1.5px),
    radial-gradient(circle,rgba(255,255,255,.32) 0 1px,transparent 1.5px);
  background-size:170px 170px,260px 260px;
  background-position:20px 30px,90px 100px;
  mix-blend-mode:screen;
  animation:particleDrift 24s linear infinite;
}
@keyframes particleDrift{
  to{background-position:190px 210px,-100px -160px}
}

.hero:after{
  content:"";
  position:absolute;
  z-index:2;
  left:0;right:0;bottom:0;height:180px;
  background:linear-gradient(transparent,#050a0d);
  pointer-events:none;
}

.scroll-quetzal{
  position:fixed;
  z-index:80;
  right:4vw;
  top:38%;
  width:125px;
  pointer-events:none;
  opacity:0;
  transform:translate3d(120px,0,0) rotate(8deg);
  filter:drop-shadow(0 12px 22px rgba(229,170,65,.22));
  transition:opacity .5s ease;
}
.scroll-quetzal img{width:100%;height:auto}
.scroll-quetzal.active{opacity:.9}

/* ==========================================================
   SECCIONES NARRATIVAS — STORY SPLIT
========================================================== */

.story-split {
  min-height: 690px;
  display: grid;
  grid-template-columns: 54% 46%;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #070e12;
}

.story-split.story-two {
  grid-template-columns: 45% 55%;
  background: #050b0e;
}

/* Zona de la ilustración */
.story-art {
  position: relative;
  min-width: 0;
  min-height: 690px;
  padding: 30px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #050b0e;
}

/* Marco decorativo */
.story-art::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: 2;
  border: 1px solid rgba(202, 157, 87, .22);
  pointer-events: none;
}

/* Imagen: completa, sin deformarse */
/* Imagen: completa, más pequeña y sin deformarse */
.story-art img {
display: block;
width: 85%;
height: 85%;
margin: auto;
object-fit: cover;
object-position: center;
filter: saturate(.85) contrast(1.03);
transform-origin: center center;
animation: storyCameraMove 18s ease-in-out infinite alternate;
will-change: transform;
}

/* Movimiento cinematográfico lento */
@keyframes storyCameraMove {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(0, -7px, 0) scale(1.045);
  }
}

/* Texto sobre la ilustración */
.art-caption {
  position: absolute;
  z-index: 3;
  bottom: 35px;
  left: 9%;
  font: 9px var(--sans);
  letter-spacing: 2.5px;
  color: var(--gold2);
}

/* Texto de las secciones */
.story-copy {
  padding: 100px 10vw 100px 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.story-two .story-copy {
  padding-left: 10vw;
  padding-right: 5vw;
}

.story-copy h2 {
  font: 400 clamp(38px, 4vw, 62px)/1.13 var(--serif);
  max-width: 650px;
}

.story-copy p {
  max-width: 440px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  margin: 26px 0 30px;
}


/* Línea decorativa */
.story-split .story-copy::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 1px;
  bottom: 80px;
  background: var(--gold);
  opacity: .35;
}

.story-one .story-copy::after {
  right: 10vw;
}

.story-two .story-copy::after {
  left: 10vw;
}

/* Tablet */
@media (max-width: 1050px) {
  .story-split,
  .story-split.story-two {
    grid-template-columns: 1fr;
  }

  .story-art {
    min-height: 560px;
    order: 0;
  }

  .story-copy,
  .story-two .story-copy {
    padding: 85px 8vw;
    order: 1;
  }
}

/* Móvil */
@media (max-width: 700px) {
  .story-art {
    min-height: 390px;
    padding: 14px;
  }

  .story-copy,
  .story-two .story-copy {
    padding: 70px 8vw;
  }

  .story-split .story-copy::after {
    display: none;
  }
}

/* Respetar la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .story-art img {
    animation: none;
  }
}

.characters{
  position:relative;
  overflow:hidden;
}
.characters:before{
  content:"";
  position:absolute;
  width:480px;height:480px;
  border-radius:50%;
  background:rgba(197,144,61,.08);
  filter:blur(60px);
  left:-160px;top:20%;
  pointer-events:none;
}
.character:nth-child(1){transform:translateY(25px)}
.character:nth-child(2){transform:translateY(-25px)}
.character:nth-child(3){transform:translateY(35px)}
.character:nth-child(4){transform:translateY(-5px)}
.character.visible{animation:cardSettle .9s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes cardSettle{
  from{opacity:0;transform:translateY(70px)}
  to{opacity:1;transform:translateY(var(--card-y,0))}
}

.legend{
  position:relative;
  overflow:hidden;
}
.legend:after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(90deg,transparent 55%,rgba(224,168,78,.05));
}
.legend-art img{
 transform:translate3d(0,0,0) scale(.92);
  transition:transform 1.2s cubic-bezier(.2,.8,.2,1);
}
.legend-art:hover img{transform:translate3d(18px,-10px,0) scale(.98)}

.gallery-item{
  transform:translateY(25px);
  transition:transform .9s cubic-bezier(.2,.8,.2,1),opacity .8s;
}
.gallery-item.visible{transform:translateY(0)}
.gallery-item:nth-child(2){transition-delay:.08s}
.gallery-item:nth-child(3){transition-delay:.16s}
.gallery-item:nth-child(4){transition-delay:.24s}
.gallery-item:nth-child(5){transition-delay:.32s}
.gallery-item:nth-child(6){transition-delay:.4s}

.cta-content{
  transform:translateY(20px);
  transition:transform 1s ease;
}
.cta-content.visible{transform:none}

@media(max-width:1050px){
  .scroll-quetzal{width:95px;right:2vw}
  .story-split,.story-split.story-two{grid-template-columns:1fr}
  .story-art{min-height:560px;order:0}
  .story-copy,.story-two .story-copy{padding:85px 8vw;order:1}
  .story-two .story-art{order:0}
}
@media(max-width:650px){

    .scroll-quetzal{
        width:72px;
        right:5vw;
        top:30%;
    }

    .ambient-particles{
        background-size:130px 130px,190px 190px;
    }

    .story-art{
        min-height:390px;
    }

    .story-copy,
    .story-two .story-copy{
        padding:70px 8vw;
    }

    .story-split .story-copy:after{
        display:none;
    }


    /* PERSONAJES EN MÓVIL */

    .characters-carousel{
        padding:0;
    }

    .character-card{
        flex:0 0 100%;
    }

    .character-arrow{
        flex:0 0 40px;
        width:40px;
        height:40px;
    }


    /* AUTOR EN MÓVIL */

    .author{
        grid-template-columns:1fr;
        gap:60px;
        padding:90px 8vw;
    }

    .author-copy{
        padding-right:0;
    }

    .author-image{
        width:85%;
    }

}

@media(max-width:1050px){
  .main-nav.mobile-open{
    display:flex;
    position:absolute;
    top:70px;left:5vw;right:5vw;
    flex-direction:column;
    gap:0;
    background:rgba(3,8,11,.97);
    border:1px solid var(--line);
    backdrop-filter:blur(15px);
  }
  .main-nav.mobile-open a{padding:17px 20px;border-bottom:1px solid rgba(203,161,94,.12)}
}
/* =========================================================
   GALERÍA CINEMATOGRÁFICA 3D
========================================================= */

.gallery-3d {
    position: relative;
    width: min(1450px, 100%);
    margin: 65px auto 0;

    display: grid;
    grid-template-columns: 65px minmax(0, 1fr) 65px;
    align-items: center;
    gap: 8px;
}

.gallery-3d-stage {
    position: relative;
    min-width: 0;
    overflow: hidden;

    perspective: 1400px;
    perspective-origin: center 42%;
}

.gallery-3d-track {
    position: relative;
    height: clamp(360px, 47vw, 600px);

    transform-style: preserve-3d;
}

.gallery-3d-slide {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 56%;
    height: 85%;

    overflow: hidden;

    border: 1px solid rgba(196, 157, 91, .35);
    background: #091116;

    box-shadow: 0 25px 70px rgba(0, 0, 0, .55);

    transform-style: preserve-3d;
    backface-visibility: hidden;

    transition:
        transform .85s cubic-bezier(.2, .75, .2, 1),
        opacity .65s ease,
        filter .85s ease,
        box-shadow .85s ease;

    cursor: pointer;
}

.gallery-3d-slide img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;

    background:
        radial-gradient(
            circle at center,
            #19282e 0%,
            #081116 75%
        );
}

/* Brillo cinematográfico */

.gallery-3d-slide::after {
    content: "";
    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            110deg,
            rgba(255, 255, 255, .08),
            transparent 35%,
            transparent 65%,
            rgba(0, 0, 0, .35)
        );
}

/* Imagen protagonista */

.gallery-3d-slide.is-active {
    z-index: 10;

    opacity: 1;
    filter: brightness(1);

    transform:
        translate(-50%, -50%)
        translateX(0)
        translateZ(130px)
        rotateY(0deg)
        scale(1);

    box-shadow:
        0 35px 90px rgba(0, 0, 0, .7),
        0 0 35px rgba(196, 157, 91, .08);
}

/* Imagen anterior: doblada hacia la izquierda */

.gallery-3d-slide.is-prev {
    z-index: 5;

    opacity: .8;
    filter: brightness(.65);

    transform:
        translate(-50%, -50%)
        translateX(-72%)
        translateZ(-100px)
        rotateY(52deg)
        scale(.85);
}

/* Imagen siguiente: doblada hacia la derecha */

.gallery-3d-slide.is-next {
    z-index: 5;

    opacity: .8;
    filter: brightness(.65);

    transform:
        translate(-50%, -50%)
        translateX(72%)
        translateZ(-100px)
        rotateY(-52deg)
        scale(.85);
}

/* Imágenes más alejadas */

.gallery-3d-slide.is-far-prev {
    z-index: 2;

    opacity: .35;
    filter: brightness(.4);

    transform:
        translate(-50%, -50%)
        translateX(-115%)
        translateZ(-260px)
        rotateY(65deg)
        scale(.7);
}

.gallery-3d-slide.is-far-next {
    z-index: 2;

    opacity: .35;
    filter: brightness(.4);

    transform:
        translate(-50%, -50%)
        translateX(115%)
        translateZ(-260px)
        rotateY(-65deg)
        scale(.7);
}

/* Imágenes ocultas */

.gallery-3d-slide.is-hidden {
    z-index: 0;

    opacity: 0;
    pointer-events: none;

    transform:
        translate(-50%, -50%)
        translateZ(-450px)
        scale(.5);
}

/* Flechas */

.gallery-3d-arrow {
    position: relative;
    z-index: 20;

    width: 52px;
    height: 52px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(196, 157, 91, .55);
    border-radius: 50%;

    background: rgba(5, 13, 18, .8);
    color: var(--gold2);

    font-size: 23px;

    cursor: pointer;

    transition:
        background .3s ease,
        color .3s ease,
        transform .3s ease;
}

.gallery-3d-arrow:hover {
    background: var(--gold);
    color: #050d12;
    transform: scale(1.1);
}

/* Título y contador */

.gallery-3d-info {
    position: relative;
    z-index: 12;

    margin-top: 5px;
    padding-bottom: 20px;

    text-align: center;
}

.gallery-3d-counter {
    display: inline-block;

    color: var(--gold);
    font-size: 10px;
    letter-spacing: 4px;
}

.gallery-3d-title {
    margin: 13px 0 0;

  color: #102F46;

    font: 400 clamp(22px, 2.7vw, 36px)/1.2 var(--serif);

    letter-spacing: 1px;
}

/* Adaptación a tablet */

@media (max-width: 1050px) {

    .gallery-3d {
        grid-template-columns: 45px minmax(0, 1fr) 45px;
        gap: 0;
    }

    .gallery-3d-slide {
        width: 70%;
    }

    .gallery-3d-slide.is-prev {
        transform:
            translate(-50%, -50%)
            translateX(-60%)
            translateZ(-120px)
            rotateY(55deg)
            scale(.82);
    }

    .gallery-3d-slide.is-next {
        transform:
            translate(-50%, -50%)
            translateX(60%)
            translateZ(-120px)
            rotateY(-55deg)
            scale(.82);
    }
}

/* Adaptación a móvil */

@media (max-width: 650px) {

    .gallery-3d {
        width: 100%;

        grid-template-columns: 38px minmax(0, 1fr) 38px;
    }

    .gallery-3d-track {
        height: 390px;
    }

    .gallery-3d-slide {
        width: 90%;
        height: 80%;
    }

    .gallery-3d-slide.is-active {
        transform:
            translate(-50%, -50%)
            translateZ(60px)
            scale(1);
    }

    .gallery-3d-slide.is-prev {
        transform:
            translate(-50%, -50%)
            translateX(-85%)
            translateZ(-150px)
            rotateY(65deg)
            scale(.7);
    }

    .gallery-3d-slide.is-next {
        transform:
            translate(-50%, -50%)
            translateX(85%)
            translateZ(-150px)
            rotateY(-65deg)
            scale(.7);
    }

    .gallery-3d-slide.is-far-prev,
    .gallery-3d-slide.is-far-next {
        opacity: 0;
    }

    .gallery-3d-arrow {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .gallery-3d-title {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .gallery-3d-slide,
    .gallery-3d-arrow {
        transition: none;
    }
}
/* =========================================================
   QUETZAL — EFECTO CINEMATOGRÁFICO
========================================================= */

.legend{
    position:relative;
    overflow:hidden;
    isolation:isolate;
}

/* Fondo atmosférico */

.legend::before{
    content:"";
    position:absolute;
    inset:-20%;

    background:
        radial-gradient(
            circle at 38% 50%,
            rgba(196,157,91,.13),
            transparent 27%
        ),
        radial-gradient(
            circle at 20% 70%,
            rgba(34,100,55,.10),
            transparent 30%
        );

    pointer-events:none;
    z-index:0;

    animation:
        legendAtmosphere 10s ease-in-out infinite alternate;
}


/* =========================================================
   ZONA DEL QUETZAL
========================================================= */

.legend-art{
    position:relative;
    z-index:2;

    perspective:1200px;
}


/* Halo detrás del Quetzal */

.legend-art::before{
    content:"";

    position:absolute;

    width:70%;
    aspect-ratio:1;

    left:50%;
    top:50%;

    transform:
        translate(-50%,-50%);

    border-radius:50%;

    background:
        radial-gradient(
            circle,
            rgba(255,205,75,.20) 0%,
            rgba(196,157,91,.09) 28%,
            transparent 68%
        );

    filter:blur(20px);

    opacity:.8;

    pointer-events:none;

    animation:
        quetzalHalo 5s ease-in-out infinite;
}


/* Anillo mágico */

.legend-art::after{
    content:"";

    position:absolute;

    width:62%;
    aspect-ratio:1;

    left:50%;
    top:50%;

    transform:
        translate(-50%,-50%)
        rotate(-18deg);

    border:
        1px solid
        rgba(196,157,91,.30);

    border-left-color:transparent;
    border-bottom-color:rgba(196,157,91,.12);

    border-radius:50%;

    opacity:.65;

    pointer-events:none;

    animation:
        quetzalRing 18s linear infinite;
}


/* Quetzal */

.legend-art img{
    position:relative;
    z-index:5;

    transform:
        translate3d(
            calc(var(--quetzal-mx, 0px)),
            calc(var(--quetzal-my, 0px)),
            0
        );

    transform-origin:center center;

    animation:
        quetzalFloat 5s ease-in-out infinite;

    filter:
        drop-shadow(
            0 25px 35px
            rgba(0,0,0,.35)
        )
        drop-shadow(
            0 0 18px
            rgba(196,157,91,.10)
        );

    will-change:
        transform,
        filter;
}


/* =========================================================
   PARTÍCULAS
========================================================= */

.legend-particle{
    position:absolute;

    z-index:4;

    width:4px;
    height:4px;

    border-radius:50%;

    background:
        rgba(230,194,102,.9);

    box-shadow:
        0 0 8px
        rgba(230,194,102,.8),
        0 0 18px
        rgba(230,194,102,.35);

    pointer-events:none;

    animation:
        quetzalParticle
        var(--particle-duration)
        ease-in-out
        infinite;

    animation-delay:
        var(--particle-delay);
}


/* Algunas partículas más pequeñas */

.legend-particle.small{
    width:2px;
    height:2px;
}


/* =========================================================
   PLUMAS / DESTELLOS
========================================================= */

.legend-spark{
    position:absolute;

    z-index:4;

    width:7px;
    height:7px;

    pointer-events:none;

    transform:rotate(45deg);

    border:
        1px solid
        rgba(235,204,125,.7);

    box-shadow:
        0 0 10px
        rgba(235,204,125,.7);

    animation:
        quetzalSpark
        var(--spark-duration)
        ease-in-out
        infinite;

    animation-delay:
        var(--spark-delay);
}


/* =========================================================
   TEXTO — ENTRADA CINEMATOGRÁFICA
========================================================= */

.legend-copy{
    position:relative;
    z-index:10;
}

.legend-copy .section-no,
.legend-copy .kicker,
.legend-copy h2,
.legend-copy p,
.legend-copy .line-link{
    animation:
        legendTextReveal
        1s
        cubic-bezier(.2,.8,.2,1)
        both;
}

.legend-copy .section-no{
    animation-delay:.15s;
}

.legend-copy .kicker{
    animation-delay:.28s;
}

.legend-copy h2{
    animation-delay:.40s;
}

.legend-copy p{
    animation-delay:.55s;
}

.legend-copy .line-link{
    animation-delay:.70s;
}


/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes quetzalFloat{

    0%{
        margin-top:0;
        rotate:0deg;
    }

    50%{
        margin-top:-13px;
        rotate:-1deg;
    }

    100%{
        margin-top:0;
        rotate:0deg;
    }

}


@keyframes quetzalHalo{

    0%{
        transform:
            translate(-50%,-50%)
            scale(.92);

        opacity:.55;
    }

    50%{
        transform:
            translate(-50%,-50%)
            scale(1.08);

        opacity:.9;
    }

    100%{
        transform:
            translate(-50%,-50%)
            scale(.92);

        opacity:.55;
    }

}


@keyframes quetzalRing{

    from{
        rotate:0deg;
        opacity:.45;
    }

    50%{
        opacity:.75;
    }

    to{
        rotate:360deg;
        opacity:.45;
    }

}


@keyframes quetzalParticle{

    0%{
        opacity:0;
        transform:
            translate3d(
                0,
                25px,
                0
            )
            scale(.5);
    }

    20%{
        opacity:.9;
    }

    50%{
        opacity:1;
    }

    100%{
        opacity:0;
        transform:
            translate3d(
                var(--particle-x),
                var(--particle-y),
                0
            )
            scale(0);
    }

}


@keyframes quetzalSpark{

    0%{
        opacity:0;
        transform:
            rotate(45deg)
            scale(.2);
    }

    45%{
        opacity:1;
        transform:
            rotate(45deg)
            scale(1);
    }

    70%{
        opacity:.8;
    }

    100%{
        opacity:0;
        transform:
            rotate(45deg)
            scale(.2);
    }

}


@keyframes legendAtmosphere{

    0%{
        transform:
            scale(1)
            translate3d(0,0,0);
    }

    100%{
        transform:
            scale(1.08)
            translate3d(1%, -1%, 0);
    }

}


@keyframes legendTextReveal{

    from{
        opacity:0;
        transform:
            translateY(22px);
        filter:blur(4px);
    }

    to{
        opacity:1;
        transform:
            translateY(0);
        filter:blur(0);
    }

}


/* =========================================================
   MÓVIL
========================================================= */

@media(max-width:650px){

    .legend-art::after{
        width:80%;
    }

    .legend-art::before{
        width:90%;
    }

    .legend-particle{
        width:3px;
        height:3px;
    }

}
/* =========================================================
   ANILLO MÁGICO DEL QUETZAL
========================================================= */

.quetzal-magic-ring{
    position:absolute;

    z-index:1;

    left:50%;
    top:50%;

    width:68%;
    aspect-ratio:1;

    transform:
        translate(-50%,-50%)
        rotate(-12deg);

    border-radius:50%;

    pointer-events:none;

    opacity:.85;

    background:
        conic-gradient(
            from 0deg,
            transparent 0deg,
            rgba(196,157,91,.15) 25deg,
            rgba(255,211,91,.95) 55deg,
            rgba(255,158,38,.65) 78deg,
            transparent 115deg,
            transparent 175deg,
            rgba(69,151,58,.65) 215deg,
            rgba(196,157,91,.95) 250deg,
            transparent 295deg,
            transparent 360deg
        );

    -webkit-mask:
        radial-gradient(
            farthest-side,
            transparent calc(100% - 5px),
            #000 calc(100% - 3px)
        );

    mask:
        radial-gradient(
            farthest-side,
            transparent calc(100% - 5px),
            #000 calc(100% - 3px)
        );

    filter:
        blur(.2px)
        drop-shadow(
            0 0 7px
            rgba(255,191,61,.65)
        )
        drop-shadow(
            0 0 22px
            rgba(196,157,91,.25)
        );

    animation:
        magicRingRotate
        18s
        linear
        infinite;
}


/* =========================================================
   SEGUNDO ANILLO
========================================================= */

.quetzal-magic-ring.ring-two{

    width:74%;

    opacity:.42;

    transform:
        translate(-50%,-50%)
        rotate(18deg);

    animation:
        magicRingRotateReverse
        25s
        linear
        infinite;
}


/* =========================================================
   TERCER ANILLO — MUY SUTIL
========================================================= */

.quetzal-magic-ring.ring-three{

    width:84%;

    opacity:.18;

    transform:
        translate(-50%,-50%)
        rotate(-35deg);

    filter:
        blur(.5px)
        drop-shadow(
            0 0 12px
            rgba(255,190,50,.4)
        );

    animation:
        magicRingRotate
        34s
        linear
        infinite;
}


/* =========================================================
   LLAMAS / PUNTOS DE ENERGÍA DEL ANILLO
========================================================= */

.quetzal-ring-flare{

    position:absolute;

    z-index:2;

    width:9px;
    height:9px;

    border-radius:50%;

    background:
        #ffe9a0;

    box-shadow:
        0 0 7px #ffd45c,
        0 0 18px rgba(255,166,35,.85),
        0 0 35px rgba(255,166,35,.35);

    pointer-events:none;

    animation:
        ringFlare
        var(--flare-duration)
        ease-in-out
        infinite;

    animation-delay:
        var(--flare-delay);
}


/* Algunas chispas pequeñas */

.quetzal-ring-flare.small{

    width:4px;
    height:4px;

    box-shadow:
        0 0 5px rgba(255,216,100,.9),
        0 0 13px rgba(255,160,30,.5);
}


/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes magicRingRotate{

    from{
        rotate:0deg;
    }

    to{
        rotate:360deg;
    }

}


@keyframes magicRingRotateReverse{

    from{
        rotate:360deg;
    }

    to{
        rotate:0deg;
    }

}


@keyframes ringFlare{

    0%{
        opacity:0;

        transform:
            scale(.25);
    }

    25%{
        opacity:1;

        transform:
            scale(1.15);
    }

    50%{
        opacity:.75;

        transform:
            scale(.8);
    }

    75%{
        opacity:1;

        transform:
            scale(1);
    }

    100%{
        opacity:0;

        transform:
            scale(.2);
    }

}


/* =========================================================
   RESPUESTA AL RATÓN
========================================================= */

.legend-art:hover .quetzal-magic-ring{

    filter:
        blur(.2px)
        drop-shadow(
            0 0 10px
            rgba(255,203,78,.85)
        )
        drop-shadow(
            0 0 30px
            rgba(196,157,91,.35)
        );

}


/* =========================================================
   MÓVIL
========================================================= */

@media(max-width:650px){

    .quetzal-magic-ring{
        width:82%;
    }

    .quetzal-magic-ring.ring-two{
        width:88%;
    }

    .quetzal-magic-ring.ring-three{
        width:96%;
    }

}
/* =====================================================
   QUETZAL DE SCROLL — NO APARECE EN EL HERO
   ===================================================== */

.scroll-quetzal {
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.7s ease,
        filter 0.7s ease;
}

.scroll-quetzal.active {
    opacity: 1;
    pointer-events: none;
}
/* =====================================================
   GALERÍA 3D — SOLO LAS ILUSTRACIONES
   ===================================================== */

.gallery-3d-slide {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.gallery-3d-slide img {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Quitamos la capa de brillo que cubría toda la tarjeta */
.gallery-3d-slide::after {
    display: none !important;
}

/* Mantener la imagen completa sin deformarla */
.gallery-3d-slide img {
    object-fit: contain;
}

/* Portátiles y pantallas de poca altura */
@media (max-height: 800px) and (min-width: 769px) {
  .hero-title-image {
    width: min(460px, 37vw);
    top: 12%;
  }

  .hero-copy {
    bottom: 8%;
  }

  .hero-character {
    height: 78%;
  }

  .hero-quetzal {
    width: 160px;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .hero {
    min-height: 850px;
  }

  .hero-title-image {
    width: min(78vw, 480px);
    left: 6vw;
    top: 16%;
  }

  .hero-copy {
    left: 6vw;
    bottom: 9%;
    width: 88%;
    max-width: 500px;
  }

  .hero-character {
    right: -8%;
    height: 58%;
    width: 65%;
  }

  .hero-quetzal {
    width: 130px;
    right: 7%;
    top: 12%;
  }
}

/* Móviles */
@media (max-width: 480px) {
  .hero {
    min-height: 780px;
  }

  .hero-title-image {
    width: 88vw;
    left: 6vw;
    top: 17%;
  }

  .hero-copy {
    left: 6vw;
    bottom: 8%;
    width: 88%;
  }

  .hero-copy p {
    font-size: 13px;
    max-width: 310px;
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
  }

  .hero-character {
    height: 43%;
    width: 75%;
    right: -12%;
    bottom: 19%;
  }

  .hero-quetzal {
    width: 95px;
    top: 10%;
    right: 5%;
  }

  .scroll-hint {
    bottom: 18px;
  }
}
/* =====================================================
   FUSIÓN DEL QUETZAL AL LLEGAR A LA LEYENDA
   ===================================================== */

/* El pájaro grande desaparece durante la fusión,
   pero sus halos, anillos y partículas siguen visibles. */
.legend-art img {
    transition: none;
}

.legend-art img.quetzal-merging {
opacity: 0 !important;
}

/* El pájaro pequeño se controla desde JavaScript. */
.scroll-quetzal {
    transform-origin: center center;
    transition: none !important;
    will-change: transform, opacity;
}

.scroll-quetzal img {
    display: block;
    width: 100%;
    height: auto;
}



/* TEST DE PERSONALIDAD SAGRA — estilos aislados */
.sagra-quiz-cta {
  appearance: none;
  display: inline-block;
  padding: 0 0 8px;
  border: 0;
  border-bottom: 1px solid var(--gold);
  border-radius: 0;
  background: transparent;
  color: var(--gold2);
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: 1.7px;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .25s, border-color .25s, transform .25s;
}
.sagra-quiz-cta:hover {
  color: var(--cream);
  border-color: var(--gold2);
  transform: translateX(3px);
}
.sagra-quiz-cta:focus-visible {
  outline: 1px solid var(--gold2);
  outline-offset: 6px;
}
.sagra-quiz { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; padding: clamp(12px, 3vw, 36px); background: rgba(3, 8, 11, .94); backdrop-filter: blur(12px); overflow-y: auto; }
.sagra-quiz.is-open { display: flex; }
.sagra-quiz__panel { position: relative; width: min(850px, 100%); min-height: min(620px, 90vh); padding: clamp(24px, 5vw, 58px); color: #eee8dc; background: radial-gradient(ellipse at 80% 0%, rgba(91, 111, 82, .16), transparent 48%), #101719; border: 1px solid rgba(207, 183, 129, .38); box-shadow: 0 25px 100px #0008; display: flex; flex-direction: column; }
.sagra-quiz__close { position: absolute; top: 14px; right: 18px; border: 0; background: transparent; color: #eee8dc; font-size: 32px; cursor: pointer; line-height: 1; }
.sagra-quiz__eyebrow { color: #c9b47e; font-size: 10px; letter-spacing: .22em; padding-right: 30px; }
.sagra-quiz__progress-row { display: flex; justify-content: space-between; margin-top: 34px; color: #bcb8ab; font-size: 10px; letter-spacing: .14em; }
.sagra-quiz__progress { height: 2px; margin-top: 12px; background: #343a36; overflow: hidden; }
.sagra-quiz__progress span { display: block; height: 100%; width: 12.5%; background: #c9b47e; transition: width .25s ease; }
.sagra-quiz__content { flex: 1; padding: 30px 0 24px; }
.sagra-quiz__content h2 { margin: 0 0 12px; font-family: Cinzel, Georgia, serif; font-size: clamp(25px, 4vw, 39px); line-height: 1.2; font-weight: 400; }
.sagra-quiz__intro { color: #b8b8ad; line-height: 1.7; font-size: 14px; margin: 0 0 28px; }
.sagra-quiz__answers { display: grid; gap: 10px; }
.sagra-quiz__answer { width: 100%; text-align: left; padding: 16px 18px; color: #e9e4d9; border: 1px solid #3b4540; background: rgba(255,255,255,.025); cursor: pointer; font: inherit; line-height: 1.5; transition: border-color .2s, background .2s; }
.sagra-quiz__answer:hover, .sagra-quiz__answer.is-selected { border-color: #c9b47e; background: rgba(201,180,126,.1); }
.sagra-quiz__footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid #343a36; color: #777f75; font-size: 9px; letter-spacing: .16em; }
.sagra-quiz__back, .sagra-quiz__action { padding: 11px 15px; border: 1px solid #59645a; background: transparent; color: #eee8dc; cursor: pointer; font: inherit; }
.sagra-quiz__back:disabled { opacity: .3; cursor: default; }
.sagra-quiz__result { display: grid; grid-template-columns: minmax(130px, .72fr) 1fr; gap: clamp(20px, 4vw, 38px); align-items: center; }
.sagra-quiz__portrait { width: 100%; max-height: 390px; object-fit: contain; object-position: center bottom; }
.sagra-quiz__result h2 { margin-bottom: 6px; }
.sagra-quiz__role { color: #c9b47e; font-size: 10px; letter-spacing: .17em; margin: 0 0 18px; }
.sagra-quiz__description { color: #c3c3b9; font-size: 14px; line-height: 1.75; }
.sagra-quiz__traits { color: #d2c49f; font-size: 12px; line-height: 1.8; margin: 15px 0 22px; }
.sagra-quiz__result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sagra-quiz__action--primary { background: #c9b47e; color: #151914; border-color: #c9b47e; }
@media (max-width: 600px) { .sagra-quiz__panel { min-height: calc(100dvh - 24px); padding: 28px 20px 20px; } .sagra-quiz__progress-row { margin-top: 25px; } .sagra-quiz__content { padding-top: 25px; } .sagra-quiz__result { grid-template-columns: 1fr; gap: 12px; } .sagra-quiz__portrait { height: 190px; max-height: 190px; object-position: center; } .sagra-quiz__result h2 { font-size: 27px; } .sagra-quiz__footer > span { text-align: right; } }
@media (prefers-reduced-motion: reduce) { .sagra-quiz * { transition: none !important; } }


/* La ilustración ocupa todo el marco dorado */
.story-two .story-art {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.story-two .story-art > img {
    display: block;
    width: 60% !important;
    height: 65% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center;
    transform: none !important;
    animation: none !important;
}

/* VENTANA DEL AUTOR */
.author-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 15, 17, 0.88);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.author-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.author-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
    padding: clamp(32px, 6vw, 68px);
    background: #eee5d5;
    color: #302a22;
    border: 1px solid #a98248;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    transform: translateY(18px);
    transition: transform 0.35s ease;
}

.author-overlay.is-open .author-panel {
    transform: translateY(0);
}

.author-close {
    position: absolute;
    top: 16px;
    right: 20px;
    border: 0;
    background: transparent;
    color: #805b2d;
    font: inherit;
    font-size: 32px;
    cursor: pointer;
}

.author-kicker,
.author-signature {
    display: block;
    color: #805b2d;
    font-size: 10px;
    letter-spacing: 0.2em;
    line-height: 1.8;
}

.author-panel h2 {
    margin: 22px 0;
    font-size: clamp(34px, 6vw, 54px);
    font-weight: 400;
    line-height: 1.1;
}

.author-panel h2 em {
    color: #956c32;
    font-family: Georgia, serif;
    font-weight: 400;
}

.author-divider {
    width: 70px;
    height: 1px;
    margin: 28px 0;
    background: #a98248;
}

.author-text {
    font-size: 15px;
    line-height: 1.9;
}

.author-text p {
    margin: 0 0 20px;
}

.author-signature {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid rgba(128, 91, 45, 0.3);
}

@media (max-width: 600px) {
    .author-overlay {
        padding: 12px;
    }

    .author-panel {
        max-height: 90vh;
        padding: 42px 25px 30px;
    }
}

/* Vídeo de fondo e ilustración del quiz */
.quiz-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    background: #080d16;
    border-radius: 12px;
}

.quiz-visual .quiz-background-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.75;
}

.quiz-visual .quiz-characters {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: 560px;
    height: auto;
    object-fit: contain;
}

.quiz-visual .art-caption {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    z-index: 2;
    text-align: center;
}

@media (max-width: 700px) {
    .quiz-visual {
        min-height: 350px;
    }

    .quiz-visual .quiz-characters {
        max-width: 340px;
        max-height: 420px;
    }
}


/* ==========================================================
   EFECTOS MÁGICOS DEL QUIZ DE SAGRA
========================================================== */

/* Fondo y capas de luz */
.story-split.story-two.quiz-magic .story-art {
  position: relative;
  isolation: isolate;
  background: #050b0e;
}

/* Halo de luz dorada y azul */
.story-split.story-two.quiz-magic .quiz-light-effects {
  position: absolute;
  z-index: 0;
  inset: 5%;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at 50% 45%,
      rgba(214, 170, 91, 0.30) 0%,
      rgba(175, 127, 61, 0.12) 38%,
      transparent 70%
    ),
    radial-gradient(
      ellipse at 50% 55%,
      rgba(74, 120, 185, 0.18) 0%,
      transparent 72%
    );
  filter: blur(14px);
  animation: quiz-magic-glow 6s ease-in-out infinite alternate;
}

/* Pequeños destellos de luz */
.story-split.story-two.quiz-magic .quiz-light-effects::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 224, 157, .9) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(190, 214, 255, .8) 0 1px, transparent 2px);
  background-size: 83px 97px, 127px 113px;
  background-position: 10px 15px, 43px 51px;
  opacity: .4;
  animation: quiz-magic-particles 14s linear infinite;
}

/* Imagen de los personajes: sin recortes */
.story-split.story-two.quiz-magic .quiz-characters {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 480px;
  max-height: 560px;
  height: auto;
  object-fit: contain;
  animation: none;
}

/* Movimiento suave del resplandor */
@keyframes quiz-magic-glow {
  from {
    opacity: .65;
    transform: scale(.95);
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Movimiento de las partículas */
@keyframes quiz-magic-particles {
  from {
    background-position: 10px 15px, 43px 51px;
  }
  to {
    background-position: 93px -82px, -84px 164px;
  }
}

/* Respetar la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .story-split.story-two.quiz-magic .quiz-light-effects,
  .story-split.story-two.quiz-magic .quiz-light-effects::before {
    animation: none;
  }
}

/* Halo que recorre la escena */
.quiz-moving-halo {
  position: absolute;
  z-index: 0;
  width: 55%;
  aspect-ratio: 1;
  left: 22%;
  top: 12%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(239, 194, 112, 0.22) 0%,
    rgba(89, 139, 204, 0.12) 38%,
    transparent 70%
  );
  filter: blur(24px);
  animation: quiz-halo-float 9s ease-in-out infinite alternate;
}

/* Partículas flotantes */
.quiz-spark {
  position: absolute;
  z-index: 2;
  left: var(--x);
  bottom: 5%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f5d99a;
  box-shadow: 0 0 8px 2px rgba(239, 194, 112, 0.45);
  pointer-events: none;
  opacity: 0;
  animation: quiz-spark-rise var(--duracion) linear
    var(--retraso) infinite;
}

@keyframes quiz-halo-float {
  0% {
    transform: translate(-12px, 8px) scale(.9);
    opacity: .55;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(18px, -12px) scale(1.12);
    opacity: .75;
  }
}

@keyframes quiz-spark-rise {
  0% {
    transform: translateY(0) translateX(0) scale(.5);
    opacity: 0;
  }
  15% {
    opacity: .8;
  }
  80% {
    opacity: .65;
  }
  100% {
    transform: translateY(-260px)
      translateX(var(--desplazamiento)) scale(1.2);
    opacity: 0;
  }
}

/* Desactivar animaciones si se prefiere movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .quiz-moving-halo,
  .quiz-spark {
    animation: none;
  }

  .quiz-spark {
    display: none;
  }
}

/* Instagram en el pie de página */
.footer-instagram {
  margin-top: 24px;
}

.footer-instagram a {
  color: #c6a66b;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.footer-instagram a:hover {
  color: #f0d49a;
}

@media (prefers-reduced-motion: reduce) {
  .footer-instagram a {
    transition: none;
  }
}

/* =========================================
   FOOTER EDITORIAL DE SAGRA
========================================= */

.sagra-footer {
  position: relative;
  padding: 0 7%;
  color: #eee5d4;
  background: #05090b;
  border-top: 1px solid rgba(198, 166, 107, 0.35);
}

/* Zona principal */
.sagra-footer .footer-main {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 60px;
  padding: 70px 0 65px;
}

/* Marca */
.sagra-footer .footer-logo {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  color: inherit;
  text-decoration: none;
}

.sagra-footer .footer-brand-main {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 5px;
  color: #d6b778;
}

.sagra-footer .footer-brand-sub {
  font-size: 8px;
  letter-spacing: 2.5px;
  color: #d6b778;
}

.sagra-footer .footer-description {
  margin-top: 25px;
  color: #a9a49a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.9;
}

/* Títulos de las columnas */
.sagra-footer .footer-heading {
  display: block;
  margin-bottom: 23px;
  color: #c6a66b;
  font-size: 10px;
  letter-spacing: 2.5px;
}

/* Enlaces de navegación */
.sagra-footer .footer-navigation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}

.sagra-footer .footer-navigation a {
  color: #d8d4cc;
  font-size: 12px;
  text-decoration: none;
  transition: color .25s ease;
}

.sagra-footer .footer-navigation a:hover {
  color: #d6b778;
}

/* Redes sociales */
.sagra-footer .footer-social p {
  margin: 0 0 22px;
  color: #a9a49a;
  font-size: 12px;
  line-height: 1.8;
}

.sagra-footer .footer-instagram {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 15px;
  border: 1px solid rgba(198, 166, 107, .4);
  color: #e5d2a7;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1px;
  transition:
    background .3s ease,
    border-color .3s ease,
    color .3s ease;
}

.sagra-footer .footer-instagram svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.sagra-footer .footer-instagram:hover {
  background: rgba(198, 166, 107, .1);
  border-color: #d6b778;
  color: #fff0cc;
}

.sagra-footer .footer-arrow {
  margin-left: 8px;
}

/* Franja inferior */
.sagra-footer .footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.sagra-footer .footer-copyright,
.sagra-footer .footer-signature {
  color: #89877f;
  font-size: 9px;
  letter-spacing: 1.5px;
}

.sagra-footer .footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 23px;
}

.sagra-footer .footer-legal a {
  color: #aaa69c;
  font-size: 10px;
  text-decoration: none;
  transition: color .25s ease;
}

.sagra-footer .footer-legal a:hover {
  color: #d6b778;
}

/* Móviles y tabletas */
@media (max-width: 760px) {
  .sagra-footer {
    padding: 0 24px;
  }

  .sagra-footer .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 42px 25px;
    padding: 48px 0;
  }

  .sagra-footer .footer-brand {
    grid-column: 1 / -1;
  }

  .sagra-footer .footer-brand-main {
    font-size: 30px;
  }

  .sagra-footer .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .sagra-footer .footer-legal {
    gap: 16px;
  }

  .sagra-footer .footer-signature {
    font-size: 8px;
  }
}

@media (max-width: 420px) {
  .sagra-footer .footer-main {
    grid-template-columns: 1fr;
  }

  .sagra-footer .footer-brand {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sagra-footer a {
    transition: none;
  }
}



/* Detener las partículas ambientales después del quetzal */
.author .ambient-particles,
#autor .ambient-particles,
footer .ambient-particles,
.sagra-footer .ambient-particles {
  animation: none !important;
  background-position: 20px 30px, 90px 100px !important;
}
/* Ajuste provisional para comprobar el movimiento de las partículas */
main > .ambient-particles {
  height: 100vh;
  bottom: auto;
}

/* Ajuste visual de las tarjetas del test Sagra */
.sagra-quiz__answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.sagra-quiz__answer {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 20px 24px;
}

.sagra-quiz__answer > span:first-child {
  display: inline-flex;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
}

.sagra-quiz__answer > span:last-child {
  flex: 1;
  line-height: 1.5;
}

.sagra-quiz__answer.is-selected {
  border-color: #c7b58a;
}

@media (min-width: 700px) {
  .sagra-quiz__answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================
   PORTADA MÓVIL — CORRECCIÓN DEFINITIVA
   El título y los protagonistas no deben solaparse
   ========================================================= */

@media (max-width: 480px) {

  .hero {
    min-height: 820px !important;
    height: 820px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* TÍTULO: zona superior */
  .hero-title-image {
    position: absolute !important;
    z-index: 3 !important;

    width: 76vw !important;
    max-width: none !important;

    left: 5vw !important;
    top: 13% !important;

    transform: none !important;
  }

  /* PROTAGONISTAS:
     mucho más pequeños y colocados ABAJO */
.hero-character {
    position: absolute !important;
    z-index: 4 !important;

    width: 70vw !important;
    height: 33% !important;

    left: 50% !important;
    right: auto !important;

    bottom: 25% !important;

    transform: translateX(-50%) !important;

    opacity: 1 !important;
}

  .hero-character img {
    width: auto !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  /* QUETZAL */
  .hero-quetzal {
    position: absolute !important;
    z-index: 5 !important;

    width: 90px !important;

    right: 4% !important;
    top: 8% !important;
  }

  /* TEXTO INFERIOR */
  .hero-copy {
    position: absolute !important;
    z-index: 6 !important;

    left: 6vw !important;
    bottom: 4% !important;

    width: 88% !important;
    max-width: 330px !important;
  }

  .hero-copy p {
    font-size: 11px !important;
    line-height: 1.5 !important;
    max-width: 290px !important;
    margin-bottom: 0 !important;
  }

  .hero-actions {
    margin-top: 14px !important;
    gap: 12px !important;
  }

  .hero-actions .gold-btn {
    padding: 15px 25px !important;
    font-size: 10px !important;
  }
}
/* =========================================================
   AJUSTE SOLO DEL LIBRO EN MÓVIL
   Evita que el libro abierto se corte por los lados
   ========================================================= */

@media (max-width: 700px) {

  .book-stage {
    overflow: visible !important;
    min-height: 620px !important;
    height: 620px !important;
    padding: 0 15px !important;
  }

  .book-3d {
    transform:
      translateX(25px)
      rotateY(-3deg)
      rotateX(2deg)
      rotateZ(0deg)
      scale(.48) !important;
  }

  .book-3d.is-open {
    transform:
      translateX(25px)
      rotateY(0deg)
      rotateX(1deg)
      rotateZ(0deg)
      scale(.48) !important;
  }

  .book-3d.is-open .book-cover {
    transform:
      translateZ(18px)
      rotateY(-120deg) !important;
  }
}

/* =========================================================
   INDICACIÓN DE MAPA INTERACTIVO
   ========================================================= */

.map-panel {
  position: relative !important;
}

.map-interactive-hint {
  position: absolute !important;

  left: 50% !important;
  bottom: 25px !important;

  transform: translateX(-50%) !important;

  z-index: 50 !important;

  width: max-content;
  max-width: 85%;

  padding: 10px 18px;

  text-align: center;

  pointer-events: none;

  border: 1px solid rgba(218, 185, 112, .35);

  background: rgba(5, 15, 14, .72);

  backdrop-filter: blur(3px);

  border-radius: 3px;

  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}

.map-interactive-hint strong {
  display: block;

  color: #e8d29c;

  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;

  text-shadow: 0 2px 6px rgba(0, 0, 0, .9);
}

.map-interactive-hint span {
  display: block;

  margin-top: 4px;

  color: rgba(255, 255, 255, .82);

  font-size: 10px;
  line-height: 1.4;

  text-shadow: 0 2px 6px rgba(0, 0, 0, .9);
}

/* Ordenador */
.map-hint-mobile {
  display: none !important;
}

/* MÓVIL */
@media (max-width: 700px) {

  .map-interactive-hint {
    bottom: 18px !important;

    width: 82%;

    padding: 9px 12px;
  }

  .map-hint-desktop {
    display: none !important;
  }

  .map-hint-mobile {
    display: block !important;
  }

  .map-interactive-hint strong {
    font-size: 10px;
    letter-spacing: 2px;
  }

  .map-interactive-hint span {
    font-size: 9px;
  }
}

/* =========================================================
   CORRECCIÓN ANCHO MÓVIL
   Evita la franja negra a la derecha
   ========================================================= */

@media (max-width: 700px) {

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  main,
  .site-header,
  .hero,
  .world,
  .intro,
  .characters,
  .gallery-section,
  .author,
  footer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .hero,
  .world,
  .intro,
  .characters,
  .gallery-section,
  .author {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* =========================================================
   VER EL UNIVERSO — ESTILO SAGRA
   ========================================================= */

.play-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;

  color: #e8d29c !important;
  text-decoration: none;

  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.play-btn b {
  display: inline-block;

  color: #d9ad5a;

  font-size: 22px;
  font-weight: 300;
  line-height: 1;

  transition:
    transform .3s ease,
    color .3s ease;
}

/* Ordenador */
.play-btn:hover b {
  transform: translateX(6px);
  color: #f0c873;
}

/* Móvil */
@media (max-width: 700px) {

  .play-btn {
    gap: 9px;

    font-size: 10px;
    letter-spacing: 2px;
  }

  .play-btn b {
    font-size: 20px;
  }
}
/* =========================================================
   DESCUBRIR MI PERSONAJE — ESTILO SAGRA
   ========================================================= */

.sagra-quiz-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;

  color: #e8d29c !important;
  text-decoration: none;

  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;

  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.sagra-quiz-cta b {
  display: inline-block;

  color: #d9ad5a;

  font-size: 22px;
  font-weight: 300;
  line-height: 1;

  transition:
    transform .3s ease,
    color .3s ease;
}

.sagra-quiz-cta:hover b {
  transform: translateX(6px);
  color: #f0c873;
}

/* Móvil */
@media (max-width: 700px) {

  .sagra-quiz-cta {
    gap: 9px;
    font-size: 10px;
    letter-spacing: 2px;
  }

  .sagra-quiz-cta b {
    font-size: 20px;
  }
}
/* =========================================================
   FICHAS DE PERSONAJES — INDICACIÓN DE GIRO
   ========================================================= */

.character-hint {
  display: flex !important;
  align-items: center;
  gap: 9px;

  color: #e8d29c !important;

  font-size: 10px;
  letter-spacing: 2.5px;
}

.character-hint b {
  display: inline-block;

  color: #d9ad5a;

  font-size: 19px;
  font-weight: 300;
  line-height: 1;

  transition:
    transform .4s ease,
    color .3s ease;
}

.character-card:hover .character-hint b {
  transform: rotate(-45deg);
  color: #f0c873;
}

@media (max-width: 700px) {

  .character-hint {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .character-hint b {
    display: inline-block !important;

    font-size: 26px !important;
    line-height: 1 !important;

    color: #d9ad5a !important;

    font-weight: 300 !important;

    transform: translateY(-1px) !important;
  }
}

/* =========================================================
   QUIZ — MISMO ESTILO QUE LOS DEMÁS ENLACES
   SOLO DESKTOP
   ========================================================= */
@media (min-width: 701px) {

  .sagra-quiz-cta {
    display: inline-flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: center !important;
    gap: 10px !important;

    padding: 0 0 8px !important;

    border: none !important;
    border-bottom: 1px solid var(--gold) !important;

    font-size: 9px !important;
    letter-spacing: 1.7px !important;
    line-height: normal !important;
  }

  .sagra-quiz-cta b {
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 300 !important;
  }

  .story-two .story-copy::after {
    display: none !important;
  }
}


