:root {
    --bg-obsidian: #0D0D0D;
    --bg-charcoal: #1a1a1a;
    --accent-gold: #C9A961;
    --accent-gold-bright: #D4AF37;
    --accent-gold-dark: #8B7355;
    --accent-gold-glow: rgba(201, 169, 97, 0.4);
    --accent-cyan: #5BC9DE;
    --accent-purple: #9B59B6;
    --text-white: #f9f9f9;
    --text-mid: #CCCCCC;
    --text-grey: #666666;
    --border-gold: rgba(201, 169, 97, 0.2);
}

/* ============================================
   LIBRARY LAYOUT - COSMIC FOUNDATION
   ============================================ */
.library-layout {
    font-family: 'EB Garamond', serif;
    background-color: var(--bg-obsidian);
    color: var(--text-white);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    padding-bottom: 100px; /* Space for fixed footer */
}

/* Animated cosmic background */
.library-layout::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://media.xdripia.com/assets/banners/tales-tribes-of-the-sphere.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    opacity: 0.25;
    animation: slowZoom 60s ease-in-out infinite alternate;
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Mystic veil overlay */
.library-layout::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(91, 201, 222, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(201, 169, 97, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(155, 89, 182, 0.05) 0%, transparent 70%),
        rgba(13, 13, 13, 0.75);
    z-index: -1;
    animation: mysticPulse 15s ease-in-out infinite;
}

@keyframes mysticPulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* Floating particles effect */
.library-layout::before {
    animation: slowZoom 60s ease-in-out infinite alternate, particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% { filter: brightness(1) hue-rotate(0deg); }
    50% { filter: brightness(1.1) hue-rotate(10deg); }
    100% { filter: brightness(1) hue-rotate(0deg); }
}

.library-layout h1, 
.library-layout h2, 
.library-layout h3, 
.library-layout h4, 
.library-layout h5, 
.library-layout h6 {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 400;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.15),
        0 0 40px rgba(201, 169, 97, 0.1);
}

/* Library Stats Bar Positioning - Portal Page */
body:not(.library-layout) .library-stats-bar-widget {
    margin: 40px auto 50px;
    padding: 0 20px;
    max-width: 1200px;
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */
.glass-effect {
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 40px rgba(201, 169, 97, 0.05);
}

/* ============================================
   LIBRARY NAVBAR - TECH CONSOLE STYLE
   ============================================ */
.library-navbar {
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 2px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 10000;
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(201, 169, 97, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Scanline effect on navbar */
.library-navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    pointer-events: none;
    z-index: 1;
}

.library-navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 18px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    position: relative;
    z-index: 2;
}

.library-navbar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-white);
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(201, 169, 97, 0.2),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
}

.library-navbar-logo::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--accent-gold), var(--accent-cyan));
    box-shadow: 0 0 10px var(--accent-gold-glow);
    transition: height 0.3s ease;
}

.library-navbar-logo:hover::before {
    height: 100%;
}

.library-navbar-logo:hover {
    color: var(--accent-gold-bright);
    text-shadow: 
        0 0 25px rgba(255, 255, 255, 0.5),
        0 0 50px rgba(201, 169, 97, 0.4),
        2px 2px 6px rgba(0, 0, 0, 0.9);
    transform: translateX(5px);
}

.library-logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--accent-gold-glow));
    animation: iconPulse 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes iconPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 8px var(--accent-gold-glow));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 15px var(--accent-gold-glow));
        transform: scale(1.05);
    }
}

.library-navbar-links {
    display: flex;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.library-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-mid);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

/* Tech grid background on nav links */
.library-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(201, 169, 97, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.library-nav-link:hover::before {
    left: 100%;
}

.library-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold-bright), transparent);
    box-shadow: 0 0 15px var(--accent-gold-glow);
    transition: width 0.4s ease;
}

.library-nav-link:hover,
.library-nav-link.active {
    color: var(--accent-gold-bright);
    background: rgba(201, 169, 97, 0.1);
    border: 1px solid var(--border-gold);
    text-shadow: 0 0 15px rgba(201, 169, 97, 0.4);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.library-nav-link:hover::after,
.library-nav-link.active::after {
    width: 90%;
}

.nav-link-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px var(--accent-gold-glow));
}

.library-navbar-home {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-mid);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
}

.library-navbar-home:hover {
    color: var(--accent-cyan);
    background: rgba(91, 201, 222, 0.1);
    border: 1px solid rgba(91, 201, 222, 0.3);
    text-shadow: 0 0 15px rgba(91, 201, 222, 0.4);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(91, 201, 222, 0.2);
    transform: translateY(-2px);
}

