/* ===================================================
   bcd.day - Blockchain Day
   Dark Neon / Y2K-Futurism / Hexagonal Honeycomb
   =================================================== */

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

:root {
    --void-indigo: #080b1a;
    --obsidian: #0f1428;
    --lunar-silver: #c0c8e0;
    --ledger-green: #00e5a0;
    --signal-cyan: #00b4d8;
    --frost-white: #e8ecf4;
    --haze-slate: #6b7a99;
    --block-amber: #f5a623;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--void-indigo);
    color: var(--frost-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Scan-Line Overlay --- */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.03) 1px,
        rgba(0, 0, 0, 0.03) 2px
    );
    transition: opacity 500ms ease;
}

.scanline-overlay.visible {
    opacity: 1;
}

/* --- Hash Watermark --- */
.hash-watermark {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    opacity: 0.04;
}

.hash-stream {
    position: absolute;
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 3vw;
    color: var(--lunar-silver);
    animation: hashFlow 120s linear infinite;
    top: 30%;
}

.hash-stream-2 {
    top: 65%;
    animation-duration: 150s;
    animation-direction: reverse;
}

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

/* --- HUD Overlay --- */
.hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    pointer-events: none;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hud-block-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--lunar-silver);
    text-shadow: 0 0 8px rgba(0, 229, 160, 0.15);
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 600ms ease;
}

.hud-block-counter.visible {
    opacity: 1;
}

.hud-minimap {
    opacity: 0;
    transition: opacity 600ms ease;
}

.hud-minimap.visible {
    opacity: 1;
}

.minimap-svg {
    width: 36px;
    height: 52px;
}

.minimap-hex {
    fill: none;
    stroke: var(--lunar-silver);
    stroke-width: 0.8;
    opacity: 0.3;
    transition: all 400ms ease;
}

.minimap-hex.active {
    stroke: var(--ledger-green);
    opacity: 1;
    fill: rgba(0, 229, 160, 0.08);
}

/* --- Nonce Counter --- */
.nonce-counter {
    position: fixed;
    bottom: 1.5rem;
    right: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--haze-slate);
    z-index: 100;
    letter-spacing: 0.05em;
    text-shadow: 0 0 8px rgba(0, 229, 160, 0.15);
    transition: color 100ms ease;
}

.nonce-counter.green {
    color: var(--ledger-green);
}

/* --- Block Sections --- */
.block-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* --- Interstitial Void --- */
.interstitial-void {
    height: 20vh;
    position: relative;
    z-index: 2;
}

/* ===================================================
   BLOCK ZERO: Hero
   =================================================== */
.block-zero {
    background: var(--void-indigo);
    flex-direction: column;
}

.node-constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1000ms ease;
}

.node-constellation.visible {
    opacity: 1;
}

.constellation-svg {
    width: 100%;
    height: 100%;
}

.constellation-line {
    stroke: var(--ledger-green);
    stroke-width: 0.5;
    opacity: 0.1;
}

.constellation-node {
    fill: var(--ledger-green);
    opacity: 0.3;
}

.node-pulse-1 { animation: nodePulse 4s ease-in-out infinite; }
.node-pulse-2 { animation: nodePulse 4s ease-in-out infinite 1s; }
.node-pulse-3 { animation: nodePulse 4s ease-in-out infinite 2s; }
.node-pulse-4 { animation: nodePulse 4s ease-in-out infinite 3s; }

@keyframes nodePulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Hex Frame */
.hex-frame-container {
    position: relative;
    width: clamp(280px, 50vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-frame-svg {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: hexRotate 60s linear infinite;
}

.hex-frame-path {
    fill: none;
    stroke: var(--lunar-silver);
    stroke-width: 1.5;
    opacity: 0.6;
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    filter: drop-shadow(0 0 4px rgba(0, 229, 160, 0.12));
    transition: stroke-dashoffset 2s ease-in-out;
}

.hex-frame-path.drawn {
    stroke-dashoffset: 0;
}

@keyframes hexRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Title */
.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 15vw, 14rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--frost-white);
    position: relative;
    z-index: 2;
    line-height: 1;
    white-space: nowrap;
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 400ms ease, transform 400ms ease;
}

.hero-letter-left { transform: translateX(-60px); }
.hero-letter-right { transform: translateX(60px); }
.hero-letter-top { transform: translateY(-60px); }
.hero-letter-bottom { transform: translateY(60px); }

.hero-letter.revealed {
    opacity: 1;
    transform: translate(0, 0);
}

/* Block Counter */
.block-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 600ms ease;
}

.block-counter.visible {
    opacity: 1;
}

.block-counter-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--haze-slate);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.block-counter-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 500;
    color: var(--ledger-green);
    text-shadow: 0 0 12px rgba(0, 229, 160, 0.25);
    letter-spacing: 0.05em;
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 2rem;
    opacity: 0;
    animation: chevronBounce 2s ease-in-out infinite;
    transition: opacity 600ms ease;
}

