/* ========================================
   cbdc.bar - Styles
   Fintech Trust Blue / Brutalist Data
   ======================================== */

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

:root {
    --primary: #0a1929;
    --surface-light: #f4f6f8;
    --surface-dark: #132f4c;
    --blue: #1976d2;
    --green: #2e7d32;
    --amber: #ed6c02;
    --red: #c62828;
    --text-dark: #1a2027;
    --text-light: #b2bac2;
    --grid: #e0e3e7;
    --white: #f8f9fa;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-data: 'IBM Plex Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--primary);
}

/* --- Sections --- */
.section-dark {
    background: var(--primary);
    color: var(--text-light);
    position: relative;
    overflow: hidden;
}

.section-light {
    background: var(--surface-light);
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
}

.section-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 1;
}

.section-inner-wide {
    max-width: 1200px;
}

/* --- Watermark Currency Symbols --- */
.watermark {
    position: absolute;
    top: 50%;
    right: -40px;
    transform: translateY(-50%);
    font-family: var(--font-display);
    font-size: 20rem;
    font-weight: 700;
    opacity: 0.04;
    color: var(--text-dark);
    pointer-events: none;
    line-height: 1;
    user-select: none;
    z-index: 0;
}

.watermark-light {
    color: var(--text-light);
    opacity: 0.05;
}

/* ========================================
   HERO
   ======================================== */
.hero-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 80px 24px 60px;
    position: relative;
    z-index: 1;
}

.site-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.dot {
    color: var(--blue);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 32px;
    font-weight: 400;
}

/* --- Status Legend --- */
.status-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-launched { background: var(--green); }
.legend-pilot { background: var(--amber); }
.legend-research { background: var(--blue); }
.legend-cancelled { background: var(--red); }

/* --- Hero Bar Chart --- */
.hero-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    align-items: center;
    gap: 12px;
}

.bar-label {
    font-family: var(--font-data);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-feature-settings: 'tnum';
}

.flag-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.bar-track {
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 800ms ease-out;
}

.bar-fill.animated {
    width: calc(var(--value) * 1%);
}

.status-launched { background: var(--green); }
.status-pilot { background: var(--amber); }
.status-research { background: var(--blue); }
.status-cancelled { background: var(--red); }

.bar-value {
    font-family: var(--font-data);
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
    opacity: 0.7;
    white-space: nowrap;
    font-feature-settings: 'tnum';
}

/* ========================================
   SECTION HEADINGS & TEXT
   ======================================== */
.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.section-dark .section-heading {
    color: #fff;
}

.section-body {
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 680px;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.section-body-light {
    color: var(--text-light);
}

/* ========================================
   STATS ROW
   ======================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--grid);
    border-radius: 4px;
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--blue);
    line-height: 1.1;
}

.stat-label {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-dark);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ========================================
   MINI CHART / SVG Trend
   ======================================== */
.mini-chart {
    margin-top: 20px;
}

.trend-svg {
    width: 100%;
    max-height: 80px;
}

.trend-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trend-label {
    font-family: var(--font-data);
    font-size: 10px;
    fill: var(--text-dark);
    opacity: 0.5;
}

.chart-caption {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-dark);
    opacity: 0.6;
    margin-top: 8px;
}

/* ========================================
   ARCHITECTURE SECTION
   ======================================== */
.arch-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 48px;
}

.arch-bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.arch-label {
    font-family: var(--font-data);
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

.arch-value {
    font-family: var(--font-data);
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: right;
    font-feature-settings: 'tnum';
}

.section-dark .bar-track {
    background: rgba(255, 255, 255, 0.08);
}

/* --- Tech Grid --- */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tech-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tech-icon {
    font-family: var(--font-data);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--blue);
    letter-spacing: 0.05em;
}

.tech-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: #fff;
}

.tech-count {
    font-family: var(--font-data);
    font-size: 0.78rem;
    color: var(--text-light);
    opacity: 0.7;
}

