/* ============================================================
   book.css — A Thought in the Mind of God — Book Landing Page
   Cosmic/cinematic dark theme with deep navy, blues, orange/gold
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --book-hero-bg-start: #0a0e1a;
    --book-hero-bg-mid: #0f1b3d;
    --book-hero-bg-end: #0a0e1a;
    --book-hero-text: #e8e8f0;
    --book-hero-subtext: #b0b8d0;
    --book-accent: #8b5cf6;
    --book-accent-light: #c4b5fd;
    --book-accent-glow: rgba(139, 92, 246, 0.3);
    --book-gold: #d4a24e;
    --book-gold-bg: rgba(212, 162, 78, 0.15);
    --book-gold-border: rgba(212, 162, 78, 0.4);
    --book-section-bg: #ffffff;
    --book-section-text: #1a1a2e;
    --book-section-subtext: #495057;
    --book-card-bg: #fff;
    --book-card-border: rgba(0,0,0,0.08);
    --book-card-hover-border: rgba(139, 92, 246, 0.3);
    --book-card-hover-shadow: rgba(139, 92, 246, 0.08);
    --book-toc-part-color: #6c757d;
    --book-toc-link: #1a1a2e;
    --book-toc-hover-bg: #f0ecff;
    --book-bio-bg: #ffffff;
    --book-bio-border: #8b5cf6;
    --book-divider: #dee2e6;
}

[data-theme="dark"] {
    --book-section-bg: #1a1a2e;
    --book-section-text: #e0e0e0;
    --book-section-subtext: #a0a0b0;
    --book-card-bg: #252538;
    --book-card-border: rgba(255,255,255,0.1);
    --book-card-hover-border: rgba(139, 92, 246, 0.4);
    --book-card-hover-shadow: rgba(139, 92, 246, 0.15);
    --book-toc-part-color: #a0a0b0;
    --book-toc-link: #e0e0e0;
    --book-toc-hover-bg: rgba(139, 92, 246, 0.12);
    --book-bio-bg: #252538;
    --book-bio-border: #8b5cf6;
    --book-divider: rgba(255,255,255,0.1);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.book-hero {
    position: relative;
    background: linear-gradient(
        170deg,
        var(--book-hero-bg-start) 0%,
        var(--book-hero-bg-mid) 40%,
        #1a1040 70%,
        var(--book-hero-bg-end) 100%
    );
    overflow: hidden;
    padding: 4rem 0 3.5rem;
    text-align: center;
    color: var(--book-hero-text);
}

/* Star twinkle animations */
@keyframes book-twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
@keyframes book-twinkle2 {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Star field layers */
.book-hero::before,
.book-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Extra star layers with randomized twinkle timing */
.star-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

@keyframes twinkle-slow {
    0%, 100% { opacity: 0.9; }
    40% { opacity: 0.2; }
    70% { opacity: 0.7; }
}

@keyframes twinkle-med {
    0%, 100% { opacity: 0.8; }
    30% { opacity: 0.15; }
    60% { opacity: 0.6; }
    80% { opacity: 0.3; }
}

@keyframes twinkle-fast {
    0%, 100% { opacity: 0.7; }
    25% { opacity: 0.1; }
    50% { opacity: 0.8; }
    75% { opacity: 0.2; }
}

/* Layer with slow twinkle (7s) - big bright stars */
.star-layer-1 {
    background-image:
        radial-gradient(3.5px 3.5px at 18% 28%, rgba(255,255,255,0.95), transparent),
        radial-gradient(3px 3px at 62% 72%, rgba(255,255,255,0.85), transparent),
        radial-gradient(4px 4px at 85% 18%, rgba(255,255,255,0.9), rgba(255,255,255,0.15) 50%, transparent),
        radial-gradient(3px 3px at 42% 88%, rgba(200,180,255,0.7), transparent),
        radial-gradient(2.5px 2.5px at 75% 45%, rgba(255,200,150,0.65), transparent),
        radial-gradient(3.5px 3.5px at 8% 65%, rgba(255,255,255,0.8), transparent);
    /* twinkle disabled for perf */
}

/* Layer with medium twinkle (3.5s, delayed) - mixed stars */
.star-layer-2 {
    background-image:
        radial-gradient(2px 2px at 32% 15%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 55% 42%, rgba(200,180,255,0.6), transparent),
        radial-gradient(2.5px 2.5px at 78% 62%, rgba(255,255,255,0.75), transparent),
        radial-gradient(2px 2px at 15% 78%, rgba(255,200,150,0.6), transparent),
        radial-gradient(1.5px 1.5px at 92% 35%, rgba(255,255,255,0.65), transparent),
        radial-gradient(2px 2px at 48% 58%, rgba(200,180,255,0.55), transparent),
        radial-gradient(1.5px 1.5px at 25% 92%, rgba(255,255,255,0.6), transparent),
        radial-gradient(2.5px 2.5px at 68% 8%, rgba(255,200,150,0.55), transparent);
    /* twinkle disabled for perf */
}

/* Layer with fast twinkle (2.2s, delayed) - small flickering stars */
.star-layer-3 {
    background-image:
        radial-gradient(1px 1px at 22% 48%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 45% 25%, rgba(200,180,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 68% 82%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 88% 55%, rgba(255,200,150,0.5), transparent),
        radial-gradient(1px 1px at 12% 38%, rgba(255,255,255,0.55), transparent),
        radial-gradient(1.5px 1.5px at 52% 72%, rgba(200,180,255,0.45), transparent),
        radial-gradient(1px 1px at 35% 5%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 82% 28%, rgba(255,200,150,0.45), transparent),
        radial-gradient(1px 1px at 5% 85%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 72% 48%, rgba(200,180,255,0.4), transparent);
    /* twinkle disabled for perf */
}

/* Nebula clouds - vivid drifting color patches matching cover */
.book-hero .nebula-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

.book-hero .nebula-1 {
    background:
        radial-gradient(ellipse 600px 400px at 15% 35%, rgba(59,130,246,0.35), transparent 70%),
        radial-gradient(ellipse 500px 350px at 75% 25%, rgba(234,120,20,0.35), transparent 70%),
        radial-gradient(ellipse 450px 300px at 50% 80%, rgba(139,92,246,0.25), transparent 70%),
        radial-gradient(ellipse 350px 250px at 90% 70%, rgba(234,88,12,0.2), transparent 70%);
    opacity: 0.6;
    /* nebula drift disabled for perf (site-wide cosmic nebula still runs) */
}

.book-hero .nebula-2 {
    background:
        radial-gradient(ellipse 400px 500px at 82% 50%, rgba(59,130,246,0.25), transparent 70%),
        radial-gradient(ellipse 550px 300px at 25% 65%, rgba(234,120,20,0.3), transparent 70%),
        radial-gradient(ellipse 300px 400px at 55% 15%, rgba(168,85,247,0.3), transparent 70%),
        radial-gradient(ellipse 400px 250px at 10% 80%, rgba(234,88,12,0.2), transparent 70%);
    opacity: 0.5;
    /* nebula drift disabled for perf */
}

@keyframes nebula-drift-1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
    50% { transform: translate(30px, -15px) scale(1.06); opacity: 0.7; }
    100% { transform: translate(-20px, 10px) scale(0.95); opacity: 0.55; }
}

@keyframes nebula-drift-2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    50% { transform: translate(-25px, 20px) scale(1.08); opacity: 0.6; }
    100% { transform: translate(15px, -10px) scale(0.98); opacity: 0.45; }
}

