/* ===== GLOBAL RESET & SCROLL SNAP ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}
body {
    width: 100%; min-height: 100%;
    font-family: 'Cormorant Garamond', serif;
    background: #0a0502; color: #f5e6c8;
    overflow-x: hidden;
}
.snap-page {
    position: relative; width: 100vw; height: 100vh;
    scroll-snap-align: start; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}

/* ===== PROGRESS BAR & PAGE INDICATOR ===== */
.progress-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: rgba(10, 5, 2, 0.3); z-index: 10000;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #ff8c00, #d4af37);
    width: 0%; transition: width 0.3s ease;
}
.page-indicator {
    position: fixed; top: 15px; left: 30px;
    font-family: 'Playfair Display', serif; font-size: 0.9rem;
    color: #f5e6c8; z-index: 10000;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: 0.1em;
    background: rgba(10, 5, 2, 0.7);
    padding: 8px 15px; border-radius: 3px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #0a0502; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    opacity: 1; transition: opacity 1s ease;
}
.loading-screen.loaded { opacity: 0; pointer-events: none; }
.loading-title {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(3rem, 6vw, 5rem); color: #f5e6c8;
    text-shadow: 0 0 30px rgba(255, 69, 0, 0.4), 0 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 40px; opacity: 0;
    animation: loadingFadeIn 1s ease 0.5s forwards;
}
.loading-subtitle {
    font-family: 'Cormorant Garamond', serif; font-style: italic;
    font-size: 1.1rem; color: #e8d4a8; letter-spacing: 0.15em;
    opacity: 0; animation: loadingFadeIn 1s ease 1s forwards;
}
.loading-divider {
    width: 0; height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 140, 0, 0.6), transparent);
    margin: 30px 0; animation: loadingDivider 1.5s ease 1.5s forwards;
}
@keyframes loadingFadeIn { to { opacity: 1; } }
@keyframes loadingDivider { to { width: 200px; } }

/* =========================================
   PAGE 1: BEATRICE & PORTINARI PLAQUE
   ========================================= */
.page-s3-1 {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Pushes content to the left */
    background-color: #1a0f0a;
}
.page-s3-1-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-portinari-plaque.jpg');
    background-size: cover;
    background-position: center right; /* Focus on the plaque on the right */
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Shadow Bridges (Top/Bottom gradients) */
.shadow-bridge-top, .shadow-bridge-bottom {
    position: absolute; left: 0; width: 100%; height: 180px;
    z-index: 4; pointer-events: none;
}
.shadow-bridge-top {
    top: 0;
    background: linear-gradient(to bottom, #0a0502 0%, transparent 100%);
}
.shadow-bridge-bottom {
    bottom: 0;
    background: linear-gradient(to top, #0a0502 0%, transparent 100%);
}

/* The Text Box - Left Side */
.beatrice-text-box {
    position: relative;
    z-index: 4;
    width: 45%;
    max-width: 700px;
    margin-left: 5%;
    padding: 40px 50px;
    /* Dark semi-transparent background for readability against the warm image */
    background: linear-gradient(to right, rgba(10, 5, 2, 0.92) 0%, rgba(10, 5, 2, 0.65) 100%);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);

    /* NEW: Constrain height and enable internal scrolling */
    max-height: 85vh; 
    overflow-y: auto;
    overflow-x: hidden;

    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animations */
.page-s3-1.in-view .page-s3-1-bg {
    transform: scale(1);
}
.page-s3-1.in-view .beatrice-text-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Text Styling */
.beatrice-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #f5e6c8;
    text-align: justify;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    margin-bottom: 20px;
}
.beatrice-text:last-child {
    margin-bottom: 0;
}
.beatrice-text em {
    color: #ff8c00; /* Orange emphasis for titles/names */
    font-style: italic;
}

/* =========================================
   NAVIGATION BUTTONS (Triggered on Last Page)
   ========================================= */
.navigation-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 20px;
    opacity: 0;
    /* Increased delay so they appear after the text box has finished sliding in */
    transition: opacity 1s ease 2.5s; 
}

