/* cbdc.bar - The Zen Garden of Money That Doesn't Exist Yet */
/* Colors: #1A1423, #E8C4C4, #8B9E7E, #E63946, #F4A261, #1D3557, #FAF3E0 */
/* Fonts: Dela Gothic One, Space Grotesk, Lora, Inter */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #1A1423;
    color: #FAF3E0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   DISPLAY TYPOGRAPHY
   ============================================ */

.display-text {
    font-family: 'Dela Gothic One', cursive;
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* ============================================
   OPENING SECTION
   ============================================ */

.opening {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.opening-inner {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

.opening .display-text {
    font-size: clamp(36px, 8vw, 96px);
    color: #FAF3E0;
    margin-bottom: 1.5rem;
}

.opening-subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(16px, 2.5vw, 22px);
    color: #E8C4C4;
    margin-bottom: 3rem;
    opacity: 0.8;
}

.enso-circle {
    margin: 0 auto 3rem;
    animation: enso-rotate 20s linear infinite;
}

@keyframes enso-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: scroll-fade 2.5s ease-in-out infinite;
}

.scroll-hint-text {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B9E7E;
    opacity: 0.6;
}

.scroll-hint-arrow {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #8B9E7E, transparent);
    opacity: 0.4;
}

@keyframes scroll-fade {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(8px); }
}

/* ============================================
   TIMELINE SPINE
   ============================================ */

.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 120px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 6px;
    background-color: #E63946;
    transform: translateX(-50%);
    border-radius: 3px;
    animation: spine-pulse 4s ease-in-out infinite;
}

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

/* ============================================
   TIMELINE NODES
   ============================================ */

