/* The Red Hand & The Eternal Throne: A Bard's Chronicle - Complete Styling */

/* CSS Variables for Consistent Theming */
:root {
    /* Primary Color Palette - Celtic/Medieval Theme */
    --primary-gold: #d4af37;
    --dark-blue: #1a1a2e;
    --deep-blue: #16213e;
    --accent-red: #8b0000;
    --royal-purple: #4b0082;
    
    /* Secondary Colors */
    --light-gold: #f4e5a1;
    --medium-gold: #e6c969;
    --dark-gold: #b8941f;
    --cream: #f5f5dc;
    --silver: #c0c0c0;
    
    /* Text Colors */
    --text-light: #f5f5dc;
    --text-dark: #2c2c2c;
    --text-muted: #888;
    
    /* Background Colors */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-accent: rgba(212, 175, 55, 0.1);
    
    /* Fonts */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    
    /* Spacing */
    --section-padding: 6rem 0;
    --container-padding: 0 2rem;
    --border-radius: 15px;
    
    /* Shadows */
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
    --transition-slow: 0.8s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Series Navigation Banner */
.series-banner {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid var(--primary-gold);
    padding: 0.3rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.series-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-family: var(--font-heading);
}

.book-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition-fast);
    color: var(--text-light);
}

.book-link:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-gold);
}

.current-book {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-gold);
    font-weight: 600;
}

.book-number {
    font-size: 0.8rem;
    opacity: 0.8;
}

.book-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.series-divider {
    color: var(--primary-gold);
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Mobile hamburger menu styles */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-gold);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Touch and Mobile Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Touch device optimizations */
    .nav-menu a,
    .book-link,
    .btn,
    .character-card,
    .chapter-card {
        min-height: 44px; /* Apple's recommended touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .character-card,
    .chapter-card {
        touch-action: manipulation;
    }
    
    /* Remove hover effects on touch devices */
    .book-link:hover,
    .btn:hover,
    .character-card:hover,
    .chapter-card:hover {
        transform: none;
    }
    
    /* Larger touch targets for navigation */
    .nav-menu a {
        padding: 1rem;
        margin: 0.25rem;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding-top: 80px;
        min-height: 100vh;
    }
    
    .series-banner {
        padding: 0.25rem 0;
    }
    
    .navbar {
        top: 40px;
        padding: 0.5rem 0;
    }
    
    .hero-content {
        flex-direction: row;
        gap: 1rem;
    }
    
    .book-cover {
        width: 200px;
        height: 280px;
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: inherit;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--deep-blue) 50%, var(--dark-blue) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 2rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
    margin-bottom: 1.5rem;
}

a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--light-gold);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.section {
    padding: var(--section-padding);
    position: relative;
}

.section-title {
    text-align: center;
    color: var(--primary-gold);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    margin: 1rem auto;
}

/* Celtic Border Decorations */
.celtic-border {
    position: relative;
}

.celtic-border::before,
.celtic-border::after {
    content: '';
    position: absolute;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M0,10 Q25,0 50,10 T100,10' stroke='%23d4af37' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    height: 20px;
    left: 0;
    right: 0;
}

.celtic-border::before {
    top: 0;
}

.celtic-border::after {
    bottom: 0;
    transform: scaleY(-1);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 100px; /* Increased gap from series banner */
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition-fast);
}

.navbar.scrolled {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: var(--shadow-medium);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.nav-brand h2 {
    color: var(--primary-gold);
    font-size: 1.5rem;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-menu a {
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
    transition: var(--transition-fast);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: var(--transition-fast);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--accent-red), var(--royal-purple));
    overflow: hidden;
    padding-top: 130px; /* Adjusted for series banner + navbar with proper spacing */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cdefs%3E%3Cpattern id='celtic-knot' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Cpath d='M20,20 Q40,0 60,20 T100,20 M20,80 Q40,100 60,80 T100,80' stroke='%23d4af37' stroke-width='1' fill='none' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23celtic-knot)'/%3E%3C/svg%3E") center/cover;
    opacity: 0.1;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 1200px;
    padding: var(--container-padding);
    z-index: 1;
    position: relative;
}

.book-display {
    flex: 1;
    display: flex;
    justify-content: center;
    perspective: 1500px;
}

/* Featured Book 3D Container */
.book-container {
    position: relative;
    transform-style: preserve-3d;
    animation: bookFloat 6s ease-in-out infinite;
}

.book-cover-3d {
    width: 400px;
    height: 600px;
    position: relative;
    transform: rotateY(-15deg) rotateX(5deg);
    transition: transform 0.8s ease;
    cursor: pointer;
    border-radius: 15px;
    overflow: visible;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 80px rgba(212, 175, 55, 0.3);
    transform-style: preserve-3d;
}

.book-cover-3d:hover {
    transform: rotateY(165deg) rotateX(0deg) scale(1.05);
}

/* Front and Back Cover Containers */
.book-front, .book-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(212, 175, 55, 0.2);
}

.book-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.book-back {
    transform: rotateY(180deg);
    z-index: 1;
}