/* CHANGED: Now triggered by the last page (page-s3-10) */
.page-s3-10.in-view .navigation-container {
    opacity: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: rgba(10, 5, 2, 0.8);
    border: 2px solid #d4af37;
    color: #f5e6c8;
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.nav-btn:hover {
    background: rgba(212, 175, 55, 0.9);
    color: #0a0502;
}
.btn-arrow {
    width: 20px;
    height: 20px;
}

/* =========================================
   MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 768px) {
    .page-s3-1 {
        justify-content: center;
        align-items: center;
    }
    .beatrice-text-box {
        width: 90%;
        max-width: 90%;
        margin-left: 0;
        padding: 30px 25px;
        background: rgba(10, 5, 2, 0.92); /* Solid dark background on mobile */
    }
    .beatrice-text {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    .page-s3-1-bg {
        background-position: center center;
    }
    .navigation-container {
        bottom: 30px;
        flex-direction: column;
        width: 80%;
    }
    .nav-btn {
        justify-content: center;
        width: 100%;
        margin: -5px;
    }
}
/* =========================================
   CITATION POP-UPS (CLICKABLE TOOLTIPS)
   ========================================= */
.citation-pop {
    color: #ff8c00;
    font-style: italic;
    cursor: pointer;
    border-bottom: 1px dotted rgba(255, 140, 0, 0.5);
    transition: color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.citation-pop:hover {
    color: #ffa500;
    border-bottom-color: #ffa500;
}

/* Active state when clicked */
.citation-pop.active {
    color: #ffa500;
    border-bottom-color: #ffa500;
    font-weight: 600;
}

/* The Tooltip Box (Fixed at bottom center) */
#citation-tooltip {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(10, 5, 2, 0.95);
    color: #f5e6c8;
    padding: 15px 25px;
    border: 1px solid #d4af37;
    border-radius: 4px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-style: italic;
    max-width: 600px;
    width: 90%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 10000;
    box-shadow: 0 5px 20px rgba(0,0,0,0.7);
    pointer-events: none;
    line-height: 1.5;
}

#citation-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Mobile adjustment for tooltip */
@media (max-width: 768px) {
    #citation-tooltip {
        bottom: 20px;
        font-size: 0.95rem;
        padding: 12px 20px;
    }
}
/* =========================================
   CUSTOM SCROLLBAR FOR TEXT BOX
   ========================================= */
/* Webkit browsers (Chrome, Safari, Edge) */
.beatrice-text-box::-webkit-scrollbar {
    width: 8px;
}
.beatrice-text-box::-webkit-scrollbar-track {
    background: rgba(10, 5, 2, 0.3); /* Dark subtle track */
    border-radius: 4px;
}
.beatrice-text-box::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #d4af37, #8b0000); /* Gold to deep red */
    border-radius: 4px;
    border: 1px solid rgba(10, 5, 2, 0.5);
}
.beatrice-text-box::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #f5e6c8, #d4af37); /* Lighter gold on hover */
}

/* Firefox */
.beatrice-text-box {
    scrollbar-width: thin;
    scrollbar-color: #d4af37 rgba(10, 5, 2, 0.3);
}
/* =========================================
   PAGE 2: DANTE'S DREAM (ROSETTI)
   ========================================= */
.page-s3-2 {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Pushes content to the right */
    background-color: #1a0f0a;
}
.page-s3-2-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-sleep.jpg');
    background-size: 90%;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-2.in-view .page-s3-2-bg {
    transform: scale(1);
}

/* Poem Text Box - Dark Red & Transparent */
.poem-text-box {
    position: absolute; /* Changed to absolute to pin it to the corner */
    bottom: 80px;       /* Distance from the bottom of the screen */
    right: 0; 
    z-index: 4;
    width: 30%;
    max-width: 450px;
    margin-right: 5%;
    padding: 35px 40px;
    background: rgba(139, 0, 0, 0.5); /* Dark red, 50% transparency */
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);

    opacity: 0;
    transform: translateY(30px); 
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.page-s3-2.in-view .poem-text-box {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Poem Text Styling */
.poem-content {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.0 !important;
    color: #ffffff;
    text-align: center;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* Subtle shadow */
}
.poem-line {
    margin-bottom: 5px;
}
.poem-line:last-child {
    margin-bottom: 0;
}

/* Tiny Book Icon (Citation Trigger) */
.poem-citation-icon {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 5;
}
.poem-citation-icon:hover {
    color: #ffffff;
    transform: scale(1.15);
}

/* =========================================
   ARCHIVIST TAB STYLES (With Pulse Animation)
   ========================================= */
@keyframes pulseTab {
    0% {
        transform: translateY(-50%) scale(1);
        box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    }
    50% {
        transform: translateY(-50%) scale(1.08); /* Gently grows */
        box-shadow: 0 0 15px rgba(139, 0, 0, 0.8); /* Soft red glow */
    }
    100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    }
}