/* Layer 1: Massive white star field */
.book-hero::before {
    background-image:
        /* Dust (0.5px) - dense field */
        radial-gradient(0.5px 0.5px at 3% 8%, rgba(255,255,255,0.4), transparent),
        radial-gradient(0.5px 0.5px at 12% 42%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 22% 78%, rgba(255,255,255,0.35), transparent),
        radial-gradient(0.5px 0.5px at 38% 15%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 47% 63%, rgba(255,255,255,0.4), transparent),
        radial-gradient(0.5px 0.5px at 58% 28%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 67% 87%, rgba(255,255,255,0.35), transparent),
        radial-gradient(0.5px 0.5px at 76% 5%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 83% 52%, rgba(255,255,255,0.4), transparent),
        radial-gradient(0.5px 0.5px at 92% 38%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 31% 92%, rgba(255,255,255,0.35), transparent),
        radial-gradient(0.5px 0.5px at 54% 47%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 2% 65%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 45% 3%, rgba(255,255,255,0.35), transparent),
        radial-gradient(0.5px 0.5px at 78% 88%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 61% 52%, rgba(255,255,255,0.25), transparent),
        radial-gradient(0.5px 0.5px at 16% 22%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 88% 68%, rgba(255,255,255,0.35), transparent),
        radial-gradient(0.5px 0.5px at 35% 45%, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 72% 92%, rgba(255,255,255,0.25), transparent),
        /* Small stars (1px) */
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 55% 80%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 60% 45%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 5% 40%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 75% 65%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 95% 75%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 42% 33%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 18% 55%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 33% 8%, rgba(255,255,255,0.45), transparent),
        radial-gradient(1px 1px at 82% 73%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 7% 92%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 62% 18%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 28% 75%, rgba(255,255,255,0.45), transparent),
        radial-gradient(1px 1px at 88% 48%, rgba(255,255,255,0.4), transparent),
        /* Medium stars (1.5-2px) */
        radial-gradient(1.5px 1.5px at 40% 30%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 85% 50%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 35% 70%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 20% 35%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 65% 12%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 92% 82%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 8% 48%, rgba(255,255,255,0.65), transparent),
        radial-gradient(2px 2px at 52% 38%, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 78% 58%, rgba(255,255,255,0.65), transparent),
        /* Bright stars (2.5-3px) */
        radial-gradient(2.5px 2.5px at 28% 22%, rgba(255,255,255,0.95), transparent),
        radial-gradient(2.5px 2.5px at 72% 68%, rgba(255,255,255,0.85), transparent),
        radial-gradient(2.5px 2.5px at 48% 85%, rgba(255,255,255,0.8), transparent),
        radial-gradient(2.5px 2.5px at 88% 15%, rgba(255,255,255,0.9), transparent),
        radial-gradient(2.5px 2.5px at 15% 72%, rgba(255,255,255,0.85), transparent),
        radial-gradient(2.5px 2.5px at 58% 5%, rgba(255,255,255,0.8), transparent),
        radial-gradient(3px 3px at 38% 52%, rgba(255,255,255,0.9), transparent),
        radial-gradient(3px 3px at 82% 32%, rgba(255,255,255,0.85), transparent),
        /* Big feature stars (3.5-4px) with glow */
        radial-gradient(4px 4px at 22% 55%, rgba(255,255,255,1), rgba(255,255,255,0.2) 50%, transparent),
        radial-gradient(3.5px 3.5px at 68% 25%, rgba(255,255,255,0.95), rgba(255,255,255,0.15) 50%, transparent),
        radial-gradient(4px 4px at 45% 72%, rgba(255,255,255,0.9), rgba(255,255,255,0.15) 50%, transparent),
        radial-gradient(3.5px 3.5px at 90% 45%, rgba(255,255,255,0.85), rgba(255,255,255,0.1) 50%, transparent),
        radial-gradient(4px 4px at 12% 18%, rgba(255,255,255,0.9), rgba(255,255,255,0.15) 50%, transparent),
        radial-gradient(3.5px 3.5px at 75% 82%, rgba(255,255,255,0.85), rgba(255,255,255,0.1) 50%, transparent);
    /* book-twinkle disabled for perf */
}

/* Layer 2: Tinted stars + warm-toned stars */
.book-hero::after {
    background-image:
        /* Tinted dust */
        radial-gradient(0.5px 0.5px at 7% 33%, rgba(200,180,255,0.35), transparent),
        radial-gradient(0.5px 0.5px at 24% 67%, rgba(200,180,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 43% 18%, rgba(255,200,150,0.3), transparent),
        radial-gradient(0.5px 0.5px at 57% 72%, rgba(200,180,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 73% 45%, rgba(255,200,150,0.25), transparent),
        radial-gradient(0.5px 0.5px at 86% 82%, rgba(200,180,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 94% 58%, rgba(255,200,150,0.3), transparent),
        radial-gradient(0.5px 0.5px at 16% 12%, rgba(180,200,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 52% 95%, rgba(255,200,150,0.25), transparent),
        radial-gradient(0.5px 0.5px at 35% 55%, rgba(200,180,255,0.3), transparent),
        /* Small tinted stars */
        radial-gradient(1px 1px at 8% 55%, rgba(200,180,255,0.5), transparent),
        radial-gradient(1px 1px at 30% 12%, rgba(255,200,150,0.4), transparent),
        radial-gradient(1px 1px at 45% 92%, rgba(200,180,255,0.4), transparent),
        radial-gradient(1px 1px at 78% 42%, rgba(255,200,150,0.4), transparent),
        radial-gradient(1px 1px at 18% 72%, rgba(180,200,255,0.35), transparent),
        radial-gradient(1px 1px at 52% 58%, rgba(255,200,150,0.3), transparent),
        radial-gradient(1px 1px at 42% 5%, rgba(200,180,255,0.5), transparent),
        radial-gradient(1px 1px at 68% 88%, rgba(255,200,150,0.35), transparent),
        radial-gradient(1px 1px at 33% 48%, rgba(200,180,255,0.4), transparent),
        /* Medium tinted */
        radial-gradient(1.5px 1.5px at 62% 38%, rgba(200,180,255,0.55), transparent),
        radial-gradient(1.5px 1.5px at 88% 28%, rgba(255,200,150,0.5), transparent),
        radial-gradient(1.5px 1.5px at 15% 18%, rgba(180,200,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 48% 62%, rgba(255,200,150,0.45), transparent),
        /* Bright tinted */
        radial-gradient(2px 2px at 55% 25%, rgba(200,180,255,0.6), transparent),
        radial-gradient(2px 2px at 82% 72%, rgba(255,200,150,0.5), transparent),
        radial-gradient(2px 2px at 35% 88%, rgba(200,180,255,0.5), transparent),
        radial-gradient(2.5px 2.5px at 25% 42%, rgba(255,200,150,0.55), transparent),
        /* Big tinted feature stars */
        radial-gradient(3px 3px at 75% 55%, rgba(180,200,255,0.55), transparent),
        radial-gradient(3px 3px at 12% 35%, rgba(255,200,150,0.5), transparent),
        radial-gradient(3.5px 3.5px at 60% 15%, rgba(200,180,255,0.5), rgba(200,180,255,0.1) 50%, transparent),
        radial-gradient(3.5px 3.5px at 42% 78%, rgba(255,200,150,0.45), rgba(255,200,150,0.1) 50%, transparent);
    /* book-twinkle2 disabled for perf */
}

/* Shooting stars */
@keyframes shooting-star {
    0% { transform: translateX(0) translateY(0); opacity: 0; width: 0; }
    2% { opacity: 1; width: 80px; }
    4% { opacity: 0.6; width: 150px; }
    6% { opacity: 0; width: 200px; transform: translateX(200px) translateY(80px); }
    100% { opacity: 0; width: 0; }
}

.shooting-star {
    position: absolute;
    height: 1px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.8), rgba(255,255,255,0));
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transform-origin: left center;
}

.shooting-star::after {
    content: '';
    position: absolute;
    right: 0;
    top: -1px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 0 4px 1px rgba(255,255,255,0.4);
}

.shooting-star-1 {
    top: 12%;
    left: 8%;
    transform: rotate(35deg);
    /* shooting-star disabled for perf */
}

.shooting-star-2 {
    top: 40%;
    left: 60%;
    transform: rotate(25deg);
    /* shooting-star disabled for perf */
}

.shooting-star-3 {
    top: 65%;
    left: 25%;
    transform: rotate(42deg);
    /* shooting-star disabled for perf */
}

.shooting-star-4 {
    top: 18%;
    left: 78%;
    transform: rotate(30deg);
    /* shooting-star disabled for perf */
}

.book-hero-content {
    position: relative;
    z-index: 1;
}

/* Cover image with 3D tilt + glow */
.book-cover-wrapper {
    display: inline-block;
    margin-bottom: 2rem;
    perspective: 1000px;
    position: relative;
}

/* Floating animation */
@keyframes book-float {
    0%, 100% { transform: rotateY(-4deg) rotateX(2deg) translateY(0); }
    50% { transform: rotateY(-4deg) rotateX(2deg) translateY(-8px); }
}

.book-cover-img {
    width: 420px;
    height: auto;
    max-width: 80vw;
    border-radius: 6px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(139, 92, 246, 0.15),
        0 0 80px rgba(139, 92, 246, 0.08);
    /* book-float disabled for perf */
    transition: box-shadow 0.4s ease;
}

/* Override animation on hover - JS handles transform via parallax */
.book-cover-wrapper:hover .book-cover-img {
    animation: none;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(139, 92, 246, 0.3),
        0 0 120px rgba(139, 92, 246, 0.15),
        0 0 160px rgba(234, 120, 20, 0.08);
}

/* Sparkle container */
.book-sparkles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: visible;
}

@keyframes sparkle-fall {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--sx), 60px) scale(0); }
}

.sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 4px 1px rgba(255,255,255,0.6), 0 0 8px rgba(139,92,246,0.3);
    opacity: 0;
    pointer-events: none;
}

.book-hero-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
    color: #fff;
}

.book-hero-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--book-hero-subtext);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.book-hero-author {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--book-accent-light);
    margin-bottom: 2rem;
}

.book-hero-quote {
    max-width: 680px;
    margin: 0 auto 2.2rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--book-hero-subtext);
    border-left: 3px solid var(--book-accent);
    padding-left: 1.25rem;
    text-align: left;
}

/* Download buttons */
.book-hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

/* Hero CTA: Read Online */
.book-hero-cta {
    margin-bottom: 1rem;
}

/* Continue reading card: appears on /mind for returning visitors who have a
   recent chapter in localStorage. Hidden by default; populated via JS. */
.book-continue-card {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0.75rem auto 1.25rem;
    padding: 0.85rem 1.25rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
    text-align: left;
    max-width: 380px;
}
.book-continue-card:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}
.book-continue-icon {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 4px 14px rgba(139,92,246,0.4);
}
.book-continue-text {
    flex: 1;
    min-width: 0;
}
.book-continue-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    margin-bottom: 0.15rem;
}
.book-continue-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-continue-section {
    font-size: 0.78rem;
    opacity: 0.75;
    margin-top: 0.15rem;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-continue-arrow {
    flex-shrink: 0;
    opacity: 0.6;
    font-size: 1.1rem;
    transition: transform 0.2s, opacity 0.2s;
}
.book-continue-card:hover .book-continue-arrow {
    transform: translateX(3px);
    opacity: 1;
}
@media (max-width: 540px) {
    .book-continue-card {
        max-width: 100%;
        width: calc(100% - 2rem);
    }
}
.btn-book-hero-read {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: none;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 50%, #4c1d95 100%);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.15);
    /* hero-btn-glow disabled for perf */
}
.btn-book-hero-read svg {
    width: 22px;
    height: 22px;
}
.btn-book-hero-read:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5), 0 0 60px rgba(139, 92, 246, 0.25);
    color: #fff;
    text-decoration: none;
}
.btn-book-hero-read:active {
    transform: translateY(0) scale(0.98);
}
@keyframes hero-btn-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.15); }
    50% { box-shadow: 0 4px 25px rgba(139, 92, 246, 0.55), 0 0 60px rgba(139, 92, 246, 0.25); }
}

/* Sparkle sweep across button */
.btn-book-hero-sparkle {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    /* hero-btn-sparkle disabled for perf */
    pointer-events: none;
}
@keyframes hero-btn-sparkle {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

@media (max-width: 575px) {
    .btn-book-hero-read {
        padding: 0.85rem 2rem;
        font-size: 1.05rem;
    }
}

.btn-book {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

.btn-book:hover {
    transform: translateY(-2px);
    color: #fff;
}

.btn-book:active {
    transform: translateY(0);
}

.btn-book svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-book-pdf {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-book-pdf:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-book-epub {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.btn-book-epub:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.btn-book-share {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
    cursor: pointer;
    border: none;
    color: #fff;
}

.btn-book-share:hover {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
}

.btn-book-read {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    box-shadow: none;
}

.btn-book-read:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(255,255,255,0.08);
}

/* Download counter */
.book-download-count {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    color: var(--book-hero-subtext);
    margin-bottom: 1rem;
}

.book-download-count strong {
    color: #fff;
}

/* Print notice badge */
.book-print-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--book-gold);
    background: var(--book-gold-bg);
    border: 1px solid var(--book-gold-border);
    border-radius: 50px;
    letter-spacing: 0.02em;
}

/* ============================================================
   WHERE TO START
   ============================================================ */

.book-where-to-start {
    background: var(--book-section-bg);
    padding: 3rem 0 2rem;
}

.book-reading-paths {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.reading-path {
    padding: 1rem 1.25rem;
    border-left: 3px solid rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.04);
    border-radius: 0 8px 8px 0;
}

.reading-path-audience {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--book-section-text);
    margin-bottom: 0.35rem;
}

.reading-path-direction {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: var(--book-section-subtext);
}

.reading-path-direction a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
}

.reading-path-direction a:hover {
    text-decoration: underline;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */

.book-about {
    background: var(--book-section-bg);
    padding: 3rem 0 1.5rem;
}

.book-section-heading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--book-section-text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.book-about-text {
    max-width: 720px;
    margin: 0 auto;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--book-section-subtext);
}

.book-about-text p {
    margin-bottom: 1.25rem;
}

.book-dedication {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 1.5rem 2rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--book-section-subtext);
    border-left: 3px solid var(--book-accent);
    background: var(--book-card-bg);
    border-radius: 0 8px 8px 0;
}

.book-copyright-info {
    max-width: 600px;
    margin: 1.5rem auto 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--book-section-subtext);
    opacity: 0.7;
    line-height: 1.6;
}

.book-copyright-info p {
    margin: 0.2rem 0;
}

/* ============================================================
   TABLE OF CONTENTS SECTION
   ============================================================ */

.book-toc {
    background: var(--book-card-bg);
    padding: 4rem 0;
    border-top: 1px solid var(--book-divider);
}

.book-toc-container {
    max-width: 780px;
    margin: 0 auto;
}

.book-toc-part {
    margin-bottom: 1.75rem;
}

.book-toc-part-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--book-accent, #7c3aed);
    margin-bottom: 0.35rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
    display: inline-block;
}

.book-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.book-toc-item {
    margin: 0;
}

.book-toc-link {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    text-decoration: none;
    color: var(--book-toc-link);
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
}

.book-toc-link:hover {
    background: var(--book-toc-hover-bg);
    color: var(--book-accent);
    text-decoration: none;
}

.book-toc-number {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--book-toc-link);
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
}

.book-toc-title {
    flex: 1;
}

.book-toc-sections {
    font-size: 0.75rem;
    font-style: italic;
    color: #9ca3af;
    line-height: 1.5;
    padding: 0.15rem 0 0.6rem 3rem;
}

.book-toc-sections-list {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0 0.6rem 3rem;
}
.book-toc-sections-list li {
    font-size: 0.92rem;
    font-style: italic;
    padding: 0.2rem 0;
}