/* Back Cover Background */
.back-cover-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(135deg, 
            rgba(26, 36, 71, 0.95) 0%, 
            rgba(10, 17, 51, 0.98) 50%, 
            rgba(5, 8, 25, 1) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Cdefs%3E%3Cpattern id='celtic-pattern' x='0' y='0' width='100' height='100' patternUnits='userSpaceOnUse'%3E%3Cpath d='M20,20 Q40,0 60,20 T100,20 M20,80 Q40,100 60,80 T100,80' stroke='%23d4af37' stroke-width='0.5' fill='none' opacity='0.1'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='100%25' height='100%25' fill='url(%23celtic-pattern)'/%3E%3C/svg%3E") center/cover;
    border-radius: 15px;
}

.back-cover-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.back-summary h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: #d4af37;
    margin-bottom: 1.5rem;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.back-summary p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #f4f1e8;
    margin-bottom: 2rem;
    text-align: justify;
}

.back-quote {
    background: rgba(212, 175, 55, 0.1);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #d4af37;
    margin: 2rem 0;
    text-align: center;
}

.back-quote em {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #d4af37;
    display: block;
    margin-bottom: 0.5rem;
}

.back-quote span {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    color: #c9a961;
}

.back-credits {
    margin-top: auto;
    padding-top: 2rem;
}

.back-credits p {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: #d4af37;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Book Spine */
.book-spine {
    position: absolute;
    top: 0;
    left: -15px;
    width: 15px;
    height: 100%;
    background: linear-gradient(90deg, #2a3366 0%, #1a2447 50%, #0a1133 100%);
    transform: rotateY(90deg);
    transform-origin: left;
    border-radius: 0 5px 5px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 5px;
    z-index: 1;
}

.spine-title {
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: #d4af37;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.spine-author {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.6rem;
    color: #c9a961;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Book Shadow and Glow */
.book-shadow {
    position: absolute;
    top: 10px;
    left: 10px;
    right: -10px;
    bottom: -10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    filter: blur(20px);
    z-index: -1;
}

.book-glow {
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, 
        rgba(212, 175, 55, 0.1) 0%, 
        rgba(147, 112, 219, 0.1) 25%,
        rgba(220, 20, 60, 0.1) 50%,
        rgba(70, 130, 180, 0.1) 75%,
        rgba(212, 175, 55, 0.1) 100%);
    border-radius: 20px;
    animation: auraGlow 6s ease-in-out infinite;
    z-index: -1;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 15px;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-text h1 {
    color: var(--primary-gold);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-text h2 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.subtitle {
    font-style: italic;
    color: var(--primary-gold);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.biblical-quote {
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--primary-gold);
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    position: relative;
}

.biblical-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 3rem;
    color: var(--primary-gold);
    opacity: 0.5;
}

.biblical-quote cite {
    display: block;
    text-align: right;
    margin-top: 1rem;
    color: var(--primary-gold);
    font-style: normal;
    font-weight: 600;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    display: inline-block;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition-medium);
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: linear-gradient(45deg, var(--primary-gold), var(--light-gold));
    color: var(--dark-blue);
    box-shadow: var(--shadow-medium);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.btn.secondary {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--primary-gold);
}

.btn.secondary:hover {
    background: var(--primary-gold);
    color: var(--dark-blue);
    transform: translateY(-3px);
}

/* Section Styles */
.synopsis-section {
    background: var(--bg-accent);
    position: relative;
}

.synopsis-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.lead {
    font-size: 1.3rem;
    color: var(--primary-gold);
    margin-bottom: 2rem;
    font-style: italic;
}

.characters-section {
    background: rgba(139, 0, 0, 0.1);
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.character-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    border: 2px solid transparent;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    z-index: 0;
}

.character-card > * {
    position: relative;
    z-index: 1;
}

.character-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-medium);
}

.character-card.featured {
    border-color: var(--primary-gold);
    background: var(--bg-accent);
}

.character-card.delta {
    border-color: var(--accent-red);
    background: rgba(139, 0, 0, 0.1);
}

.character-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, var(--primary-gold), var(--light-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-blue);
    box-shadow: var(--shadow-medium);
}

.character-card h3 {
    color: var(--primary-gold);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.character-title {
    color: var(--primary-gold);
    font-weight: 600;
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Chapters Section */
.chapters-section {
    background: var(--bg-accent);
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.chapter-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.chapter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(212, 175, 55, 0.03), transparent);
    z-index: 0;
}

.chapter-card > * {
    position: relative;
    z-index: 1;
}

.chapter-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-medium);
}

.chapter-number {
    display: inline-flex;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-gold), var(--light-gold));
    color: var(--dark-blue);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
}

.chapter-card h4 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.epilogue {
    border-color: var(--accent-red);
    background: rgba(139, 0, 0, 0.1);
}

.epilogue .chapter-number {
    background: linear-gradient(45deg, var(--accent-red), #a00000);
    color: var(--text-light);
}

/* Author Section */
.author-section {
    background: rgba(139, 0, 0, 0.1);
}

.author-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 3rem 0;
    border-top: 2px solid var(--primary-gold);
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    color: var(--primary-gold);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-gold);
}

