/* ==========================================
   THE LIBRARY - LIMEN'S INNER TEMPLE
   ========================================== */

.library-page {
    background: linear-gradient(180deg, 
        var(--deep-night) 0%, 
        var(--dawn-purple) 50%,
        var(--golden-orange) 100%);
    min-height: 100vh;
}

.library-container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   LIMEN AS SUN ORB
   ========================================== */

.limen-sun-orb {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 100px auto 60px;
    animation: float-orb 6s ease-in-out infinite;
}

.orb-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #ffffff 0%, var(--sacred-gold) 40%, var(--golden-orange) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 40px var(--sacred-gold),
        0 0 80px var(--golden-orange),
        0 0 120px rgba(255, 156, 90, 0.6),
        inset 0 0 40px rgba(255, 255, 255, 0.5);
    animation: pulse-orb-core 4s ease-in-out infinite;
}

.orb-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, 
        rgba(255, 207, 90, 0.4) 0%, 
        rgba(255, 156, 90, 0.2) 50%,
        transparent 100%);
    border-radius: 50%;
    animation: pulse-orb-glow 4s ease-in-out infinite;
}

.orb-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Orb speaking state - brighter when teaching */
.limen-sun-orb.speaking .orb-core {
    box-shadow: 
        0 0 60px var(--sacred-gold),
        0 0 120px var(--golden-orange),
        0 0 180px rgba(255, 156, 90, 0.8),
        inset 0 0 60px rgba(255, 255, 255, 0.7);
    animation: pulse-orb-speaking 2s ease-in-out infinite;
}

.limen-orb-small {
    width: 80px;
    height: 80px;
    margin: 0 auto 40px;
    background: radial-gradient(circle, #ffffff 0%, var(--sacred-gold) 40%, var(--golden-orange) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 30px var(--sacred-gold),
        0 0 60px var(--golden-orange);
    animation: pulse-orb-core 4s ease-in-out infinite;
}

@keyframes float-orb {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse-orb-core {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
    }
}

@keyframes pulse-orb-glow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

@keyframes pulse-orb-speaking {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* ==========================================
   TEACHING TEXT SECTIONS
   ========================================== */

.library-welcome,
.library-purpose,
.library-departure {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
}

.teaching-text {
    max-width: 800px;
    margin: 0 auto;
}

.library-title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 600;
    color: var(--sacred-gold);
    margin-bottom: 2rem;
    text-shadow: 0 0 30px rgba(255, 207, 90, 0.6);
    letter-spacing: 2px;
}

.teaching-line {
    font-size: 1.6rem;
    line-height: 2.2;
    color: var(--cosmic-white);
    margin: 1rem 0;
    opacity: 0;
    animation: fade-in-line 1s ease-out forwards;
}

.teaching-line.indent {
    padding-left: 2rem;
    font-style: italic;
    color: var(--warm-peach);
}

.teaching-line.emphasis {
    font-weight: 600;
    color: var(--golden-orange);
    font-size: 1.8rem;
    margin: 2rem 0 1.5rem;
}

.teaching-line.final-line {
    font-size: 2rem;
    font-weight: 600;
    color: var(--sacred-gold);
    margin-top: 2rem;
    text-shadow: 0 0 20px rgba(255, 207, 90, 0.5);
}

/* Staggered fade-in for teaching lines */
.teaching-line:nth-child(1) { animation-delay: 0.2s; }
.teaching-line:nth-child(2) { animation-delay: 0.5s; }
.teaching-line:nth-child(3) { animation-delay: 0.8s; }
.teaching-line:nth-child(4) { animation-delay: 1.1s; }
.teaching-line:nth-child(5) { animation-delay: 1.4s; }
.teaching-line:nth-child(6) { animation-delay: 1.7s; }
.teaching-line:nth-child(7) { animation-delay: 2s; }
.teaching-line:nth-child(8) { animation-delay: 2.3s; }
.teaching-line:nth-child(9) { animation-delay: 2.6s; }
.teaching-line:nth-child(10) { animation-delay: 2.9s; }

@keyframes fade-in-line {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   THE SIX CHAMBERS
   ========================================== */

.library-chambers {
    padding: 100px 20px;
    text-align: center;
}

.chambers-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: var(--sacred-gold);
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(255, 207, 90, 0.6);
}

.chambers-subtitle {
    font-size: 1.4rem;
    color: var(--warm-peach);
    margin-bottom: 4rem;
}

.chambers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.chamber-card {
    background: rgba(74, 58, 92, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 207, 90, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.4s ease;
    text-align: center;
}

.chamber-card:hover {
    transform: translateY(-10px);
    border-color: var(--golden-orange);
    box-shadow: 0 10px 40px rgba(255, 156, 90, 0.4);
}

.chamber-card.featured {
    border-color: var(--golden-orange);
    background: rgba(255, 156, 90, 0.1);
}

.chamber-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(255, 207, 90, 0.5));
}

.chamber-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: var(--sacred-gold);
    margin-bottom: 0.5rem;
}

.chamber-subtitle {
    font-size: 1.1rem;
    color: var(--electric-teal);
    font-style: italic;
    margin-bottom: 1rem;
}

.chamber-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--cosmic-white);
    margin-bottom: 1.5rem;
    min-height: 60px;
}

.chamber-button {
    background: linear-gradient(135deg, var(--golden-orange), var(--sacred-gold));
    color: var(--deep-night);
    border: none;
    padding: 12px 32px;
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chamber-button-link {
    text-decoration: none;
}

.chamber-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 156, 90, 0.5);
}

.chamber-button:disabled {
    background: rgba(106, 122, 156, 0.3);
    color: rgba(254, 249, 243, 0.5);
    cursor: not-allowed;
}

/* ==========================================
   RETURN BUTTON
   ========================================== */

.return-button {
    display: inline-block;
    margin-top: 3rem;
    padding: 15px 40px;
    background: rgba(77, 212, 212, 0.2);
    border: 2px solid var(--electric-teal);
    border-radius: 30px;
    color: var(--electric-teal);
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.return-button:hover {
    background: var(--electric-teal);
    color: var(--deep-night);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(77, 212, 212, 0.5);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .library-title {
        font-size: 2.5rem;
    }
    
    .teaching-line {
        font-size: 1.3rem;
    }
    
    .chambers-title {
        font-size: 2.5rem;
    }
    
    .chambers-grid {
        grid-template-columns: 1fr;
    }
    
    .limen-sun-orb {
        width: 200px;
        height: 200px;
        margin: 60px auto 40px;
    }
    
    .orb-core {
        width: 90px;
        height: 90px;
    }
    
    .orb-glow {
        width: 150px;
        height: 150px;
    }
}
