/* ==============================
   bcd.day - Blockchain Day
   Dark Mode Neon Crypto Dashboard
   ============================== */

:root {
    /* Palette from DESIGN.md */
    --bg: #0d0d12;
    --surface: #141418;
    --border: #2a2a32;
    --neon-blue: #00b4d8;
    --neon-green: #00ff88;
    --neon-orange: #ff8c42;
    --neon-purple: #a78bfa;
    --text-primary: #e0e0e4;
    --text-muted: #6b6b78;
    --glow-blue: rgba(0, 180, 216, 0.3);
    --glow-green: rgba(0, 255, 136, 0.3);
    --glow-orange: rgba(255, 140, 66, 0.3);
    --glow-purple: rgba(167, 139, 250, 0.3);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg);
    overflow-x: hidden;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 400;
}

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

.hash-string {
    color: var(--text-muted);
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- HERO / Block Ticker ---- */
#hero {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

#block-ticker {
    width: 100%;
    overflow: hidden;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    position: relative;
}

#ticker-track {
    display: inline-flex;
    gap: 12px;
    animation: ticker-scroll 40s linear infinite;
    white-space: nowrap;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.ticker-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    min-width: 130px;
    flex-shrink: 0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ticker-block.confirmed {
    border-color: var(--neon-green);
}

.ticker-block.pending {
    border-color: var(--neon-orange);
}

.ticker-block-number {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.ticker-block-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.ticker-block-hash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    color: var(--text-muted);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes confirmation-pulse {
    0% { box-shadow: 0 0 0 0 var(--glow-green); }
    50% { box-shadow: 0 0 16px 4px var(--glow-green); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.ticker-block.pulse {
    animation: confirmation-pulse 0.8s ease-out;
}

/* Hero Content */
#hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    gap: 1.2rem;
}

#site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

#site-tagline {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 480px;
}

#block-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1rem;
}

.counter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#block-number {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--neon-green);
    font-weight: 500;
}

@keyframes block-flash {
    0% { color: #ffffff; text-shadow: 0 0 12px var(--glow-green); }
    100% { color: var(--neon-green); text-shadow: none; }
}

#block-number.flash {
    animation: block-flash 0.5s ease-out;
}

#hero-hash {
    max-width: 600px;
    margin-top: 1rem;
}

/* ---- DASHBOARD GRID ---- */
#dashboard {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

#dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1rem;
}

/* Panel Base */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.2rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.panel[data-accent="blue"] { border-top: 2px solid var(--neon-blue); }
.panel[data-accent="green"] { border-top: 2px solid var(--neon-green); }
.panel[data-accent="orange"] { border-top: 2px solid var(--neon-orange); }
.panel[data-accent="purple"] { border-top: 2px solid var(--neon-purple); }

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.panel-date, .panel-period {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.panel-block-icon {
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--neon-blue);
    border-radius: 2px;
    flex-shrink: 0;
}

.panel[data-accent="green"] .panel-block-icon { border-color: var(--neon-green); }
.panel[data-accent="orange"] .panel-block-icon { border-color: var(--neon-orange); }
.panel[data-accent="purple"] .panel-block-icon { border-color: var(--neon-purple); }

/* Panel: Events */
.panel-events {
    grid-column: span 2;
    grid-row: span 1;
}

.event-list {
    list-style: none;
}

.event-list li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.event-list li:last-child {
    border-bottom: none;
}

.event-time {
    font-size: 0.75rem;
    color: var(--neon-blue);
    flex-shrink: 0;
    min-width: 80px;
}

.event-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Panel: Protocols */
.panel-protocols {
    grid-column: span 2;
    grid-row: span 1;
}

.protocol-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.protocol-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.protocol-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px var(--glow-purple);
}

.protocol-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--neon-purple);
}