.archivist-tab-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: #8b0000;
    color: #f5e6c8;
    border: none;
    padding: 16px 10px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    z-index: 100;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    transition: background-color 0.3s ease;
    
    /* Apply the slow pulsing animation */
    animation: pulseTab 3s infinite ease-in-out; 
}

.archivist-tab-btn:hover {
    background-color: #a00000;
    animation: none; /* Stops pulsing when hovered so it feels stable to click */
    transform: translateY(-50%) scale(1.05);
}
.tab-icon {
    font-size: 1.3rem;
    display: block;
}

.archivist-panel {
    position: absolute;
    top: 0;
    left: -400px; /* Hidden off-screen */
    width: 320px;
    height: 100%;
    background-color: #4a0404; /* Deep maroon */
    color: #f5e6c8;
    z-index: 101;
    padding: 50px 30px 30px 30px;
    box-shadow: 5px 0 20px rgba(0,0,0,0.6);
    transition: left 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
}
.archivist-panel.open {
    left: 0;
}
.close-panel-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #f5e6c8;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}
.close-panel-btn:hover {
    color: #d4af37;
}
.panel-content {
    padding-top: 20px;
}
.panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #f5e6c8;
    margin-bottom: 8px;
    line-height: 1.3;
}
.panel-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #d4af37;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 12px;
}
.panel-details p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #e8d4a8;
}
.panel-details em {
    color: #d4af37;
    font-style: italic;
}

/* Mobile Responsiveness for Page 2 */
@media (max-width: 768px) {
    .page-s3-2 {
        justify-content: center;
    }
    .poem-text-box {
        width: 90%;
        max-width: 90%;
        padding: 30px 25px;
        /* Position it near the bottom but centered on mobile */
        bottom: 40px;
        right: 5%;
        left: 5%; 
    }
    .poem-content {
        font-size: 1.1rem;
    }
    .archivist-panel {
        width: 100%;
        left: -100%;
    }
}
/* =========================================
   PAGE 3: BOCCACCIO ON DANTE'S GRIEF
   ========================================= */
.page-s3-3 {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Pushes content to the right */
    background-color: #1a0f0a;
}
.page-s3-3-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-dante-look-right.jpg');
    background-size: cover;
    background-position: center left; /* Focuses on Dante on the left side */
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-3.in-view .page-s3-3-bg {
    transform: scale(1);
}

/* Ornate Text Box */
.boccaccio-grief-box {
    position: relative;
    z-index: 4;
    width: 45%;
    max-width: 700px;
    margin-right: 5%;
    padding: 50px 60px;
    /* Dark semi-transparent background */
    background: rgba(10, 5, 2, 0.85);
    border: 8px solid #8b0000;
    outline: 3px solid #d4af37;
    outline-offset: -12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);

    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.page-s3-3.in-view .boccaccio-grief-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Quote Text Styling */
.grief-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.7;
    color: #f5e6c8;
    text-align: justify;
    font-style: italic;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Decorative Drop Cap */
.drop-cap {
    font-family: 'Great Vibes', cursive;
    font-size: 3.5rem;
    color: #d4af37;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 5px;
}

/* Citation Styling */
.grief-citation {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #e8d4a8;
    line-height: 1.5;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    padding-top: 15px;
}
.grief-citation .author {
    font-weight: 700;
    color: #d4af37;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.grief-citation em {
    font-style: italic;
    color: #f5e6c8;
}

