/* The Vaulted Library - Neo-Gothic Cyberpunk Repository */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Uncial+Antiqua&family=Share+Tech+Mono&display=swap');

:root {
    /* Cyberpunk Neons */
    --neon-cyan: #00ffff;
    --neon-magenta: #ff00ff;
    --neon-green: #39ff14;
    --neon-purple: #9d00ff;
    --neon-blue: #0ff;
    --neon-pink: #ff006e;
    
    /* Medieval Stone & Metal */
    --stone-dark: #1a1a2e;
    --stone-gray: #2d2d3a;
    --iron-gray: #3a3a4a;
    --ancient-parchment: #e8dcc4;
    --aged-bronze: #cd7f32;
    
    /* Hybrid Accents */
    --cyber-gold: #ffd700;
    --electric-blue: #0abdc6;
    --shadow-black: #0a0a0f;
    --glow-white: #e0e0ff;
    
    /* Legacy compatibility */
    --primary-gold: #ffd700;
    --parchment-ivory: #e8dcc4;
    --cathedral-stone: #2d2d3a;
    --copper-patina: #00ffff;
    --crimson: #ff006e;
    --cool-silver: #0abdc6;
    --accent-blue: #0abdc6;
    --royal-purple: #9d00ff;
    
    /* Cathedral proportions */
    --golden-ratio: 1.618;
    --nave-width: 80vw;
    --transept-height: calc(var(--nave-width) / var(--golden-ratio));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background: 
        linear-gradient(135deg, 
            var(--shadow-black) 0%, 
            var(--stone-dark) 30%,
            var(--stone-gray) 70%, 
            var(--stone-dark) 100%);
    color: var(--glow-white);
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 17px;
    position: relative;
}

/* Cyberpunk Grid Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* Vaulted Architecture Layout */
.cathedral-container {
    position: relative;
    min-height: 100vh;
    z-index: 2;
}

/* Accessibility: Dyslexia-friendly typography defaults */
/* Base font size: 16-18px, increased line height for readability */
/* Short paragraphs, avoid dense blocks, minimal italics in body text */

/* Gothic Arches Background with Neon Glow */
.cathedral-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(157, 0, 255, 0.08) 0%, transparent 60%);
    z-index: -1;
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Header - Cathedral Facade */
.cathedral-header {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.facade {
    position: relative;
    z-index: 2;
}

.cathedral-title {
    font-family: 'Uncial Antiqua', serif;
    font-size: clamp(2rem, 8vw, 6rem);
    color: var(--neon-cyan);
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 30px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 255, 0.2),
        2px 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 1rem;
    letter-spacing: 3px;
    animation: neonFlicker 3s ease-in-out infinite;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 10px rgba(0, 255, 255, 0.8),
            0 0 20px rgba(0, 255, 255, 0.6),
            0 0 30px rgba(0, 255, 255, 0.4),
            0 0 40px rgba(0, 255, 255, 0.2),
            2px 2px 4px rgba(0,0,0,0.8);
    }
    20%, 24%, 55% {
        text-shadow: 
            0 0 5px rgba(0, 255, 255, 0.4),
            2px 2px 4px rgba(0,0,0,0.8);
    }
}

.cathedral-subtitle {
    font-family: 'Cinzel', serif;
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--ancient-parchment);
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.heraldic-motto {
    font-family: 'Share Tech Mono', monospace;
    color: var(--neon-magenta);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    margin-top: 1rem;
    text-shadow: 
        0 0 8px rgba(255, 0, 255, 0.8),
        0 0 15px rgba(255, 0, 255, 0.4);
    letter-spacing: 1px;
}

/* Navigation - Rose Window with Neon */
.rose-window-nav {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9), rgba(45, 45, 58, 0.9));
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.5),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.rose-window-nav:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 50px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    border-color: var(--neon-magenta);
}

.nav-icon {
    color: var(--neon-cyan);
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.navigation-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, 
        rgba(26, 26, 46, 0.95), 
        rgba(45, 45, 58, 0.95));
    border-left: 3px solid var(--neon-cyan);
    box-shadow: -5px 0 30px rgba(0, 255, 255, 0.3);
    transition: right 0.4s ease;
    z-index: 999;
    padding: 2rem;
    backdrop-filter: blur(20px);
}

.navigation-menu.active {
    right: 0;
}

