/* =============================================
   blockchain.day — Gold on Black Luxury
   Timeline-Vertical Descent Narrative
   ============================================= */

/* CSS Custom Properties */
:root {
    --void: #0a0a0a;
    --surface: #111111;
    --elevation: #1a1a1a;
    --gold-pure: #c9a84c;
    --gold-pale: #e8d5a3;
    --gold-warm: #d4a017;
    --gold-shadow: rgba(201, 168, 76, 0.06);
    --text-body: #a89f8a;
    --text-dust: #6b6356;
    --dark-deep: #0d0d0d;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease-resolve: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void);
    color: var(--text-body);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   Guide Rails
   ============================================= */
.guide-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--gold-pure);
    opacity: 0;
    z-index: 5;
    transition: opacity 1.2s var(--ease-resolve);
}

.guide-rail.visible {
    opacity: 0.08;
}

.guide-rail--left {
    left: 16.666%;
}

.guide-rail--right {
    right: 16.666%;
}

/* =============================================
   Margin Hexagons
   ============================================= */
.margin-hexagons {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 16%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.margin-hexagons--left {
    left: 0;
}

.margin-hexagons--right {
    right: 0;
}

.hex {
    position: absolute;
    opacity: 0.06;
    animation: hexFloat linear infinite;
}

.hex--1 {
    width: 80px;
    left: 20%;
    top: 120%;
    animation-duration: 45s;
}

.hex--2 {
    width: 50px;
    left: 50%;
    top: 130%;
    animation-duration: 60s;
    animation-delay: -15s;
}

.hex--3 {
    width: 120px;
    left: 10%;
    top: 140%;
    animation-duration: 75s;
    animation-delay: -30s;
}

.hex--4 {
    width: 60px;
    right: 30%;
    left: auto;
    top: 125%;
    animation-duration: 50s;
    animation-delay: -10s;
}

.hex--5 {
    width: 100px;
    right: 10%;
    left: auto;
    top: 135%;
    animation-duration: 65s;
    animation-delay: -25s;
}

.hex--6 {
    width: 40px;
    right: 50%;
    left: auto;
    top: 145%;
    animation-duration: 55s;
    animation-delay: -5s;
}

@keyframes hexFloat {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-300vh);
    }
}

/* =============================================
   Progress Indicator
   ============================================= */
.progress-track {
    position: fixed;
    right: 3%;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background-color: rgba(201, 168, 76, 0.06);
    z-index: 10;
    border-radius: 1px;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: var(--gold-pure);
    border-radius: 1px;
    transition: height 0.15s linear;
}

.progress-fill.complete {
    animation: progressPulse 1.5s ease-in-out 1;
}

@keyframes progressPulse {
    0%, 100% {
        background-color: var(--gold-pure);
        box-shadow: none;
    }
    50% {
        background-color: var(--gold-warm);
        box-shadow: 0 0 12px rgba(212, 160, 23, 0.4);
    }
}

/* =============================================
   Main Chain Container
   ============================================= */
.chain {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100vh 0 0 0;
    position: relative;
}

/* =============================================
   Block Sections
   ============================================= */
.block {
    width: 50%;
    max-width: 720px;
    min-width: 320px;
    position: relative;
    opacity: 0;
    transform: scale(0.92);
    filter: blur(2px);
    transition: opacity 0.6s var(--ease-resolve),
                transform 0.6s var(--ease-resolve),
                filter 0.6s var(--ease-resolve);
}

.block.in-view {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.block__border-wrap {
    position: relative;
    background-color: var(--surface);
    box-shadow: inset 0 0 40px var(--gold-shadow);
    padding: 0;
}

.block__border-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.block__border-rect {
    stroke-opacity: 0.2;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 2s var(--ease-resolve);
}

.block.in-view .block__border-rect {
    stroke-dashoffset: 0;
}

.block.in-view .block__border-wrap {
    background-color: var(--surface);
}

.block:hover .block__border-wrap {
    background-color: var(--elevation);
}

.block__inner {
    position: relative;
    z-index: 2;
    padding: 48px 48px 56px;
}

.block__hash {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--gold-pure);
    opacity: 0.4;
    margin-bottom: 28px;
}

.chevron {
    display: inline-block;
    font-size: 0.6em;
    opacity: 0.6;
    animation: chevronExpand 3s ease-in-out infinite;
}

.chevron--left {
    margin-right: 4px;
    animation-direction: normal;
}

.chevron--right {
    margin-left: 4px;
    animation-direction: reverse;
}

@keyframes chevronExpand {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-2px);
    }
}

.chevron--right {
    animation-name: chevronExpandRight;
}

@keyframes chevronExpandRight {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(2px);
    }
}

.block__header {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.block__header-text {
    flex: 1;
    min-width: 0;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--gold-pale);
    margin-bottom: 32px;
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.2;
    color: var(--gold-pure);
    margin-bottom: 24px;
}