.home-icon {
    font-size: 1.2rem;
}

/* ============================================
   HERO SECTION - CINEMATIC EPIC
   ============================================ */
.library-hero {
    text-align: center;
    padding: 140px 20px 100px;
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: brightness(0.8) contrast(1.1);
}

/* Animated vignette */
.library-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: -2;
    animation: vignetteBreath 10s ease-in-out infinite;
}

@keyframes vignetteBreath {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Mystical particles effect */
.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 25% 75%, rgba(201, 169, 97, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 75% 25%, rgba(91, 201, 222, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(155, 89, 182, 0.10) 0%, transparent 50%);
    animation: particlesFloat 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particlesFloat {
    0%, 100% { 
        opacity: 0.6; 
        transform: translateY(0) scale(1) rotate(0deg); 
    }
    33% {
        opacity: 0.9;
        transform: translateY(-30px) scale(1.05) rotate(5deg);
    }
    66% {
        opacity: 0.7;
        transform: translateY(-15px) scale(0.95) rotate(-5deg);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-logo-container {
    margin-bottom: 50px;
    position: relative;
}

.hero-logo-icon {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 0 30px rgba(201, 169, 97, 0.5));
}

.hero-central-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(201, 169, 97, 0.5));
    animation: logoFloat 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* Rotating cosmic ring around logo */
.hero-logo-icon::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid transparent;
    border-top-color: var(--accent-gold);
    border-right-color: var(--accent-cyan);
    border-radius: 50%;
    animation: cosmicRotate 20s linear infinite;
    opacity: 0.3;
}

.hero-logo-icon::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border: 1px solid transparent;
    border-bottom-color: var(--accent-purple);
    border-left-color: var(--accent-gold-bright);
    border-radius: 50%;
    animation: cosmicRotate 15s linear infinite reverse;
    opacity: 0.4;
}

@keyframes cosmicRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stacked-books {
    position: relative;
    width: 90px;
    height: 110px;
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.8));
    animation: booksFloat 6s ease-in-out infinite;
}

@keyframes booksFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.book {
    position: absolute;
    width: 70px;
    height: 10px;
    border-radius: 3px;
    left: 10px;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stacked-books:hover .book {
    transform: translateX(-3px);
}

.book-red {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    top: 20px;
    border: 2px solid rgba(212, 175, 55, 0.9);
    animation: bookGlow 3s ease-in-out infinite;
    animation-delay: 0s;
}

.book-green {
    background: linear-gradient(135deg, #006400, #32CD32);
    top: 35px;
    border: 2px solid rgba(212, 175, 55, 0.9);
    animation: bookGlow 3s ease-in-out infinite;
    animation-delay: 0.3s;
}

.book-blue {
    background: linear-gradient(135deg, #00008B, #4169E1);
    top: 50px;
    border: 2px solid rgba(212, 175, 55, 0.9);
    animation: bookGlow 3s ease-in-out infinite;
    animation-delay: 0.6s;
}

@keyframes bookGlow {
    0%, 100% { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 4px 15px rgba(212, 175, 55, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
}

.hero-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 72px;
    font-weight: 900;
    letter-spacing: 6px;
    margin-bottom: 25px;
    color: var(--text-white);
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.5),
        0 0 60px rgba(201, 169, 97, 0.4),
        0 0 90px rgba(91, 201, 222, 0.3),
        3px 3px 6px rgba(0, 0, 0, 0.9),
        0 0 120px rgba(255, 255, 255, 0.2);
    animation: epicTitleGlow 4s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

/* Glitch effect on title */
.hero-title::before,
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

@keyframes epicTitleGlow {
    0%, 100% { 
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 0.5),
            0 0 60px rgba(201, 169, 97, 0.4),
            0 0 90px rgba(91, 201, 222, 0.3),
            3px 3px 6px rgba(0, 0, 0, 0.9);
    }
    25% {
        text-shadow: 
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 80px rgba(201, 169, 97, 0.5),
            0 0 120px rgba(91, 201, 222, 0.4),
            3px 3px 6px rgba(0, 0, 0, 0.9);
    }
    50% { 
        text-shadow: 
            0 0 50px rgba(255, 255, 255, 0.7),
            0 0 100px rgba(201, 169, 97, 0.6),
            0 0 150px rgba(155, 89, 182, 0.4),
            3px 3px 6px rgba(0, 0, 0, 0.9);
    }
    75% {
        text-shadow: 
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 80px rgba(91, 201, 222, 0.5),
            0 0 120px rgba(201, 169, 97, 0.4),
            3px 3px 6px rgba(0, 0, 0, 0.9);
    }
}

.hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--text-white);
    font-style: italic;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 70px;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(201, 169, 97, 0.2),
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 60px rgba(91, 201, 222, 0.2);
    opacity: 0.95;
    animation: subtitleShimmer 5s ease-in-out infinite;
}

@keyframes subtitleShimmer {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

.hero-emblems {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 80px;
    flex-wrap: wrap;
}

.hero-emblem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Cosmic aura around emblems */
.hero-emblem::before {
    content: '';
    position: absolute;
    width: 140px;
    height: 140px;
    top: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-emblem:hover::before {
    opacity: 1;
    animation: auraExpand 2s ease-in-out infinite;
}

@keyframes auraExpand {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 0.3; }
}

.hero-emblem:hover {
    transform: translateY(-10px) scale(1.05);
}

.emblem-logo {
    width: 130px;
    height: auto;
    max-height: 130px;
    object-fit: contain;
    filter: 
        drop-shadow(0 0 25px rgba(255, 255, 255, 0.4))
        drop-shadow(0 0 40px rgba(201, 169, 97, 0.3));
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.95;
}

.hero-emblem:hover .emblem-logo {
    filter: 
        drop-shadow(0 0 40px rgba(255, 255, 255, 0.7))
        drop-shadow(0 0 60px rgba(201, 169, 97, 0.5))
        drop-shadow(0 0 80px rgba(91, 201, 222, 0.3));
    transform: scale(1.1);
    opacity: 1;
}

.emblem-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--text-white);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.3),
        0 0 30px rgba(201, 169, 97, 0.2),
        2px 2px 4px rgba(0, 0, 0, 0.9);
    margin-top: 12px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.hero-emblem:hover .emblem-label {
    color: var(--accent-gold-bright);
    text-shadow: 
        0 0 20px rgba(201, 169, 97, 0.6),
        0 0 40px rgba(201, 169, 97, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.9);
    opacity: 1;
}
/* ============================================
   CONTAINER & SECTIONS
   ============================================ */
   .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 100px;
    position: relative;
}