/* Mobile Responsiveness for Page 3 */
@media (max-width: 768px) {
    .page-s3-3 {
        justify-content: center;
    }
    .boccaccio-grief-box {
        width: 90%;
        max-width: 90%;
        margin-right: 0;
        padding: 30px 25px;
        border-width: 6px;
        outline-width: 2px;
        outline-offset: -10px;
    }
    .grief-quote {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    .drop-cap {
        font-size: 2.5rem;
    }
    .grief-citation {
        font-size: 0.9rem;
    }
    .page-s3-3-bg {
        background-position: center center;
    }
}
/* =========================================
   PAGE 4: DANTIS AMOR (ROSETTI ILLUSTRATION)
   ========================================= */
.page-s3-4 {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a0f0a;
}
.page-s3-4-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-dantis-armor.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-4.in-view .page-s3-4-bg {
    transform: scale(1);
}

/* Mobile Responsiveness for Page 4 */
@media (max-width: 768px) {
    .page-s3-4-bg {
        background-position: center center;
    }
}
/* =========================================
   PAGE 4: VITA NUOVA QUOTE BOX (IMPROVED READABILITY)
   ========================================= */
.vita-nuova-box {
    position: absolute;
    bottom: 80px;
    right: 80px;
    z-index: 4;
    width: 45%;
    max-width: 650px;
    padding: 40px 45px; /* Increased padding for breathing room */
    
    /* GLASSMORPHISM EFFECT - ENHANCED */
    background: rgba(10, 5, 2, 0.75); /* Darker, more opaque background */
    backdrop-filter: blur(16px) saturate(180%); /* Stronger blur + saturation */
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    
    /* More defined borders for better contrast */
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    
    /* Softer, deeper shadow */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.2); /* Inner shadow for depth */
    
    border-radius: 12px;

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-4.in-view .vita-nuova-box {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Text Styling - Enhanced for Readability */
.poem-content {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem; /* Slightly larger */
    line-height: 1.75; /* Better line spacing */
    color: #ffffff; /* Pure white for maximum contrast */
    text-align: center;
    font-style: italic;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), /* Stronger shadow */
                 0 0 1px rgba(0, 0, 0, 0.5); /* Subtle outline effect */
}

.poem-line {
    margin-bottom: 6px; /* More spacing between lines */
}

.poem-line:last-child {
    margin-bottom: 0;
}

/* Hover effect for extra interactivity */
.vita-nuova-box:hover {
    background: rgba(10, 5, 2, 0.8); /* Slightly more opaque on hover */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* Tiny Book Icon - More Visible */
.poem-citation-icon {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8); /* Brighter */
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); /* Shadow for visibility */
}

.poem-citation-icon:hover {
    color: #ffffff;
    transform: scale(1.2);
}

/* Mobile Responsiveness for Page 4 Quote Box */
@media (max-width: 768px) {
    .vita-nuova-box {
        width: 90%;
        max-width: 90%;
        bottom: 40px;
        right: 5%;
        padding: 30px 25px;
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        background: rgba(10, 5, 2, 0.8); /* Even more opaque on mobile */
    }
    .poem-content {
        font-size: 1.15rem;
        line-height: 1.65;
    }
}
/* =========================================
   PAGE 5: PARADISO QUOTE (LEFT GLASS BOX)
   ========================================= */
.page-s3-5 {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Pushes content to the left */
    background-color: #1a0f0a;
}
.page-s3-5-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-paradiso.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-5.in-view .page-s3-5-bg {
    transform: scale(1);
}