.block__body {
    color: var(--text-body);
    margin-bottom: 20px;
}

.block__body:last-child {
    margin-bottom: 0;
}

/* Block paragraph stagger animation */
.block__body {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s var(--ease-resolve),
                transform 0.4s var(--ease-resolve);
}

.block.in-view .block__body {
    opacity: 1;
    transform: translateY(0);
}

.block.in-view .block__body:nth-child(2) {
    transition-delay: 0.3s;
}

.block.in-view .block__body:nth-child(3) {
    transition-delay: 0.6s;
}

/* =============================================
   Block Icons
   ============================================= */
.block__icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.block__icon--large {
    width: 160px;
    height: 160px;
}

.block__icon svg {
    width: 100%;
    height: 100%;
}

/* Iso Block */
.iso-block {
    opacity: 0.8;
}

/* Iso Ledger */
.iso-ledger {
    opacity: 0.7;
}

/* Iso Seal */
.iso-seal {
    opacity: 0.7;
}

.seal-ring {
    animation: sealPulse 4s ease-in-out infinite;
}

.seal-ring--1 {
    animation-delay: 0s;
}

.seal-ring--2 {
    animation-delay: 0.3s;
}

.seal-ring--3 {
    animation-delay: 0.6s;
}

@keyframes sealPulse {
    0%, 100% {
        stroke-opacity: 0.2;
    }
    50% {
        stroke-opacity: 0.45;
    }
}

/* Iso Node */
.iso-node {
    opacity: 0.7;
}

.node-edge {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.375s var(--ease-resolve);
}

.block--network.in-view .node-edge[data-index="0"] { stroke-dashoffset: 0; transition-delay: 0s; }
.block--network.in-view .node-edge[data-index="1"] { stroke-dashoffset: 0; transition-delay: 0.375s; }
.block--network.in-view .node-edge[data-index="2"] { stroke-dashoffset: 0; transition-delay: 0.75s; }
.block--network.in-view .node-edge[data-index="3"] { stroke-dashoffset: 0; transition-delay: 1.125s; }
.block--network.in-view .node-edge[data-index="4"] { stroke-dashoffset: 0; transition-delay: 1.5s; }
.block--network.in-view .node-edge[data-index="5"] { stroke-dashoffset: 0; transition-delay: 1.875s; }
.block--network.in-view .node-edge[data-index="6"] { stroke-dashoffset: 0; transition-delay: 2.25s; }
.block--network.in-view .node-edge[data-index="7"] { stroke-dashoffset: 0; transition-delay: 2.625s; }

.node-vertex {
    opacity: 0;
    transition: opacity 0.3s var(--ease-resolve);
}

.block--network.in-view .node-vertex {
    opacity: 1;
    transition-delay: 3s;
    animation: vertexPulse 2s ease-in-out 3.1s 1;
}

@keyframes vertexPulse {
    0%, 100% {
        fill-opacity: 0.6;
        r: 3;
    }
    50% {
        fill-opacity: 1;
        r: 5;
    }
}

/* =============================================
   Chain Connectors
   ============================================= */
.chain-connector {
    width: 2px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chain-connector__line {
    width: 2px;
    height: 100%;
    background-color: var(--gold-pure);
    opacity: 0.15;
}

.chain-connector__pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
}

.chain-connector__pulse svg {
    width: 100%;
    height: 100%;
}

.pulse-ring {
    transform-origin: center;
    animation: concentricPulse 4s ease-in-out infinite;
}

.pulse-ring--outer {
    animation-delay: 0s;
}

.pulse-ring--mid {
    animation-delay: 0.4s;
}

.pulse-ring--inner {
    animation-delay: 0.8s;
}

@keyframes concentricPulse {
    0%, 100% {
        transform: scale(1);
        stroke-opacity: var(--base-opacity, 0.08);
    }
    50% {
        transform: scale(1.15);
        stroke-opacity: calc(var(--base-opacity, 0.08) * 2);
    }
}

.pulse-ring--outer {
    --base-opacity: 0.12;
}

.pulse-ring--mid {
    --base-opacity: 0.08;
}

.pulse-ring--inner {
    --base-opacity: 0.04;
}

/* =============================================
   Block 5: Permanence — Thicker Border
   ============================================= */
.block--permanence .block__border-rect {
    stroke-width: 1;
    stroke-opacity: 0.3;
}

.chain-band {
    margin-top: 32px;
    width: 100%;
    overflow: hidden;
}

.chain-links {
    width: 100%;
    height: 40px;
}

/* =============================================
   Block 6: Genesis — Full Bleed Expansion
   ============================================= */
.block--genesis {
    width: 50%;
    max-width: 720px;
    transition: width 0.5s var(--ease-resolve),
                max-width 0.5s var(--ease-resolve),
                opacity 0.6s var(--ease-resolve),
                transform 0.6s var(--ease-resolve),
                filter 0.6s var(--ease-resolve);
    margin-bottom: 0;
    padding-bottom: 100px;
}