/* Decorative corner elements */
.container::before,
.container::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    opacity: 0.1;
}

.container::before {
    top: 0;
    left: 0;
    border-top: 2px solid var(--accent-gold);
    border-left: 2px solid var(--accent-gold);
}

.container::after {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--accent-gold);
    border-right: 2px solid var(--accent-gold);
}

.section {
    margin-bottom: 80px;
    position: relative;
}

.section-header {
    margin-bottom: 50px;
    padding-bottom: 25px;
    border-bottom: 2px solid transparent;
    background: linear-gradient(90deg, transparent, var(--border-gold), transparent) bottom;
    background-size: 100% 2px;
    background-repeat: no-repeat;
    position: relative;
    text-align: center;
}

/* Glowing orb decoration */
.section-header::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, var(--accent-gold-bright), transparent);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-gold-glow);
    animation: orbPulse 2s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translateX(-50%) scale(1.3); 
        opacity: 0.7; 
    }
}

.section-title {
    font-size: 42px;
    color: var(--text-white);
    margin-bottom: 15px;
    letter-spacing: 3px;
    text-transform: normal;
    text-shadow: 
        0 0 20px var(--accent-gold-glow),
        0 0 40px rgba(201, 169, 97, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: titleShine 5s ease-in-out infinite;
}

@keyframes titleShine {
    0%, 100% { 
        text-shadow: 
            0 0 20px var(--accent-gold-glow),
            0 0 40px rgba(201, 169, 97, 0.3),
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    50% { 
        text-shadow: 
            0 0 30px var(--accent-gold-glow),
            0 0 60px rgba(201, 169, 97, 0.5),
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

.section-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: var(--text-mid);
    font-style: italic;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* ============================================
   TOME CARDS - MYSTICAL GRIMOIRES
   ============================================ */
.tome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.tome-card {
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 2px solid var(--border-gold);
    border-radius: 20px;
    padding: 35px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Animated gradient border */
.tome-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        var(--accent-gold),
        var(--accent-cyan),
        var(--accent-purple),
        var(--accent-gold)
    );
    background-size: 300% 300%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: gradientRotate 6s ease infinite;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tome-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.9);
    border-radius: 20px;
    z-index: -1;
}

.tome-card:hover::before {
    opacity: 1;
}

.tome-card:hover {
    border-color: transparent;
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.6),
        0 0 60px var(--accent-gold-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-10px) scale(1.02);
}

/* Floating runes effect */
.tome-card:hover::after {
    animation: runesFloat 3s ease-in-out infinite;
}

@keyframes runesFloat {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

.tome-number {
    font-family: 'Cinzel', serif;
    font-size: 56px;
    font-weight: 900;
    color: var(--accent-gold-bright);
    line-height: 1;
    margin-bottom: 20px;
    text-shadow: 
        0 0 20px var(--accent-gold-glow),
        0 0 40px rgba(201, 169, 97, 0.4);
    background: linear-gradient(135deg, var(--accent-gold-bright), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

/* Roman numeral decoration */
.tome-number::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold-bright), transparent);
    box-shadow: 0 0 10px var(--accent-gold-glow);
}

.tome-title {
    font-family: 'Cinzel', serif;
    font-size: 26px;
    color: var(--text-white);
    margin-bottom: 18px;
    letter-spacing: 1.5px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tome-card:hover .tome-title {
    color: var(--accent-gold-bright);
    text-shadow: 0 0 20px var(--accent-gold-glow);
}

.tome-label {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(201, 169, 97, 0.15);
    border: 1px solid var(--accent-gold-dark);
    border-radius: 25px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-gold-bright);
    margin-bottom: 25px;
    box-shadow: 
        0 0 15px rgba(201, 169, 97, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', monospace;
}

.tome-card:hover .tome-label {
    background: rgba(201, 169, 97, 0.25);
    border-color: var(--accent-gold);
    box-shadow: 
        0 0 25px rgba(201, 169, 97, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tome-description {
    font-size: 17px;
    line-height: 1.9;
    color: var(--text-mid);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.tome-stats {
    display: flex;
    gap: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-gold);
    position: relative;
}

/* Tech scanline on stats divider */
.tome-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-gold-bright),
        transparent
    );
    box-shadow: 0 0 10px var(--accent-gold-glow);
    animation: scanlineMove 3s ease-in-out infinite;
}

@keyframes scanlineMove {
    0%, 100% { transform: translateX(-100%); opacity: 0; }
    50% { transform: translateX(100%); opacity: 1; }
}

.stat {
    flex: 1;
    text-align: center;
    transition: transform 0.3s ease;
}

.tome-card:hover .stat {
    transform: scale(1.05);
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 900;
    color: var(--accent-gold-bright);
    display: block;
    text-shadow: 
        0 0 15px var(--accent-gold-glow),
        0 0 30px rgba(201, 169, 97, 0.3);
    animation: statGlow 3s ease-in-out infinite;
}

@keyframes statGlow {
    0%, 100% { 
        text-shadow: 
            0 0 15px var(--accent-gold-glow),
            0 0 30px rgba(201, 169, 97, 0.3);
    }
    50% { 
        text-shadow: 
            0 0 25px var(--accent-gold-glow),
            0 0 50px rgba(201, 169, 97, 0.5);
    }
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-grey);
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   CATEGORIES LIST - GRIMOIRE INDEX
   ============================================ */
.categories-list {
    margin-top: 25px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 97, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.categories-title {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-gold-bright);
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--accent-gold-glow);
    position: relative;
    padding-bottom: 10px;
}