.scroll-indicator.visible {
    opacity: 0.6;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

/* ===================================================
   BLOCK ONE: Genesis Narrative
   =================================================== */
.block-one {
    background: var(--void-indigo);
    min-height: 100vh;
    padding: 6rem 2rem;
}

.genesis-honeycomb {
    position: relative;
    width: clamp(320px, 80vw, 900px);
    height: clamp(400px, 80vh, 800px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Genesis hexagons */
.genesis-hex {
    position: absolute;
    width: clamp(120px, 20vw, 200px);
    height: clamp(138px, 23vw, 230px);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 500ms ease, transform 500ms ease;
}

.genesis-hex.visible {
    opacity: 1;
    transform: scale(1);
}

.genesis-hex-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.hex-clip {
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(15, 20, 40, 0.7);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
}

.hex-clip::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(192, 200, 224, 0.4);
    pointer-events: none;
}

/* Hex border using SVG overlay */
.genesis-hex-inner::after {
    content: '';
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(192, 200, 224, 0.3), rgba(0, 229, 160, 0.1));
    z-index: -1;
}

.genesis-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--haze-slate);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.genesis-value {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.95rem);
    font-weight: 500;
    color: var(--frost-white);
    line-height: 1.3;
}

.genesis-value-small {
    font-size: clamp(0.55rem, 0.9vw, 0.75rem);
    font-weight: 300;
    color: var(--block-amber);
    line-height: 1.4;
}

.genesis-value-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.7rem);
    word-break: break-all;
    color: var(--ledger-green);
    text-shadow: 0 0 8px rgba(0, 229, 160, 0.15);
}

/* Ripple on center hex */
.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid var(--ledger-green);
    opacity: 0;
    animation: rippleExpand 3s ease-out infinite;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

/* Hex positions for honeycomb layout */
.genesis-hex-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
}
.genesis-hex-center.visible {
    transform: translate(-50%, -50%) scale(1);
}

.genesis-hex-1 {
    top: calc(50% - clamp(138px, 23vw, 230px));
    left: 50%;
    transform: translate(-50%, 0) scale(0.6);
}
.genesis-hex-1.visible {
    transform: translate(-50%, 0) scale(1);
}

.genesis-hex-2 {
    top: calc(50% - clamp(69px, 11.5vw, 115px));
    left: calc(50% + clamp(105px, 17.5vw, 175px));
    transform: translate(-50%, 0) scale(0.6);
}
.genesis-hex-2.visible {
    transform: translate(-50%, 0) scale(1);
}

.genesis-hex-3 {
    top: calc(50% + clamp(69px, 11.5vw, 115px));
    left: calc(50% + clamp(105px, 17.5vw, 175px));
    transform: translate(-50%, 0) scale(0.6);
}
.genesis-hex-3.visible {
    transform: translate(-50%, 0) scale(1);
}

.genesis-hex-4 {
    top: calc(50% + clamp(138px, 23vw, 230px));
    left: 50%;
    transform: translate(-50%, 0) scale(0.6);
}
.genesis-hex-4.visible {
    transform: translate(-50%, 0) scale(1);
}

.genesis-hex-5 {
    top: calc(50% + clamp(69px, 11.5vw, 115px));
    left: calc(50% - clamp(105px, 17.5vw, 175px));
    transform: translate(-50%, 0) scale(0.6);
}
.genesis-hex-5.visible {
    transform: translate(-50%, 0) scale(1);
}

.genesis-hex-6 {
    top: calc(50% - clamp(69px, 11.5vw, 115px));
    left: calc(50% - clamp(105px, 17.5vw, 175px));
    transform: translate(-50%, 0) scale(0.6);
}
.genesis-hex-6.visible {
    transform: translate(-50%, 0) scale(1);
}

/* ===================================================
   BLOCK TWO: The Chain Explained
   =================================================== */
.block-two {
    background: var(--obsidian);
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.chain-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--ledger-green);
    box-shadow: 0 0 8px rgba(0, 229, 160, 0.4);
    z-index: 10;
    transition: width 50ms linear;
}

.chain-scroll-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chain-scroll-container::-webkit-scrollbar {
    display: none;
}

.chain-track {
    display: flex;
    align-items: center;
    height: 100vh;
    padding: 0 calc(50vw - 160px);
    gap: 0;
}

.chain-hex-card {
    flex: 0 0 auto;
    width: 320px;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    position: relative;
    opacity: 0.4;
    filter: blur(3px);
    transform: scale(0.95);
    transition: opacity 400ms ease, filter 300ms ease, transform 300ms ease;
}

.chain-hex-card.active {
    opacity: 1;
    filter: blur(0);
    transform: scale(1.03);
}

.chain-hex-shape {
    width: 300px;
    min-height: 340px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(15, 20, 40, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2.5rem;
    position: relative;
}

.chain-hex-shape::before {
    content: '';
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(192, 200, 224, 0.25), rgba(0, 229, 160, 0.08));
    z-index: -1;
}

.chain-hex-content {
    text-align: center;
}

.chain-hex-content h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--signal-cyan);
    margin-bottom: 1rem;
}

