/* ═══════════════════════════════════════════════════════════
   BSC Token Growth Dashboard — Cream Theme
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #FBF8F1;
    --bg-secondary: #F5F0E8;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-solid: #FFFFFF;
    --bg-code: #F0EBE1;
    --text-primary: #2D2A26;
    --text-secondary: #5A5550;
    --text-muted: #7A746A;
    --text-faint: #A39E94;
    --border: #E8E0D4;
    --border-light: #F0E8DC;
    --accent: #C0785C;
    --accent-light: #D4A574;
    --accent-dark: #A06040;
    --accent-bg: rgba(192, 120, 92, 0.08);
    --green: #5B8C5A;
    --green-bg: rgba(91, 140, 90, 0.08);
    --amber: #B8860B;
    --amber-bg: rgba(184, 134, 11, 0.08);
    --info: #7B8FA8;
    --info-bg: rgba(123, 143, 168, 0.08);
    --chart-grid: #EDE6DA;
    --shadow-sm: 0 1px 3px rgba(45, 42, 38, 0.06);
    --shadow-md: 0 4px 16px rgba(45, 42, 38, 0.08);
    --shadow-lg: 0 8px 32px rgba(45, 42, 38, 0.1);
    --radius: 14px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

h1,
h2,
h3 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    z-index: 999;
    width: 0%;
}

/* ── Layout ───────────────────────────────────────────────── */
.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    position: relative;
}

.scene:nth-child(even) {
    background: var(--bg-secondary);
}

.scene-inner {
    max-width: 960px;
    width: 100%;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(192, 120, 92, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hero-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    opacity: 0;
}

.hero-title {
    font-size: 3.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.2rem;
    opacity: 0;
}

.hero-subtitle-tag {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0;
}

.hero-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 1.2rem;
    opacity: 0;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 0.8rem;
    opacity: 0;
    line-height: 1.8;
}

.hero-subtitle strong {
    color: var(--text-primary);
    font-weight: 700;
}

.hero-subtitle-sm {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 560px;
    margin-bottom: 1.2rem;
    opacity: 0;
    line-height: 1.7;
}

.update-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    margin-left: 0.3rem;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid rgba(192, 120, 92, 0.2);
}

.hero-contract {
    font-size: 0.74rem;
    color: var(--text-faint);
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.contract-sep {
    color: var(--border);
    margin: 0 0.2rem;
}

.hero-last-update {
    font-size: 0.72rem;
    color: var(--text-faint);
    margin-top: 1rem;
    opacity: 0;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    opacity: 0;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-faint);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    opacity: 0;
}

.scroll-indicator .arrow {
    width: 18px;
    height: 18px;
    border-right: 2px solid var(--text-faint);
    border-bottom: 2px solid var(--text-faint);
    transform: rotate(45deg);
    animation: bounceArrow 2s infinite;
}

@keyframes bounceArrow {

    0%,
    100% {
        transform: rotate(45deg) translateY(0);
    }

    50% {
        transform: rotate(45deg) translateY(8px);
    }
}

/* ── Section Labels ──────────────────────────────────────── */
.scene-label {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
    opacity: 0;
}

.scene-title {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 1rem;
    opacity: 0;
}