.footer-copyright {
    text-align: center;
    grid-column: 1 / -1;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    color: rgba(245, 245, 220, 0.7);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-gold), var(--light-gold));
    color: var(--dark-blue);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
    transition: var(--transition-fast);
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Animation Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .book-cover-3d {
        width: 350px;
        height: 525px;
    }
}

@media (max-width: 1024px) {
    .hero-content {
        gap: 2rem;
    }
    
    .book-cover-3d {
        width: 320px;
        height: 480px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 3rem 0;
        --container-padding: 0 1rem;
    }
    
    /* Series banner mobile optimization - Ultra compact */
    .series-banner {
        padding: 0.1rem 0;
        background: rgba(139, 69, 19, 0.95);
        min-height: auto;
    }
    
    .series-nav {
        gap: 0.2rem;
        font-size: 0.7rem;
        line-height: 1.2;
    }
    
    .book-link {
        padding: 0.15rem 0.4rem;
        border-radius: 2px;
        min-height: auto;
    }
    
    .book-number {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    .book-title {
        font-size: 0.65rem;
        line-height: 1.1;
    }
    
    /* Navigation mobile optimization - Horizontal compact */
    .navbar {
        top: 28px; /* Minimal height for ultra-compact series banner */
        padding: 0.2rem 0;
        background: rgba(139, 69, 19, 0.95);
        min-height: auto;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 0;
        min-height: auto;
    }
    
    .nav-brand {
        display: none; /* Hide brand on mobile to save space */
    }
    
    .nav-menu {
        flex-direction: row; /* Horizontal layout */
        gap: 0.2rem;
        text-align: center;
        margin: 0;
        padding: 0.1rem 0;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    
    .nav-menu li {
        margin: 0;
        padding: 0;
        flex: 1;
        min-width: auto;
    }
    
    .nav-menu li a {
        font-size: 0.7rem;
        padding: 0.2rem 0.1rem;
        line-height: 1;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Hero section mobile optimization */
    .hero {
        padding-top: 45px; /* Adjusted for horizontal compact mobile headers */
        min-height: 100vh;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .hero-text h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-text h2 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .biblical-quote {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .biblical-quote p {
        font-size: 0.95rem;
    }
    
    .hero-description {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* 3D Book mobile optimization */
    .hero-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .book-display {
        perspective: 1000px;
    }
    
    .book-cover-3d {
        width: 300px;
        height: 450px;
        transform: rotateY(0deg) rotateX(0deg);
    }
    
    .book-cover-3d:hover {
        transform: rotateY(45deg) rotateX(0deg) scale(1.02);
    }
    
    /* Grid layouts mobile optimization */
    .characters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .character-card,
    .chapter-card {
        padding: 1rem;
    }
    
    /* Button optimization */
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* Footer mobile optimization */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-links ul {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem 2rem;
    }
}

@media (max-width: 480px) {
    :root {
        --section-padding: 2rem 0;
        --container-padding: 0 0.75rem;
    }
    
    /* Series banner extra small screens */
    .series-nav {
        flex-direction: column;
        gap: 0.3rem;
        font-size: 0.8rem;
    }
    
    .book-link {
        padding: 0.25rem 0.5rem;
    }
    
    .series-divider {
        display: none; /* Hide divider on very small screens */
    }
    
    /* Navigation extra small */
    .navbar {
        top: 80px; /* More space for stacked series banner */
        padding: 0.6rem 0;
    }
    
    .nav-brand h2 {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        gap: 0.8rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    /* Hero section extra small */
    .hero {
        padding-top: 140px; /* More space for stacked headers */
    }
    
    .hero-content {
        gap: 1rem;
        padding: 0.5rem;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
        line-height: 1.1;
        margin-bottom: 0.5rem;
    }
    
    .hero-text h2 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .biblical-quote {
        margin: 0.8rem 0;
        padding: 0.8rem;
    }
    
    .biblical-quote p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .biblical-quote cite {
        font-size: 0.8rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    /* Book cover extra small */
    .book-cover {
        width: 180px;
        height: 260px;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    /* Cards extra small */
    .character-card,
    .chapter-card {
        padding: 0.8rem;
    }
    
    .character-image {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .chapter-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Buttons extra small */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Footer extra small */
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer-brand h3 {
        font-size: 1.3rem;
    }
    
    .footer-links ul {
        gap: 0.8rem 1.5rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
        line-height: 1.4;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .back-to-top,
    .cta-buttons {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        break-inside: avoid;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-gold: #ffff00;
        --text-light: #ffffff;
        --bg-primary: #000000;
        --bg-secondary: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
.book-cover:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-gold);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations for 3D Book Cover */
@keyframes bookFloat {
    0%, 100% { transform: translateY(0px) rotateY(-15deg) rotateX(5deg); }
    50% { transform: translateY(-10px) rotateY(-12deg) rotateX(3deg); }
}

@keyframes auraGlow {
    0% { opacity: 0.1; }
    100% { opacity: 0.3; }
}