.timeline-node {
    position: relative;
    width: 45%;
    padding: 0 0 80px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.node-left {
    margin-right: auto;
    margin-left: 0;
    text-align: right;
    padding-right: 40px;
}

.node-right {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
    padding-left: 40px;
}

/* Node dot on the spine */
.node-dot {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #E63946;
    border: 3px solid #1A1423;
    top: 8px;
    z-index: 2;
}

.node-left .node-dot {
    right: -9px;
    transform: translateX(50%);
    right: calc(-45% / 45% * 50% - 9px);
}

/* Precise positioning relative to the spine center */
.node-left .node-dot {
    position: absolute;
    right: -53px;
}

.node-right .node-dot {
    position: absolute;
    left: -53px;
}

/* Connector line from node to spine */
.node-connector {
    position: absolute;
    top: 15px;
    height: 2px;
    background-color: #E63946;
    opacity: 0.4;
}

.node-left .node-connector {
    right: -40px;
    width: 40px;
}

.node-right .node-connector {
    left: -40px;
    width: 40px;
}

/* Node content */
.node-content {
    position: relative;
    padding: 2rem;
    background-color: rgba(29, 53, 87, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

/* Grain overlay on nodes */
.node-content::before {
    content: '';
    position: absolute;
    inset: 0;
    filter: url(#grain-filter);
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.node-date {
    font-family: 'Space Mono', monospace;
    font-style: normal;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #F4A261;
    display: block;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.node-title {
    font-size: clamp(24px, 4vw, 48px);
    color: #FAF3E0;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.node-body {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(14px, 1.8vw, 17px);
    font-weight: 300;
    line-height: 1.7;
    color: #E8C4C4;
    position: relative;
    z-index: 1;
}

.node-quote {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(14px, 1.6vw, 16px);
    color: #F4A261;
    border-left: 3px solid #E63946;
    padding: 0.5rem 0 0.5rem 1rem;
    margin-top: 1rem;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

/* Benday dot pattern overlay */
.benday-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #E63946 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Era-specific accent colors */
[data-era="ancient"] .node-content {
    border-left: 3px solid #F4A261;
}
[data-era="ancient"].node-right .node-content {
    border-left: 3px solid #F4A261;
    border-right: none;
}
[data-era="ancient"].node-left .node-content {
    border-left: none;
    border-right: 3px solid #F4A261;
}

[data-era="medieval"] .node-content { border-color: #E8C4C4; }
[data-era="medieval"].node-right .node-content { border-left: 3px solid #E8C4C4; }
[data-era="medieval"].node-left .node-content { border-right: 3px solid #E8C4C4; border-left: none; }

[data-era="renaissance"] .node-content { border-color: #8B9E7E; }
[data-era="renaissance"].node-right .node-content { border-left: 3px solid #8B9E7E; }
[data-era="renaissance"].node-left .node-content { border-right: 3px solid #8B9E7E; border-left: none; }

[data-era="modern"].node-right .node-content { border-left: 3px solid #1D3557; }
[data-era="modern"].node-left .node-content { border-right: 3px solid #1D3557; border-left: none; }

[data-era="digital"].node-right .node-content { border-left: 3px solid #E63946; }
[data-era="digital"].node-left .node-content { border-right: 3px solid #E63946; border-left: none; }

[data-era="crypto"].node-right .node-content { border-left: 3px solid #F4A261; }
[data-era="crypto"].node-left .node-content { border-right: 3px solid #F4A261; border-left: none; }

[data-era="cbdc"].node-right .node-content { border-left: 3px solid #E63946; }
[data-era="cbdc"].node-left .node-content { border-right: 3px solid #E63946; border-left: none; }

[data-era="future"].node-right .node-content { border-left: 3px solid #8B9E7E; }
[data-era="future"].node-left .node-content { border-right: 3px solid #8B9E7E; border-left: none; }

/* ============================================
   BOTANICAL BREATHING SPACES
   ============================================ */

.botanical-space {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.botanical-space.visible {
    opacity: 1;
    transform: scale(1);
}

.botanical-svg {
    animation: botanical-sway 8s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes botanical-sway {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

/* ============================================
   CLOSING SECTION
   ============================================ */

.closing {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.closing-inner {
    text-align: center;
    padding: 2rem;
    max-width: 700px;
}

.closing .enso-circle {
    margin-bottom: 2rem;
}

.closing-text {
    font-size: clamp(28px, 6vw, 72px);
    color: #FAF3E0;
    margin-bottom: 2rem;
}

.closing-sub {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: #8B9E7E;
    opacity: 0.5;
}

/* ============================================
   NODE DOT HOVER EFFECT
   ============================================ */

.node-dot {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-node:hover .node-dot {
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
}

/* ============================================
   GRAIN ANIMATION
   ============================================ */

@keyframes grain-shift {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-2%, -2%); }
    20% { transform: translate(1%, 3%); }
    30% { transform: translate(-3%, 1%); }
    40% { transform: translate(3%, -1%); }
    50% { transform: translate(-1%, 2%); }
    60% { transform: translate(2%, -3%); }
    70% { transform: translate(-2%, 3%); }
    80% { transform: translate(3%, 1%); }
    90% { transform: translate(-1%, -2%); }
    100% { transform: translate(0, 0); }
}

.node-content::before {
    animation: grain-shift 0.5s steps(3) infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-node {
        width: calc(100% - 50px);
        margin-left: 50px !important;
        margin-right: 0 !important;
        text-align: left;
        padding-left: 20px !important;
        padding-right: 0 !important;
    }

    .node-left .node-content,
    .node-right .node-content {
        border-left: 3px solid #E63946;
        border-right: none;
    }

    .node-dot {
        left: -44px !important;
        right: auto !important;
    }

    .node-connector {
        left: -20px !important;
        right: auto !important;
        width: 20px !important;
    }

    .node-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .opening .display-text {
        font-size: 28px;
    }

    .node-title {
        font-size: 22px;
    }

    .closing-text {
        font-size: 24px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1A1423;
}

::-webkit-scrollbar-thumb {
    background: #E63946;
    border-radius: 3px;
    opacity: 0.5;
}

/* ============================================
   SELECTION
   ============================================ */

::selection {
    background: #E63946;
    color: #FAF3E0;
}
