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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #fafafa;
}

/* Navigation */
nav {
    background: white;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: #059669;
}

/* Header */
.header {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    color: white;
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.header .subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.header .description {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.7;
}

/* Main Content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Section */
section {
    background: white;
    border-radius: 12px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

section h2 {
    font-size: 1.8rem;
    color: #0284c7;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #0284c7;
    display: block;
    width: fit-content;
    text-align: left;
}

section h3 {
    font-size: 1.2rem;
    color: #0369a1;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

section p {
    color: #334155;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

section p:last-child {
    margin-bottom: 0;
}

/* Lists */
section ul,
section ol {
    margin: 1rem 0 1.5rem 0;
    padding-left: 2rem;
    text-align: left;
}

section ul li,
section ol li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: #334155;
}

section ul li::marker {
    color: #0284c7;
}

section ol li::marker {
    color: #0284c7;
    font-weight: 600;
}

/* Links */
section a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
}

section a:hover {
    text-decoration: underline;
    color: #0ea5e9;
}

/* Codebook link callout */
.codebook-link {
    background: #e0f2fe;
    border-left: 4px solid #0284c7;
    padding: 1rem 1.5rem;
    margin: 0 0 2rem 0;
    border-radius: 8px;
}

.codebook-link strong {
    font-size: 1.1rem;
}

.codebook-link a {
    color: #0369a1;
    font-weight: 600;
}

/* Visualization blocks */
.viz-block {
    padding: 2.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.viz-block:first-child {
    padding-top: 0;
}

.viz-block:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.viz-block h3 {
    font-size: 1.4rem;
    color: #0369a1;
    margin-bottom: 1rem;
    font-weight: 600;
}

.chart-intro {
    color: #475569;
    line-height: 1.7;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.chart-wrapper {
    margin: 2rem auto;
    display: block;
    width: fit-content;
}

.fig-caption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
    text-align: center;
}

.fig-caption strong {
    font-weight: 600;
    color: #222;
    font-style: normal;
}

/* Chart grids */
#chartGridx2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0rem;
    margin: 2rem auto;
    justify-items: center;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Data sources section */
.data-sources {
    background: white;
}

.source-list p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #475569;
}

.source-list strong {
    color: #1e293b;
    display: block;
    margin-bottom: 0.25rem;
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    margin-top: 4rem;
}

footer a {
    color: #059669;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 968px) {
    #chartGridx2 {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    section {
        padding: 2rem;
    }

    .nav-menu {
        gap: 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }

    .fig-caption {
        font-size: 0.85rem;
    }

    .write-up-section h2,
    section h2 {
        font-size: 1.5rem;
    }
}