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

:root {
    /* Primary Blue Palette */
    --color-primary: #1e40af;
    --color-primary-light: #3b82f6;
    --color-primary-lighter: #60a5fa;
    --color-primary-lightest: #dbeafe;
    --color-blue-medium: #2563eb;
    --color-blue-pale: #f0f9ff;
    
    /* Neutral Colors */
    --color-text-primary: #1f2937;
    --color-text-secondary: #4b5563;
    --color-text-tertiary: #64748b;
    --color-background: #ffffff;
    --color-surface: #f8fafc;
    --color-border: #e2e8f0;
    
    /* Accent Colors */
    --color-accent: #3b82f6;
    --color-accent-dark: #1e40af;
    --color-accent-light: #dbeafe;
    --color-growth: #10b981;
    --color-decline: #ef4444;
    --color-warning: #f59e0b;
    
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Montserrat', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 2px 12px rgba(30, 64, 175, 0.08);
    --shadow-md: 0 6px 24px rgba(30, 64, 175, 0.13);
    --shadow-lg: 0 16px 40px rgba(30, 64, 175, 0.18);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: #ffffff;
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* Page layout — sidenav column + scrollable content column */
.page-body {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
}

.page-content {
    flex: 1;
    min-width: 0; /* prevent flex children from overflowing */
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

.sidenav {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 60px;
    flex-shrink: 0;
    align-self: flex-start;
    background: linear-gradient(180deg, #0c1f4a 0%, #1e40af 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: width 250ms ease;
    z-index: 200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
}

/* On the hero page the blue gradient page background shows through,
   so a frosted glass effect works. Other pages use the solid gradient above. */
.hero-page .sidenav {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.sidenav:hover {
    width: 220px;
}


/* Brand logo at the top of the sidebar */
.sidenav-logo {
    display: flex;
    align-items: center;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 4px;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.sidenav-logo:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidenav-logo-mark {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 6px;
}

.sidenav-menu {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
}

.sidenav-link {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.sidenav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.sidenav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-right: 3px solid #60a5fa;
}

.sidenav-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidenav-icon svg {
    width: 20px;
    height: 20px;
}

.sidenav-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 14px;
    opacity: 0;
    transition: opacity 180ms ease 30ms;
}

.sidenav:hover .sidenav-label {
    opacity: 1;
}

.sidenav-social {
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidenav-social-link {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.sidenav-social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, #0f2d6b 0%, #1a4fa8 60%, #2563eb 100%);
    position: relative;
    z-index: 201;
    color: white;
    padding: 2.5rem var(--spacing-xl) 2rem;
    text-align: left;
    border-bottom: none;
}

.header-container {
    position: relative;
    z-index: 1;
}

.header-container h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 1.1;
}

.subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.4px;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(90deg, #1a3f8f 0%, #1e4db5 100%);
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(15, 45, 107, 0.3);
}

.navbar-container {
    padding: 0 var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing-lg);
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.3px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 2px solid #60a5fa;
    padding-bottom: 6px;
}

.nav-link.substack-btn {
    background: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.social-link:hover {
    background: rgba(96, 165, 250, 0.3);
    color: white;
    border-color: #60a5fa;
}

.social-icon {
    display: inline-block;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Main Dashboard Container - Three Column Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: calc(var(--spacing-lg) + 0.5rem);
    margin: var(--spacing-xl) 0;
    padding: 0 var(--spacing-xl);
}

.dashboard-container.two-col {
    grid-template-columns: 2fr 1fr;
}

.dashboard-column {
    display: flex;
    flex-direction: column;
}

.dashboard-widget {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    border: none;
    color: var(--color-text-primary);
}

.dashboard-widget:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
}

.widget-header h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.3px;
}

.last-updated {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: var(--spacing-lg);
}

.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0f2fe;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    margin-top: var(--spacing-md);
    color: #1e40af;
    font-size: 0.95rem;
}

#gdpChart {
    max-height: 400px;
}

