/* bcd.day - Neon-Lit Countdown Terminal for Blockchain Day */
/* Colors: #0A0A0F #0D0D14 #F5A623 #00D4FF #7B61FF #1A1A2E #6B7280 #D1D5DB */

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    line-height: 1.75;
    background: #0A0A0F;
    color: #D1D5DB;
    overflow-x: hidden;
}

/* ===== Dot-Grid Background ===== */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle, #1A1A2E 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

/* ===== CRT Scan Lines (permanent) ===== */
#crt-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(245,166,35,0.02) 3px,
        rgba(245,166,35,0.02) 4px
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

#crt-overlay.visible {
    opacity: 1;
}

/* ===== Amber Scan Line (sweeping) ===== */
#scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: #F5A623;
    opacity: 0.12;
    pointer-events: none;
    z-index: 999;
    animation: scanSweep 6s linear infinite;
}

@keyframes scanSweep {
    0% { top: 0; }
    100% { top: 100vh; }
}

/* ===== Hash Decoration (margin elements) ===== */
.hash-decoration {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: #6B7280;
    opacity: 0.3;
    pointer-events: none;
    letter-spacing: 0.05em;
}

.left-hash {
    left: 12px;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left center;
}

.right-hash {
    right: 12px;
    top: 40%;
    writing-mode: vertical-rl;
}

/* ===== Ticker Bar ===== */
#ticker-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: #0A0A0F;
    border-bottom: 1px solid rgba(245,166,35,0.15);
    z-index: 100;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 2rem;
    white-space: nowrap;
    animation: tickerScroll 40s linear infinite;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #F5A623;
    letter-spacing: 0.05em;
}

.ticker-sep {
    font-size: 0.4rem;
    color: #7B61FF;
}

/* ===== Terminal Main ===== */
#terminal-main {
    padding-top: 48px;
}

.terminal-section {
    padding: 4rem 2rem;
    position: relative;
}

/* ===== Section Labels ===== */
.section-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #00D4FF;
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-label::before,
.section-label::after {
    content: ' // ';
    color: #6B7280;
}

/* ===== Hero: Flip Clock ===== */
#hero {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(26,26,46,0.5) 0%, #0D0D14 50%, #0A0A0F 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.flip-clock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 2rem;
}

.flip-group {
    display: flex;
    gap: 4px;
}

.flip-digit {
    width: clamp(40px, 8vw, 64px);
    height: clamp(56px, 11vw, 96px);
    background: #0D0D14;
    border: 1px solid rgba(245,166,35,0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(245,166,35,0.15), inset 0 0 20px rgba(0,0,0,0.5);
}

.flip-digit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #0A0A0F;
    z-index: 2;
}

.flip-digit span {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #F5A623;
    text-shadow: 0 0 10px rgba(245,166,35,0.5);
    line-height: 1;
    letter-spacing: 0.05em;
}

.flip-separator {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #F5A623;
    opacity: 0.5;
    padding: 0 4px;
}

.hero-label-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 0.75rem;
}

.hero-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #00D4FF;
    text-shadow: 0 0 20px rgba(0,212,255,0.3);
}

.blink-cursor {
    display: inline-block;
    width: 12px;
    height: 2px;
    background: #F5A623;
    animation: cursorBlink 530ms step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #6B7280;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-sub.visible {
    opacity: 1;
}

/* ===== Metrics Grid ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    max-width: 960px;
    margin: 0 auto;
    background: rgba(26,26,46,0.3);
}

.metric-card {
    background: #0D0D14;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #1A1A2E;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.metric-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.metric-card:hover {
    border-color: #F5A623;
    box-shadow: 0 0 16px rgba(245,166,35,0.1);
}

.metric-card:hover .metric-value {
    color: #00D4FF;
    text-shadow: 0 0 8px rgba(0,212,255,0.3);
}

.metric-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 400;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6B7280;
    display: block;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #F5A623;
    display: block;
    text-shadow: 0 0 8px rgba(245,166,35,0.3);
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.metric-change {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    display: block;
    margin-top: 0.5rem;
    letter-spacing: 0.08em;
}

.metric-change.positive { color: #00D4FF; }
.metric-change.neutral { color: #6B7280; }
.metric-change.negative { color: #FF4444; }

/* ===== Timeline ===== */
.timeline-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 2rem 0;
}