.categories-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    box-shadow: 0 0 10px var(--accent-gold-glow);
}

.category-item {
    display: flex;
    align-items: baseline;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(201, 169, 97, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.category-item::before {
    content: '◆';
    position: absolute;
    left: -15px;
    color: var(--accent-gold);
    opacity: 0;
    transition: all 0.3s ease;
}

.category-item:hover::before {
    opacity: 1;
    left: -10px;
}

.category-item:hover {
    padding-left: 10px;
    border-bottom-color: rgba(201, 169, 97, 0.3);
    background: rgba(201, 169, 97, 0.05);
}

.category-item:last-child {
    border-bottom: none;
}

.category-number {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--accent-gold-dark);
    min-width: 55px;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(201, 169, 97, 0.3);
}

.category-name {
    flex: 1;
    font-size: 16px;
    color: var(--text-mid);
    transition: color 0.3s ease;
}

.category-item:hover .category-name {
    color: var(--text-white);
}

.category-count {
    font-size: 13px;
    color: var(--text-grey);
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* ============================================
   INFO BOX - SACRED KNOWLEDGE
   ============================================ */
.info-box {
    background: rgba(201, 169, 97, 0.12);
    border-left: 4px solid var(--accent-gold-bright);
    padding: 25px;
    margin: 40px 0;
    border-radius: 8px;
    box-shadow: 
        0 5px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Mystical glow effect */
.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(201, 169, 97, 0.2),
        transparent
    );
    animation: infoBoxGlow 3s ease-in-out infinite;
}

@keyframes infoBoxGlow {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.info-box h4 {
    font-size: 20px;
    color: var(--accent-gold-bright);
    margin-bottom: 12px;
    text-shadow: 0 0 10px var(--accent-gold-glow);
    letter-spacing: 1px;
}

.info-box p {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-mid);
}

/* ============================================
   OVERVIEW STATS - COSMIC METRICS
   ============================================ */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.stat-card {
    background: rgba(26, 26, 26, 0.7);
    border: 2px solid var(--border-gold);
    border-radius: 18px;
    padding: 35px 25px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Hexagonal pattern background */
.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(201, 169, 97, 0.03) 40px,
            rgba(201, 169, 97, 0.03) 41px
        ),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 40px,
            rgba(201, 169, 97, 0.03) 40px,
            rgba(201, 169, 97, 0.03) 41px
        ),
        repeating-linear-gradient(
            120deg,
            transparent,
            transparent 40px,
            rgba(201, 169, 97, 0.03) 40px,
            rgba(201, 169, 97, 0.03) 41px
        );
    animation: hexRotate 30s linear infinite;
    opacity: 0.5;
}