.block--genesis.expanded {
    width: 100vw;
    max-width: 100vw;
}

.block__border-wrap--genesis {
    position: relative;
    background-color: transparent;
    box-shadow: none;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.genesis-strata {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
}

.strata-layer {
    flex: 1;
    position: relative;
}

.strata-layer--1 {
    background-color: #0d0d0d;
    border-bottom: 1px solid rgba(201, 168, 76, 0.04);
}

.strata-layer--2 {
    background-color: #0c0c0c;
    border-bottom: 1px solid rgba(201, 168, 76, 0.06);
}

.strata-layer--3 {
    background-color: var(--surface);
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
}

.strata-layer--4 {
    background-color: #0e0e0e;
    border-bottom: 1px solid rgba(201, 168, 76, 0.05);
}

.strata-layer--5 {
    background-color: var(--void);
}

.block__inner--genesis {
    text-align: center;
    padding: 80px 48px 100px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.block__hash--genesis {
    opacity: 0.3;
    margin-bottom: 60px;
}

.genesis-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--gold-pure);
    margin-bottom: 40px;
    position: relative;
    z-index: 3;
}

.block__body--genesis {
    max-width: 640px;
    text-align: center;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
}

/* Genesis Hexagons — Mandala */
.genesis-hexagons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
    z-index: 1;
}

.genesis-hex {
    position: absolute;
    opacity: 0;
    transition: all 2s var(--ease-resolve);
}

.genesis-hex--1 {
    width: 200px;
    top: -20%;
    left: -30%;
}

.genesis-hex--2 {
    width: 160px;
    top: -15%;
    right: -25%;
    left: auto;
}

.genesis-hex--3 {
    width: 120px;
    bottom: -10%;
    left: -20%;
    top: auto;
}

.genesis-hex--4 {
    width: 180px;
    bottom: -15%;
    right: -20%;
    top: auto;
    left: auto;
}

.genesis-hex--5 {
    width: 100px;
    top: 30%;
    left: -35%;
}

.genesis-hex--6 {
    width: 140px;
    top: 25%;
    right: -30%;
    left: auto;
}

/* Converged mandala positions */
.genesis-hexagons.converged .genesis-hex {
    opacity: 0.08;
}

.genesis-hexagons.converged .genesis-hex--1 {
    top: 10%;
    left: 15%;
    transform: rotate(0deg);
}

.genesis-hexagons.converged .genesis-hex--2 {
    top: 10%;
    right: 15%;
    left: auto;
    transform: rotate(30deg);
}

.genesis-hexagons.converged .genesis-hex--3 {
    top: 50%;
    left: 5%;
    transform: rotate(60deg);
}

.genesis-hexagons.converged .genesis-hex--4 {
    top: 50%;
    right: 5%;
    left: auto;
    transform: rotate(90deg);
}

.genesis-hexagons.converged .genesis-hex--5 {
    top: 70%;
    left: 20%;
    transform: rotate(120deg);
}

.genesis-hexagons.converged .genesis-hex--6 {
    top: 70%;
    right: 20%;
    left: auto;
    transform: rotate(150deg);
}

/* =============================================
   Surface Block — Initial Animation
   ============================================= */
.block--surface {
    opacity: 0;
}

.block--surface.in-view h1 {
    animation: fadeInUp 0.6s var(--ease-resolve) 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   Consensus Block — Scroll-responsive pulse
   ============================================= */
.block--consensus .seal-ring {
    transition: animation-duration 0.5s;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 1024px) {
    .block {
        width: 70%;
    }

    .block--genesis {
        width: 70%;
    }

    .guide-rail--left {
        left: 10%;
    }

    .guide-rail--right {
        right: 10%;
    }
}

@media (max-width: 768px) {
    .block {
        width: 90%;
        min-width: 280px;
    }

    .block--genesis {
        width: 90%;
    }

    .block__inner {
        padding: 32px 24px 40px;
    }

    .block__header {
        flex-direction: column;
    }

    .block__icon {
        width: 60px;
        height: 60px;
        align-self: flex-end;
        margin-top: -20px;
    }

    .block__icon--large {
        width: 120px;
        height: 120px;
    }

    .genesis-hexagons {
        width: 300px;
        height: 300px;
    }

    .guide-rail {
        display: none;
    }

    .margin-hexagons {
        display: none;
    }

    .progress-track {
        right: 2%;
    }

    .block__inner--genesis {
        padding: 60px 24px 80px;
    }
}

@media (max-width: 480px) {
    .block {
        width: 95%;
    }

    .block--genesis {
        width: 95%;
    }

    .block__inner {
        padding: 24px 16px 32px;
    }

    .genesis-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}

/* =============================================
   Selection styling
   ============================================= */
::selection {
    background-color: rgba(201, 168, 76, 0.2);
    color: var(--gold-pale);
}

/* =============================================
   Scrollbar styling (Webkit)
   ============================================= */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.3);
}
