/* Global Reset & Theme Variables */
:root {
    --bg-dark: #070a13;
    --bg-dark-secondary: #0d1222;
    --card-bg: rgba(15, 22, 42, 0.75);
    --card-border: rgba(56, 189, 248, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    
    --accent: #e0a96d;
    --accent-glow: rgba(224, 169, 109, 0.4);
    --cyan: #38bdf8;
    --cyan-glow: rgba(56, 189, 248, 0.4);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-serif: 'EB Garamond', Georgia, serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

body {
    position: relative;
    min-height: 100vh;
}

/* Background Canvas */
#agent-network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #0c1428 0%, var(--bg-dark) 100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Header & Navigation */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(7, 10, 19, 0.7);
    transition: var(--transition-smooth);
}

.app-header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.logo-icon-wrapper {
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo:hover .logo-icon-wrapper {
    transform: rotate(-10deg) scale(1.1);
}

.logo-bold {
    font-weight: 800;
    color: var(--cyan);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
    padding: 0.25rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cyan);
    transition: var(--transition-smooth);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

.btn-primary {
    background: #0d3b66;
    color: var(--text-primary);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background: #124c82;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #c68b4c 100%);
    color: #2c1d0f;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 169, 109, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    border-radius: 8px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition-smooth);
}

.btn-text:hover {
    color: var(--text-primary);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px var(--accent-glow); }
    50% { transform: scale(1.02); box-shadow: 0 4px 22px rgba(224, 169, 109, 0.7); }
    100% { transform: scale(1); box-shadow: 0 4px 15px var(--accent-glow); }
}

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

/* Hero Section */
.hero-section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 8.5rem 2rem 4rem 2rem;
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.rating-badge-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.stars-gold {
    color: var(--accent);
    letter-spacing: 2px;
    font-size: 0.85rem;
}

.rating-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--cyan);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}

.highlight-text {
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 540px;
}

.hero-subtitle em {
    color: var(--text-primary);
    font-style: normal;
}

.hero-cta-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.amazon-disclaimer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.amazon-badge-icon {
    color: #ff9900;
}

/* 3D Book Cover Recreations */
.hero-visual-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-book-perspective {
    perspective: 1500px;
    padding: 2rem;
}

.book-3d-closed {
    width: 280px;
    height: 410px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-26deg) rotateX(12deg) rotateZ(-2deg);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-3d-closed:hover {
    transform: rotateY(-8deg) rotateX(8deg) rotateZ(0deg) scale(1.03);
}

.book-3d-side {
    position: absolute;
    height: 100%;
}

.book-3d-front {
    width: 100%;
    left: 0;
    top: 0;
    transform: translateZ(12px);
    z-index: 5;
    transform-style: preserve-3d;
}

.book-3d-back {
    width: 100%;
    left: 0;
    top: 0;
    background: #090e15;
    border-radius: 2px 10px 10px 2px;
    transform: translateZ(-12px);
    box-shadow: 12px 15px 35px rgba(0, 0, 0, 0.65);
    z-index: 1;
}

.book-3d-spine {
    width: 24px;
    left: -12px;
    top: 0;
    background: linear-gradient(90deg, #090f17 0%, #172435 50%, #090f17 100%);
    transform: rotateY(-90deg);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spine-text {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    letter-spacing: 2px;
    white-space: nowrap;
}

.book-3d-pages {
    width: 268px; /* Slightly shorter than book width */
    left: 8px;
    top: 5px;
    height: 400px;
    background: linear-gradient(90deg, #f5ecd7 0%, #e8dec9 100%);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    transform: translateZ(-11px);
    border-radius: 0 8px 8px 0;
    z-index: 3;
    border-right: 2px solid #ccc1aa;
    border-top: 1px solid #d4c8b0;
    border-bottom: 2px solid #b8ab92;
    /* Create lines to look like pages */
    background-image: linear-gradient(rgba(0,0,0,0.04) 50%, transparent 50%);
    background-size: 100% 4px;
}

/* Beautiful Cover Artwork CSS */
.real-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #0b1320 0%, #152238 100%);
    border-radius: 3px 10px 10px 3px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset -4px 0 10px rgba(0,0,0,0.4);
    padding: 30px 24px;
    position: relative;
    overflow: hidden;
}

.cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 8;
    border-radius: inherit;
    pointer-events: none;
}

.cover-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(56, 189, 248, 0.15);
    padding: 20px 15px;
    border-radius: 6px;
    position: relative;
}