.scene-narrative {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
    opacity: 0;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

/* ── Big Numbers ─────────────────────────────────────────── */
.metrics-row {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.metric-card {
    flex: 1;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(20px);
    transition: box-shadow 0.3s, transform 0.2s;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) !important;
}

.metric-value {
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-label {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.metric-spark {
    margin-top: 0.5rem;
    height: 30px;
}

/* ── Chart Controls ──────────────────────────────────────── */
.controls-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.controls-row label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.btn {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card-solid);
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:hover,
.btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-group {
    display: flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
    border-radius: 0 8px 8px 0;
}

/* ── Date Range Slider ───────────────────────────────────── */
.range-slider-container {
    position: relative;
    width: 100%;
    height: 48px;
    margin: 1rem 0 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.range-brush-area {
    width: 100%;
    height: 100%;
}

/* ── Charts ───────────────────────────────────────────────── */
.chart-area {
    position: relative;
    width: 100%;
}

.chart-area svg {
    width: 100%;
    overflow: visible;
}

/* ── Heatmap ─────────────────────────────────────────────── */
.heatmap-wrapper {
    overflow-x: auto;
}

.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}

.heatmap-table th {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.6rem;
    text-align: center;
}

.heatmap-table td {
    text-align: center;
    padding: 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.15s;
    cursor: default;
    position: relative;
}

.heatmap-table td:hover {
    transform: scale(1.08);
    z-index: 2;
}

.heatmap-table .row-label {
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
}

/* ── Tooltip ─────────────────────────────────────────────── */
.tooltip {
    position: fixed;
    padding: 0.6rem 0.9rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 8px;
    font-size: 0.78rem;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: var(--shadow-lg);
    max-width: 240px;
    line-height: 1.5;
}

.tooltip.visible {
    opacity: 1;
}

/* ── Insight Cards ───────────────────────────────────────── */
.insights-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.3rem 1.8rem;
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateX(-20px);
}

.insight-card.positive {
    border-left: 3px solid var(--green);
    background: var(--green-bg);
}

.insight-card.warning {
    border-left: 3px solid var(--amber);
    background: var(--amber-bg);
}

.insight-card.info {
    border-left: 3px solid var(--info);
    background: var(--info-bg);
}

.insight-card .title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.insight-card.positive .title {
    color: var(--green);
}

.insight-card.warning .title {
    color: var(--amber);
}

.insight-card.info .title {
    color: var(--info);
}

.insight-card .detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Formula Block ───────────────────────────────────────── */
details.formula-block {
    margin-top: 1.2rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
}

details.formula-block summary {
    padding: 0.65rem 1rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-secondary);
    user-select: none;
    transition: color 0.2s;
}

details.formula-block summary:hover {
    color: var(--accent);
}

details.formula-block[open] summary {
    border-bottom: 1px solid var(--border-light);
}

.formula-content {
    padding: 1rem;
    background: var(--bg-code);
}

.formula-content .desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

.formula-content pre {
    background: #2D2A26;
    color: #E8E0D4;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.6;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Loading ─────────────────────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 0.75rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-faint);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.footer-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 0.8rem;
    opacity: 0.7;
}

.footer-brand {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.footer a {
    color: var(--accent);
    text-decoration: none;
}

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

.footer-disclaimer {
    font-size: 0.72rem;
    color: var(--text-faint);
    margin-top: 0.8rem;
    max-width: 500px;
    margin-inline: auto;
}

.footer-update {
    font-size: 0.7rem;
    color: var(--text-faint);
    margin-top: 0.6rem;
}

/* ── Explanation Blocks ──────────────────────────────────── */
.explanation-block {
    background: var(--accent-bg);
    border-left: 3px solid var(--accent-light);
    border-radius: 0 10px 10px 0;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(15px);
}

.explanation-block p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.explanation-block p:last-child {
    margin-bottom: 0;
}

.explanation-block strong {
    color: var(--text-primary);
}

.explanation-block em {
    color: var(--accent-dark);
    font-style: normal;
    font-weight: 500;
}

.explanation-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82em;
    background: rgba(192, 120, 92, 0.1);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

.strip-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

/* ── Chart Captions ──────────────────────────────────────── */
.chart-caption {
    font-size: 0.78rem;
    color: var(--text-faint);
    margin-top: 0.8rem;
    line-height: 1.6;
    border-top: 1px solid var(--border-light);
    padding-top: 0.7rem;
}

.chart-caption code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    background: var(--bg-code);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* ── Formula Cards ───────────────────────────────────────── */
.formula-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.formula-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.formula-icon {
    font-size: 1.4rem;
}

.formula-card-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.formula-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.formula-card-body {
    padding: 1.2rem 1.5rem;
}

.formula-step {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.formula-step:last-child {
    margin-bottom: 0;
}

.step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.formula-step>div:last-child {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.formula-step strong {
    color: var(--text-primary);
}

.formula-step code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82em;
    background: var(--bg-code);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

details.formula-sql {
    border-top: 1px solid var(--border-light);
}

details.formula-sql summary {
    padding: 0.65rem 1.5rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-secondary);
    user-select: none;
    transition: color 0.2s;
}

details.formula-sql summary:hover {
    color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero {
        padding: 3rem 1.8rem;
    }

    .hero-logo {
        width: 56px;
        height: 56px;
    }

    .hero-title {
        font-size: 2.6rem;
    }

    .hero-subtitle-tag {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle,
    .hero-subtitle-sm {
        padding: 0 0.5rem;
        font-size: 0.9rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-contract {
        font-size: 0.68rem;
        padding: 0.4rem 0.8rem;
    }

    .scene {
        padding: 3rem 1.6rem;
    }

    .scene-inner {
        padding: 0 0.2rem;
    }

    .scene-title {
        font-size: 1.4rem;
    }

    .scene-narrative {
        font-size: 0.9rem;
    }

    .card {
        padding: 1.2rem 1rem;
    }

    .explanation-block {
        padding: 1rem 1.1rem;
        margin-left: 0;
        margin-right: 0;
    }

    .formula-card-header {
        padding: 1rem 1.1rem;
    }

    .formula-card-body {
        padding: 1rem 1.1rem;
    }

    .formula-step {
        gap: 0.6rem;
    }

    .formula-step>div:last-child {
        font-size: 0.82rem;
    }

    .metric-value {
        font-size: 1.8rem;
    }

    .metrics-row {
        gap: 0.8rem;
    }

    .metric-card {
        min-width: 140px;
        padding: 1rem;
    }

    .heatmap-table th,
    .heatmap-table td {
        padding: 0.4rem 0.3rem;
        font-size: 0.72rem;
    }

    .footer {
        padding: 2rem 1.5rem;
    }
}