@keyframes hexRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat-card:hover {
    border-color: var(--accent-gold-bright);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.5),
        0 0 60px var(--accent-gold-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-10px) scale(1.05);
}

.stat-card-value {
    font-family: 'Cinzel', serif;
    font-size: 56px;
    font-weight: 900;
    color: var(--accent-gold-bright);
    display: block;
    margin-bottom: 12px;
    text-shadow: 
        0 0 20px var(--accent-gold-glow),
        0 0 40px rgba(201, 169, 97, 0.4);
    animation: valueCount 2s ease-out;
    position: relative;
    z-index: 1;
}

@keyframes valueCount {
    0% { 
        opacity: 0; 
        transform: scale(0.5); 
    }
    100% { 
        opacity: 1; 
        transform: scale(1); 
    }
}

.stat-card-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-mid);
    font-family: 'Cinzel', serif;
    position: relative;
    z-index: 1;
}

/* ============================================
   DIVIDER - COSMIC SEPARATOR
   ============================================ */
.divider {
    display: flex;
    align-items: center;
    gap: 25px;
    margin: 80px 0;
    opacity: 0.6;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(
        90deg, 
        transparent, 
        var(--accent-gold-bright), 
        transparent
    );
    box-shadow: 0 0 10px var(--accent-gold-glow);
    animation: dividerPulse 4s ease-in-out infinite;
}

@keyframes dividerPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.divider-text {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 6px;
    color: var(--accent-gold-bright);
    text-transform: uppercase;
    text-shadow: 0 0 15px var(--accent-gold-glow);
    padding: 0 20px;
    position: relative;
}

/* Mystical rune decoration */
.divider-text::before,
.divider-text::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-gold);
    animation: runeFloat 3s ease-in-out infinite;
}

.divider-text::before {
    left: 0;
}

.divider-text::after {
    right: 0;
    animation-delay: 1.5s;
}

@keyframes runeFloat {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(-70%); }
}

/* ============================================
   FOOTER - ETERNAL SEAL
   ============================================ */
.footer {
    text-align: center;
    padding: 50px 20px;
    margin-top: 100px;
    border-top: 2px solid transparent;
    background: linear-gradient(180deg, transparent, var(--border-gold)) top;
    background-size: 100% 2px;
    background-repeat: no-repeat;
    position: relative;
}

/* Mystical symbols */
.footer::before {
    content: '✦';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--accent-gold-bright);
    text-shadow: 0 0 20px var(--accent-gold-glow);
    animation: symbolRotate 10s linear infinite;
}

@keyframes symbolRotate {
    0% { transform: translateX(-50%) rotate(0deg); }
    100% { transform: translateX(-50%) rotate(360deg); }
}

