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

:root {
    --ground: #F5EDE0;
    --ground-dark: #2A1F14;
    --ink: #4A3F30;
    --ink-light: #E8D8C2;
    --spine-gold: #C4A265;
    --node-amber: #D4956B;
    --glow-honey: #E8C47A;
    --y2k-pink: #FF6B9D;
    --aqua-tint: #5BBFAD;
    --deep-sepia: #8B7355;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    line-height: 1.7;
    color: var(--ink);
    background: var(--ground);
    overflow-x: hidden;
    position: relative;
}

/* ===== GRAIN OVERLAY ===== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ===== TIMELINE NAV (Fixed dots) ===== */
.timeline-nav {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    list-style: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--deep-sepia);
    cursor: pointer;
    position: relative;
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}

.nav-dot:hover,
.nav-dot.active {
    background: var(--glow-honey);
    box-shadow: 0 0 8px rgba(232, 196, 122, 0.6);
    transform: scale(1.3);
}

.nav-dot span {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-sepia);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.nav-dot:hover span {
    opacity: 1;
}

/* ===== AQUARIUM HERO ===== */
.aquarium {
    width: 90vw;
    max-width: 1100px;
    height: 85vh;
    margin: 5vh auto;
    border-radius: 2rem;
    background: var(--ground);
    overflow: hidden;
    position: relative;
    box-shadow: 
        inset 0 0 60px rgba(42, 31, 20, 0.08),
        0 8px 40px rgba(42, 31, 20, 0.12);
    border: 2px solid rgba(196, 162, 101, 0.2);
}

/* Fish animations */
.fish {
    position: absolute;
    pointer-events: none;
}

.fish--angel {
    width: 80px;
    top: 25%;
    z-index: 1;
    animation: drift-right 18s linear infinite;
    filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.3));
}

.fish--lion {
    width: 110px;
    top: 55%;
    z-index: 2;
    animation: drift-left 25s linear infinite;
    animation-delay: -8s;
    filter: drop-shadow(0 0 4px rgba(91, 191, 173, 0.3));
}

.fish--koi {
    width: 95px;
    top: 72%;
    z-index: 3;
    animation: drift-right 32s linear infinite;
    animation-delay: -15s;
    filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.2));
}

@keyframes drift-right {
    0% { transform: translateX(-15vw) scaleX(1); }
    100% { transform: translateX(115vw) scaleX(1); }
}

@keyframes drift-left {
    0% { transform: translateX(115vw) scaleX(-1); }
    100% { transform: translateX(-15vw) scaleX(-1); }
}

/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(196, 162, 101, 0.15), rgba(196, 162, 101, 0.05));
    border: 1px solid rgba(196, 162, 101, 0.1);
    pointer-events: none;
}

.bubble--1 { width: 12px; height: 12px; left: 20%; animation: rise 12s ease-in infinite; animation-delay: 0s; }
.bubble--2 { width: 8px; height: 8px; left: 45%; animation: rise 15s ease-in infinite; animation-delay: -3s; }
.bubble--3 { width: 15px; height: 15px; left: 65%; animation: rise 18s ease-in infinite; animation-delay: -7s; }
.bubble--4 { width: 6px; height: 6px; left: 80%; animation: rise 10s ease-in infinite; animation-delay: -2s; }
.bubble--5 { width: 10px; height: 10px; left: 35%; animation: rise 20s ease-in infinite; animation-delay: -12s; }

@keyframes rise {
    0% { bottom: -5%; opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.3; }
    100% { bottom: 105%; opacity: 0; }
}

/* Aquarium title */
.aquarium-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    mix-blend-mode: multiply;
    opacity: 0.85;
}

.aquarium-title h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    color: var(--ink);
    line-height: 1.1;
}

.title-dot {
    color: var(--y2k-pink);
}

.aquarium-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-sepia);
    margin-top: 1rem;
}

/* ===== TIMELINE BODY ===== */
.timeline-body {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.spine {
    position: absolute;
    left: 50%;
    width: 2px;
    top: 0;
    bottom: 0;
    background: linear-gradient(to bottom, var(--spine-gold), var(--deep-sepia));
    transform: translateX(-50%);
}

/* ===== NODES ===== */
.node {
    position: relative;
    width: 42%;
    margin-bottom: 6rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.node--right {
    margin-left: 56%;
}

.node--left {
    margin-left: 2%;
}

/* Connector line */
.node-connector {
    position: absolute;
    top: 1.5rem;
    height: 2px;
    background: var(--spine-gold);
    transition: width 0.6s ease-out;
    width: 0;
}

.node.visible .node-connector {
    width: calc(14% + 2rem);
}

.node--right .node-connector {
    right: 100%;
}

.node--left .node-connector {
    left: 100%;
}

/* Glowing dot at spine */
.node-connector::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-honey), var(--node-amber));
    box-shadow: 0 0 8px rgba(212, 149, 107, 0.6);
}

