/* story-engine.css - MÓDULO NARRATIVO */
:root {
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --reveal-path: circle(0% at 50% 50%);
    --reveal-path-active: circle(150% at 50% 50%);
}

::-webkit-scrollbar {
    display: none;
    /* Oculta el scroll en WebKit */
}


.story-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background: #000;
}

.story-section {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    perspective: 1200px;
}

/* --- Fondo --- */
.bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    clip-path: var(--reveal-path);
    transition: clip-path 1.5s var(--ease-out-expo);
}

.story-section.active .bg-wrapper {
    clip-path: var(--reveal-path-active);
}

.bg-image,
video.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    transform: scale(1.15);
    transition: transform 10s ease-out;
}

.story-section.active .bg-image,
.story-section.active video.bg-video {
    transform: scale(1);
}

/* --- Capa de Oscurecimiento para Lectura --- */
.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

/* --- Tarjeta de Conversación --- */
.story-content {
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(25px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 60px;
    border-radius: 40px;
    max-width: 850px;
    /* Más ancho para textos largos */
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    /* Permitir scroll si el texto es MUY largo */
    color: white;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    z-index: 10;

    opacity: 0;
    transform: translateZ(-300px) rotateX(15deg);
    transition: all 1.5s var(--ease-out-expo);
}

/* Estilo del Scrollbar interno de la tarjeta */
.story-content::-webkit-scrollbar {
    width: 6px;
}

.story-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.story-section.active .story-content {
    opacity: 1;
    transform: translateZ(0) rotateX(0deg);
}

/* --- Tipografía Conversacional --- */
.story-content span {
    font-family: 'Outfit', sans-serif;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 15px;
}

.story-content h2 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 25px;
    line-height: 1.1;
    font-weight: 800;
}

.story-content p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

/* --- Quitar botón de música --- */
.music-toggle {
    display: none;
}

/* --- Sección Siguiente Historia --- */
.next-story-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #000;
    scroll-snap-align: start;
    position: relative;
    z-index: 10;
}

.next-story-content {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s var(--ease-out-expo);
}

.next-story-section.active .next-story-content {
    opacity: 1;
    transform: translateY(0);
}

.next-label {
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: block;
}

.next-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 5rem);
    color: white;
    text-decoration: none;
    transition: all 0.5s ease;
    display: block;
    margin-bottom: 40px;
}

.next-title:hover {
    color: var(--primary);
    transform: scale(1.05);
    text-shadow: 0 0 50px rgba(197, 160, 89, 0.4);
}

.next-btn-circle {
    width: 100px;
    height: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    text-decoration: none;
    transition: all 0.5s ease;
    margin: 0 auto;
}

.next-btn-circle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: black;
    transform: rotate(90deg);
}