.chart-legend {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    padding: var(--spacing-md);
    background: var(--color-surface);
    border-radius: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.growth {
    background-color: var(--color-growth);
}

.legend-color.decline {
    background-color: var(--color-decline);
}

.error-message {
    padding: var(--spacing-md);
    background-color: #fee2e2;
    border: 2px solid #fecaca;
    border-radius: 6px;
    color: #7f1d1d;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Sidebar */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    align-self: stretch;
}

.articles-widget {
    flex: 1;
    min-height: 0;
}

.sidebar-widget {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    border: none;
    color: var(--color-text-primary);
}

.sidebar-widget:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.sidebar-widget h3 {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Indicators Widget */
.indicators-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
}

.indicator-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 100%);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    box-shadow: 0 1px 6px rgba(30, 64, 175, 0.07);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    color: var(--color-text-primary);
}

.indicator-card:hover {
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.13);
    transform: translateY(-1px);
}

.indicator-card label {
    display: block;
    font-size: 0.75rem;
    color: #1f2937;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.indicator-card-text {
    display: flex;
    flex-direction: column;
}

.indicator-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-display);
    line-height: 1.2;
}

.indicator-period {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
}

/* Articles Widget */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.article-card {
    padding: var(--spacing-md);
    background: #f8fafc;
    border-radius: 12px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 6px rgba(30, 64, 175, 0.06);
    color: var(--color-text-primary);
}

.article-card:hover {
    background: #f0f7ff;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.12);
    transform: translateY(-1px);
}

.article-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: #dbeafe;
    color: #1e40af;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    margin-bottom: var(--spacing-xs);
}

.article-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
    line-height: 1.45;
}

.article-card p {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.sources-text {
    font-size: 0.9rem;
    color: var(--color-text-tertiary);
    line-height: 1.6;
}

/* Substack Column */
.substack-column {
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

.substack-widget {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.substack-heading-link {
    color: var(--color-primary);
    text-decoration: none;
}

.substack-heading-link:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
}

.substack-posts {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
}

.substack-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-tertiary);
    font-size: 0.9rem;
    padding: var(--spacing-sm) 0;
}

.substack-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.substack-post {
    padding: var(--spacing-sm);
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #FF6719;
    text-decoration: none;
    display: block;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.substack-post:hover {
    background: #fff7f3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.substack-post-date {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #FF6719;
    margin-bottom: 0.35rem;
}

.substack-post-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
}

.substack-error {
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    padding: var(--spacing-sm) 0;
    line-height: 1.5;
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #0f2d6b 0%, #1a4fa8 60%, #2563eb 100%);
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-top: var(--spacing-xl);
    font-size: 0.9rem;
    border-top: none;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.5rem;
    line-height: 1.65;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.site-footer a {
    color: #dbeafe;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.site-footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 2fr 1fr;
    }

    .substack-column {
        grid-column: 2 / 3;
        grid-row: 2;
    }
}

@media (max-width: 1024px) {
    .site-header {
        padding: 2.5rem var(--spacing-lg) 2rem;
    }

    .header-container h1 {
        font-size: 2rem;
    }

    .navbar-container {
        padding: 0 var(--spacing-lg);
    }

    .summary-top-row {
        padding: 0 var(--spacing-lg) var(--spacing-lg);
    }

    .dashboard-container {
        grid-template-columns: 1.5fr 1fr;
        gap: var(--spacing-md);
        padding: 0 var(--spacing-lg);
    }

    .substack-column {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .widget-header h2 {
        font-size: 1.5rem;
    }

    .indicators-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .summary-top-row {
        grid-template-columns: 1fr;
        padding: 0 var(--spacing-sm) var(--spacing-lg);
    }

    .dashboard-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: 0 var(--spacing-sm);
        margin: var(--spacing-lg) auto;
    }

    .header-container h1 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .widget-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .widget-header h2 {
        font-size: 1.3rem;
    }

    .chart-container {
        height: 300px;
    }

    .sidebar-widget h3 {
        font-size: 1.1rem;
    }

    .indicators-grid {
        grid-template-columns: 1fr;
    }

    .indicator-value {
        font-size: 1.5rem;
    }

    .dashboard-widget,
    .sidebar-widget {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .header-container h1 {
        font-size: 1.5rem;
    }

    .chart-legend {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: more) {
    .dashboard-widget,
    .sidebar-widget {
        border: 2px solid var(--color-primary);
    }

    .widget-header {
        border-bottom: 3px solid var(--color-primary);
    }
}

/* =====================================================
   ECONOMIC SNAPSHOT SECTION  (index.html only)
   ===================================================== */

.snapshot-section {
    padding: 0 var(--spacing-xl) var(--spacing-xl);
}

.snapshot-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--spacing-lg);
}

