/* Mobile-first. Dark theme. Trading terminal aesthetic. */

:root {
    --bg: #0a0a0a;
    --bg-card: #111;
    --bg-elevated: #181818;
    --text: #e8e8e8;
    --text-muted: #999;
    --accent: #4fc3f7;
    --accent-glow: rgba(79, 195, 247, 0.15);
    --green: #00e676;
    --amber: #ffab00;
    --red: #ff1744;
    --border: #222;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* ---- HERO ---- */
.hero {
    padding: 48px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, #0f1923 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.byline { font-size: 0.8rem; margin-bottom: 6px; letter-spacing: 0.08em; text-transform: uppercase; }
.byline a { color: var(--accent); text-decoration: none; }

.hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.badges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.badge:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.badge .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.badge .label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

/* ---- SECTIONS ---- */
section { padding: 40px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--accent);
}

h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; color: var(--text); }

p { margin-bottom: 14px; color: var(--text-muted); font-size: 0.9rem; }

strong { color: var(--text); }

ul { margin: 0 0 14px 20px; color: var(--text-muted); font-size: 0.9rem; }
li { margin-bottom: 5px; }

/* ---- CHARTS ---- */
.chart-container {
    margin: 20px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.chart-container:hover { border-color: #333; }

.chart-container img { width: 100%; height: auto; display: block; }

.chart-caption {
    padding: 10px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    line-height: 1.5;
}

.chart-caption-inline {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 6px 0 14px;
}

/* ---- INTERACTIVE CHART ---- */
.interactive-chart {
    width: 100%;
    height: 350px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 20px 0;
}

/* ---- TABLES ---- */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
    border-radius: 10px;
    border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }

th {
    background: var(--bg-elevated);
    color: var(--accent);
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

th:first-child { text-align: left; }

td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

td:first-child { text-align: left; font-weight: 500; color: var(--text); }

tr.highlight { background: rgba(79, 195, 247, 0.06); }
tr.highlight td:first-child { color: var(--accent); }

.positive { color: var(--green); }
.negative { color: var(--red); }

/* ---- PIPELINE ---- */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.pipeline-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.pipeline-arrow { color: var(--accent); font-size: 1rem; }

/* ---- CODE ---- */
details {
    margin: 14px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

summary { padding: 10px 14px; cursor: pointer; color: var(--accent); font-weight: 500; font-size: 0.85rem; }
pre { background: #0d0d0d; padding: 14px; overflow-x: auto; font-size: 0.75rem; line-height: 1.5; }
code { font-family: 'SF Mono', 'Fira Code', monospace; color: var(--text); }

/* ---- STAT HIGHLIGHT CARDS ---- */
.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.stat-card .big { font-size: 1.4rem; font-weight: 700; color: var(--green); }
.stat-card .big.negative-val { color: var(--red); }
.stat-card .desc { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- SIMULATION ---- */
.sim-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.sim-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.sim-slider-row label {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.sim-slider-row input[type="range"] {
    flex: 1;
    min-width: 120px;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.sim-slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.sim-value {
    font-weight: 700;
    color: var(--accent);
    min-width: 50px;
    font-size: 0.9rem;
}

.sim-button {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sim-button:hover { opacity: 0.85; }
.sim-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- FOOTER ---- */
footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    opacity: 0;
    animation: fadeUp 0.6s ease-out forwards;
}

section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.15s; }

/* ---- DESKTOP ---- */
@media (min-width: 640px) {
    .container { padding: 0 32px; }
    .hero { padding: 80px 0 60px; }
    .hero h1 { font-size: 2.6rem; }
    .hero .tagline { font-size: 1rem; }

    .badges {
        grid-template-columns: repeat(4, 1fr);
        max-width: 600px;
    }

    .badge .value { font-size: 1.8rem; }
    .badge .label { font-size: 0.72rem; }

    section { padding: 60px 0; }
    h2 { font-size: 1.5rem; }
    p { font-size: 0.95rem; }

    .interactive-chart { height: 450px; }

    .stat-row { grid-template-columns: repeat(4, 1fr); }
    .stat-card .big { font-size: 1.6rem; }

    table { font-size: 0.85rem; }
    th { font-size: 0.75rem; }
}

@media (min-width: 1024px) {
    .hero h1 { font-size: 3rem; }
}
