/* ========================================
   bcd.day - Blockchain Day
   Color Palette:
     Primary dark:    #0b0e1a
     Secondary dark:  #151820
     Tertiary dark:   #1a1e2e
     Accent primary:  #00e5ff
     Accent secondary:#6c5ce7
     Text primary:    #e0e0e0
     Text secondary:  #8892b0
     Confirmation:    #00ff88
   Fonts:
     Display: Bebas Neue
     Body:    IBM Plex Mono
     Data:    Overpass Mono
   ======================================== */

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

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

body {
    background-color: #0b0e1a;
    color: #e0e0e0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
}

/* ---- Hash Watermarks (parallax background) ---- */
#hash-watermarks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.hash-line {
    position: absolute;
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 120px;
    color: #1a1e2e;
    white-space: nowrap;
    user-select: none;
    will-change: transform;
}

.hash-line-1 {
    top: 15%;
    left: -5%;
    transform: rotate(-5deg);
}

.hash-line-2 {
    top: 50%;
    left: -10%;
    transform: rotate(3deg);
}

.hash-line-3 {
    top: 80%;
    left: -3%;
    transform: rotate(-2deg);
}

/* ---- Nonce Counter ---- */
#nonce-counter {
    position: fixed;
    bottom: 12px;
    right: 12px;
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #6c5ce7;
    opacity: 0.4;
    z-index: 1000;
    pointer-events: none;
}

/* ---- Drift Particles ---- */
#drift-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.drift-particle {
    position: absolute;
    width: 4px;
    height: 2px;
    background: #00e5ff;
    opacity: 0.15;
    will-change: transform;
}

@keyframes drift-up {
    0% {
        transform: translateY(0);
        opacity: 0.15;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-110vh);
        opacity: 0;
    }
}

/* ---- Genesis Line ---- */
@keyframes genesis-shimmer {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes genesis-gradient-shift {
    0% {
        stop-color: transparent;
    }
    30% {
        stop-color: #00e5ff;
    }
    50% {
        stop-color: #00e5ff;
    }
    70% {
        stop-color: #00e5ff;
    }
    100% {
        stop-color: transparent;
    }
}

.genesis-line {
    width: 100%;
    height: 2px;
    opacity: 0;
    will-change: opacity;
}

.genesis-line line {
    vector-effect: non-scaling-stroke;
}

/* ---- Section: Opening Viewport ---- */
#opening {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0e1a;
    z-index: 2;
    overflow: hidden;
}

#domain-name {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.25em;
    color: #e0e0e0;
    opacity: 0;
    text-transform: uppercase;
    will-change: opacity;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

#genesis-line {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* ---- Section: Block Timeline ---- */
#block-timeline {
    position: relative;
    z-index: 2;
}

.block-section {
    position: relative;
    padding: 120px 0;
    overflow: hidden;
}

.block-dark {
    background: #0b0e1a;
}

.block-charcoal {
    background: #151820;
}

.block-separator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
}

.block-separator line {
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1920;
    stroke-dashoffset: 1920;
    transition: stroke-dashoffset 0.8s ease-out;
}

.block-section.revealed .block-separator line {
    stroke-dashoffset: 0;
}

.block-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 40px;
}

.block-skew {
    transform: skewY(-2deg);
}

.block-skew > * {
    transform: skewY(2deg);
}

.block-number {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(11px, 1vw, 14px);
    letter-spacing: 0.08em;
    color: #6c5ce7;
    display: block;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.block-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(24px, 4vw, 56px);
    letter-spacing: 0.20em;
    color: #e0e0e0;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.block-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 18px);
    line-height: 1.85;
    color: #8892b0;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.block-text:nth-child(4) {
    transition-delay: 0.45s;
}

.block-text:nth-child(5) {
    transition-delay: 0.6s;
}

.block-section.revealed .block-number,
.block-section.revealed .block-title,
.block-section.revealed .block-text {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Section: Consensus ---- */
#consensus {
    position: relative;
    z-index: 2;
    background: #0b0e1a;
    padding: 120px 40px;
    overflow: hidden;
}

.consensus-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 80px;
}

.consensus-cube-container {
    flex: 0 0 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cube-wrapper {
    width: 200px;
    height: 200px;
    perspective: 600px;
}

.cube {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    animation: cube-spin 30s linear infinite;
    margin: 40px auto;
}

@keyframes cube-spin {
    0% {
        transform: rotateY(0deg) rotateX(15deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(15deg);
    }
}

.cube-face {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 1px solid #00e5ff;
    background: transparent;
    opacity: 0.4;
}

.cube-front  { transform: translateZ(60px); }
.cube-back   { transform: rotateY(180deg) translateZ(60px); }
.cube-left   { transform: rotateY(-90deg) translateZ(60px); }
.cube-right  { transform: rotateY(90deg) translateZ(60px); }
.cube-top    { transform: rotateX(90deg) translateZ(60px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(60px); }

.consensus-text {
    flex: 1;
}

.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(24px, 4vw, 56px);
    letter-spacing: 0.20em;
    color: #e0e0e0;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#consensus.revealed .section-title,
#consensus.revealed .block-text {
    opacity: 1;
    transform: translateY(0);
}

#consensus .block-text:nth-child(2) {
    transition-delay: 0.15s;
}

#consensus .block-text:nth-child(3) {
    transition-delay: 0.3s;
}

#consensus .block-text:nth-child(4) {
    transition-delay: 0.45s;
}

/* ---- Section: Mempool ---- */
#mempool {
    position: relative;
    z-index: 2;
    background: #151820;
    padding: 120px 40px;
    min-height: 100vh;
    overflow: hidden;
}

.mempool-inner {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.mempool-description {
    max-width: 700px;
    margin-bottom: 60px;
}

#mempool-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.mempool-tx {
    position: absolute;
    width: 32px;
    height: 16px;
    border: 1px solid #6c5ce7;
    opacity: 0.3;
    will-change: transform;
    transition: animation-duration 1s ease;
}

@keyframes mempool-rise {
    0% {
        transform: translateY(0);
        opacity: 0.3;
    }
    10% {
        opacity: 0.3;
    }
    80% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-100vh);
        opacity: 0;
    }
}

#mempool.revealed .section-title,
#mempool.revealed .block-text {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Section: Closing Viewport ---- */
#closing {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0e1a;
    z-index: 2;
    overflow: hidden;
}

.closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.closing-genesis {
    width: 80vw;
    animation: genesis-pulse 4s ease-in-out infinite;
    opacity: 0.4;
}

@keyframes genesis-pulse {
    0% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.2;
    }
}

#timestamp-display {
    font-family: 'Overpass Mono', monospace;
    font-weight: 300;
    font-size: clamp(14px, 1.5vw, 20px);
    letter-spacing: 0.08em;
    color: #00e5ff;
    text-align: center;
}

.confirmed-label {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(11px, 1vw, 14px);
    letter-spacing: 0.30em;
    color: #00ff88;
    opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .consensus-inner {
        flex-direction: column;
        gap: 40px;
    }

    .consensus-cube-container {
        flex: none;
    }

    .block-inner {
        padding: 0 24px;
    }

    .block-section {
        padding: 80px 0;
    }

    #consensus,
    #mempool {
        padding: 80px 24px;
    }

    .hash-line {
        font-size: 60px;
    }
}

@media (max-width: 480px) {
    .hash-line {
        font-size: 40px;
    }

    .block-inner {
        padding: 0 16px;
    }
}
