/* ============================================================
   bcd.day - Styles
   Palette: Dark-Neon | Typography: Futura-Geometric
   ============================================================ */

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

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

body {
    background-color: #09090B;
    color: #F0EDE8;
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Noise Texture Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* --- Timeline Spine --- */
#timeline-spine {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 0%;
    background: #00FFC8;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    animation: spine-pulse 8s ease-in-out infinite;
    transition: height 0.05s linear;
}

@keyframes spine-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1.0; }
}

/* --- Zones --- */
.zone {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

/* ============================================================
   SECTION 1: EPOCH ZERO
   ============================================================ */
#epoch-zero {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #09090B;
}

.epoch-content {
    text-align: center;
    position: relative;
    z-index: 20;
}

.domain-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 10vw, 140px);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: #F0EDE8;
    margin-bottom: 40px;
    line-height: 1;
}

.date-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.counter-row {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.counter-value {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(28px, 5vw, 56px);
    line-height: 1;
    letter-spacing: 0.05em;
}

.counter-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #9B958D;
    margin-top: 8px;
}

.counter-separator {
    font-family: 'Space Mono', monospace;
    font-size: clamp(28px, 5vw, 56px);
    line-height: 1;
    align-self: flex-start;
}

.time-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.time-counter .counter-value {
    font-size: clamp(20px, 3vw, 36px);
}

.counter-tick {
    font-family: 'Space Mono', monospace;
    font-size: clamp(20px, 3vw, 36px);
    line-height: 1;
    animation: tick-blink 1s steps(1) infinite;
}

@keyframes tick-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* --- Neon Utility Classes --- */
.neon-mint {
    color: #00FFC8;
    text-shadow: 0 0 7px rgba(0,255,200,0.6), 0 0 20px rgba(0,255,200,0.3), 0 0 40px rgba(0,255,200,0.1);
}

.neon-amber {
    color: #FFB800;
    text-shadow: 0 0 7px rgba(255,184,0,0.6), 0 0 20px rgba(255,184,0,0.3), 0 0 40px rgba(255,184,0,0.1);
}

.neon-magenta {
    color: #FF2D6B;
    text-shadow: 0 0 7px rgba(255,45,107,0.6), 0 0 20px rgba(255,45,107,0.3), 0 0 40px rgba(255,45,107,0.1);
}

/* ============================================================
   SECTION 2: CHRONICLE
   ============================================================ */
#chronicle {
    padding: 100px 0;
    position: relative;
}

/* --- Timeline Nodes --- */
.timeline-node {
    position: relative;
    width: 100%;
    margin-bottom: 200px;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: scale(1);
}

/* Node Left */
.node-left {
    justify-content: flex-end;
    padding-right: calc(50% + 60px);
}

.node-left .node-connector {
    position: absolute;
    right: calc(50% - 40px);
    top: 50%;
    width: 40px;
    height: 1px;
    background: #00FFC8;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    transform: translateY(-50%);
}

.node-left .node-marker {
    position: absolute;
    right: calc(50% - 6px);
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #00FFC8;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    transform: translateY(-50%);
    background: linear-gradient(135deg, #E8E4DF 0%, #9B958D 100%);
}

/* Node Right */
.node-right {
    justify-content: flex-start;
    padding-left: calc(50% + 60px);
}

.node-right .node-connector {
    position: absolute;
    left: calc(50% - 40px);
    top: 50%;
    width: 40px;
    height: 1px;
    background: #00FFC8;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    transform: translateY(-50%);
}

.node-right .node-marker {
    position: absolute;
    left: calc(50% - 6px);
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #00FFC8;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    transform: translateY(-50%);
    background: linear-gradient(135deg, #E8E4DF 0%, #9B958D 100%);
}

/* Node Content */
.node-content {
    max-width: 480px;
    background-color: #141418;
    padding: 32px;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

.node-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.05em;
    color: #F0EDE8;
    margin-bottom: 12px;
}

.neon-divider {
    border: none;
    height: 1px;
    background: #00FFC8;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    margin: 16px 0;
}

.node-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.7;
    color: #C4BEB7;
}

/* --- Corner Brackets --- */
.corner-bracket {
    position: absolute;
    width: 16px;
    height: 16px;
}

.corner-bracket.top-left {
    top: 0;
    left: 0;
    border-top: 1px solid #00FFC8;
    border-left: 1px solid #00FFC8;
}

.corner-bracket.top-right {
    top: 0;
    right: 0;
    border-top: 1px solid #00FFC8;
    border-right: 1px solid #00FFC8;
}

.corner-bracket.bottom-left {
    bottom: 0;
    left: 0;
    border-bottom: 1px solid #00FFC8;
    border-left: 1px solid #00FFC8;
}

.corner-bracket.bottom-right {
    bottom: 0;
    right: 0;
    border-bottom: 1px solid #00FFC8;
    border-right: 1px solid #00FFC8;
}

/* --- Marble Panel --- */
.marble-panel {
    background:
        linear-gradient(125deg, transparent 30%, rgba(155,149,141,0.12) 32%, transparent 35%),
        linear-gradient(205deg, transparent 45%, rgba(155,149,141,0.08) 47%, transparent 50%),
        linear-gradient(75deg, transparent 60%, rgba(196,190,183,0.1) 62%, transparent 65%),
        radial-gradient(ellipse at 30% 40%, rgba(155,149,141,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(196,190,183,0.05) 0%, transparent 40%),
        #E8E4DF;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

.marble-panel .corner-bracket {
    border-color: #706A62;
}

.marble-inscription {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 40px);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: center;
    color: transparent;
    background: linear-gradient(180deg, #9B958D 0%, #706A62 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.4), -1px -1px 0 rgba(0,0,0,0.2);
}

/* ============================================================
   SECTION 3: MARBLE HALL
   ============================================================ */
#marble-hall {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #09090B;
    overflow: hidden;
}

.marble-band {
    width: 200px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.marble-surface {
    background:
        linear-gradient(125deg, transparent 30%, rgba(155,149,141,0.12) 32%, transparent 35%),
        linear-gradient(205deg, transparent 45%, rgba(155,149,141,0.08) 47%, transparent 50%),
        linear-gradient(75deg, transparent 60%, rgba(196,190,183,0.1) 62%, transparent 65%),
        radial-gradient(ellipse at 30% 40%, rgba(155,149,141,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(196,190,183,0.05) 0%, transparent 40%),
        #E8E4DF;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

.marble-text-container {
    text-align: center;
    padding: 40px 20px;
}

.chiseled-text {
    color: transparent;
    background: linear-gradient(180deg, #9B958D 0%, #706A62 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.4), -1px -1px 0 rgba(0,0,0,0.2);
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: clamp(16px, 2.5vw, 28px);
    line-height: 1.5;
    margin-bottom: 8px;
}

.chiseled-text.small {
    font-size: clamp(12px, 1.8vw, 20px);
    font-weight: 300;
    letter-spacing: 0.1em;
}

.marble-divider {
    border: none;
    height: 1px;
    background: #9B958D;
    margin: 24px auto;
    width: 60%;
    opacity: 0.5;
}

/* ============================================================
   SECTION 4: SIGNAL
   ============================================================ */
#signal {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #09090B;
    position: relative;
}

#signal::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #FF2D6B;
    transform: translateX(-50%);
    box-shadow: 0 0 4px rgba(255,45,107,0.5), 0 0 12px rgba(255,45,107,0.2);
    opacity: 0;
    transition: opacity 0.8s ease;
}

#signal.active::before {
    opacity: 1;
}

.signal-content {
    text-align: center;
    position: relative;
    z-index: 20;
}

.signal-number {
    display: block;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(80px, 15vw, 200px);
    line-height: 1;
    color: #FF2D6B;
    text-shadow: 0 0 7px rgba(255,45,107,0.6), 0 0 20px rgba(255,45,107,0.3), 0 0 40px rgba(255,45,107,0.1);
    letter-spacing: 0.02em;
}

.signal-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 2vw, 24px);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9B958D;
    margin-top: 24px;
}

/* ============================================================
   SECTION 5: TERMINAL
   ============================================================ */
#terminal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #09090B;
    position: relative;
}