.footer p {
    font-size: 14px;
    color: var(--text-grey);
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Cinzel', serif;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE MAGIC
   ============================================ */
@media (max-width: 768px) {
    .library-navbar-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .library-navbar-links {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .library-nav-link {
        width: 100%;
        justify-content: center;
    }
    
    .library-hero {
        padding: 100px 20px 60px;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 42px;
        letter-spacing: 3px;
    }
    
    .hero-subtitle {
        font-size: 16px;
        letter-spacing: 2px;
        margin-bottom: 50px;
    }
    
    .hero-emblems {
        gap: 25px;
        margin-top: 50px;
    }
    
    .emblem-logo {
        width: 90px;
        max-height: 90px;
    }
    
    .emblem-label {
        font-size: 0.75rem;
    }
    
    .hero-logo-icon {
        width: 130px;
        height: 130px;
    }
    
    .stacked-books {
        width: 75px;
        height: 95px;
    }
    
    .tome-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .container {
        padding: 0 20px 70px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .overview-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tome-number {
        font-size: 48px;
    }
    
    .tome-title {
        font-size: 22px;
    }
}

/* ============================================
   SCROLLBAR STYLING - GLASS EFFECT
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid rgba(201, 169, 97, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 169, 97, 0.3);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 10px;
    box-shadow: 
        0 0 10px rgba(201, 169, 97, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 169, 97, 0.5);
    box-shadow: 
        0 0 15px rgba(201, 169, 97, 0.4),
        inset 0 0 15px rgba(255, 255, 255, 0.15);
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
    background: var(--accent-gold-glow);
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

::-moz-selection {
    background: var(--accent-gold-glow);
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */
@keyframes shimmerFlow {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    animation: shimmerFlow 3s linear infinite;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    background-size: 1000px 100%;
}

/* ============================================
   ENTRANCE ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up:nth-child(5) { animation-delay: 0.5s; }

/* ============================================
   MEGA MENU - GLASSMORPHIC BROWSE ALL
   ============================================ */
.mega-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mega-menu.active {
    opacity: 1;
    visibility: visible;
}

.mega-menu-container {
    position: relative;
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 2px solid var(--border-gold);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.9),
        0 0 80px rgba(201, 169, 97, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 40px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mega-menu.active .mega-menu-container {
    transform: scale(1);
}

.mega-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-gold);
    border-radius: 50%;
    background: rgba(201, 169, 97, 0.1);
    color: var(--text-white);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.mega-menu-close:hover {
    background: rgba(201, 169, 97, 0.2);
    border-color: var(--accent-gold-bright);
    transform: rotate(90deg);
    box-shadow: 0 0 20px var(--accent-gold-glow);
}

.mega-menu-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-gold);
    padding-bottom: 15px;
}

.mega-menu-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-mid);
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mega-menu-tab::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--accent-gold-bright);
    box-shadow: 0 0 15px var(--accent-gold-glow);
    transition: width 0.3s ease;
}

.mega-menu-tab:hover {
    background: rgba(201, 169, 97, 0.1);
    color: var(--text-white);
    border-color: var(--border-gold);
}

.mega-menu-tab.active {
    background: rgba(201, 169, 97, 0.15);
    color: var(--accent-gold-bright);
    border-color: var(--accent-gold);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mega-menu-tab.active::after {
    width: 80%;
}

.tab-icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px var(--accent-gold-glow));
}

.mega-menu-content {
    position: relative;
    min-height: 400px;
    max-height: calc(90vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

.mega-menu-tab-content {
    display: none;
}

.mega-menu-tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

.mega-menu-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-mid);
    font-family: 'Cinzel', serif;
}

.mega-menu-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-gold);
    border-top-color: var(--accent-gold-bright);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mega-menu-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.mega-menu-entry {
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.mega-menu-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(201, 169, 97, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.mega-menu-entry:hover::before {
    left: 100%;
}

.mega-menu-entry:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold-bright);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(201, 169, 97, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 45, 0.8);
}

.entry-category {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 8px;
    opacity: 0.8;
}

.entry-title {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 10px;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.mega-menu-entry:hover .entry-title {
    color: var(--accent-gold-bright);
    text-shadow: 0 0 15px var(--accent-gold-glow);
}

.entry-excerpt {
    font-family: 'EB Garamond', serif;
    font-size: 0.9rem;
    color: var(--text-mid);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-grey);
    font-family: 'Cinzel', serif;
}

.entry-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.mega-menu-entry:hover .entry-image {
    opacity: 1;
}

.mega-menu-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-gold);
    text-align: center;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: rgba(201, 169, 97, 0.1);
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    color: var(--accent-gold-bright);
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(201, 169, 97, 0.2);
}