/* Grouped sections (Appendix A) */
.book-toc-grouped-sections {
    padding: 0.15rem 0 0.6rem 3rem;
}
.book-toc-grouped-sections .book-toc-sections-list {
    padding: 0;
}
.book-toc-section-group {
    margin-bottom: 0.5rem;
}
.book-toc-section-group-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--book-accent, #7c3aed);
    padding: 0.4rem 0 0.15rem;
}

.book-toc-section-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}
[data-theme="dark"] .book-toc-section-link { color: #9ca3af; }

.book-toc-section-link:hover {
    color: var(--book-accent, #7c3aed);
    text-decoration: underline;
}

.book-toc-pipe {
    color: #d1d5db;
    margin: 0 0.1rem;
}
[data-theme="dark"] .book-toc-pipe { color: #4b5563; }

.book-toc-subsections {
    list-style: none;
    padding: 0.2rem 0 0.4rem 2.5rem;
    margin: 0;
}

.book-toc-subsection {
    font-size: 0.85rem;
    color: var(--book-text-muted, #888);
    padding: 0.1rem 0;
}

/* ============================================================
   ABOUT THE AUTHOR SECTION
   ============================================================ */

.book-author {
    background: var(--book-section-bg);
    padding: 4rem 0;
    border-top: 1px solid var(--book-divider);
}

.book-author-card {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.book-author-photo {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.book-author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-author-content {
    flex: 1;
}

.book-author-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--book-section-text);
    margin-bottom: 1rem;
}

.book-author-bio {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--book-section-subtext);
    margin-bottom: 1.5rem;
}

.book-author-bio p {
    margin-bottom: 1rem;
}

.book-author-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9rem;
    color: var(--book-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.book-author-link:hover {
    color: var(--book-accent-light);
    text-decoration: underline;
}

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

@media (max-width: 768px) {
    .book-hero {
        padding: 2.5rem 0 2rem;
    }

    .book-cover-img {
        width: 240px;
        transform: rotateY(-2deg) rotateX(1deg);
    }

    .book-hero-title {
        font-size: 1.8rem;
    }

    .book-hero-subtitle {
        font-size: 0.95rem;
    }

    .book-hero-quote {
        font-size: 0.95rem;
        padding-left: 1rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .book-hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-book {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .book-section-heading {
        font-size: 1.35rem;
    }

    .book-about-text {
        font-size: 0.98rem;
    }

    .book-dedication {
        padding: 1.2rem 1.5rem;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }

    .book-author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-author-photo {
        width: 100px;
        height: 100px;
    }

    .book-toc {
        padding: 3rem 0;
    }

    .book-toc-link {
        padding: 0.45rem 0.5rem;
        font-size: 1.05rem;
    }

    .book-author {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .book-cover-img {
        width: 200px;
    }

    .book-hero-title {
        font-size: 1.5rem;
    }

    .book-hero-quote {
        font-size: 0.9rem;
    }

    .book-print-badge {
        font-size: 0.75rem;
        padding: 0.35rem 1rem;
    }
}

/* ============================================================
   SEARCH SECTION
   ============================================================ */

.book-search-section {
    padding: 1.5rem 0;
    background: var(--book-section-bg);
}

/* Search trigger button - command palette style */
.book-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 400px;
    margin: 0 auto;
    padding: 0.55rem 1rem;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.06);
    color: #8b5cf6;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.book-search-trigger:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.4);
}

.book-search-trigger i {
    font-size: 0.85rem;
}

.book-search-trigger span {
    flex: 1;
    text-align: left;
}

.book-search-trigger kbd {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.08);
    color: #8b5cf6;
    opacity: 0.7;
}

[data-theme="dark"] .book-search-trigger {
    background: rgba(139, 92, 246, 0.08);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .book-search-trigger:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.35);
}

[data-theme="dark"] .book-search-trigger kbd {
    border-color: rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

.book-search-section .container {
    text-align: center;
}

/* Search results (used by unified modal in book_search_modal.php) */
.book-search-results {
    overflow-y: auto;
    flex: 1;
}

.book-search-summary {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] .book-search-summary {
    color: #9ca3af;
    border-bottom-color: rgba(255,255,255,0.1);
}

.book-search-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

[data-theme="dark"] .book-search-empty {
    color: #9ca3af;
}

.book-search-result {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

[data-theme="dark"] .book-search-result {
    border-bottom-color: rgba(255,255,255,0.08);
}

.book-search-result:last-child {
    border-bottom: none;
}

.book-search-result-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #7c3aed;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] .book-search-result-title {
    color: #a78bfa;
}

.book-search-result-title:hover {
    color: #6d28d9;
    text-decoration: none;
}

[data-theme="dark"] .book-search-result-title:hover {
    color: #c4b5fd;
}

.book-search-match-count {
    font-size: 0.7rem;
    font-weight: 400;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

[data-theme="dark"] .book-search-match-count {
    color: #9ca3af;
    background: rgba(255,255,255,0.1);
}

.book-search-result-part {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.15rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] .book-search-result-part {
    color: #9ca3af;
}

.book-search-snippet {
    font-size: 0.85rem;
    color: #374151;
    margin-top: 0.4rem;
    line-height: 1.5;
}

[data-theme="dark"] .book-search-snippet {
    color: #d1d5db;
}

.book-search-snippet mark {
    background: rgba(245, 158, 11, 0.3);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

[data-theme="dark"] .book-search-snippet mark {
    background: rgba(245, 158, 11, 0.4);
}

/* Medium tier: reduce book hero layers */
.cosmic-tier-medium .star-layer-3 { display: none !important; }
.cosmic-tier-medium .star-layer-1,
.cosmic-tier-medium .star-layer-2 { animation-duration: 14s !important; }
.cosmic-tier-medium .nebula-layer { animation: none !important; }
/* Low tier: hide book hero entirely -- site-wide cosmic is enough */
.cosmic-tier-low .star-layer { display: none !important; }
.cosmic-tier-low .nebula-layer { display: none !important; }
.cosmic-android .star-layer { display: none !important; }
.cosmic-android .nebula-layer { display: none !important; }


/* ============================================================================
   LINEAGE DIAGRAM (Appendix I + About contexts): Plato -> Augustine -> Tradition -> This Book
   Styled vertical timeline of glassy cards connected by arrows.
   ============================================================================ */
.lineage-heading {
    text-align: center;
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2.5rem 0 0.5rem;
    letter-spacing: 0.01em;
    opacity: 0.9;
}

.lineage-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 2.5rem 0 3rem;
    font-family: var(--book-body-font, Georgia, serif);
}

.lineage-stage {
    width: min(100%, 560px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 1.4rem 1.6rem 1.2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    position: relative;
}

.lineage-stage .lineage-era {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.65;
    margin-bottom: 0.25rem;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
}

.lineage-stage .lineage-name {
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.55rem;
    font-weight: 600;
    margin: 0 0 0.85rem;
    line-height: 1.2;
    letter-spacing: 0.005em;
}

.lineage-stage p,
.lineage-stage ul {
    margin: 0 0 0.6rem;
    line-height: 1.55;
}

.lineage-stage p:last-child,
.lineage-stage ul:last-child {
    margin-bottom: 0;
}

.lineage-stage .lineage-points {
    list-style: none;
    padding-left: 0;
}

.lineage-stage .lineage-points li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.35rem;
}

.lineage-stage .lineage-points li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    top: 0.7em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.45;
}

.lineage-stage .lineage-intro,
.lineage-stage .lineage-rejects-label {
    font-style: italic;
    opacity: 0.85;
    margin-bottom: 0.4rem;
}

.lineage-stage .lineage-outro,
.lineage-stage .lineage-foot {
    font-style: italic;
    opacity: 0.78;
    margin-top: 0.6rem;
}

.lineage-stage .lineage-roster {
    font-family: var(--book-display-font, Georgia, serif);
    line-height: 1.7;
    opacity: 0.92;
}

.lineage-stage .lineage-refs {
    font-size: 0.88em;
    opacity: 0.75;
    white-space: nowrap;
}

/* Pivot card (THIS BOOK) gets a warmer accent so the divergence reads visually */
.lineage-stage-pivot {
    border-color: rgba(255, 188, 92, 0.45);
    box-shadow: 0 6px 32px rgba(255, 188, 92, 0.18), 0 4px 24px rgba(0, 0, 0, 0.22);
    background: linear-gradient(180deg,
        rgba(255, 188, 92, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 100%);
}

.lineage-stage-pivot .lineage-era {
    color: #f4b860;
    opacity: 0.95;
}

/* The connector between cards */
.lineage-arrow {
    width: 2px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.15) 100%);
    height: 56px;
    margin: 0;
    position: relative;
}

.lineage-arrow::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid rgba(255, 255, 255, 0.4);
}

.lineage-arrow .lineage-arrow-note {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 0.82rem;
    font-style: italic;
    opacity: 0.7;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
}

.lineage-arrow-divergent {
    background: linear-gradient(180deg,
        rgba(255, 188, 92, 0.4) 0%,
        rgba(255, 188, 92, 0.15) 100%);
    height: 70px;
}

.lineage-arrow-divergent::after {
    border-top-color: #f4b860;
}

.lineage-arrow-divergent .lineage-arrow-note {
    color: #f4b860;
    opacity: 0.85;
}

/* Light theme adjustments */
[data-theme="light"] .lineage-stage {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    color: #1f2230;
}

[data-theme="light"] .lineage-arrow {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.12) 100%);
}