/* Glassmorphism Text Box - Left Side */
.paradiso-poem-box {
    position: relative;
    z-index: 4;
    width: 25%; /* Slightly wider for the long poem */
    max-width: 450px;
    margin-left: 2%;
    padding: 45px 50px;
    
    /* Dark Glassmorphism for Readability */
    background: rgba(10, 5, 2, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.2);
    border-radius: 12px;

    opacity: 0;
    transform: translateX(-50px); /* Slide in from left */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-5.in-view .paradiso-poem-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Hover effect */
.paradiso-poem-box:hover {
    background: rgba(10, 5, 2, 0.8);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 25px rgba(0, 0, 0, 0.3);
    transform: translateX(5px); /* Slight shift right on hover */
}

/* Poem Stanza Spacing */
.poem-stanza {
    margin-bottom: 0; /* Space between tercets */
}
.poem-stanza:last-child {
    margin-bottom: 0;
}

/* Mobile Responsiveness for Page 5 */
@media (max-width: 768px) {
    .page-s3-5 {
        justify-content: center;
    }
    .paradiso-poem-box {
        width: 90%;
        max-width: 90%;
        margin-left: 0;
        padding: 30px 25px;
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        background: rgba(10, 5, 2, 0.8);
    }
    .poem-content {
        font-size: 1.1rem;
    }
    .poem-stanza {
        margin-bottom: 0;
    }
    .page-s3-5-bg {
        background-position: center center;
    }
}
.ai-disclosure-box {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 5;
    padding: 12px 20px;
    background: rgba(10, 5, 2, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-s3-5.in-view .ai-disclosure-box {
    opacity: 0.7;
    transform: translateY(0);
    transition: opacity 1s ease 2s, transform 1s ease 2s;
}

.ai-disclosure-box:hover {
    opacity: 1 !important;
}

.ai-disclosure-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    color: #e8d4a8;
    text-align: right;
    line-height: 1.4;
    margin: 0;
    font-style: italic;
    letter-spacing: 0.05em;
}
/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ai-disclosure-box {
        bottom: 20px;
        right: 20px;
        padding: 10px 15px;
    }
    .ai-disclosure-text {
        font-size: 0.75rem;
    }
}
/* =========================================
   PAGE 6: PRIMUM MOBILE (DORÉ ENGRAVING)
   ========================================= */
.page-s3-6 {
    display: flex;
    align-items: flex-end; /* Pushes content to the bottom */
    justify-content: flex-start; /* Pushes content to the left */
    background-color: #1a0f0a;
}
.page-s3-6-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-hierarchies.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-6.in-view .page-s3-6-bg {
    transform: scale(1);
}

/* Descriptive Text Box - Dark Red */
/* Descriptive Text Box - Glassmorphism */
.hierarchies-desc-box {
    position: relative;
    z-index: 4;
    width: 25%;
    max-width: 430px;
    margin-left: 5%;
    margin-bottom: 8%;
    padding: 35px 40px;
    
    /* GLASSMORPHISM EFFECT */
    background: rgba(10, 5, 2, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    
    /* Light-catching glass edges */
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    
    /* Floating shadow + inner depth */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.15);
    
    border-radius: 12px;

    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-6.in-view .hierarchies-desc-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Hover effect */
.hierarchies-desc-box:hover {
    background: rgba(10, 5, 2, 0.72);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 25px rgba(0, 0, 0, 0.2);
    transform: translateX(5px);
}

/* Text Styling */
.hierarchies-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.7;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7),
                 0 0 1px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* Mobile Responsiveness for Page 6 */
@media (max-width: 768px) {
    .page-s3-6 {
        align-items: down;
        justify-content: center;
    }
    .hierarchies-desc-box {
        width: 90%;
        max-width: 90%;
        margin-left: 0;
        margin-bottom: 70px;
        padding: 30px 25px;
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        background: rgba(10, 5, 2, 0.75);
    }
    .hierarchies-text {
        font-size: 1.15rem;
        text-align: center;
    }
    .page-s3-6-bg {
        background-position: center center;
    }
}
/* =========================================
   PAGE 7: THE EMPYREAN (DORÉ ROSETTE)
   ========================================= */
.page-s3-7 {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Pushes content to the left */
    background-color: #1a0f0a;
}
.page-s3-7-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-rosette.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-7.in-view .page-s3-7-bg {
    transform: scale(1);
}

/* Glassmorphic Text Box */
.empyrean-desc-box {
    position: relative;
    z-index: 4;
    width: 35%;
    max-width: 500px;
    margin-left: 5%;
    margin-top: 25%;
    padding: 35px 40px;
    
    /* GLASSMORPHISM EFFECT */
    background: rgba(10, 5, 2, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    
    /* Light-catching glass edges */
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    
    /* Floating shadow + inner depth */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.15);
    
    border-radius: 12px;

    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-7.in-view .empyrean-desc-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Hover effect */
.empyrean-desc-box:hover {
    background: rgba(10, 5, 2, 0.72);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 25px rgba(0, 0, 0, 0.2);
    transform: translateX(5px);
}

/* Text Styling */
.empyrean-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.7;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7),
                 0 0 1px rgba(0, 0, 0, 0.5);
    margin: 0;
    text-align: center;
}

