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

:root {
    /* Colors */
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-50: #f9fafb;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-serif: 'Merriweather', Georgia, serif;

    /* Spacing */
    --section-padding: 120px 0;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 18px;
    line-height: 1.8;
    color: var(--gray-800);
    background-color: #fff;
    overflow-x: hidden;
}

/* ===== Progress Bar ===== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 10000;
    transition: width 0.1s ease;
}

/* ===== Fixed Map Container ===== */
.fixed-map-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
}

.map {
    width: 100%;
    height: 100%;
}

/* ===== Story Container ===== */
.story-container {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.story-section {
    pointer-events: all;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0;
}

/* ===== Title Section ===== */
.title-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%);
    color: white;
    text-align: center;
    padding: 100px 20px;
    pointer-events: all;
}

.title-content {
    max-width: 900px;
    margin: 0 auto;
}

.chapter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

.subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.intro-text {
    font-size: 1.25rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 3rem;
    opacity: 0.9;
}

.scroll-indicator {
    margin-top: 4rem;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.scroll-indicator p {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* ===== Chapter Headers ===== */
.chapter-header {
    text-align: center;
    margin-bottom: 4rem;
}

.chapter-number {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.chapter-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

/* ===== Narrative Content ===== */
.narrative-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 4rem 3rem;
    box-shadow: var(--shadow-xl);
}

.lead-paragraph {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--gray-700);
    margin-bottom: 2rem;
    font-weight: 300;
}

.narrative-content h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin: 3rem 0 1.5rem;
    line-height: 1.3;
}

.narrative-content h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 2rem 0 1rem;
}

.narrative-content h2 {
    margin-bottom: 1.5rem;
    color: rgba(0, 0, 0, 0.9)
}

.narrative-content p {
    margin-bottom: 1.5rem;
    color: var(--gray-700);
}

.narrative-content ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.narrative-content li {
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

/* ===== Stat Highlights ===== */
.stat-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    padding: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 1rem;
    color: white;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.stat-context {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    opacity: 0.8;
    font-style: italic;
}

.stat-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.stat-list li {
    padding: 1rem;
    background: var(--gray-50);
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    border-radius: 0.5rem;
}

.stat-list strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* ===== Image Blocks ===== */
.image-block {
    margin: 3rem 0;
}

.image-placeholder {
    width: 100%;
    margin-bottom: 1rem;
}

.image-caption {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-style: italic;
    text-align: center;
    padding: 0 2rem;
}

/* ===== Callout Boxes ===== */
.callout-box {
    background: var(--gray-50);
    border-left: 4px solid var(--primary-color);
    padding: 2rem;
    margin: 3rem 0;
    border-radius: 0.5rem;
}

.callout-box i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.callout-box h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.callout-box blockquote {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.8;
    font-style: italic;
    margin: 0;
    color: var(--gray-700);
}

.callout-box cite {
    display: block;
    margin-top: 1rem;
    font-size: 1rem;
    font-style: normal;
    color: var(--gray-600);
    font-weight: 600;
}

/* ===== Charts ===== */
.chart-container {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.chart-container h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--dark);
    text-align: center;
}

.chart-container canvas {
    max-height: 400px;
}

.chart-caption {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
    font-style: italic;
}

/* ===== Interactive Map Container ===== */
.interactive-map-container {
    margin: 3rem 0;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.map-controls {
    padding: 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-group label {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
}

.map-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-family: var(--font-primary);
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.map-select:hover {
    border-color: var(--primary-color);
}

.map-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.map-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 0.25rem;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.state-map {
    width: 100%;
    height: 500px;
    background: var(--gray-50);
}

.state-info-panel {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    min-height: 120px;
}

.info-prompt {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    margin: 0;
}

.state-info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.state-info-header {
    grid-column: 1 / -1;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
}

.state-info-header h4 {
    font-size: 1.5rem;
    color: var(--dark);
    margin: 0;
}

.info-stat {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

.info-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.info-stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Timeline ===== */
.timeline-block {
    margin: 3rem 0;
}

.timeline-block h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark);
}

.timeline-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 40px;
    bottom: -40px;
    width: 2px;
    background: var(--gray-300);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-year {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    height: fit-content;
}

.timeline-content h4 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.timeline-content p {
    color: var(--gray-700);
}

/* ===== Strategy Grid ===== */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.strategy-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.strategy-number {
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 6rem;
    font-weight: 900;
    color: rgba(37, 99, 235, 0.05);
    line-height: 1;
}

.strategy-card h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
    position: relative;
    z-index: 1;
}

.strategy-card p {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.strategy-card ul {
    position: relative;
    z-index: 1;
}

/* ===== Factor Breakdown ===== */
.factor-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.factor-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.factor-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.factor-icon i {
    font-size: 1.75rem;
    color: white;
}

.factor-card h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.factor-card p {
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* ===== Case Studies ===== */
.case-study {
    background: var(--gray-50);
    padding: 2rem;
    border-radius: 1rem;
    margin: 2rem 0;
    border-left: 4px solid var(--success-color);
}

.case-study h4 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 1rem;
}

.case-study strong {
    color: var(--success-color);
    font-weight: 700;
}

/* ===== Key Lessons ===== */
.key-lessons {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.key-lessons li {
    padding: 1.5rem;
    background: white;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.key-lessons strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* ===== Final Section ===== */
.final-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.closing-paragraph {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.9;
    color: var(--gray-800);
    margin: 2rem 0;
}

.final-callout {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border-radius: 1rem;
    margin: 4rem 0;
}

.final-callout h2 {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.final-callout p {
    font-size: 1.25rem;
    color: white;
}

.final-stats {
    margin: 3rem 0;
}

.final-stats h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

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

.progress-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
}

.progress-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.progress-label {
    display: block;
    color: var(--gray-700);
}

/* ===== Sources Section ===== */
.sources-section {
    background: var(--gray-900);
    color: white;
    padding: 80px 20px;
    pointer-events: all;
}

.sources-section h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

/* Override for h2 inside narrative-content within sources-section */
.sources-section .narrative-content h2 {
    color: var(--dark);
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.source-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.source-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.source-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.source-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.source-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.source-card a:hover {
    color: #60a5fa;
}

.methodology-text {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 1rem;
}

.methodology-text h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.methodology-text p {
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 1rem;
}

/* ===== Footer ===== */
.story-footer {
    background: var(--gray-900);
    color: white;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: all;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0.5rem 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .narrative-content {
        padding: 2rem 1.5rem;
    }

    .narrative-content h2 {
        color: var(--dark);
    }

    .main-title {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.5rem;
    }

    .timeline-item {
        grid-template-columns: 80px 1fr;
        gap: 1rem;
    }

    .timeline-item::before {
        left: 40px;
    }

    .timeline-year {
        font-size: 1.25rem;
    }

    .strategy-grid,
    .factor-breakdown {
        grid-template-columns: 1fr;
    }

    .stat-highlight {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .stat-number {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .narrative-content {
        padding: 1.5rem 1rem;
    }

    .narrative-content h2 {

        color: var(--dark);
    }

    .chapter-title {
        font-size: 2rem;
    }

    .lead-paragraph {
        font-size: 1.25rem;
    }
}