.view-all-link:hover {
    background: rgba(201, 169, 97, 0.2);
    border-color: var(--accent-gold-bright);
    box-shadow: 
        0 0 30px rgba(201, 169, 97, 0.4),
        0 0 60px rgba(201, 169, 97, 0.2);
    transform: translateY(-2px);
}

.browse-all-btn {
    cursor: pointer;
}

.browse-all-btn:hover {
    color: var(--accent-cyan);
    background: rgba(91, 201, 222, 0.1);
    border: 1px solid rgba(91, 201, 222, 0.3);
    text-shadow: 0 0 15px rgba(91, 201, 222, 0.4);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(91, 201, 222, 0.2);
    transform: translateY(-2px);
}

/* Responsive Mega Menu */
@media (max-width: 768px) {
    .mega-menu-container {
        padding: 20px;
        max-height: 95vh;
    }
    
    .mega-menu-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .mega-menu-tab {
        width: 100%;
        padding: 12px 15px;
    }
    
    .mega-menu-entries {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .mega-menu-content {
        max-height: calc(95vh - 250px);
    }
    
    .mega-menu-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* ============================================
   SECTION HERO - ENCYCLOPEDIA & CHRONICLES
   ============================================ */
.section-hero {
    text-align: center;
    padding: 140px 20px 100px;
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%),
        linear-gradient(180deg, rgba(201, 169, 97, 0.05) 0%, transparent 100%);
}

/* Encyclopedia specific hero */
.encyclopedia-hero {
    background: 
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%),
        radial-gradient(circle at 30% 50%, rgba(201, 169, 97, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(91, 201, 222, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, rgba(201, 169, 97, 0.05) 0%, transparent 100%);
}

/* Hide moving particles background for encyclopedia hero */
.encyclopedia-hero .section-hero-particles {
    display: none;
}

/* Encyclopedia hero title styling */
.encyclopedia-hero-title {
    font-family: 'Cinzel Decorative', serif;
    font-weight: 400;
    text-transform: none;
}

/* Chronicles specific hero */
.chronicles-hero {
    background: 
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%),
        radial-gradient(circle at 30% 50%, rgba(155, 89, 182, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(201, 169, 97, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, rgba(155, 89, 182, 0.05) 0%, transparent 100%);
}

.section-hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: 
        radial-gradient(circle at 25% 75%, rgba(201, 169, 97, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 75% 25%, rgba(91, 201, 222, 0.10) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(155, 89, 182, 0.08) 0%, transparent 50%);
    animation: sectionParticlesFloat 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sectionParticlesFloat {
    0%, 100% { 
        opacity: 0.5; 
        transform: translateY(0) scale(1) rotate(0deg); 
    }
    33% {
        opacity: 0.8;
        transform: translateY(-25px) scale(1.03) rotate(3deg);
    }
    66% {
        opacity: 0.6;
        transform: translateY(-12px) scale(0.97) rotate(-3deg);
    }
}

.section-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.section-hero-logo-container {
    margin-bottom: 40px;
    position: relative;
}

.section-hero-logo-icon {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 0 30px rgba(201, 169, 97, 0.5));
}

.section-logo-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.3) 0%, transparent 70%);
    animation: sectionLogoGlow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes sectionLogoGlow {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1); 
    }
}

.section-logo-emoji {
    font-size: 4rem;
    filter: drop-shadow(0 0 20px rgba(201, 169, 97, 0.6));
    animation: sectionLogoFloat 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes sectionLogoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.section-hero-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 64px;
    font-weight: 400;
    letter-spacing: 5px;
    margin-bottom: 20px;
    color: var(--text-white);
    text-shadow: 
        0 0 30px rgba(255, 255, 255, 0.5),
        0 0 60px rgba(201, 169, 97, 0.4),
        0 0 90px rgba(91, 201, 222, 0.3),
        3px 3px 6px rgba(0, 0, 0, 0.9),
        0 0 120px rgba(255, 255, 255, 0.2);
    animation: sectionTitleGlow 4s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

@keyframes sectionTitleGlow {
    0%, 100% { 
        text-shadow: 
            0 0 30px rgba(255, 255, 255, 0.5),
            0 0 60px rgba(201, 169, 97, 0.4),
            0 0 90px rgba(91, 201, 222, 0.3),
            3px 3px 6px rgba(0, 0, 0, 0.9);
    }
    50% { 
        text-shadow: 
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 80px rgba(201, 169, 97, 0.5),
            0 0 120px rgba(91, 201, 222, 0.4),
            3px 3px 6px rgba(0, 0, 0, 0.9);
    }
}

.section-hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: var(--text-white);
    font-style: italic;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(201, 169, 97, 0.2),
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 60px rgba(91, 201, 222, 0.2);
    opacity: 0.95;
    animation: sectionSubtitleShimmer 5s ease-in-out infinite;
}