[data-theme="light"] .lineage-arrow::after {
    border-top-color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .lineage-stage-pivot {
    background: linear-gradient(180deg, rgba(244, 184, 96, 0.18) 0%, rgba(255, 255, 255, 0.92) 100%);
    border-color: rgba(212, 138, 32, 0.55);
    box-shadow: 0 6px 26px rgba(212, 138, 32, 0.18);
}

[data-theme="light"] .lineage-stage-pivot .lineage-era {
    color: #b07418;
}

[data-theme="light"] .lineage-arrow-divergent {
    background: linear-gradient(180deg, rgba(212, 138, 32, 0.6) 0%, rgba(212, 138, 32, 0.2) 100%);
}

[data-theme="light"] .lineage-arrow-divergent::after {
    border-top-color: #b07418;
}

[data-theme="light"] .lineage-arrow-divergent .lineage-arrow-note {
    color: #b07418;
}

/* On narrow screens, drop the side note under the arrow */
@media (max-width: 600px) {
    .lineage-arrow .lineage-arrow-note {
        position: static;
        transform: none;
        white-space: normal;
        text-align: center;
        margin-top: 0.4rem;
        display: block;
    }
    .lineage-arrow {
        height: auto;
        min-height: 56px;
        padding-bottom: 1.6rem;
    }
}

/* ============================================================================
   SENTENCE BREAKDOWN (Appendix B): the centered sentence + 5 numbered clauses
   ============================================================================ */
.sentence-breakdown {
    margin: 2.5rem 0 3rem;
    font-family: var(--book-body-font, Georgia, serif);
}

.sentence-breakdown-header {
    text-align: center;
    margin-bottom: 2rem;
}

.sb-label {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.6;
    margin-bottom: 0.85rem;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
}

.sb-quote {
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.35rem;
    font-style: italic;
    line-height: 1.55;
    max-width: 720px;
    margin: 0 auto;
    padding: 1.4rem 1.8rem;
    border-left: 3px solid rgba(255, 188, 92, 0.7);
    background: linear-gradient(180deg,
        rgba(255, 188, 92, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 100%);
    border-radius: 4px;
    text-align: left;
}

.sb-clauses {
    list-style: none;
    counter-reset: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.sb-clause {
    display: flex;
    gap: 1.1rem;
    padding: 1.1rem 1.3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: flex-start;
}

.sb-clause-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 188, 92, 0.25), rgba(255, 188, 92, 0.08));
    border: 1px solid rgba(255, 188, 92, 0.45);
    color: #f4b860;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--book-display-font, Georgia, serif);
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: 0.15rem;
}

.sb-clause-body {
    flex: 1;
    min-width: 0;
}

.sb-clause-text {
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    line-height: 1.35;
}

.sb-description {
    margin: 0 0 0.55rem;
    line-height: 1.55;
    opacity: 0.92;
}

.sb-refs {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.72;
    line-height: 1.5;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
}

.sb-refs-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    margin-right: 0.4rem;
    opacity: 0.85;
}

[data-theme="light"] .sb-clause {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    color: #1f2230;
}

[data-theme="light"] .sb-clause-num {
    color: #b07418;
    background: linear-gradient(135deg, rgba(244, 184, 96, 0.3), rgba(244, 184, 96, 0.1));
    border-color: rgba(212, 138, 32, 0.5);
}

[data-theme="light"] .sb-quote {
    border-left-color: #b07418;
    background: linear-gradient(180deg,
        rgba(244, 184, 96, 0.12) 0%,
        rgba(255, 255, 255, 0.4) 100%);
}

@media (max-width: 600px) {
    .sb-quote { font-size: 1.15rem; padding: 1.1rem 1.3rem; }
    .sb-clause { padding: 0.95rem 1rem; gap: 0.85rem; }
    .sb-clause-num { width: 30px; height: 30px; font-size: 0.95rem; }
    .sb-clause-text { font-size: 1.05rem; }
}

/* Mind modal About panel: narrower context, tighten spacing and stack notes */
.book-modal-about-content .lineage-heading {
    margin: 2rem 0 0.4rem;
    font-size: 1.15rem;
}
.book-modal-about-content .lineage-stage {
    width: 100%;
    padding: 1.1rem 1.25rem 0.9rem;
}
.book-modal-about-content .lineage-stage .lineage-name {
    font-size: 1.3rem;
}
.book-modal-about-content .lineage-arrow {
    height: 44px;
}
.book-modal-about-content .lineage-arrow .lineage-arrow-note {
    position: static;
    transform: none;
    white-space: normal;
    text-align: center;
    margin-top: 0.3rem;
    display: block;
    padding: 0 0.5rem;
}
.book-modal-about-content .lineage-arrow:has(.lineage-arrow-note) {
    height: auto;
    min-height: 60px;
    padding-bottom: 1.2rem;
}

/* ============================================================================
   ETERNAL THOUGHT DIAGRAM (Chapter 2): the eternal thought collapsing into
   three frames -- Cross, Conversion, Judgment. Hero card on top, vertical
   connector, three frame cards in a row.
   ============================================================================ */
.eternal-thought-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2.5rem 0 3rem;
    font-family: var(--book-body-font, Georgia, serif);
}

.eternal-thought-source {
    width: min(100%, 560px);
    background: linear-gradient(180deg,
        rgba(255, 188, 92, 0.10) 0%,
        rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 188, 92, 0.45);
    border-radius: 14px;
    padding: 1.4rem 1.6rem 1.2rem;
    text-align: center;
    box-shadow: 0 6px 32px rgba(255, 188, 92, 0.18), 0 4px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.eternal-thought-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #f4b860;
    opacity: 0.95;
    margin-bottom: 0.55rem;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
}

.eternal-thought-quote {
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.45rem;
    font-style: italic;
    margin: 0 0 0.55rem;
    line-height: 1.3;
}

.eternal-thought-refs {
    font-size: 0.85em;
    opacity: 0.75;
    margin: 0;
}

.eternal-thought-branch {
    width: 2px;
    height: 56px;
    background: linear-gradient(180deg,
        rgba(255, 188, 92, 0.55) 0%,
        rgba(255, 255, 255, 0.18) 100%);
}

.eternal-thought-frames {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: min(100%, 720px);
    position: relative;
}

