/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: #060e1a;
    color: #b3c8e8;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

/* ==================== GRID UNDERLAYER ==================== */
.grid-underlayer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(26, 45, 77, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 45, 77, 0.15) 1px, transparent 1px);
    background-size: 60px 60px;
    transition: opacity 2s ease;
}

/* ==================== TIMELINE SPINE ==================== */
.timeline-spine {
    position: fixed;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100vh;
    z-index: 5;
    pointer-events: none;
    transform: translateX(-50%);
}

.spine-line {
    width: 100%;
    height: 100%;
    background: #6eb5ff;
    opacity: 0.4;
    animation: spinePulse 4s ease-in-out infinite;
}

@keyframes spinePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* ==================== EPOCHS (SECTIONS) ==================== */
.epoch {
    position: relative;
    min-height: 100vh;
    padding: clamp(1.5rem, 4vw, 4rem);
    overflow: hidden;
}

.epoch-1 {
    min-height: 110vh;
    background: #060e1a;
}

.epoch-2 {
    min-height: 100vh;
    background: linear-gradient(180deg, #060e1a 0%, #0b1628 15%, #0b1628 100%);
}

.epoch-3 {
    min-height: 120vh;
    background: linear-gradient(180deg, #0b1628 0%, #0f1d33 20%, #0f1d33 80%, #0b1628 100%);
}

.epoch-4 {
    min-height: 100vh;
    background: linear-gradient(180deg, #0b1628 0%, #0b1628 100%);
}

.epoch-5 {
    min-height: 80vh;
    background: linear-gradient(180deg, #0b1628 0%, #060e1a 100%);
}

/* ==================== EPOCH LABELS ==================== */
.epoch-label {
    position: absolute;
    top: clamp(2rem, 4vh, 4rem);
    left: calc(50% + clamp(2rem, 6vw, 8rem) + 20px);
    writing-mode: vertical-lr;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3d7abf; opacity: 0.7;
    z-index: 10;
    display: flex;
    gap: 0.5em;
}

.epoch-number {
    color: #6eb5ff;
    opacity: 0.6;
}

.epoch-name {
    opacity: 0.5;
}

/* ==================== ORGANIC BLOBS ==================== */
.blob {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.blob-1 {
    top: 8%;
    left: 5%;
    width: clamp(250px, 35vw, 500px);
    height: clamp(250px, 35vw, 500px);
    border-radius: 30% 70% 60% 40% / 50% 40% 60% 50%;
    background: radial-gradient(ellipse at 30% 40%, #1a2d4d, transparent 70%);
    box-shadow:
        0 0 60px rgba(110, 181, 255, 0.05),
        0 0 120px rgba(110, 181, 255, 0.03);
    animation: blobMorph1 18s ease-in-out infinite;
}

.blob-2 {
    bottom: 10%;
    right: 5%;
    width: clamp(300px, 40vw, 600px);
    height: clamp(300px, 40vw, 600px);
    border-radius: 60% 40% 30% 70% / 40% 60% 50% 50%;
    background: radial-gradient(ellipse at 60% 50%, #1a2d4d, transparent 70%);
    box-shadow:
        0 0 80px rgba(110, 181, 255, 0.04),
        0 0 140px rgba(110, 181, 255, 0.03);
    animation: blobMorph2 22s ease-in-out infinite;
}

.blob-3 {
    top: 15%;
    right: 3%;
    width: clamp(400px, 50vw, 800px);
    height: clamp(400px, 50vw, 800px);
    border-radius: 40% 60% 50% 50% / 60% 30% 70% 40%;
    background: radial-gradient(ellipse at 50% 40%, #1a2d4d, transparent 65%);
    box-shadow:
        0 0 100px rgba(110, 181, 255, 0.05),
        0 0 180px rgba(110, 181, 255, 0.03);
    animation: blobMorph3 25s ease-in-out infinite;
}

.blob-4 {
    top: 20%;
    left: 8%;
    width: clamp(250px, 30vw, 450px);
    height: clamp(250px, 30vw, 450px);
    border-radius: 50% 50% 40% 60% / 40% 60% 40% 60%;
    background: radial-gradient(ellipse at 40% 50%, #1a2d4d, transparent 70%);
    box-shadow: 0 0 80px rgba(110, 181, 255, 0.05);
    animation: blobMorph1 20s ease-in-out infinite reverse;
}

.blob-5 {
    bottom: 15%;
    right: 10%;
    width: clamp(300px, 35vw, 500px);
    height: clamp(300px, 35vw, 500px);
    border-radius: 60% 40% 50% 50% / 50% 50% 40% 60%;
    background: radial-gradient(ellipse at 60% 60%, #1a2d4d, transparent 65%);
    box-shadow: 0 0 90px rgba(110, 181, 255, 0.04);
    animation: blobMorph2 17s ease-in-out infinite;
}

.blob-6 {
    top: 30%;
    left: 15%;
    width: clamp(350px, 45vw, 700px);
    height: clamp(350px, 45vw, 700px);
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    background: radial-gradient(ellipse at 40% 40%, #1a2d4d, transparent 75%);
    box-shadow: 0 0 100px rgba(110, 181, 255, 0.03);
    opacity: 0.3;
    animation: blobMorph3 23s ease-in-out infinite;
}

.blob-7 {
    top: 20%;
    right: 20%;
    width: clamp(200px, 25vw, 400px);
    height: clamp(200px, 25vw, 400px);
    border-radius: 50% 50% 45% 55% / 45% 55% 50% 50%;
    background: radial-gradient(ellipse at 50% 50%, #1a2d4d, transparent 80%);
    box-shadow: 0 0 60px rgba(110, 181, 255, 0.02);
    opacity: 0.15;
    animation: blobMorph1 15s ease-in-out infinite;
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 30% 70% 60% 40% / 50% 40% 60% 50%; }
    25% { border-radius: 50% 50% 40% 60% / 40% 60% 50% 50%; }
    50% { border-radius: 60% 40% 30% 70% / 40% 60% 50% 50%; }
    75% { border-radius: 40% 60% 50% 50% / 60% 40% 40% 60%; }
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 60% 40% 30% 70% / 40% 60% 50% 50%; }
    33% { border-radius: 40% 60% 60% 40% / 60% 40% 50% 50%; }
    66% { border-radius: 50% 50% 40% 60% / 50% 50% 60% 40%; }
}

@keyframes blobMorph3 {
    0%, 100% { border-radius: 40% 60% 50% 50% / 60% 30% 70% 40%; }
    50% { border-radius: 55% 45% 45% 55% / 40% 60% 45% 55%; }
}


/* ==================== TIMELINE NODES ==================== */
.timeline-node {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    margin-bottom: clamp(4rem, 8vh, 8rem);
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-node.visible {
    opacity: 1;
    transform: translateX(0) !important;
}

.node-left {
    flex-direction: row-reverse;
    padding-right: calc(50% + clamp(2rem, 6vw, 8rem));
    padding-left: clamp(1.5rem, 4vw, 4rem);
    transform: translateX(-40px);
}

.node-right {
    flex-direction: row;
    padding-left: calc(50% + clamp(2rem, 6vw, 8rem));
    padding-right: clamp(1.5rem, 4vw, 4rem);
    transform: translateX(40px);
}

.node-content {
    max-width: 520px;
}

/* ==================== WHISKER LINES ==================== */
.whisker-line {
    position: absolute;
    top: 8px;
    width: clamp(2rem, 6vw, 8rem);
    height: 2px;
    z-index: 10;
}

.node-left .whisker-line {
    right: calc(50% + 6px);
}

.node-right .whisker-line {
    left: calc(50% + 6px);
}

.whisker {
    stroke: rgba(110, 181, 255, 0.3);
    stroke-width: 1;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1s ease;
}

.timeline-node.visible .whisker {
    stroke-dashoffset: 0;
}

/* ==================== NODE MARKERS ==================== */
.node-marker {
    position: absolute;
    top: 2px;
    left: calc(50% - 6px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6eb5ff;
    z-index: 15;
    cursor: pointer;
}

.node-marker::before,
.node-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid #6eb5ff;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
}

.node-marker:hover::before {
    animation: rippleExpand 1.2s ease-out;
}

.node-marker:hover::after {
    animation: rippleExpand 1.2s ease-out 0.3s;
}


.node-marker:hover {
    background: #3da0ff;
    transition: background 0.3s ease;
}

.node-marker.accent-marker:hover {
    background: #ff6b8a;
}

.node-marker.accent-marker {
    background: #ff6b8a;
}

.node-marker.accent-marker::before,
.node-marker.accent-marker::after {
    border-color: #ff6b8a;
}

.node-marker.accent-marker:hover::before {
    animation: rippleExpandAccent 1.2s ease-out;
}

.node-marker.accent-marker:hover::after {
    animation: rippleExpandAccent 1.2s ease-out 0.3s;
}

/* Pulsing animation for node markers */
.node-marker {
    animation: nodePulse 3s ease-in-out infinite;
}

.node-marker.accent-marker {
    animation: nodePulseAccent 3s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(110, 181, 255, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(110, 181, 255, 0); }
}

@keyframes nodePulseAccent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(255, 107, 138, 0); }
}

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

@keyframes rippleExpandAccent {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

/* ==================== TYPOGRAPHY ==================== */
.display-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #e8f0ff;
    margin-bottom: clamp(1rem, 2vh, 2rem);
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: #b3c8e8;
}

.body-text em {
    font-style: italic;
    color: #6eb5ff;
}

.large-body {
    font-size: clamp(1.1rem, 1.3vw, 1.35rem);
}

.pull-quote {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.15rem, 1.5vw, 1.5rem);
    line-height: 1.65;
    color: #6eb5ff;
}


/* ==================== GLASS PANEL ==================== */
.glass-panel {
    background: rgba(15, 29, 51, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(110, 181, 255, 0.1);
    border-radius: 12px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* ==================== WATERMARK TEXT (EPOCH 3) ==================== */
.watermark-text {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: clamp(5rem, 12vw, 10rem);
    color: #6eb5ff;
    opacity: 0.08;
    text-align: center;
    pointer-events: none;
    z-index: 2;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* ==================== SPINE FRACTURE (EPOCH 3) ==================== */
.spine-fracture {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 100%;
    z-index: 6;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 1s ease;
}

.spine-fracture.active {
    opacity: 1;
}

.fracture-line {
    width: 1px;
    height: 100%;
    background: rgba(110, 181, 255, 0.25);
}

.fracture-left {
    transform: translateX(-30px);
}

.fracture-center {
    background: rgba(110, 181, 255, 0.35);
    width: 2px;
}

.fracture-right {
    transform: translateX(30px);
}

/* ==================== SYNTHESIS SPARSE SPACING ==================== */
.synthesis-sparse {
    margin-bottom: clamp(3rem, 6vh, 6rem);
}

/* ==================== EPOCH 5 — HORIZON ==================== */
.particle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #6eb5ff;
    opacity: 0.6;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0);
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh);
        opacity: 0;
    }
}

.horizon-statement {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: clamp(4rem, 10vw, 10rem);
    text-align: center;
}

.closing-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #e8f0ff;
    line-height: 1.4;
    letter-spacing: -0.02em;
    max-width: 680px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.closing-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.final-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff6b8a;
    margin-top: clamp(2rem, 4vh, 4rem);
    animation: finalDotPulse 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.final-dot.visible {
    opacity: 1;
}

@keyframes finalDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 138, 0.5), 0 0 20px rgba(255, 107, 138, 0.3); }
    50% { box-shadow: 0 0 0 12px rgba(255, 107, 138, 0), 0 0 30px rgba(255, 107, 138, 0.1); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .node-left,
    .node-right {
        padding-left: clamp(1rem, 3vw, 2rem);
        padding-right: clamp(1rem, 3vw, 2rem);
    }

    .node-left {
        flex-direction: column;
        padding-right: clamp(1rem, 3vw, 2rem);
        padding-left: calc(50% + 1.5rem);
    }

    .node-right {
        flex-direction: column;
        padding-left: calc(50% + 1.5rem);
        padding-right: clamp(1rem, 3vw, 2rem);
    }

    .whisker-line {
        display: none;
    }

    .epoch-label {
        left: calc(50% + 1.5rem + 20px);
    }

    .display-heading {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .watermark-text {
        font-size: clamp(3rem, 10vw, 6rem);
    }

    .closing-text {
        font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    }
}

@media (max-width: 480px) {
    .node-left,
    .node-right {
        padding-left: calc(20px + 1rem);
        padding-right: 1rem;
    }

    .timeline-spine {
        left: 20px;
    }

    .node-marker {
        left: calc(20px - 6px);
    }

    .epoch-label {
        left: 40px;
        top: 1rem;
    }

    .spine-fracture {
        left: 20px;
        width: 60px;
    }

    .fracture-left {
        transform: translateX(-15px);
    }

    .fracture-right {
        transform: translateX(15px);
    }
}