.snapshot-section-header h2 {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* "View Full Dashboard →" button — used at top and bottom of the section */
.snapshot-cta-btn {
    display: inline-block;
    background: var(--color-primary);
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1.3rem;
    border-radius: 24px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.snapshot-cta-btn:hover {
    background: var(--color-blue-medium);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}

/* Loading state shown while data is being fetched */
.snapshot-loading-overlay {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl) 0;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Bento free-form grid — panels use explicit placement above 900px */
.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 60px;
    gap: 14px;
    margin-bottom: var(--spacing-lg);
}

/* Explicit bento placement (desktop only — overridden by responsive rules below) */
@media (min-width: 901px) {
    /* Row 1: Inflation hero (left) + GDP wide bar chart (right) */
    .snap-inflation    { grid-column: 1 / 6;   grid-row: 1 / 9;  }
    .snap-gdp          { grid-column: 6 / 13;  grid-row: 1 / 5;  }
    /* Row 2: Wages + LFPR fill under GDP */
    .snap-wages        { grid-column: 6 / 10;  grid-row: 5 / 9;  }
    .snap-lfpr         { grid-column: 10 / 13; grid-row: 5 / 9;  }
    /* Blurb break: CPI insight (left) + LFPR insight (right) */
    .snap-blurb-cpi    { grid-column: 1 / 7;   grid-row: 9 / 13; }
    .snap-blurb-lfpr   { grid-column: 7 / 13;  grid-row: 9 / 13; }
    /* Full-width yield curve banner */
    .snap-yield        { grid-column: 1 / 13;  grid-row: 13 / 17;}
    /* Middle band: Fed, Real Yield, CAPE */
    .snap-fed          { grid-column: 1 / 4;   grid-row: 17 / 22;}
    .snap-realyield    { grid-column: 4 / 8;   grid-row: 17 / 22;}
    .snap-cape         { grid-column: 8 / 13;  grid-row: 17 / 22;}
    /* Blurb break: DXY insight full-width */
    .snap-blurb-dxy    { grid-column: 1 / 13;  grid-row: 22 / 25;}
    /* Bottom band: DXY, Credit Spreads, Debt Service */
    .snap-dxy          { grid-column: 1 / 5;   grid-row: 25 / 29;}
    .snap-creditspreads{ grid-column: 5 / 9;   grid-row: 25 / 29;}
    .snap-debtservice  { grid-column: 9 / 13;  grid-row: 25 / 29;}
}

/* Panel insight blurbs — dark blue text cards that break up the chart grid */
.snap-blurb {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    border-radius: 14px;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.blurb-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.65rem;
}

.blurb-text {
    font-size: 0.92rem;
    color: #ffffff;
    line-height: 1.7;
}

.blurb-loading {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Time-range toggle (GDP panel) */
.range-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: var(--spacing-sm);
}

.range-btn {
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1.8;
}

.range-btn:hover { background: #e2e8f0; color: var(--color-text-primary); }

.range-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Accent tile — blue decorative card */
.snap-accent {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    justify-content: center;
}
.snap-accent .panel-title         { color: rgba(255, 255, 255, 0.65); }
.snap-accent .panel-latest-value  { color: #ffffff; font-size: 2rem; }
.snap-accent .panel-updated       { color: rgba(255, 255, 255, 0.55); line-height: 1.6; }

/* Individual chart panel card */
.snapshot-panel {
    background: #ffffff;
    border-radius: 14px;
    border: none;
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.snapshot-panel:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Small uppercase label above the big number */
.panel-title {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-text-secondary);
    margin-bottom: 0.2rem;
}

/* The headline value (e.g. "3.2% CPI") shown prominently */
.panel-latest-value {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
    margin-bottom: 0.15rem;
}

/* "Last updated: Jan '24" in small gray text */
.panel-updated {
    font-size: 0.72rem;
    color: var(--color-text-tertiary);
    margin-bottom: var(--spacing-sm);
}

/* Constrained height wrapper — chart fills this via responsive: true */
.panel-chart-wrap {
    position: relative;
    flex: 1;
    min-height: 80px;
    height: auto;
}

/* AI-generated written summary card — feature article treatment */
.snapshot-summary-block {
    background: #ffffff;
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
}

.snapshot-summary-block h3 {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--spacing-sm);
}

/* Two-column reading layout for the summary text on desktop */
.summary-text {
    font-size: 0.92rem;
    color: var(--color-text-primary);
    line-height: 1.82;
    columns: 2;
    column-gap: var(--spacing-xl);
}

.summary-text p + p {
    margin-top: var(--spacing-sm);
}

.summary-loading-placeholder {
    color: var(--color-text-tertiary);
    font-style: italic;
}

/* Collapsible wrapper */
.summary-collapsible {
    position: relative;
    overflow: hidden;
    transition: max-height 0.45s ease;
}

/* Fade gradient fades out the text bottom in collapsed state */
.summary-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #ffffff);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.summary-collapsible.expanded .summary-fade {
    opacity: 0;
}

/* Expand / collapse toggle button */
.summary-toggle-btn {
    display: block;
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: 0.6rem var(--spacing-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.2px;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.summary-toggle-btn:hover {
    background: #e8f0fe;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.12);
    transform: translateY(-1px);
}

.summary-month {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
}

.summary-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    flex-wrap: wrap;
}

.summary-meta {
    font-size: 0.78rem;
    color: var(--color-text-tertiary);
    margin: 0;
}

.summary-archive-link {
    flex-shrink: 0;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

/* Bottom CTA row */
.snapshot-footer-cta {
    display: flex;
    justify-content: center;
    padding-bottom: var(--spacing-sm);
}

/* ── Snapshot responsive breakpoints ─────────────────────────────── */

@media (max-width: 900px) {
    .snapshot-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
    }
    /* Reset all explicit bento placement — let panels stack naturally */
    .snapshot-grid .snapshot-panel {
        grid-column: auto;
        grid-row: auto;
    }
    .snap-inflation,
    .snap-gdp,
    .snap-yield,
    .snap-blurb-cpi,
    .snap-blurb-lfpr,
    .snap-blurb-dxy {
        grid-column: span 2;
    }
    .panel-chart-wrap {
        height: 180px;
    }
}

@media (max-width: 600px) {
    .snapshot-grid {
        grid-template-columns: 1fr;
    }
    .snap-inflation,
    .snap-gdp,
    .snap-yield,
    .snap-blurb-cpi,
    .snap-blurb-lfpr,
    .snap-blurb-dxy {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .snapshot-section {
        padding: 0 var(--spacing-lg) var(--spacing-xl);
    }

    .snapshot-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .summary-text {
        columns: 1;
    }
}

@media (max-width: 640px) {
    .snapshot-section {
        padding: 0 var(--spacing-sm) var(--spacing-xl);
    }
}

/* =====================================================
   HERO SECTION  (index.html only — .hero-page on body)
   ===================================================== */

.hero {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    z-index: 300;
    /* No background here — body.hero-page supplies the gradient so the canvas
       (which sits between body and hero in the z-stack) shows through. */
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    pointer-events: none;
    will-change: clip-path;
}

/* Persistent animated line background.
   Moved outside .hero so it is NOT clipped or faded as the hero scrolls away.
   z-index: 0 keeps it above the body gradient but below all page content. */
.hero-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-left: calc(60px + 2.5rem);
    pointer-events: none;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.05;
    letter-spacing: -1px;
    white-space: nowrap;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    transform-origin: left center;
    will-change: transform;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.78);
    margin-top: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.hero-disclaimer {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(640px, 80%);
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.38);
    pointer-events: none;
    z-index: 2;
}

.hero-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(255, 255, 255, 0.45);
    animation: scrollHintBounce 2s ease-in-out infinite;
    pointer-events: none;
}