.node--right .node-connector::after {
    left: -6px;
}

.node--left .node-connector::after {
    right: -6px;
}

/* Node content */
.node-content {
    padding: 1.5rem;
}

.node-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-sepia);
    display: block;
    margin-bottom: 0.5rem;
}

.node-label.light {
    color: var(--y2k-pink);
}

.node-content h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    letter-spacing: 0.01em;
    color: var(--ink);
    margin-bottom: 0.75rem;
}

.node-content p {
    margin-bottom: 1rem;
    color: var(--ink);
}

/* Pill badges */
.pill-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: rgba(196, 162, 101, 0.15);
    backdrop-filter: blur(4px);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-sepia);
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.pill-badge.accent {
    color: var(--y2k-pink);
    background: rgba(255, 107, 157, 0.08);
}

/* ===== ROUTE MAP ===== */
.route-map {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(42, 31, 20, 0.03);
    border-radius: 1rem;
}

.trade-route {
    width: 100%;
    height: auto;
}

.route-line {
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease-out;
}

.node.visible .route-line {
    stroke-dashoffset: 0;
}

.port-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    fill: var(--deep-sepia);
    letter-spacing: 0.1em;
}

.port-dot--dest {
    filter: drop-shadow(0 0 4px #FF6B9D) drop-shadow(0 0 8px rgba(255, 107, 157, 0.4));
}

/* ===== NETWORK GRAPH ===== */
.network-graph {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(42, 31, 20, 0.03);
    border-radius: 1rem;
}

.network-graph svg {
    width: 100%;
    height: auto;
}

/* Pulse animation for dots */
.pulse-dot {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; r: 6; }
    50% { opacity: 0.6; r: 9; }
}

/* ===== CURRENT ZONE (dark band) ===== */
.current-zone {
    background: var(--ground-dark);
    padding: 5rem 2rem;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
}

.zone-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.zone-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--ink-light);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.zone-text {
    color: var(--ink-light);
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.zone-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--glow-honey);
    filter: drop-shadow(0 0 6px rgba(232, 196, 122, 0.4));
}

.stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--deep-sepia);
    margin-top: 0.25rem;
    display: block;
}

.zone-route-map {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: block;
}

.zone-route-line {
    animation: trace-route 4s ease-in-out infinite alternate;
}

@keyframes trace-route {
    0% { stroke-dashoffset: 600; }
    100% { stroke-dashoffset: 0; }
}

/* ===== OBSERVATORY FOOTER ===== */
.observatory-footer {
    background: var(--ground-dark);
    padding: 5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-title h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--ink-light);
    letter-spacing: 0.02em;
    margin-top: 0.5rem;
}

.footer-text {
    color: var(--ink-light);
    opacity: 0.7;
    max-width: 500px;
    margin: 1.5rem auto;
}

.footer-data {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.data-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--deep-sepia);
}

.fish--footer {
    position: absolute;
    bottom: 2rem;
    width: 80px;
    z-index: 1;
    animation: drift-right 22s linear infinite;
}

/* ===== CIRCULAR LOADER DECORATION ===== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(196, 162, 101, 0.2);
    border-top-color: var(--spine-gold);
    animation: spin 3s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .aquarium {
        height: 60vh;
    }

    .fish--koi {
        display: none;
    }

    .spine {
        left: 2rem;
    }

    .node {
        width: calc(100% - 4rem);
        margin-left: 4rem !important;
    }

    .node-connector {
        right: auto !important;
        left: auto !important;
        right: 100% !important;
    }

    .node--left .node-connector {
        left: auto;
        right: 100% !important;
    }

    .node.visible .node-connector {
        width: 2rem;
    }

    .node--left .node-connector::after,
    .node--right .node-connector::after {
        left: -6px;
        right: auto;
    }

    .timeline-nav {
        right: 0.5rem;
    }

    .nav-dot span {
        display: none;
    }

    .zone-stats {
        gap: 1.5rem;
    }

    .footer-data {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== SCROLL-DRIVEN ZONE SHIFT ===== */
.zone-route-map {
    transition: transform 0.1s linear;
}