.timeline-rail {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #F5A623;
    opacity: 0.2;
    transform: translateX(-50%);
    transform-origin: top;
}

.timeline-event {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3rem;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    position: relative;
}

.left-event {
    flex-direction: row;
    padding-right: calc(50% + 2rem);
    transform: translateX(-20px);
}

.right-event {
    flex-direction: row;
    padding-left: calc(50% + 2rem);
    transform: translateX(20px);
}

.timeline-event.visible {
    opacity: 1;
    transform: translateX(0);
}

.event-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #7B61FF;
    box-shadow: 0 0 8px rgba(123,97,255,0.4);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

.timeline-event.visible .event-dot {
    background: #F5A623;
    border-color: #F5A623;
    box-shadow: 0 0 8px rgba(245,166,35,0.5);
}

.active-dot {
    background: #00D4FF !important;
    border-color: #00D4FF !important;
    box-shadow: 0 0 12px rgba(0,212,255,0.6) !important;
    animation: activePulse 2.5s ease-in-out infinite;
}

@keyframes activePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(0,212,255,0.5); }
    50% { box-shadow: 0 0 20px rgba(0,212,255,0.8); }
}

.event-content {
    flex: 1;
}

.left-event .event-content {
    text-align: right;
}

.right-event .event-content {
    text-align: left;
}

.event-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #7B61FF;
    letter-spacing: 0.08em;
}

.current-year {
    color: #00D4FF;
}

.event-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #D1D5DB;
    margin: 0.25rem 0;
    letter-spacing: 0.05em;
}

.event-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #6B7280;
    line-height: 1.6;
}

/* Timeline card hover accent */
.left-event .event-content {
    padding-right: 1.5rem;
    border-right: 3px solid transparent;
    transition: border-color 0.2s ease;
}

.right-event .event-content {
    padding-left: 1.5rem;
    border-left: 3px solid transparent;
    transition: border-color 0.2s ease;
}

.left-event:hover .event-content {
    border-right-color: #F5A623;
}

.right-event:hover .event-content {
    border-left-color: #F5A623;
}

/* ===== Hash Display ===== */
.hash-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem;
    background: #0D0D14;
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: 4px;
    text-align: center;
    overflow: hidden;
}

.hash-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 1.2vw, 0.85rem);
    color: #F5A623;
    letter-spacing: 0.05em;
    word-break: break-all;
    opacity: 0.8;
}

/* ===== Block Footer ===== */
#block-footer {
    padding: 3rem 2rem 4rem;
}

.block-container {
    max-width: 600px;
    margin: 0 auto;
    background: #0D0D14;
    border: 2px dashed rgba(245,166,35,0.25);
    border-radius: 8px;
    padding: 2rem;
}

.block-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #1A1A2E;
    margin-bottom: 1rem;
}

.block-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #7B61FF;
}

.block-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #F5A623;
}

.block-data {
    margin-bottom: 1.5rem;
}

.block-row {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(26,26,46,0.5);
}

.block-key {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #6B7280;
    letter-spacing: 0.08em;
    min-width: 110px;
}

.block-val {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #D1D5DB;
    letter-spacing: 0.05em;
    word-break: break-all;
}

.block-footer-line {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #1A1A2E;
}

.footer-brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: #F5A623;
    letter-spacing: 0.15em;
    display: block;
    text-shadow: 0 0 10px rgba(245,166,35,0.3);
}

.footer-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #6B7280;
    display: block;
    margin-top: 0.5rem;
    letter-spacing: 0.08em;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-container {
        max-width: 100%;
    }

    .timeline-rail {
        left: 20px;
    }

    .left-event,
    .right-event {
        padding-left: 3.5rem;
        padding-right: 0;
        flex-direction: row;
    }

    .left-event .event-content,
    .right-event .event-content {
        text-align: left;
        border-right: none;
        border-left: 3px solid transparent;
        padding-left: 1rem;
        padding-right: 0;
    }

    .left-event:hover .event-content,
    .right-event:hover .event-content {
        border-right-color: transparent;
        border-left-color: #F5A623;
    }

    .event-dot {
        left: 20px;
    }

    .hash-decoration {
        display: none;
    }
}

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

    .flip-clock {
        gap: 2px;
    }

    .flip-separator {
        padding: 0 2px;
    }

    .terminal-section {
        padding: 2.5rem 1rem;
    }
}