.terminal-marker {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-marble {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: marble-rotate 20s linear infinite;
    background-size: 200% 200%;
}

@keyframes marble-rotate {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
}

.terminal-ring {
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 1px solid #00FFC8;
    box-shadow: 0 0 4px rgba(0,255,200,0.5), 0 0 12px rgba(0,255,200,0.2);
    animation: ring-rotate 12s linear infinite;
}

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

/* Add a visible orbital dot on the ring */
.terminal-ring::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #00FFC8;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0,255,200,0.8), 0 0 16px rgba(0,255,200,0.4);
}

.terminal-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    color: #9B958D;
    margin-top: 40px;
}

/* ============================================================
   COUNTER ANIMATION GLOW INTENSITY
   ============================================================ */
.counter-animate.counting {
    text-shadow: 0 0 10px rgba(255,184,0,0.9), 0 0 30px rgba(255,184,0,0.5), 0 0 60px rgba(255,184,0,0.2);
    transition: text-shadow 0.3s ease;
}

.counter-animate.settled {
    text-shadow: 0 0 7px rgba(255,184,0,0.6), 0 0 20px rgba(255,184,0,0.3), 0 0 40px rgba(255,184,0,0.1);
    transition: text-shadow 0.8s ease;
}

#signal-counter.counting {
    text-shadow: 0 0 10px rgba(255,45,107,0.9), 0 0 30px rgba(255,45,107,0.5), 0 0 60px rgba(255,45,107,0.2);
    transition: text-shadow 0.3s ease;
}

#signal-counter.settled {
    text-shadow: 0 0 7px rgba(255,45,107,0.6), 0 0 20px rgba(255,45,107,0.3), 0 0 40px rgba(255,45,107,0.1);
    transition: text-shadow 0.8s ease;
}

/* ============================================================
   RESPONSIVE - MOBILE
   ============================================================ */
@media (max-width: 768px) {

    /* Timeline shifts to left rail */
    #timeline-spine {
        left: 24px;
        transform: none;
    }

    /* All nodes stack on the right */
    .node-left,
    .node-right {
        justify-content: flex-start;
        padding-left: 64px;
        padding-right: 20px;
    }

    .node-left .node-connector,
    .node-right .node-connector {
        left: 24px;
        right: auto;
        width: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .node-left .node-marker,
    .node-right .node-marker {
        left: 18px;
        right: auto;
        top: 50%;
        transform: translateY(-50%);
    }

    .node-content {
        max-width: 100%;
    }

    /* Marble band becomes full width on mobile */
    .marble-band {
        width: 100%;
        padding: 0 20px;
    }

    /* Signal section */
    #signal::before {
        left: 24px;
        transform: none;
    }

    /* Reduce spacing */
    .timeline-node {
        margin-bottom: 120px;
    }

    .domain-title {
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .date-counter {
        gap: 4px;
    }

    .counter-value {
        font-size: 24px;
    }

    .counter-separator {
        font-size: 24px;
    }

    .time-counter .counter-value {
        font-size: 18px;
    }

    .counter-tick {
        font-size: 18px;
    }

    .node-content {
        padding: 24px;
    }
}
