/* CSS for the New Home Page Story Layout */

html {
    overflow: visible !important;
    position: static !important;
    height: auto !important;
}

body.home-body {
    display: block !important;
    overflow: visible !important;
    position: static !important;
    height: auto !important;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
}

.story-section {
    position: relative;
}

.video-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    z-index: 0;
    overflow: hidden;
}

.sticky-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(11, 7, 22, 0.4) 0%, rgba(11, 7, 22, 0.9) 100%);
    pointer-events: none;
}

.story-content {
    position: relative;
    z-index: 1;
    margin-top: -100vh; /* Pulls content up to overlap the sticky video */
    padding: 15vh 5vw 15vh 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10vh;
}

.hero-title {
    text-align: center;
    margin-top: 10vh;
    padding: 3rem !important;
}

.hero-title h1 {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title p {
    font-size: 1.5rem;
    color: #e0d8f0;
    max-width: 600px;
    margin: 0 auto;
}

.scroll-indicator {
    margin-top: 2rem;
    font-size: 2rem;
    color: var(--gold);
    animation: bounce 2s infinite;
}

.glass-panel {
    background: rgba(22, 14, 38, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.05);
    
    /* Animation initial state */
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.glass-panel.visible, .cta-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.glass-panel h2 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.glass-panel h3 {
    font-family: 'Cinzel', serif;
    color: #c9b4e6;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.glass-panel p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d1c5e6;
    margin-bottom: 1.5rem;
}

.glass-panel ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.glass-panel li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d1c5e6;
    margin-bottom: 0.8rem;
}

.glass-panel li strong {
    color: var(--gold);
}

.story-img {
    width: 100%;
    border-radius: 10px;
    margin: 2rem 0;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.highlight-text {
    font-size: 1.25rem !important;
    font-style: italic;
    color: var(--gold) !important;
    border-left: 3px solid var(--gold);
    padding-left: 1.5rem;
    margin-top: 2rem !important;
}

/* Vertical Scrollspy Menu */
.vertical-menu {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px; /* Reduced gap for subnodes */
    z-index: 1000;
    pointer-events: none;
}

.vertical-menu .nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.3), transparent);
    z-index: -1;
}

.nav-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.3);
    border: 2px solid rgba(212, 175, 55, 0.5);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    text-decoration: none;
}

.nav-node:hover, .nav-node.active, .nav-node.active-parent {
    background: #d4af37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    transform: scale(1.3);
}

.nav-node.sub-node {
    width: 8px;
    height: 8px;
    border-width: 1px;
    transform: translateX(25px); /* Desplaza hacia la derecha */
}

/* Mantiene el desplazamiento al hacer hover o estar activo */
.nav-node.sub-node:hover, .nav-node.sub-node.active {
    transform: translateX(25px) scale(1.3);
}

/* La ramificación orgánica (Curva del árbol) */
.nav-node.sub-node::before {
    content: '';
    position: absolute;
    left: -25px; /* Distancia exacta hacia la línea central */
    top: -20px;  /* Altura desde la que nace la rama */
    width: 25px;
    height: 24px;
    border-left: 1.5px solid rgba(212, 175, 55, 0.4);
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.4);
    border-bottom-left-radius: 12px; /* Curva suave */
    pointer-events: none;
    z-index: -1;
    transition: all 0.3s ease;
}

/* Cuando el subnodo está activo, la rama brilla y se intensifica */
.nav-node.sub-node.active::before {
    border-color: rgba(212, 175, 55, 0.9);
}

.nav-node.sub-node .nav-tooltip {
    font-size: 0.75rem;
    padding: 3px 10px;
}

.nav-tooltip {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: rgba(22, 14, 38, 0.8);
    backdrop-filter: blur(5px);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.nav-node:hover .nav-tooltip, 
.nav-node.active .nav-tooltip, 
.nav-node.active-parent .nav-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Floating Expandable CTA Button */
.floating-cta {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(22, 14, 38, 0.85);
    border: 2px solid #d4af37;
    border-radius: 50px; /* Pill shape initially collapsed to circle */
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5), inset 0 0 10px rgba(212, 175, 55, 0.3);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    backdrop-filter: blur(10px);
    width: 64px; /* Fixed width for icon only */
    height: 64px;
}

.floating-cta .cta-icon {
    font-size: 30px;
    line-height: 1;
    min-width: 30px;
    text-align: center;
    transition: transform 0.3s ease;
}

.floating-cta .cta-text {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    padding-left: 15px;
    color: #d4af37;
    display: flex;
    flex-direction: column;
}

.floating-cta .cta-text small {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #f0e6ff;
    font-weight: 400;
}

/* On hover, expand to pill shape and reveal text */
.floating-cta:hover {
    width: 280px; /* Expand to show text */
    background: rgba(43, 27, 61, 0.95);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.8), inset 0 0 20px rgba(212, 175, 55, 0.5);
    border-color: #ffd700;
}

.floating-cta:hover .cta-text {
    opacity: 1;
    transform: translateX(0);
}

.floating-cta:hover .cta-icon {
    transform: scale(1.1) rotate(15deg);
}

.cta-container {
    margin: 10vh 0;
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.1);
        border-color: rgba(212, 175, 55, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(212, 175, 55, 0.9), inset 0 0 20px rgba(212, 175, 55, 0.4);
        border-color: #ffd700;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.1);
        border-color: rgba(212, 175, 55, 0.5);
    }
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0));
    border: 2px solid var(--gold);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1.5rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
    animation: pulseGlow 2s infinite ease-in-out;
}

.cta-button:hover {
    background: var(--gold);
    color: var(--bg-color);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
    transform: scale(1.05);
    animation: none; /* Detiene el parpadeo al pasar el ratón */
}

@media (max-width: 768px) {
    .vertical-menu {
        display: none !important;
    }

    .hero-title {
        padding: 1.5rem 1rem !important;
        margin-top: 5vh;
    }

    .hero-title h1 {
        font-size: 2rem;
        word-wrap: break-word;
    }
    
    .hero-title p {
        font-size: 1.1rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
    
    .glass-panel h2 {
        font-size: 1.5rem;
    }
    
    .glass-panel p, .glass-panel li {
        font-size: 1rem;
    }
    
    .cta-button {
        font-size: 1rem;
        padding: 1rem 2rem;
    }
}