/* Horizontal connector across the three frames, sitting just above them. */
.eternal-thought-frames::before {
    content: "";
    position: absolute;
    top: -28px;
    left: calc((100% / 6));
    right: calc((100% / 6));
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
}

/* Vertical drops from the horizontal bar into each card top. */
.eternal-thought-frame {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.1rem 1.1rem 0.95rem;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.eternal-thought-frame::before {
    content: "";
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 28px;
    background: rgba(255, 255, 255, 0.22);
}

.eternal-thought-frame-title {
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.eternal-thought-frame-render {
    font-size: 0.95em;
    opacity: 0.85;
    margin: 0 0 0.5rem;
    line-height: 1.45;
}

.eternal-thought-frame-ref {
    font-size: 0.82em;
    opacity: 0.7;
    margin: 0;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .eternal-thought-frames {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .eternal-thought-frames::before { display: none; }
    .eternal-thought-frame::before { display: none; }
}

/* ============================================================================
   BOOK TREE DIAGRAM (How This Book Talks): the codebase metaphor rendered as
   a code-editor sidebar -- mac-style window controls, monospaced rows with
   tree connectors, syntax-coloring for the names vs the comments.
   ============================================================================ */
.book-tree {
    margin: 2rem 0 2.5rem;
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.35);
    color: #e2e2f0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.55;
}

.book-tree-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.85rem;
    background: linear-gradient(180deg, #2a2a3e 0%, #232334 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.book-tree-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.book-tree-dot-r { background: #ff5f57; }
.book-tree-dot-y { background: #febc2e; }
.book-tree-dot-g { background: #28c840; }

.book-tree-title {
    margin-left: 0.6rem;
    font-size: 0.78rem;
    color: #b8b8c8;
    letter-spacing: 0.02em;
}

.book-tree-list {
    list-style: none;
    margin: 0;
    padding: 0.85rem 0.85rem 1rem;
}

.book-tree-row {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    padding: 0.12rem 0;
    white-space: nowrap;
    overflow-x: auto;
}

.book-tree-row::-webkit-scrollbar { display: none; }
.book-tree-row { scrollbar-width: none; }

.book-tree-root {
    color: #f4b860;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.book-tree-branch {
    color: #6a6a85;
    user-select: none;
}

.book-tree-name {
    color: #a78bfa;
    font-weight: 500;
}

.book-tree-root .book-tree-name {
    color: inherit;
}

.book-tree-comment {
    color: #6a8c6a;
    font-style: italic;
    opacity: 0.92;
}

@media (max-width: 640px) {
    .book-tree { font-size: 0.78rem; }
    .book-tree-list { padding: 0.65rem 0.65rem 0.85rem; }
}

/* ============================================================================
   SCROLL REVEAL: subtle fade-and-rise on diagram cards as they enter the
   viewport. JS adds .is-visible via IntersectionObserver. Without JS or with
   reduced-motion, the elements are visible immediately (graceful fallback).
   ============================================================================ */
.lineage-diagram,
.sentence-breakdown,
.eternal-thought-diagram,
.book-tree {
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js-reveal {
    opacity: 0;
    transform: translateY(18px);
}
.js-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger frame cards inside eternal-thought when the parent reveals. */
.eternal-thought-diagram.is-visible .eternal-thought-frame {
    animation: eternalThoughtFrameIn 600ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.eternal-thought-diagram.is-visible .eternal-thought-frame:nth-child(1) { animation-delay: 200ms; }
.eternal-thought-diagram.is-visible .eternal-thought-frame:nth-child(2) { animation-delay: 320ms; }
.eternal-thought-diagram.is-visible .eternal-thought-frame:nth-child(3) { animation-delay: 440ms; }

@keyframes eternalThoughtFrameIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .lineage-diagram,
    .sentence-breakdown,
    .eternal-thought-diagram,
    .book-tree,
    .eternal-thought-diagram .eternal-thought-frame {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================================================
   COSTUME CARDS (Appendix N): each costume paragraph tagged by kind so the
   four fields (Christian appearance, Platonic substrate, Damage, Framework
   correction) render as a stacked diagnostic with a colored left rail and a
   small label badge above the body text. Reads as four phases of the same
   move: disguise -> substrate -> wound -> cure.
   ============================================================================ */
.chapter-body .costume-field {
    position: relative;
    padding: 0.85rem 1rem 0.85rem 1.1rem;
    margin: 0 0 0.65rem;
    border-left: 3px solid;
    border-radius: 0 8px 8px 0;
    background: rgba(255, 255, 255, 0.02);
}
[data-theme="dark"] .chapter-body .costume-field {
    background: rgba(255, 255, 255, 0.025);
}

.chapter-body .costume-field-label {
    display: block;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    margin-bottom: 0.35rem;
    font-weight: 600;
    opacity: 0.95;
}

/* Christian appearance -- neutral muted (the disguise as it appears) */
.chapter-body .costume-field-appearance {
    border-left-color: rgba(160, 160, 180, 0.55);
    background: rgba(160, 160, 180, 0.06);
}
.chapter-body .costume-field-appearance .costume-field-label {
    color: #8a8aa3;
}

/* Platonic substrate -- cool blue (the hidden law underneath) */
.chapter-body .costume-field-substrate {
    border-left-color: rgba(96, 165, 250, 0.6);
    background: rgba(96, 165, 250, 0.05);
}
.chapter-body .costume-field-substrate .costume-field-label {
    color: #60a5fa;
}

/* Damage -- warm rust (the wound) */
.chapter-body .costume-field-damage {
    border-left-color: rgba(248, 113, 113, 0.6);
    background: rgba(248, 113, 113, 0.05);
}
.chapter-body .costume-field-damage .costume-field-label {
    color: #f87171;
}

/* Framework correction -- warm amber/violet (the cure: the framework's accent) */
.chapter-body .costume-field-correction {
    border-left-color: rgba(244, 184, 96, 0.7);
    background: linear-gradient(90deg,
        rgba(244, 184, 96, 0.08) 0%,
        rgba(167, 139, 250, 0.04) 100%);
}
.chapter-body .costume-field-correction .costume-field-label {
    color: #f4b860;
}

/* Light theme tweaks: deeper labels, subtler fills. */
[data-theme="light"] .chapter-body .costume-field-appearance .costume-field-label { color: #5a5a72; }
[data-theme="light"] .chapter-body .costume-field-substrate .costume-field-label  { color: #2563eb; }
[data-theme="light"] .chapter-body .costume-field-damage .costume-field-label     { color: #b91c1c; }
[data-theme="light"] .chapter-body .costume-field-correction .costume-field-label { color: #b45309; }

@media (max-width: 640px) {
    .chapter-body .costume-field {
        padding: 0.7rem 0.85rem 0.7rem 0.9rem;
    }
    .chapter-body .costume-field-label {
        font-size: 0.65rem;
        letter-spacing: 0.11em;
    }
}

/* ============================================================================
   OBJECTION CARDS (every chapter's "Objections and Answers" section): pair
   the objection (a quote, in someone else's voice) with the framework's
   answer inside one card. The header is set off as a quote-card with a
   "challenger" muted accent; the body is the framework's reply.
   ============================================================================ */
.chapter-body .objection-card {
    margin: 1.6rem 0 1.8rem;
    border: 1px solid rgba(160, 160, 180, 0.18);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.015);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.16);
}
[data-theme="dark"] .chapter-body .objection-card {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}

.chapter-body .objection-card-header {
    position: relative;
    padding: 1.1rem 1.3rem 1.05rem 3.2rem;
    background: linear-gradient(180deg,
        rgba(160, 160, 180, 0.08) 0%,
        rgba(160, 160, 180, 0.02) 100%);
    border-bottom: 1px solid rgba(160, 160, 180, 0.18);
}

.chapter-body .objection-card-header::before {
    content: "\201C";  /* left double quote */
    position: absolute;
    top: 0.15rem;
    left: 0.85rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.2rem;
    line-height: 1;
    color: rgba(160, 160, 180, 0.5);
    opacity: 0.85;
}

.chapter-body .objection-card-badge {
    display: inline-block;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #9090a8;
    margin-bottom: 0.45rem;
}
[data-theme="light"] .chapter-body .objection-card-badge { color: #6a6a82; }

.chapter-body .objection-card-quote {
    margin: 0;
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.12rem;
    font-style: italic;
    line-height: 1.4;
    color: inherit;
    opacity: 0.96;
}

.chapter-body .objection-card-body {
    padding: 1.1rem 1.3rem 1.0rem;
    border-left: 3px solid rgba(244, 184, 96, 0.55);
}
[data-theme="light"] .chapter-body .objection-card-body {
    border-left-color: rgba(180, 83, 9, 0.6);
}

.chapter-body .objection-card-body > p:first-child { margin-top: 0; }
.chapter-body .objection-card-body > p:last-child { margin-bottom: 0; }

@media (max-width: 640px) {
    .chapter-body .objection-card-header {
        padding: 0.9rem 1rem 0.9rem 2.6rem;
    }
    .chapter-body .objection-card-header::before {
        font-size: 2.6rem;
        left: 0.7rem;
    }
    .chapter-body .objection-card-body {
        padding: 0.95rem 1rem 0.85rem;
    }
    .chapter-body .objection-card-quote { font-size: 1.02rem; }
}

/* ============================================================================
   DSS CARDS (Dead Sea Scrolls quotations):
   Pre-Christian witness in the same card family as objection cards, but with
   a warm bronze/parchment accent so ancient-witness reads distinctly without
   outranking Scripture blockquotes. Auto-generated from plain <blockquote>s
   whose attribution names a DSS scroll (1QH, 1QS, 4Q*, Community Rule,
   Thanksgiving Hymns/Psalms) -- see scripts/transform_dss_cards.py. Web only.
   ============================================================================ */
.chapter-body .dss-card {
    margin: 1.6rem 0 1.8rem;
    border: 1px solid rgba(160, 130, 70, 0.22);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(160, 130, 70, 0.02);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.14);
}
[data-theme="dark"] .chapter-body .dss-card {
    background: rgba(212, 168, 84, 0.025);
    border-color: rgba(212, 168, 84, 0.22);
}

.chapter-body .dss-card-header {
    padding: 0.7rem 1.25rem 0.65rem;
    background: linear-gradient(180deg,
        rgba(160, 130, 70, 0.10) 0%,
        rgba(160, 130, 70, 0.02) 100%);
    border-bottom: 1px solid rgba(160, 130, 70, 0.22);
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    flex-wrap: wrap;
}
[data-theme="dark"] .chapter-body .dss-card-header {
    background: linear-gradient(180deg,
        rgba(212, 168, 84, 0.08) 0%,
        rgba(212, 168, 84, 0.02) 100%);
    border-bottom-color: rgba(212, 168, 84, 0.22);
}

.chapter-body .dss-card-badge {
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #8B6F2E;
}
[data-theme="dark"] .chapter-body .dss-card-badge { color: #C9A876; }

.chapter-body .dss-card-source {
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.78rem;
    font-weight: 500;
    color: #9b8a6a;
    letter-spacing: 0.02em;
}
[data-theme="dark"] .chapter-body .dss-card-source { color: #b8a87a; }

.chapter-body .dss-card-body {
    padding: 1.15rem 1.35rem 1.05rem 3.2rem;
    position: relative;
    border-left: 3px solid rgba(160, 130, 70, 0.45);
}
[data-theme="dark"] .chapter-body .dss-card-body {
    border-left-color: rgba(212, 168, 84, 0.5);
}

.chapter-body .dss-card-body::before {
    content: "\201C";  /* left double quotation mark */
    position: absolute;
    top: 0.4rem;
    left: 0.95rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3rem;
    line-height: 1;
    color: rgba(160, 130, 70, 0.45);
    opacity: 0.9;
}
[data-theme="dark"] .chapter-body .dss-card-body::before {
    color: rgba(212, 168, 84, 0.5);
}

.chapter-body .dss-card-quote {
    margin: 0;
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.08rem;
    font-style: italic;
    line-height: 1.55;
    color: inherit;
    opacity: 0.96;
}
.chapter-body .dss-card-quote > p { margin: 0 0 0.7rem; }
.chapter-body .dss-card-quote > p:last-child { margin-bottom: 0; }

.chapter-body .dss-card-attribution {
    padding: 0.65rem 1.35rem 0.75rem 3.2rem;
    border-top: 1px dashed rgba(160, 130, 70, 0.22);
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.82rem;
    line-height: 1.45;
    color: #8a7a5e;
    font-style: normal;
}
[data-theme="dark"] .chapter-body .dss-card-attribution {
    color: #a89878;
    border-top-color: rgba(212, 168, 84, 0.22);
}
.chapter-body .dss-card-attribution em { font-style: italic; }

@media (max-width: 640px) {
    .chapter-body .dss-card-body {
        padding: 0.95rem 1.05rem 0.9rem 2.6rem;
    }
    .chapter-body .dss-card-body::before {
        font-size: 2.4rem;
        left: 0.8rem;
        top: 0.35rem;
    }
    .chapter-body .dss-card-attribution {
        padding: 0.55rem 1.05rem 0.65rem 2.6rem;
        font-size: 0.76rem;
    }
    .chapter-body .dss-card-quote { font-size: 1rem; }
}

/* ============================================================================
   STUDY CARDS (For Further Study sections + inline appendix reference lists):
   topic header above a flex-wrap grid of small monospace verse chips. Reads
   like a study reference shelf instead of a wall of semicolons.
   ============================================================================ */
.chapter-body .study-card {
    margin: 1.1rem 0;
    padding: 0.95rem 1.05rem 0.85rem;
    border: 1px solid rgba(139, 92, 246, 0.16);
    border-radius: 12px;
    background: linear-gradient(180deg,
        rgba(139, 92, 246, 0.04) 0%,
        rgba(139, 92, 246, 0.01) 100%);
}
[data-theme="dark"] .chapter-body .study-card {
    background: linear-gradient(180deg,
        rgba(167, 139, 250, 0.06) 0%,
        rgba(167, 139, 250, 0.02) 100%);
    border-color: rgba(167, 139, 250, 0.18);
}

.chapter-body .study-card-topic {
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7c3aed;
    margin: 0 0 0.65rem;
    line-height: 1.3;
}
[data-theme="dark"] .chapter-body .study-card-topic {
    color: #a78bfa;
}

.chapter-body .study-card-verses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chapter-body .study-verse {
    display: inline-block;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.2);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: nowrap;
    color: inherit;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.chapter-body .study-verse:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.45);
    transform: translateY(-1px);
}
[data-theme="dark"] .chapter-body .study-verse {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.22);
}
[data-theme="dark"] .chapter-body .study-verse:hover {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.45);
}

@media (max-width: 640px) {
    .chapter-body .study-card { padding: 0.8rem 0.85rem 0.7rem; }
    .chapter-body .study-verse { font-size: 0.74rem; padding: 0.2rem 0.5rem; }
}

/* ============================================================================
   RELATED APPENDICES (where-to-read-next index at the end of each chapter).
   Sky-blue accent so it reads as a distinct family from objection-cards
   (gray/orange) and study-cards (purple). Each appendix entry is the title;
   nested sections render as inline pills like study-verses but text-style.
   ============================================================================ */
.chapter-body .related-appendices {
    margin: 1.6rem 0 1.8rem;
    padding: 1rem 1.2rem 0.95rem;
    border: 1px solid rgba(56, 132, 196, 0.22);
    border-radius: 12px;
    background: linear-gradient(180deg,
        rgba(56, 132, 196, 0.05) 0%,
        rgba(56, 132, 196, 0.01) 100%);
}
[data-theme="dark"] .chapter-body .related-appendices {
    background: linear-gradient(180deg,
        rgba(125, 211, 252, 0.06) 0%,
        rgba(125, 211, 252, 0.02) 100%);
    border-color: rgba(125, 211, 252, 0.22);
}

.chapter-body .related-appendices h3 {
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0369a1;
    margin: 0 0 0.85rem;
    line-height: 1.3;
}
[data-theme="dark"] .chapter-body .related-appendices h3 {
    color: #7dd3fc;
}

.chapter-body .related-appendices p {
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
    line-height: 1.45;
}
.chapter-body .related-appendices > p:first-of-type {
    margin-top: 0;
}

.chapter-body .related-appendices p a,
.chapter-body .related-appendices p strong a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(56, 132, 196, 0.4);
    transition: color 0.15s, border-color 0.15s;
}
.chapter-body .related-appendices p a:hover,
.chapter-body .related-appendices p strong a:hover {
    color: #0369a1;
    border-bottom-color: #0369a1;
}
[data-theme="dark"] .chapter-body .related-appendices p a,
[data-theme="dark"] .chapter-body .related-appendices p strong a {
    border-bottom-color: rgba(125, 211, 252, 0.4);
}
[data-theme="dark"] .chapter-body .related-appendices p a:hover,
[data-theme="dark"] .chapter-body .related-appendices p strong a:hover {
    color: #7dd3fc;
    border-bottom-color: #7dd3fc;
}

.chapter-body .related-appendices ul {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0.15rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.chapter-body .related-appendices ul li {
    margin: 0;
}
.chapter-body .related-appendices ul li a {
    display: inline-block;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    background: rgba(56, 132, 196, 0.08);
    border: 1px solid rgba(56, 132, 196, 0.22);
    font-size: 0.82rem;
    line-height: 1.35;
    color: inherit;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.chapter-body .related-appendices ul li a:hover {
    background: rgba(56, 132, 196, 0.18);
    border-color: rgba(56, 132, 196, 0.5);
    transform: translateY(-1px);
}
[data-theme="dark"] .chapter-body .related-appendices ul li a {
    background: rgba(125, 211, 252, 0.08);
    border-color: rgba(125, 211, 252, 0.24);
}
[data-theme="dark"] .chapter-body .related-appendices ul li a:hover {
    background: rgba(125, 211, 252, 0.2);
    border-color: rgba(125, 211, 252, 0.5);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .chapter-body .related-appendices { padding: 0.85rem 0.95rem 0.8rem; }
    .chapter-body .related-appendices ul li a { font-size: 0.78rem; padding: 0.2rem 0.55rem; }
}

/* ============================================================================
   PULL QUOTES (short blockquotes promoted to display-style emphasis)
   ============================================================================ */
.chapter-body blockquote.pullquote {
    border-left: none;
    padding: 1.4rem 1.4rem 1.4rem 2.6rem;
    margin: 2.2rem 0;
    position: relative;
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.4rem;
    line-height: 1.45;
    font-style: italic;
    color: inherit;
    background: linear-gradient(90deg,
        rgba(244, 184, 96, 0.06) 0%,
        rgba(244, 184, 96, 0) 70%);
}

.chapter-body blockquote.pullquote::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6rem;
    bottom: 0.6rem;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg,
        rgba(244, 184, 96, 0.85) 0%,
        rgba(167, 139, 250, 0.7) 100%);
}

.chapter-body blockquote.pullquote > p {
    margin: 0;
}

.chapter-body blockquote.pullquote em,
.chapter-body blockquote.pullquote i {
    font-style: italic;
}

[data-theme="light"] .chapter-body blockquote.pullquote {
    background: linear-gradient(90deg,
        rgba(180, 83, 9, 0.05) 0%,
        rgba(180, 83, 9, 0) 70%);
}
[data-theme="light"] .chapter-body blockquote.pullquote::before {
    background: linear-gradient(180deg,
        rgba(180, 83, 9, 0.7) 0%,
        rgba(124, 58, 237, 0.6) 100%);
}

@media (max-width: 640px) {
    .chapter-body blockquote.pullquote {
        font-size: 1.18rem;
        padding: 1.1rem 1.1rem 1.1rem 2rem;
        margin: 1.8rem 0;
    }
}

/* ============================================================================
   ANCHOR VERSE CALLOUTS: when one of THE SENTENCE's four anchor verses
   appears inline, frame the paragraph as a callout with a "n of 4" badge.
   ============================================================================ */
.chapter-body p.anchor-verse-callout {
    position: relative;
    margin: 1.8rem 0;
    padding: 1.15rem 1.3rem 1.15rem 1.4rem;
    border: 1px solid rgba(244, 184, 96, 0.4);
    border-radius: 12px;
    background: linear-gradient(180deg,
        rgba(244, 184, 96, 0.07) 0%,
        rgba(167, 139, 250, 0.03) 100%);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .chapter-body p.anchor-verse-callout {
    background: linear-gradient(180deg,
        rgba(244, 184, 96, 0.12) 0%,
        rgba(167, 139, 250, 0.05) 100%);
    border-color: rgba(180, 83, 9, 0.45);
}

.chapter-body .anchor-verse-badge {
    position: absolute;
    top: -0.65rem;
    right: 0.95rem;
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    background: linear-gradient(180deg, #f4b860 0%, #d97706 100%);
    color: #1a1a2e;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(244, 184, 96, 0.25);
}

.chapter-body .anchor-verse-badge-num {
    font-size: 0.78rem;
}

.chapter-body .anchor-verse-badge-of {
    opacity: 0.85;
}

@media (max-width: 640px) {
    .chapter-body p.anchor-verse-callout {
        padding: 1rem 1rem 1rem 1.05rem;
    }
}

/* ============================================================================
   NEXT-UP CARD: chapter end teaser linking to the next chapter.
   ============================================================================ */
.chapter-nextup-card,
.chapter-nextup-card:link,
.chapter-nextup-card:visited,
.chapter-nextup-card:hover,
.chapter-nextup-card:focus,
.chapter-nextup-card:active {
    color: var(--ch-text);
    text-decoration: none;
}
.chapter-nextup-card {
    display: block;
    margin: 2.4rem 0 1.6rem;
    padding: 1.4rem 1.6rem;
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 14px;
    background: linear-gradient(135deg,
        rgba(167, 139, 250, 0.07) 0%,
        rgba(244, 184, 96, 0.05) 100%);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.14);
}
.chapter-nextup-card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}
.chapter-nextup-card .chapter-nextup-title {
    color: var(--ch-heading);
}
.chapter-nextup-card .chapter-nextup-teaser {
    color: var(--ch-text);
}
[data-theme="light"] .chapter-nextup-card {
    border-color: rgba(124, 58, 237, 0.28);
    background: linear-gradient(135deg,
        rgba(124, 58, 237, 0.07) 0%,
        rgba(180, 83, 9, 0.05) 100%);
}

.chapter-nextup-eyebrow {
    display: block;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #a78bfa;
    margin-bottom: 0.45rem;
}
[data-theme="light"] .chapter-nextup-eyebrow {
    color: #7c3aed;
}

.chapter-nextup-title {
    display: block;
    font-family: var(--book-display-font, Georgia, serif);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.chapter-nextup-teaser {
    display: block;
    font-size: 1.02rem;
    line-height: 1.55;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.chapter-nextup-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--book-meta-font, "Helvetica Neue", sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: #f4b860;
    letter-spacing: 0.02em;
}
[data-theme="light"] .chapter-nextup-cta { color: #b45309; }
.chapter-nextup-card:hover .chapter-nextup-cta i {
    transform: translateX(3px);
    transition: transform 0.18s ease;
}

@media (max-width: 640px) {
    .chapter-nextup-card { padding: 1.1rem 1.15rem; margin: 1.8rem 0 1.2rem; }
    .chapter-nextup-title { font-size: 1.22rem; }
}
