/* Import Fonts: Inter for high-tech UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

/*:root {
    --bg-base: #121417;        
    --surface-color: #1C1F24; 
    --text-main: #F4F4F5;
    --text-muted: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent: #E4E4E7;        
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
*/

:root {
    --bg-base: #333333;        /* Lighter Substack Dark Gray */
    --surface-color: #2A2A2A;  /* Slightly lighter gray to make the cards pop */
    --text-main: #F4F4F5;
    --text-muted: #9CA3AF;
    --border-color: rgba(255, 255, 255, 0.08);
    --accent: #FF6719;         /* Substack Orange */
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography & Headers */
h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--text-main);
}

h2 {
    font-size: 1.1rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 1rem;
}

.kicker {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.5rem;
    padding: 0.3rem 0.8rem;
    border-left: 2px solid var(--accent);
    background: rgba(255, 255, 255, 0.03);
}

/* Navigation */
.nav-container {
    display: flex;
    justify-content: center;
    padding: 2rem 5%;
    background-color: rgba(51, 51, 51, 0.75);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-links a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Dashboard Layout */
.dashboard {
    padding: 0 1.5rem 8rem;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

/* Containers & Cards */
.chart-card, .metric-card, .architecture-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Technical sharp edges */
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart-card:hover, .architecture-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: #222222;
}

.chart-card {
    padding: 3rem 2rem;
    min-height: auto;
    position: relative;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.metric-card {
    padding: 2.5rem;
    text-align: left;
}

.metric-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

/* Labels and Metadata */
.update-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 2rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* -----------------------------------------------------------
   DATAWRAPPER PAYWALL HACK 
   Matches white-background charts to Stealth Gray theme
   ----------------------------------------------------------- */
.chart-card iframe {
    /* Invert(0.9) turns white to dark gray.
       Hue-rotate(180deg) restores blue colors.
       Brightness/Contrast ensures text remains crisp.
    */
    filter: invert(0.9) hue-rotate(180deg) brightness(1.2) contrast(0.9);
    mix-blend-mode: screen;
    opacity: 0.95;
    transition: opacity 0.3s ease;
}

.chart-card iframe:hover {
    opacity: 1;
}

/* Responsive Fixes */
/* Responsive Fixes & Mobile Typography Optimization */
@media (max-width: 768px) {
    /* Layout Spacing */
    .dashboard { 
        padding: 0 1rem 6rem; 
        gap: 3rem; 
    }
    .chart-card { 
        padding: 1.5rem 1rem 3.5rem 1rem; 
    }
    .metric-card { 
        padding: 1.5rem; 
    }

    /* Headers & Kicker */
    h1 { 
        font-size: 2.2rem; 
    }
    h2 { 
        font-size: 1rem; /* Increased readability */
        margin-bottom: 2rem; 
        line-height: 1.4;
    }
    .kicker { 
        font-size: 0.8rem; /* Increased from 0.7rem */
        margin-bottom: 1rem;
    }

    /* Navigation Menu */
    .nav-container { 
        padding: 1rem; 
    }
    .nav-links { 
        display: flex;
        flex-wrap: wrap; /* Allows links to wrap to a new line if needed */
        justify-content: center;
        gap: 0.5rem; 
    }
    .nav-links a { 
        margin: 0.3rem 0.5rem; 
        font-size: 0.85rem; /* Significantly increased from 0.65rem */
        letter-spacing: 0.1em;
    }

    /* Metrics Grid */
    .metric-value { 
        font-size: 2.2rem; /* Scaled down slightly so large numbers fit */
    }
    .metric-label { 
        font-size: 0.85rem; /* Increased from 0.65rem */
    }

    /* Labels */
    .update-label { 
        font-size: 0.8rem; /* Increased from 0.7rem */
        margin-top: 1.5rem; 
    }
    
}