.hero-scroll-hint svg {
    display: block;
    width: 30px;
    height: 30px;
}

@keyframes scrollHintBounce {
    0%, 100% { transform: translateX(-50%) translateY(0);   }
    50%       { transform: translateX(-50%) translateY(8px); }
}

.hero-spacer {
    height: 100vh;
    pointer-events: none;
    flex-shrink: 0;
}

/* On the home page the sidenav starts hidden and fades in as the hero
   collapses. z-index stays below the hero (300) so the hero covers it. */
.hero-page .sidenav {
    opacity: 0;
    pointer-events: none;
}

/* Top row: AI summary (left, wide) + Substack column (right) */
.summary-top-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    padding: 0 var(--spacing-xl) var(--spacing-lg);
    align-items: start;
}

/* Extra breathing room between the sticky header and the first content row */
.hero-page .summary-top-row {
    margin-top: calc(var(--spacing-xl) + var(--spacing-md));
}

.hero-page .dashboard-container {
    margin-top: 0;
}

/* ─── Blue page background (index.html only) ────────────────────────────────
   Makes the page background match the hero so the scroll transition is
   seamless instead of hitting a harsh white edge. White cards float on top.
   Scoped to .hero-page so other pages are unaffected until we roll it out.  */

body.hero-page {
    /* Rich multi-stop gradient fixed to the viewport — same colours under the
       hero as the hero itself (no seam), with more contrast between dark and
       light stops so the page feels less monotone. */
    background: linear-gradient(
        135deg,
        #020c1b 0%,
        #0c1f4a 18%,
        #0f2d6b 36%,
        #1a4fa8 54%,
        #1e40af 70%,
        #2563eb 84%,
        #1d4ed8 100%
    );
    background-attachment: fixed;
}

