:root {
    --bg: #000000;
    --surface: #000000;
    --surface-muted: #000000;
    --border: rgba(255, 255, 255, 0.25);
    --text-primary: #ffffff;
    --text-muted: #f5f5f5;
    --accent: #1ca350;
    --accent-hover: #29b675;
    --shadow: 0 25px 75px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 35px 100px rgba(0, 0, 0, 0.7);
    font-family: 'Lato', sans-serif;
    --font-heading: 'Instrument Sans', sans-serif;
    --font-body: 'Lato', sans-serif;
    line-height: 1.6;
    color-scheme: dark;
}

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

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text-primary);
}

nav {
    position: sticky;
    top: 1rem;
    z-index: 50;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem clamp(1.5rem, 4vw, 3.5rem);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 999px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav img.nav-logo {
    height: 22px;
    width: auto;
    display: block;
    object-fit: contain;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    justify-content: flex-end;
}

nav a {
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.data-page {
    padding-bottom: 4rem;
}

.stats-section {
    background: linear-gradient(135deg, rgba(14, 18, 15, 0.4) 0%, rgba(8, 9, 9, 0.2) 100%);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(28, 163, 80, 0.08);
    border: 1px solid rgba(28, 163, 80, 0.2);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(28, 163, 80, 0.12);
    border-color: rgba(28, 163, 80, 0.4);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    min-width: 50px;
    text-align: center;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    color: var(--accent);
    word-break: break-word;
}

.stat-unit {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

section {
    padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3.5rem);
    max-width: 1200px;
    margin: 0 auto;
}

.data-hero {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.data-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.35rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.data-hero p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.sheet-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.sheet-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    background: #06120c;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sheet-link:hover {
    border-color: var(--accent-hover);
    background: rgba(83, 209, 137, 0.3);
}

.table-section + .table-section {
    margin-top: 3rem;
    padding-top: 1rem;
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--accent);
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3vw, 2.3rem);
    font-weight: 700;
}

.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.table-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.table-scroll {
    max-height: 70vh;
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.table-section table {
    width: max(100%, 900px);
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-section thead {
    position: sticky;
    top: 0;
    background: rgba(3, 7, 18, 0.95);
    backdrop-filter: blur(8px);
    z-index: 5;
}

.table-section th,
.table-section td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    text-align: left;
}

.table-section th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.table-section tbody tr:hover {
    background: rgba(148, 163, 184, 0.08);
}

.table-section tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, 0.04);
}

.loader {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.methodology-footer {
    padding: clamp(4rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem);
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4rem;
    align-items: start;
}

.footer-logo {
    display: flex;
    align-items: flex-start;
}

.footer-logo-img {
    height: 24px;
    width: auto;
    margin-top: 10px;
}

.footer-methodology {
    text-align: left;
}

.footer-methodology h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-methodology p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 800px;
    line-height: 1.7;
}

.methodology-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.methodology-link:hover {
    color: var(--accent-hover);
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.viz-iframe {
    width: 100%;
    border: none;
}

@media (max-width: 768px) {
    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    .table-card {
        padding: 1.5rem;
    }

    .viz-item {
        padding: 1.25rem;
    }

    .viz-embed iframe {
        min-height: 480px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        min-width: auto;
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
}

.page-info {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 100px;
    text-align: center;
}