.protocol-version {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.protocol-desc {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Panel: Prices */
.panel-prices {
    grid-column: span 2;
    grid-row: span 1;
}

.price-feeds {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

.price-row:last-child {
    border-bottom: none;
}

.price-asset {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 45px;
}

.sparkline {
    width: 120px;
    height: 40px;
    flex-shrink: 0;
}

.sparkline polyline {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-wide {
    width: 100%;
    height: 50px;
    margin-top: 0.75rem;
}

.price-value {
    font-size: 0.8rem;
    color: var(--text-primary);
    min-width: 90px;
    text-align: right;
}

.price-change {
    font-size: 0.75rem;
    min-width: 60px;
    text-align: right;
}

.price-change.positive { color: var(--neon-green); }
.price-change.negative { color: var(--neon-orange); }

/* Panel: Block Stats */
.panel-stats {
    grid-column: span 1;
    grid-row: span 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.stat-value {
    font-size: 0.85rem;
    color: var(--neon-orange);
}

/* Panel: Network Health */
.panel-health {
    grid-column: span 1;
    grid-row: span 1;
}

.health-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.health-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.health-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 70px;
}

.health-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.health-fill[data-color="green"] { background: var(--neon-green); }
.health-fill[data-color="orange"] { background: var(--neon-orange); }

.health-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
}

/* Panel: Gas Tracker */
.panel-gas {
    grid-column: span 2;
    grid-row: span 1;
}

.gas-tiers {
    display: flex;
    gap: 1rem;
}

.gas-tier {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.gas-tier-active {
    border-color: var(--neon-orange);
    box-shadow: 0 0 12px var(--glow-orange);
}

.gas-speed {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gas-value {
    font-size: 1.1rem;
    color: var(--neon-orange);
}

.gas-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ---- TIMELINE ---- */
#timeline-section {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2rem 1.5rem;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

#timeline {
    position: relative;
    padding-left: 30px;
}

#timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 2rem 30px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -25px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--neon-blue);
    background: var(--bg);
    transition: box-shadow 0.4s ease, background 0.4s ease;
}

.timeline-item[data-accent="green"] .timeline-dot { border-color: var(--neon-green); }
.timeline-item[data-accent="orange"] .timeline-dot { border-color: var(--neon-orange); }
.timeline-item[data-accent="purple"] .timeline-dot { border-color: var(--neon-purple); }
.timeline-item[data-accent="blue"] .timeline-dot { border-color: var(--neon-blue); }

.timeline-item.active .timeline-dot {
    background: var(--neon-green);
    box-shadow: 0 0 12px var(--glow-green);
}

.timeline-item[data-accent="blue"].active .timeline-dot {
    background: var(--neon-blue);
    box-shadow: 0 0 12px var(--glow-blue);
}

.timeline-item[data-accent="orange"].active .timeline-dot {
    background: var(--neon-orange);
    box-shadow: 0 0 12px var(--glow-orange);
}

.timeline-item[data-accent="purple"].active .timeline-dot {
    background: var(--neon-purple);
    box-shadow: 0 0 12px var(--glow-purple);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--neon-blue);
}

.timeline-item[data-accent="green"] .timeline-time { color: var(--neon-green); }
.timeline-item[data-accent="orange"] .timeline-time { color: var(--neon-orange); }
.timeline-item[data-accent="purple"] .timeline-time { color: var(--neon-purple); }

.timeline-text {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* ---- FOOTER ---- */
#site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 1.5rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-hash {
    flex: 1;
    text-align: center;
    max-width: 500px;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
    #dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .panel-events,
    .panel-protocols,
    .panel-prices,
    .panel-gas {
        grid-column: span 2;
    }
    .panel-stats,
    .panel-health {
        grid-column: span 1;
    }
}

@media (max-width: 680px) {
    #dashboard-grid {
        grid-template-columns: 1fr;
    }
    .panel-events,
    .panel-protocols,
    .panel-prices,
    .panel-gas,
    .panel-stats,
    .panel-health {
        grid-column: span 1;
    }
    .protocol-cards {
        grid-template-columns: 1fr;
    }
    .price-row {
        flex-wrap: wrap;
    }
    .sparkline {
        width: 80px;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-hash {
        max-width: 100%;
    }
    .gas-tiers {
        flex-direction: column;
    }
}