/* ========================================
   COMPARISON TABLE
   ======================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--grid);
    border-radius: 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    background: var(--primary);
    color: var(--text-light);
    font-family: var(--font-data);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid var(--blue);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--grid);
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-dark);
    vertical-align: middle;
}

.data-table td.mono {
    font-family: var(--font-data);
    font-feature-settings: 'tnum';
}

.data-table tbody tr:nth-child(even) {
    background: var(--white);
}

.data-table tbody tr:hover {
    background: #e3ecf6;
}

/* --- Status Badges --- */
.status-badge {
    display: inline-block;
    font-family: var(--font-data);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.badge-launched {
    background: var(--green);
    color: #fff;
}

.badge-pilot {
    background: var(--amber);
    color: #fff;
}

.badge-research {
    background: var(--blue);
    color: #fff;
}

.badge-cancelled {
    background: var(--red);
    color: #fff;
}

/* ========================================
   PRIVACY SECTION
   ======================================== */
.privacy-chart {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 48px;
}

.privacy-bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 120px;
    align-items: center;
    gap: 12px;
}

.privacy-label {
    font-family: var(--font-data);
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}

.privacy-bar-track {
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.privacy-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 800ms ease-out;
}

.privacy-fill.animated {
    width: calc(var(--value) * 1%);
}

.privacy-high { background: var(--green); }
.privacy-mid { background: var(--amber); }
.privacy-low { background: var(--red); }

.privacy-value {
    font-family: var(--font-data);
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: right;
    opacity: 0.7;
}

/* --- Trade-off Grid --- */
.tradeoff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tradeoff-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 24px 20px;
}

.tradeoff-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.tradeoff-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-light);
}

/* ========================================
   TIMELINE
   ======================================== */
.timeline {
    position: relative;
    padding-left: 120px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 96px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--grid);
}

.timeline-item {
    position: relative;
    padding-bottom: 36px;
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blue);
    border: 2px solid var(--surface-light);
    z-index: 1;
}

.timeline-year {
    position: absolute;
    left: -120px;
    top: 0;
    font-family: var(--font-data);
    font-size: 1rem;
    font-weight: 500;
    color: var(--blue);
    width: 80px;
    text-align: right;
    font-feature-settings: 'tnum';
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.timeline-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-dark);
    opacity: 0.8;
}

.mono {
    font-family: var(--font-data);
    font-feature-settings: 'tnum';
}

/* ========================================
   FOOTER
   ======================================== */
#footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.footer-meta {
    text-align: right;
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.6;
    margin-bottom: 4px;
}

/* ========================================
   ANIMATIONS: Scroll Reveal
   ======================================== */
.bar-row,
.stat-card,
.arch-bar-row,
.privacy-bar-row,
.tech-card,
.tradeoff-card,
.timeline-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.bar-row.visible,
.stat-card.visible,
.arch-bar-row.visible,
.privacy-bar-row.visible,
.tech-card.visible,
.tradeoff-card.visible,
.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .bar-row {
        grid-template-columns: 64px 1fr 90px;
        gap: 8px;
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .arch-bar-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .arch-label {
        font-size: 0.78rem;
    }

    .privacy-bar-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .tech-grid,
    .tradeoff-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 80px;
    }

    .timeline::before {
        left: 60px;
    }

    .timeline-year {
        left: -80px;
        width: 52px;
        font-size: 0.85rem;
    }

    .timeline-item::before {
        left: -20px;
    }

    .footer-inner {
        flex-direction: column;
    }

    .footer-meta {
        text-align: left;
    }

    .section-inner {
        padding: 56px 16px;
    }

    .hero-inner {
        padding: 56px 16px 40px;
    }
}

@media (max-width: 480px) {
    .bar-row {
        grid-template-columns: 50px 1fr;
    }

    .bar-value {
        display: none;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-number {
        font-size: 1.8rem;
    }
}