/* iOS Safari doesn't support background-attachment:fixed reliably */
@media (max-width: 768px) {
    body.hero-page {
        background: linear-gradient(160deg, #020c1b 0%, #0f2d6b 40%, #2563eb 100%);
        background-attachment: scroll;
    }
}

/* Section header sitting directly on the blue background needs white text */
body.hero-page .snapshot-section-header h2 {
    color: #ffffff;
}

body.hero-page .snapshot-section-header {
    border-bottom-color: rgba(255, 255, 255, 0.18);
}

/* Loading spinner text on blue */
body.hero-page .snapshot-loading-overlay {
    color: rgba(255, 255, 255, 0.75);
}

/* CTA buttons placed directly on the blue background (section header + bottom)
   get a glass style so they stand out without clashing */
body.hero-page .snapshot-section-header .snapshot-cta-btn,
body.hero-page .snapshot-footer-cta .snapshot-cta-btn {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.38);
    color: #ffffff;
}

body.hero-page .snapshot-section-header .snapshot-cta-btn:hover,
body.hero-page .snapshot-footer-cta .snapshot-cta-btn:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

/* Add top breathing room before the Economic Snapshot section on blue */
body.hero-page .snapshot-section {
    padding-top: var(--spacing-xl);
}

/* Lift content sections above the canvas (z-index: 0) so white cards cover it.
   Transparent gaps between cards will still show the canvas through. */
body.hero-page .summary-top-row,
body.hero-page .dashboard-container,
body.hero-page .snapshot-section {
    position: relative;
    z-index: 1;
}

/* Footer also above canvas */
body.hero-page .site-footer {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .hero-content {
        padding-left: calc(60px + 1.25rem);
    }
    .hero-title {
        white-space: normal;
        letter-spacing: -0.5px;
    }
}

/* ========================================
   MOBILE BOTTOM NAVIGATION
   Hidden on desktop — shown at ≤ 768px
   ======================================== */

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {

    /* Hide the sidebar entirely on mobile */
    .sidenav {
        display: none;
    }

    /* Fixed bottom tab bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 500;
        background: linear-gradient(180deg, #0c1f4a 0%, #1e40af 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.3);
        /* Respect iPhone home-indicator safe area */
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 4px 8px;
        color: rgba(255, 255, 255, 0.55);
        text-decoration: none;
        gap: 3px;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease;
        min-width: 0;
    }

    .mobile-nav-item.active {
        color: #ffffff;
    }

    .mobile-nav-item svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }

    .mobile-nav-label {
        font-size: 0.58rem;
        font-weight: 600;
        text-align: center;
        white-space: nowrap;
        letter-spacing: 0.2px;
    }

    /* Prevent page content from hiding behind the fixed nav bar */
    .page-content {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    /* Remove the sidebar left-offset from the hero — sidebar is gone on mobile */
    .hero-content {
        padding-left: var(--spacing-lg);
    }

    /* Fit the title on a phone screen */
    .hero-title {
        font-size: 3rem;
    }
}