.chain-hex-content p {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    font-weight: 300;
    color: var(--frost-white);
    line-height: 1.7;
    max-width: 22em;
}

.chain-link-line {
    width: 20px;
    height: 2px;
    background: var(--lunar-silver);
    opacity: 0.3;
    flex-shrink: 0;
}

/* ===================================================
   BLOCK THREE: The Timeline
   =================================================== */
.block-three {
    background: var(--void-indigo);
    min-height: auto;
    padding: 8rem 2rem;
    flex-direction: column;
}

.timeline-container {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.timeline-path-svg {
    position: absolute;
    left: 50px;
    top: 0;
    width: 4px;
    height: 100%;
    z-index: 1;
}

.timeline-line {
    stroke: var(--ledger-green);
    stroke-width: 2;
    opacity: 0.6;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    filter: drop-shadow(0 0 4px rgba(0, 229, 160, 0.3));
}

.timeline-milestones {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding-left: 0;
}

.milestone {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    opacity: 0;
    transform: scale(0);
    transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milestone.visible {
    opacity: 1;
    transform: scale(1);
}

.milestone-hex-badge {
    flex-shrink: 0;
    width: 100px;
    height: 115px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(15, 20, 40, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.milestone-hex-badge::before {
    content: '';
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(0, 229, 160, 0.2), rgba(0, 180, 216, 0.1));
    z-index: -1;
}

.milestone-date {
    font-family: 'Righteous', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 400;
    color: var(--ledger-green);
    text-shadow: 0 0 12px rgba(0, 229, 160, 0.3);
}

.milestone-content {
    padding-top: 1rem;
}

.milestone-content h4 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--frost-white);
    margin-bottom: 0.5rem;
}

.milestone-content p {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    font-weight: 300;
    color: var(--lunar-silver);
    line-height: 1.7;
    max-width: 38em;
}

/* ===================================================
   BLOCK FOUR: The Coda
   =================================================== */
.block-four {
    background: var(--void-indigo);
    flex-direction: column;
    gap: 3rem;
}

.coda-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.coda-hex-frame {
    position: relative;
    width: clamp(180px, 30vw, 280px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coda-hex-svg {
    width: 100%;
    height: auto;
    animation: hexRotate 90s linear infinite reverse;
}

.coda-hex-path {
    fill: none;
    stroke: var(--lunar-silver);
    stroke-width: 1;
    opacity: 0.5;
    filter: drop-shadow(0 0 6px rgba(0, 229, 160, 0.12));
}

.coda-hash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.coda-hash-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    font-weight: 400;
    color: var(--ledger-green);
    text-shadow: 0 0 10px rgba(0, 229, 160, 0.2);
    letter-spacing: 0.03em;
}

.coda-tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 300;
    color: var(--lunar-silver);
    letter-spacing: 0.06em;
    text-align: center;
    text-shadow: 0 0 20px rgba(192, 200, 224, 0.15);
}

/* ===================================================
   Hex Scatter (tiny decorative hexagons)
   =================================================== */
.hex-scatter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.scatter-hex {
    position: absolute;
    width: 16px;
    height: 18px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid var(--lunar-silver);
    opacity: 0.08;
}

/* ===================================================
   Chrome Edge Effect
   =================================================== */
.chrome-edge {
    box-shadow:
        0 0 0 1px rgba(192, 200, 224, 0.4),
        0 0 0 3px rgba(0, 229, 160, 0.12);
}

/* ===================================================
   Mobile Responsive
   =================================================== */
@media (max-width: 768px) {
    .hud-minimap {
        display: none;
    }

    .genesis-honeycomb {
        flex-direction: column;
        height: auto;
        gap: 0.5rem;
        padding: 2rem 0;
    }

    .genesis-hex {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 160px;
        height: 184px;
    }

    .genesis-hex.visible {
        transform: none !important;
    }

    .genesis-hex-center {
        transform: none !important;
    }
    .genesis-hex-center.visible {
        transform: none !important;
    }

    .block-one {
        min-height: auto;
        padding: 4rem 1rem;
    }

    .chain-hex-shape {
        width: 260px;
        min-height: 300px;
        padding: 3.5rem 2rem;
    }

    .chain-track {
        padding: 0 calc(50vw - 130px);
    }

    .chain-hex-card {
        width: 280px;
    }

    .milestone {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .milestone-hex-badge {
        width: 80px;
        height: 92px;
    }

    .milestone-content {
        padding-top: 0;
    }

    .timeline-path-svg {
        display: none;
    }

    .hex-frame-container {
        width: clamp(220px, 70vw, 350px);
    }

    .hero-title {
        font-size: clamp(3.5rem, 12vw, 8rem);
    }

    .hud-overlay {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .chain-hex-shape {
        width: 220px;
        min-height: 260px;
        padding: 3rem 1.5rem;
    }

    .chain-track {
        padding: 0 calc(50vw - 110px);
    }

    .chain-hex-card {
        width: 240px;
    }
}
