/* ── Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Root variables ────────────────────────────────────────────── */
:root {
    --bg: #F5F5F3;
    --bg-card: #111318;
    --text: #111318;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border: #E5E5E3;
    --accent: #1B2B4B;
    --white: #FFFFFF;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Page container ────────────────────────────────────────────── */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Hero section ──────────────────────────────────────────────── */
.hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 6rem 4rem 4rem;
    min-height: 55vh;
    overflow: hidden;
}

/* Spline 3D animation background */
.hero-animation-slot {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: auto;
}

.hero-animation-slot iframe {
    display: block;
    width: 100%;
    height: 100%;
}


.hero-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    pointer-events: none;
}

.title {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.0;
    color: #111318;
    margin-bottom: 1.25rem;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-muted);
    max-width: 420px;
    line-height: 1.7;
}

/* ── Main content area ─────────────────────────────────────────── */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1060px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ── KPI row ───────────────────────────────────────────────────── */
.kpi-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.kpi-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.35rem;
    font-weight: 600;
    color: #F3F4F6;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
}

/* ── Chart section ─────────────────────────────────────────────── */
.chart-section {
    background: rgba(17, 19, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #F3F4F6;
    margin-bottom: 0.4rem;
}

.chart-description {
    font-size: 0.82rem;
    color: #6B7280;
    line-height: 1.55;
    max-width: 560px;
    margin-bottom: 0.6rem;
}

.chart-insight {
    font-size: 0.88rem;
    color: #D1D5DB;
    margin-bottom: 1.75rem;
    line-height: 1.6;
    max-width: 600px;
}

.last-updated {
    font-size: 0.72rem;
    font-family: 'IBM Plex Mono', monospace;
    color: #4B5563;
    margin-top: 0.75rem;
    text-align: right;
}

/* ── Loading skeleton ──────────────────────────────────────────── */
.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 0;
}

.skeleton-row {
    height: 38px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.02) 25%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.02) 75%
    );
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skeleton-pulse 1.8s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Footer ────────────────────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 200ms ease;
}

.footer a:hover {
    opacity: 0.7;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero {
        padding: 3rem 1.5rem 2rem;
        min-height: 35vh;
    }

    .hero-content {
        max-width: 280px;
    }

    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 0.9rem;
        max-width: 260px;
    }

    .main-content {
        padding: 0 0.75rem 3rem;
    }

    .kpi-row {
        gap: 0.4rem;
    }

    .kpi-card {
        padding: 0.6rem 0.75rem;
    }

    .kpi-value {
        font-size: 1rem;
    }

    .kpi-label {
        font-size: 0.6rem;
    }

    .chart-section {
        padding: 1rem;
        border-radius: 12px;
        margin-bottom: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chart-title {
        font-size: 1.05rem;
    }

    .chart-description {
        font-size: 0.75rem;
    }

    .chart-insight {
        font-size: 0.78rem;
        margin-bottom: 1rem;
    }

    .last-updated {
        font-size: 0.65rem;
    }

    /* Plotly graphs: allow horizontal scroll on small screens */
    .js-plotly-plot, .plotly {
        min-width: 500px;
    }

    .footer p {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        flex-direction: column;
    }

    .title {
        font-size: 1.8rem;
    }

    .hero {
        padding: 2.5rem 1.25rem 1.5rem;
        min-height: 30vh;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .chart-section {
        padding: 0.75rem;
    }
}

/* ── prefers-reduced-motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .skeleton-row {
        animation: none;
        background: rgba(255, 255, 255, 0.03);
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