.nav-item {
    display: block;
    padding: 1rem 0;
    color: var(--glow-white);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.nav-item:hover {
    color: var(--neon-cyan);
    padding-left: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.nav-item:hover::before {
    width: 1rem;
}

/* Main Content - Nave */
.cathedral-nave {
    max-width: var(--nave-width);
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section {
    margin-bottom: 6rem;
    position: relative;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--neon-cyan);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    text-shadow: 
        0 0 10px rgba(0, 255, 255, 0.8),
        0 0 20px rgba(0, 255, 255, 0.4);
}

.section-title::before,
.section-title::after {
    content: '◆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-magenta);
    font-size: 1.5rem;
    text-shadow: 
        0 0 10px rgba(255, 0, 255, 0.8),
        0 0 20px rgba(255, 0, 255, 0.4);
    animation: diamondPulse 2s ease-in-out infinite;
}

.section-title::before {
    left: -3rem;
}

.section-title::after {
    right: -3rem;
}

@keyframes diamondPulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateY(-50%) scale(1.2); }
}

/* Content Cards - Stone Tablets with Neon Edges */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.content-card {
    background: linear-gradient(145deg, 
        rgba(26, 26, 46, 0.8), 
        rgba(45, 45, 58, 0.8));
    border: 2px solid var(--iron-gray);
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(0, 255, 255, 0.1);
}

.content-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        var(--neon-cyan), 
        var(--neon-magenta), 
        var(--neon-purple),
        var(--neon-cyan));
    border-radius: 15px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

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

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 10px 30px rgba(0, 255, 255, 0.3),
        0 0 50px rgba(255, 0, 255, 0.2),
        inset 0 1px 0 rgba(0, 255, 255, 0.2);
    border-color: var(--neon-cyan);
}

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

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--neon-cyan);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.card-description {
    color: var(--glow-white);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.card-link {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(45deg, 
        rgba(0, 255, 255, 0.2), 
        rgba(255, 0, 255, 0.2));
    color: var(--neon-cyan);
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.3s ease;
    border: 1px solid var(--neon-cyan);
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.card-link:hover {
    background: linear-gradient(45deg, 
        rgba(0, 255, 255, 0.4), 
        rgba(255, 0, 255, 0.4));
    color: var(--glow-white);
    transform: scale(1.05);
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.6),
        0 0 40px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Illuminated Manuscripts Style with Cyberpunk Twist */
.manuscript-section {
    background: linear-gradient(145deg, 
        rgba(26, 26, 46, 0.7), 
        rgba(45, 45, 58, 0.7));
    border: 3px solid var(--neon-purple);
    border-radius: 20px;
    padding: 3rem;
    margin: 3rem 0;
    position: relative;
    box-shadow: 
        0 0 30px rgba(157, 0, 255, 0.3),
        inset 0 0 30px rgba(157, 0, 255, 0.05);
}

.manuscript-section::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, 
        var(--neon-cyan) 0%, 
        var(--neon-magenta) 25%, 
        var(--neon-purple) 50%, 
        var(--neon-cyan) 100%);
    border-radius: 25px;
    z-index: -1;
    opacity: 0.3;
    filter: blur(15px);
    animation: borderGlow 4s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.illuminated-letter {
    float: left;
    font-family: 'Uncial Antiqua', serif;
    font-size: 4rem;
    line-height: 3rem;
    color: var(--neon-magenta);
    margin: 0 1rem 1rem 0;
    text-shadow: 
        0 0 15px rgba(255, 0, 255, 0.8),
        0 0 30px rgba(255, 0, 255, 0.4),
        2px 2px 4px rgba(0,0,0,0.8);
}

/* Footer - The Archive */
.cathedral-footer {
    background: linear-gradient(180deg, 
        transparent, 
        rgba(26, 26, 46, 0.9));
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-top: 2px solid var(--neon-cyan);
    box-shadow: 0 -5px 30px rgba(0, 255, 255, 0.2);
}

.crypt-text {
    font-family: 'Share Tech Mono', monospace;
    color: var(--electric-blue);
    font-style: normal;
    text-shadow: 0 0 5px rgba(10, 189, 198, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cathedral-nave {
        padding: 2rem 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .rose-window-nav {
        width: 60px;
        height: 60px;
        top: 1rem;
        right: 1rem;
    }
    
    .navigation-menu {
        width: 250px;
    }
    
    .section-title::before,
    .section-title::after {
        display: none;
    }
}

/* Scroll Animations */
@keyframes revelio {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: revelio 0.8s ease-out;
}

/* Gothic Window Effect with Neon */
.gothic-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background-image: 
        radial-gradient(ellipse 200px 400px at 10% 0%, rgba(0, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 200px 400px at 90% 0%, rgba(255, 0, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 300px 200px at 50% 100%, rgba(157, 0, 255, 0.1) 0%, transparent 50%);
    animation: windowShimmer 6s ease-in-out infinite;
}

@keyframes windowShimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}