@keyframes sectionSubtitleShimmer {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

/* Rotating cosmic rings around logo */
.section-hero-logo-icon::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border: 2px solid transparent;
    border-top-color: var(--accent-gold);
    border-right-color: var(--accent-cyan);
    border-radius: 50%;
    animation: sectionCosmicRotate 20s linear infinite;
    opacity: 0.3;
}

.section-hero-logo-icon::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border: 1px solid transparent;
    border-bottom-color: var(--accent-purple);
    border-left-color: var(--accent-gold-bright);
    border-radius: 50%;
    animation: sectionCosmicRotate 15s linear infinite reverse;
    opacity: 0.4;
}

@keyframes sectionCosmicRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Chronicles Post Hero - Smaller, no logo */
.chronicles-post-hero {
    min-height: 60vh;
    padding: 140px 20px 100px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.chronicles-post-hero .section-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 0;
    transform: none !important;
    animation: none !important;
    will-change: auto;
}

.chronicles-post-hero .section-hero-particles {
    z-index: 1;
}

.chronicles-post-hero .section-hero-content {
    position: relative;
    z-index: 2;
}

.chronicles-post-hero .section-hero-title {
    font-size: 56px;
    margin-bottom: 15px;
}

.chronicles-post-hero .section-hero-subtitle {
    font-size: 20px;
    letter-spacing: 2px;
    text-transform: none;
    font-style: normal;
}

/* Responsive Section Hero */
@media (max-width: 768px) {
    .section-hero {
        padding: 100px 20px 60px;
        min-height: 60vh;
    }
    
    .section-hero-title {
        font-size: 42px;
        letter-spacing: 3px;
    }
    
    .section-hero-subtitle {
        font-size: 18px;
        letter-spacing: 2px;
    }
    
    .section-hero-logo-icon {
        width: 120px;
        height: 120px;
    }
    
    .section-logo-emoji {
        font-size: 3rem;
    }
    
    .section-hero-logo-icon::before {
        width: 150px;
        height: 150px;
    }
    
    .section-hero-logo-icon::after {
        width: 130px;
        height: 130px;
    }
    
    .chronicles-post-hero {
        min-height: 50vh;
        padding: 120px 20px 80px;
    }
    
    .chronicles-post-hero .section-hero-title {
        font-size: 36px;
    }
    
    .chronicles-post-hero .section-hero-subtitle {
        font-size: 16px;
    }
}

/* ============================================
   LIBRARY FOOTER - MINIMAL DESIGN
   ============================================ */
.library-footer {
    padding: 30px 20px;
    border-top: 1px solid rgba(201, 169, 97, 0.1);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.library-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(201, 169, 97, 0.3),
        transparent
    );
}

.library-footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.library-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.library-footer-left,
.library-footer-center,
.library-footer-right {
    flex: 1;
    min-width: 200px;
}

.library-footer-left {
    display: flex;
    justify-content: flex-start;
}

.library-footer-center {
    text-align: center;
}

.library-footer-right {
    display: flex;
    justify-content: flex-end;
}

.library-footer-home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-mid);
    text-decoration: none;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.library-footer-home-link:hover {
    color: var(--accent-gold);
    transform: translateX(3px);
}

.footer-home-icon {
    font-size: 16px;
    filter: drop-shadow(0 0 4px rgba(201, 169, 97, 0.3));
    transition: filter 0.3s ease;
}

.library-footer-home-link:hover .footer-home-icon {
    filter: drop-shadow(0 0 8px rgba(201, 169, 97, 0.6));
}

.footer-home-text {
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.library-footer-copyright {
    font-size: 13px;
    color: var(--text-grey);
    letter-spacing: 1px;
    margin: 0;
}

.library-footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.library-footer-link {
    color: var(--text-mid);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    font-weight: 500;
}

.library-footer-link:hover {
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(201, 169, 97, 0.4);
}

.library-footer-separator {
    color: var(--text-grey);
    opacity: 0.5;
    font-size: 12px;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .library-footer {
        padding: 30px 20px;
        margin-top: 60px;
    }
    
    .library-footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .library-footer-left,
    .library-footer-center,
    .library-footer-right {
        justify-content: center;
        width: 100%;
    }
    
    .library-footer-links {
        justify-content: center;
    }
}