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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

:root {
    --spark-teal: #00A896;
    --harvard-red: #BC2037;
    --state-blue: #587C8D;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --white: #ffffff;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--spark-teal) 0%, var(--state-blue) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* TOC Nav – question-level links */
.nav-container {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
    gap: 0.25rem;
}

.nav-item {
    background: linear-gradient(135deg, var(--spark-teal) 0%, var(--state-blue) 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 5px rgba(0,0,0,0.15);
    border: none;
    white-space: nowrap;
}

.nav-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.18);
    background: linear-gradient(135deg, var(--harvard-red) 0%, var(--spark-teal) 100%);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--harvard-red) 0%, var(--state-blue) 100%);
    transform: translateY(-1px);
}



/* Content */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

section.section {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid var(--spark-teal);
    scroll-margin-top: 90px;
}

.section h2 {
    color: var(--dark-gray);
    font-size: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--spark-teal);
}

.section p {
    color: var(--state-blue);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

h3.subheading {
    color: var(--state-blue);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.visualization-frame {
    width: 100%;
    border: none;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: var(--light-gray);
}

/* Make viz slides fill most of the screen */
/* REMOVE fullscreen slide behavior */
.section-viz {
display: block;
min-height: auto;
}

.section-viz .visualization-frame {
height: 700px;
min-height: unset;
flex: unset;
}



/* Overview cards */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.overview-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-left: 4px solid var(--spark-teal);
    transition: transform 0.3s ease;
}

.overview-card:hover {
    transform: translateY(-5px);
}

.overview-card h3 {
    color: var(--harvard-red);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

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

/* Floating next chevron button */
.next-slide-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--spark-teal) 0%, var(--state-blue) 100%);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-slide-btn:hover {
    background: linear-gradient(135deg, var(--harvard-red) 0%, var(--spark-teal) 100%);
    transform: translateY(-1px);
}

/* Footer */
.footer {
    background: var(--dark-gray);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer p {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .nav {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .container {
        padding: 0 1rem;
    }

    section.section {
        padding: 1.5rem;
    }

    .section-viz {
        min-height: calc(100vh - 140px);
    }

    .section-viz .visualization-frame {
        min-height: 320px;
    }
}

.highlight {
    background: linear-gradient(120deg, var(--spark-teal) 0%, var(--harvard-red) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.badge {
    display: inline-block;
    background: var(--harvard-red);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Mobile/Desktop Content Control */
.mobile-only-content {
    display: none;
}

.desktop-only-content {
    display: block;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

/* Enhanced Navigation Scrollability */
.nav-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-container::-webkit-scrollbar {
    display: none;
}

.nav {
    min-width: max-content;
    flex-wrap: nowrap;
    gap: 0.5rem;
}

/* Mobile styles */
@media (max-width: 768px) {
    .mobile-only-content {
        display: block;
    }
    
    .desktop-only-content {
        display: none;
    }
    
    .mobile-only {
        display: inline-flex;
    }
    
    .desktop-only {
        display: none;
    }
    
    /* Enhanced mobile navigation */
    .nav {
        justify-content: flex-start;
        padding: 0.5rem 1rem;
    }
    
    .nav-item {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Mobile visualization optimizations */
    .mobile-viz .visualization-frame {
        height: 350px;
        min-height: 350px;
        min-width: 100%;
        border-radius: 8px;
    }
    
    .mobile-viz {
        margin-bottom: 1rem;
        padding: 1rem;
        scroll-margin-top: 70px;
        border-radius: 12px;
    }
    
    .mobile-viz h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
        color: var(--dark-gray);
    }
    
    .mobile-viz p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.5;
        color: var(--state-blue);
    }
    
    /* Hide overview cards for mobile-only questions on mobile */
    .overview-card[href="#q3"],
    .overview-card[href="#q4"],
    .overview-card[href="#q5"],
    .overview-card[href="#q8"] {
        display: none;
    }
}

@media (max-width: 480px) {
    .mobile-viz .visualization-frame {
        height: 300px;
        min-height: 300px;
    }
    
    .mobile-viz h2 {
        font-size: 1.1rem;
    }
    
    .mobile-viz p {
        font-size: 0.85rem;
    }
    
    .nav-item {
        font-size: 0.7rem;
        padding: 0.35rem 0.6rem;
    }
}

@media (max-width: 320px) {
    .mobile-viz .visualization-frame {
        height: 280px;
        min-height: 280px;
    }
    
    .nav-item {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }
}