.cover-glow-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.cover-top-line {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--text-primary);
    text-align: center;
}

.cover-main-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
    text-align: center;
    letter-spacing: -0.5px;
    margin-top: 10px;
}

.cover-main-title .light-title {
    font-weight: 300;
    color: var(--cyan);
}

.cover-subtitle {
    font-family: var(--font-sans);
    font-size: 0.55rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 1.2px;
    color: var(--cyan);
    text-align: center;
    margin-top: 12px;
    padding: 0 5px;
}

.cover-network-graphic {
    width: 100%;
    height: 160px;
    position: relative;
    margin: 10px 0;
}

.cover-network-graphic.mini {
    height: 120px;
    margin: 5px 0;
}

.cover-author-name {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-primary);
    text-align: center;
}

/* Pulsing Node in SVG cover graphic */
@keyframes nodePulse {
    0% { r: 6px; fill: var(--accent); opacity: 0.8; }
    50% { r: 9px; fill: #f5cc9c; opacity: 1; }
    100% { r: 6px; fill: var(--accent); opacity: 0.8; }
}

.pulsing-node {
    animation: nodePulse 2.5s infinite ease-in-out;
}

/* Scroll Pinned Interactive Section */
.scroll-anim-container {
    position: relative;
    height: 400vh; /* Scroll length for the timeline */
    z-index: 2;
}

.scroll-sticky-element {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Spreads out title, book, and dots to fit viewport height */
    align-items: center;
    padding: 5.5vh 2rem 2vh 2rem; /* Dynamic paddings based on screen height */
    overflow: hidden;
    background: radial-gradient(circle at center, #0e162b 0%, var(--bg-dark) 100%);
}

.scroll-section-header {
    text-align: center;
    margin-bottom: 0;
    transition: opacity 0.5s ease;
    height: 12vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.matters-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.8vh, 2.3rem); /* Dynamically sized title to fit height */
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.matters-subtitle {
    font-size: clamp(0.8rem, 1.6vh, 0.95rem); /* Dynamically scaled subtitle */
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.scroll-3d-book-view {
    perspective: 1600px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.book-viewport {
    position: relative;
    width: 1100px;
    height: 800px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-open {
    position: relative;
    width: 1050px;
    height: 765px;
    transform-style: preserve-3d;
    transform: rotateX(15deg) rotateY(0deg) rotateZ(0deg) scale(0.95);
    transition: transform 0.1s linear;
}

.book-spine-mid {
    position: absolute;
    width: 12px;
    height: 100%;
    left: calc(50% - 6px);
    top: 0;
    background: linear-gradient(90deg, #070b10 0%, #1b202c 50%, #070b10 100%);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transform: translateZ(2px);
    z-index: 20;
}

.book-cover-left,
.book-cover-right {
    position: absolute;
    width: calc(50% + 4px);
    height: calc(100% + 8px);
    top: -4px;
    background: #0b1320;
    border: 1px solid rgba(255,255,255,0.05);
    z-index: 1;
}

.book-cover-left {
    right: 50%;
    border-radius: 6px 0 0 6px;
    transform-origin: right center;
    box-shadow: -15px 15px 30px rgba(0, 0, 0, 0.7);
    border-right: none;
}

.book-cover-right {
    left: 50%;
    border-radius: 0 6px 6px 0;
    transform-origin: left center;
    box-shadow: 15px 15px 30px rgba(0, 0, 0, 0.7);
    border-left: none;
}

.left-cover-inside,
.right-cover-inside {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #090e16 0%, #152238 100%);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
    position: relative;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--text-secondary);
}

.left-cover-inside {
    border-radius: 5px 0 0 5px;
    align-items: center;
    text-align: center;
}

.right-cover-inside {
    border-radius: 0 5px 5px 0;
    align-items: flex-start;
}

.inside-cover-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.inside-cover-logo h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.inside-cover-logo p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cta-back-cover {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cta-back-cover h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
}

.cta-back-cover p {
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cta-back-cover .btn {
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

/* Flipping Page Layers */
.book-flipping-page {
    position: absolute;
    width: calc(50% + 4px);
    height: calc(100% + 8px);
    top: -4px;
    left: 50%;
    transform-style: preserve-3d;
    transform-origin: left center;
    z-index: 10;
    will-change: transform;
}

.page-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: #faf8f3;
    color: var(--text-dark);
    padding: 45px 40px;
    box-shadow: inset 4px 0 15px rgba(0,0,0,0.06);
    border: 1px solid #e3decb;
}

.page-face-front {
    z-index: 2;
    transform: rotateY(0deg);
    border-radius: 0 4px 4px 0;
}

.page-face-back {
    z-index: 1;
    transform: rotateY(180deg);
    border-radius: 4px 0 0 4px;
    box-shadow: inset -4px 0 15px rgba(0,0,0,0.06);
    border-right: none;
}

/* Page inner styles (E-Book typography) */
.page-inner-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    font-family: var(--font-serif);
}

.page-content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.page-content-wrapper.center-content {
    flex-grow: 1;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.page-inner-content.center-aligned {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.chapter-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.page-heading {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 10px;
}

.page-text {
    font-size: 1.05rem;
    line-height: 1.4;
    color: #1e293b;
    font-weight: 500;
    margin-bottom: 15px;
}

.page-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.page-list li {
    font-size: 0.98rem;
    line-height: 1.3;
    color: #1e293b;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.page-list li span {
    color: var(--accent);
    font-size: 0.75rem;
    margin-top: 2px;
}

.page-footer-num {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    font-family: var(--font-sans);
}

.page-inner-content.center-aligned blockquote {
    font-size: 1.55rem;
    font-style: italic;
    line-height: 1.4;
    color: #1e293b;
    margin: 15px 0;
    max-width: 280px;
}

.page-quote-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.book-pulse-word {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--cyan);
    background: linear-gradient(135deg, #0d3b66 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.book-pulse-desc {
    font-size: 1rem;
    color: #475569;
    max-width: 200px;
    line-height: 1.4;
}

.divider {
    width: 60px;
    height: 1px;
    background: #e2ddcf;
    margin: 20px 0;
}

.inside-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.55rem;
    letter-spacing: 1px;
}

.inside-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.inside-author {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 2px;
}

/* Front Cover art wrapping */
.book-front-cover-art {
    padding: 0;
    border: none;
}
.book-front-cover-art .real-cover {
    border-radius: 0 6px 6px 0;
}

/* Z-indexing order for book stacks */
#flippable-cover { 
    z-index: 14; 
}
#flippable-page-1 { z-index: 13; }
#flippable-page-2 { z-index: 12; }
#flippable-page-3 { z-index: 11; }

/* Scroll progress indicator dots */
.scroll-progress-dots {
    display: flex;
    gap: 2rem;
    margin-top: clamp(0.5rem, 1.5vh, 2rem); /* Dynamic margins for progress dots */
    z-index: 100;
    height: 5vh;
    align-items: center;
}

.progress-dot {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding-bottom: 5px;
    transition: var(--transition-smooth);
}

.progress-dot::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition-smooth);
}

.progress-dot.active {
    color: var(--cyan);
}

.progress-dot.active::after {
    background: var(--cyan);
    width: 20px;
    border-radius: 3px;
    height: 4px;
}

/* Meet the Author Section */
.author-section {
    position: relative;
    z-index: 2;
    padding: 8rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.author-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 16px;
    padding: 3.5rem;
    backdrop-filter: blur(8px);
}

.author-image-wrapper {
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--cyan);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
    background: #101625;
}

.author-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.section-tag {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--cyan);
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    display: block;
}

.section-tag.center {
    text-align: center;
}

.author-name {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.author-desc-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.author-socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-link {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cyan);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.social-link:hover {
    color: var(--accent);
}

/* Testimonials / Reviews Section */
.testimonials-section {
    position: relative;
    z-index: 2;
    padding: 6rem 2rem 10rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.testimonials-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.testimonial-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.08);
}

.card-stars {
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.testimonial-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
}

.testimonial-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info strong {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-primary);
}