/* Mobile Responsiveness for Page 7 */
@media (max-width: 768px) {
    .page-s3-7 {
        align-items: center;
        justify-content: center;
    }
    .empyrean-desc-box {
        width: 90%;
        max-width: 90%;
        margin-left: 0;
        margin-top: 390px;
        padding: 30px 25px;
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        background: rgba(10, 5, 2, 0.75);
    }
    .empyrean-text {
        font-size: 1.15rem;
        text-align: center;
    }
    .page-s3-7-bg {
        background-position: center center;
    }
}
/* =========================================
   PAGE 8: DANTE'S PRAYER TO BEATRICE
   ========================================= */
.page-s3-8 {
    display: flex;
    align-items: center;
    justify-content: center; /* Centers the box */
    background-color: #1a0f0a;
}
.page-s3-8-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-dante-beatrice.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-8.in-view .page-s3-8-bg {
    transform: scale(1);
}

/* Centered Glassmorphic Text Box */
.prayer-beatrice-box {
    position: relative;
    z-index: 4;
    width: 25%;
    max-width: 500px;
    padding: 50px 60px;
    
    /* GLASSMORPHISM EFFECT */
    background: rgba(10, 5, 2, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    
    /* Light-catching glass edges */
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    
    /* Floating shadow + inner depth */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.15);
    
    border-radius: 12px;

    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-8.in-view .prayer-beatrice-box {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Hover effect */
.prayer-beatrice-box:hover {
    background: rgba(10, 5, 2, 0.75);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Poem Stanza Spacing */
.prayer-beatrice-box .poem-stanza {
    margin-bottom: 18px;
}
.prayer-beatrice-box .poem-stanza:last-child {
    margin-bottom: 30px;
}

/* Citation Styling */
.prayer-citation {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #e8d4a8;
    line-height: 1.6;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    padding-top: 20px;
    text-align: center;
}
.prayer-citation .author {
    font-weight: 700;
    color: #d4af37;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.prayer-citation em {
    font-style: italic;
    color: #f5e6c8;
}

/* Mobile Responsiveness for Page 8 */
@media (max-width: 768px) {
    .prayer-beatrice-box {
        width: 90%;
        max-width: 90%;
        padding: 35px 30px;
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        background: rgba(10, 5, 2, 0.8);
    }
    .prayer-beatrice-box .poem-content {
        font-size: 1.1rem;
    }
    .prayer-beatrice-box .poem-stanza {
        margin-bottom: 12px;
    }
    .prayer-citation {
        font-size: 0.9rem;
    }
    .page-s3-8-bg {
        background-position: center center;
    }
}
/* =========================================
   AI DISCLOSURE TEXT BOX (Page 8)
   ========================================= */
.ai-disclosure-box-s3-8 {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 5;
    padding: 12px 20px;
    background: rgba(10, 5, 2, 0.85);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 4px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-s3-8.in-view .ai-disclosure-box-s3-8 {
    opacity: 0.7;
    transform: translateY(0);
    transition: opacity 1s ease 2s, transform 1s ease 2s;
}

.ai-disclosure-box-s3-8:hover {
    opacity: 1 !important;
}

.ai-disclosure-text-s3-8 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    color: #e8d4a8;
    text-align: right;
    line-height: 1.4;
    margin: 0;
    font-style: italic;
    letter-spacing: 0.05em;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ai-disclosure-box-s3-8 {
        bottom: 20px;
        right: 20px;
        padding: 10px 15px;
    }
    .ai-disclosure-text-s3-8 {
        font-size: 0.75rem;
    }
}
/* =========================================
   PAGE 9: DANTE'S SUFFERING & EXILE (PIGEONS)
   ========================================= */
.page-s3-9 {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Pushes content to the left */
    background-color: #1a0f0a;
}
.page-s3-9-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-dante-pigeons.jpg');
    background-size: cover;
    background-position: center right; /* Focuses on the bust on the right */
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-9.in-view .page-s3-9-bg {
    transform: scale(1);
}

/* Glassmorphic Text Box */
.pigeons-text-box {
    position: relative;
    z-index: 4;
    width: 45%;
    max-width: 700px;
    margin-left: 5%;
    padding: 40px 50px;
    
    /* GLASSMORPHISM EFFECT */
    background: rgba(10, 5, 2, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    
    /* Light-catching glass edges */
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    
    /* Floating shadow + inner depth */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 20px rgba(0, 0, 0, 0.15);
    
    border-radius: 12px;

    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-9.in-view .pigeons-text-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Hover effect */
.pigeons-text-box:hover {
    background: rgba(10, 5, 2, 0.75);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6),
                inset 0 0 25px rgba(0, 0, 0, 0.2);
    transform: translateX(5px);
}

/* Text Styling */
.pigeons-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.7;
    color: #ffffff;
    text-align: justify;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7),
                 0 0 1px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}
.pigeons-text:last-child {
    margin-bottom: 0;
}

/* Mobile Responsiveness for Page 9 */
@media (max-width: 768px) {
    .page-s3-9 {
        align-items: center;
        justify-content: center;
    }
    .pigeons-text-box {
        width: 90%;
        max-width: 90%;
        margin-left: 0;
        padding: 30px 25px;
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        background: rgba(10, 5, 2, 0.8);
    }
    .pigeons-text {
        font-size: 1.15rem;
        line-height: 1.5;
    }
    .page-s3-9-bg {
        background-position: center center;
    }
}
/* =========================================
   PAGE 10: PROPHECY OF EXILE (FLORENCE TOWER)
   ========================================= */
.page-s3-10 {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Pushes content to the right */
    background-color: #1a0f0a;
}
.page-s3-10-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/section-3-florence-tower.jpg');
    background-size: cover;
    background-position: center left; /* Focuses on the tower on the left */
    z-index: 1;
    transform: scale(1.05);
    transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}
.page-s3-10.in-view .page-s3-10-bg {
    transform: scale(1);
}

/* Ornate Text Box - Light Parchment Style */
.florence-tower-box {
    position: relative;
    z-index: 4;
    width: 45%;
    max-width: 700px;
    margin-right: 10%;
    padding: 50px 60px;
    
    /* Light parchment background with red/gold borders */
    background-color: #f5e6c8;
    border: 8px solid #8b0000;
    outline: 3px solid #d4af37;
    outline-offset: -12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);

    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Entrance Animation */
.page-s3-10.in-view .florence-tower-box {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 1.2s ease 1s, transform 1.2s cubic-bezier(0.25, 1, 0.5, 1) 1s;
}

/* Quote Text Styling */
.tower-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    line-height: 1.7;
    color: #1a0f0a; /* Dark brown/black text for light background */
    text-align: justify;
    font-style: italic;
    font-weight: 600;
    margin-bottom: 25px;
}

/* Decorative Drop Cap */
.florence-tower-box .drop-cap {
    font-family: 'Great Vibes', cursive;
    font-size: 3.5rem;
    color: #8b0000;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 5px;
}

/* Citation Styling */
.tower-citation {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #5a0a0a;
    line-height: 1.6;
    border-top: 1px solid rgba(139, 0, 0, 0.2);
    padding-top: 15px;
}
.tower-citation .author {
    font-weight: 700;
    color: #8b0000;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tower-citation em {
    font-style: italic;
    color: #5a0a0a;
}

/* Mobile Responsiveness for Page 10 */
@media (max-width: 768px) {
    .page-s3-10 {
        justify-content: center;
    }
    .florence-tower-box {
        width: 90%;
        max-width: 90%;
        margin-right: 0;
        margin-top: -110px;
        padding: 30px 25px;
        border-width: 6px;
        outline-width: 2px;
        outline-offset: -10px;
    }
    .tower-quote {
        font-size: 1.1rem;
        line-height: 1.1;
    }
    .florence-tower-box .drop-cap {
        font-size: 2.5rem;
    }
    .tower-citation {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    .page-s3-10-bg {
        background-position: center center;
    }
}