.user-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Footer Section */
.app-footer {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: #04060c;
    padding: 3rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

/* Reader Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.preview-modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 12, 0.85);
    backdrop-filter: blur(8px);
}

.modal-window {
    position: relative;
    z-index: 1010;
    width: 90%;
    max-width: 700px;
    height: 80%;
    max-height: 600px;
    background: #fbf9f4;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(40px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-modal.open .modal-window {
    transform: translateY(0) scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #475569;
    cursor: pointer;
    z-index: 1020;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #0f172a;
}

.modal-body {
    flex-grow: 1;
    padding: 3rem;
    overflow-y: auto;
    color: var(--text-dark);
}

.sample-book-reader {
    font-family: var(--font-serif);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.reader-header {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid #e2ddcf;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.sample-book-reader h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 1.5rem;
}

.dropcap {
    float: left;
    font-size: 4rem;
    line-height: 0.8;
    padding-top: 4px;
    padding-right: 8px;
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--accent);
}

.reader-paragraph-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 1.5rem;
}

.reader-footer {
    border-top: 1px solid #e2ddcf;
    padding-top: 1.5rem;
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive Styles */
/* Height-based scaling first, so narrow-width phone rules below can override it */
@media (max-height: 850px) {
    .book-viewport {
        transform: scale(0.85);
    }
}

@media (max-height: 750px) {
    .book-viewport {
        transform: scale(0.72);
    }
}

@media (max-height: 650px) {
    .book-viewport {
        transform: scale(0.60);
    }
}

@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-text-content {
        align-items: center;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-subtitle {
        max-width: 600px;
    }
    
    .author-container {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 2.5rem;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .book-viewport {
        transform: scale(0.8);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .app-header {
        position: absolute;
    }
    
    .nav-links {
        display: none; /* Hide nav links on small screens */
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-cta-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    
    .hero-cta-group .btn,
    .hero-cta-group .btn-text {
        width: 100%;
        text-align: center;
    }
    
    /* Shrink the reserved layout height (transform: scale doesn't shrink the
       layout box) so the book sits closer below the title without a big gap,
       while staying centered and fully visible. */
    .book-viewport {
        transform: scale(0.62);
        height: 600px;
    }

    .scroll-sticky-element {
        padding-top: 3rem;
        justify-content: center;
        gap: 2rem;
    }
    
    .matters-title {
        font-size: 1.8rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 650px) {
    .book-viewport {
        transform: scale(0.5);
        height: 520px;
    }
}

@media (max-width: 480px) {
    .book-viewport {
        transform: scale(0.38);
        height: 420px;
    }
    .scroll-progress-dots {
        gap: 1rem;
    }
    .progress-dot {
        font-size: 0.7rem;
    }
    .author-container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 420px) {
    .book-viewport {
        transform: scale(0.32);
        height: 380px;
    }
}

@media (max-width: 360px) {
    .book-viewport {
        transform: scale(0.28);
        height: 330px;
    }
}
