/* bada.systems - Forest Systems Timeline */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background-color: #f4f9f6;
    color: #2c4a38;
    overflow-x: hidden;
    /* Paper noise texture */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
}

/* ===== NODE INDICATOR (Fixed) ===== */
#node-indicator {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    background: rgba(244, 249, 246, 0.92);
    padding: 8px 12px;
    border: 1px solid #c8ddd0;
}

#node-fraction {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b9a7e;
}

.scroll-arrow {
    font-size: 0.65rem;
    color: #6b9a7e;
    margin-left: 4px;
}

#progress-bar-track {
    width: 80px;
    height: 2px;
    background: #c8ddd0;
    margin-top: 6px;
}

#progress-bar-fill {
    width: 0%;
    height: 100%;
    background: #4a8c6a;
    transition: width 0.15s ease-out;
}

/* ===== TIMELINE CONTAINER ===== */
#timeline-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

/* ===== TIMELINE SPINE ===== */
#timeline-spine {
    position: fixed;
    left: 12%;
    top: 0;
    width: 2px;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

#spine-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: #1a3a2a;
}

/* ===== WATER BUBBLES ===== */
#bubble-container {
    position: absolute;
    left: -60px;
    top: 0;
    width: 120px;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.water-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(232, 244, 236, 0.9), rgba(74, 140, 106, 0.15) 50%, rgba(42, 107, 107, 0.05) 100%);
    box-shadow: inset -3px -5px 8px rgba(42, 107, 107, 0.1), 0 0 12px rgba(74, 140, 106, 0.08);
    pointer-events: none;
    opacity: 0;
}

.water-bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 40%;
    height: 35%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.7), transparent 45%);
}

/* Bubble sizes and positions */
.bubble-1 { width: 12px; height: 12px; left: 50px; animation: bubbleFloat 8s ease-in-out infinite; animation-delay: 0s; }
.bubble-2 { width: 24px; height: 24px; left: 65px; animation: bubbleFloat 10s ease-in-out infinite; animation-delay: 1.5s; }
.bubble-3 { width: 8px; height: 8px; left: 40px; animation: bubbleFloat 7s ease-in-out infinite; animation-delay: 3s; }
.bubble-4 { width: 32px; height: 32px; left: 55px; animation: bubbleFloat 12s ease-in-out infinite; animation-delay: 4.5s; }
.bubble-5 { width: 16px; height: 16px; left: 70px; animation: bubbleFloat 9s ease-in-out infinite; animation-delay: 2s; }
.bubble-6 { width: 10px; height: 10px; left: 45px; animation: bubbleFloat 6s ease-in-out infinite; animation-delay: 5s; }
.bubble-7 { width: 20px; height: 20px; left: 60px; animation: bubbleFloat 11s ease-in-out infinite; animation-delay: 1s; }
.bubble-8 { width: 40px; height: 40px; left: 50px; animation: bubbleFloat 14s ease-in-out infinite; animation-delay: 6s; }
.bubble-9 { width: 14px; height: 14px; left: 75px; animation: bubbleFloat 8s ease-in-out infinite; animation-delay: 3.5s; }
.bubble-10 { width: 18px; height: 18px; left: 42px; animation: bubbleFloat 10s ease-in-out infinite; animation-delay: 7s; }
.bubble-11 { width: 28px; height: 28px; left: 58px; animation: bubbleFloat 13s ease-in-out infinite; animation-delay: 0.5s; }
.bubble-12 { width: 10px; height: 10px; left: 68px; animation: bubbleFloat 7s ease-in-out infinite; animation-delay: 8s; }
.bubble-13 { width: 22px; height: 22px; left: 52px; animation: bubbleFloat 9s ease-in-out infinite; animation-delay: 2.5s; }
.bubble-14 { width: 36px; height: 36px; left: 48px; animation: bubbleFloat 12s ease-in-out infinite; animation-delay: 5.5s; }
.bubble-15 { width: 8px; height: 8px; left: 72px; animation: bubbleFloat 6s ease-in-out infinite; animation-delay: 9s; }
.bubble-16 { width: 15px; height: 15px; left: 62px; animation: bubbleFloat 10s ease-in-out infinite; animation-delay: 4s; }

@keyframes bubbleFloat {
    0% {
        bottom: -50px;
        opacity: 0;
        transform: translateX(0);
    }
    10% {
        opacity: 0.7;
    }
    50% {
        transform: translateX(8px);
    }
    90% {
        opacity: 0.5;
    }
    100% {
        bottom: calc(100% + 50px);
        opacity: 0;
        transform: translateX(-8px);
    }
}

/* ===== TIMELINE NODES ===== */
.timeline-node {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: flex-start;
    padding-left: calc(12% + 50px);
}

.timeline-node:nth-child(odd) {
    min-height: 85vh;
}

.timeline-node:nth-child(even) {
    min-height: 60vh;
}

/* ===== NODE 01 - ORIGIN ===== */
.node-origin {
    min-height: 100vh !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0;
    background: linear-gradient(to bottom, #f4f9f6, #e8f4ec);
}

.origin-content {
    text-align: center;
    padding-left: 20%;
}

.origin-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #1a3a2a;
    text-transform: uppercase;
}

.origin-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b9a7e;
    margin-top: 24px;
}

/* ===== DIAMOND MARKERS ===== */
.diamond-marker {
    position: absolute;
    left: calc(12% - 12px);
    top: 40px;
    width: 24px;
    height: 24px;
    transform: rotate(45deg);
    border: 2px solid #2d5a3f;
    background: #e8f4ec;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.6s ease, transform 0.6s ease;
    transform-origin: center center;
}

.diamond-marker.active {
    background: #4a8c6a;
}

.marker-number {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(0.5rem, 0.8vw, 0.65rem);
    color: #4a8c6a;
    transform: rotate(-45deg);
    line-height: 1;
}

.diamond-marker.active .marker-number {
    color: #e8f4ec;
}

/* ===== CONNECTOR LINES ===== */
.connector-line {
    position: absolute;
    left: calc(12% + 12px);
    top: 51px;
    width: 38px;
    height: 2px;
    background: #c8ddd0;
    z-index: 15;
}

.connector-line::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 0;
    width: 12px;
    height: 12px;
    border-right: 2px solid #c8ddd0;
    border-bottom: 2px solid #c8ddd0;
    transform: rotate(15deg) skew(15deg);
    transform-origin: top left;
}

/* ===== CONTENT CARDS ===== */
.content-card {
    margin-top: 20px;
    border: 1px solid #c8ddd0;
    background: #f4f9f6;
    box-shadow: 0 2px 12px rgba(26, 58, 42, 0.08);
    border-radius: 0;
    position: relative;
}

.card-narrow {
    width: 45vw;
    max-width: 700px;
}

.card-wide {
    width: 65vw;
    max-width: 1000px;
}

.card-inner {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding: 40px 32px;
}

.card-text {
    grid-column: 1 / 5;
}

.card-text-full {
    grid-column: 1 / 7;
}

.card-visual {
    grid-column: 5 / 7;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* ===== TYPOGRAPHY ===== */
.card-headline {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.6rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #1a3a2a;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.card-headline-final {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: none;
}

.card-subheading {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: 0.02em;
    color: #2d5a3f;
    margin-bottom: 24px;
    text-decoration: underline;
    text-decoration-color: #a8cfb8;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

.body-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #2c4a38;
    margin-bottom: 16px;
}

.body-text:last-child {
    margin-bottom: 0;
}

.caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b9a7e;
}

/* ===== PULL QUOTES ===== */
.pull-quote {
    background: #e8f4ec;
    border-left: 3px solid #4a8c6a;
    padding: 16px 20px;
    margin: 24px 0;
}

.pull-quote .body-text {
    margin-bottom: 0;
    font-style: italic;
}

/* ===== CHEVRON DIVIDERS ===== */
.chevron-divider {
    width: 60px;
    height: 20px;
    margin: 20px auto 0;
    padding-bottom: 10px;
}

.chevron-divider svg {
    width: 100%;
    height: 100%;
}

/* ===== SCROLL ANIMATIONS ===== */
.content-card {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Odd nodes: animate from below */
.timeline-node:nth-child(odd) .content-card {
    transform: translateY(20px);
}

/* Even nodes: animate from right */
.timeline-node:nth-child(even) .content-card {
    transform: translateX(30px);
}

.content-card.visible {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.diamond-marker {
    transform: rotate(45deg) scale(0.5);
}

.diamond-marker.visible {
    transform: rotate(45deg) scale(1);
}

/* ===== ROOTS VISUAL ===== */
.roots-visual {
    overflow: hidden;
}

.roots-pattern {
    width: 100%;
    height: 100%;
}

/* ===== FLOW VISUAL ===== */
.flow-visual {
    position: relative;
    min-height: 250px;
}

.flow-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(232, 244, 236, 0.9), rgba(74, 140, 106, 0.15) 50%, rgba(42, 107, 107, 0.05) 100%);
    box-shadow: inset -3px -5px 8px rgba(42, 107, 107, 0.1), 0 0 12px rgba(74, 140, 106, 0.08);
}

.flow-bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 40%;
    height: 35%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.7), transparent 45%);
}

/* Flow bubble positions - diagonal from bottom-left to top-right */
.fb-1  { width: 32px; height: 32px; bottom: 10%; left: 5%; }
.fb-2  { width: 18px; height: 18px; bottom: 20%; left: 12%; }
.fb-3  { width: 40px; height: 40px; bottom: 25%; left: 20%; }
.fb-4  { width: 14px; height: 14px; bottom: 35%; left: 28%; }
.fb-5  { width: 28px; height: 28px; bottom: 40%; left: 35%; }
.fb-6  { width: 10px; height: 10px; bottom: 45%; left: 42%; }
.fb-7  { width: 36px; height: 36px; bottom: 50%; left: 48%; }
.fb-8  { width: 20px; height: 20px; bottom: 58%; left: 55%; }
.fb-9  { width: 24px; height: 24px; bottom: 65%; left: 62%; }
.fb-10 { width: 12px; height: 12px; bottom: 70%; left: 70%; }
.fb-11 { width: 30px; height: 30px; bottom: 78%; left: 78%; }
.fb-12 { width: 16px; height: 16px; bottom: 85%; left: 85%; }

/* ===== BRANCHES VISUAL ===== */
.branches-visual {
    min-height: 280px;
}

.branch-diagram {
    width: 100%;
    height: 100%;
    max-height: 300px;
}

/* ===== FEEDBACK VISUAL ===== */
.feedback-visual {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-loop {
    width: 200px;
    height: 200px;
    position: relative;
}

.loop-track {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Octagonal loop nodes */
.loop-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #e8f4ec;
    border: 1.5px solid #4a8c6a;
    transform: rotate(45deg);
}

.ln-1 { top: 0; left: calc(50% - 5px); }
.ln-2 { top: 15%; right: 5%; }
.ln-3 { top: calc(50% - 5px); right: 0; }
.ln-4 { bottom: 15%; right: 5%; }
.ln-5 { bottom: 0; left: calc(50% - 5px); }
.ln-6 { bottom: 15%; left: 5%; }
.ln-7 { top: calc(50% - 5px); left: 0; }
.ln-8 { top: 15%; left: 5%; }

.loop-center {
    border: 2px solid #2a6b6b;
    position: absolute;
    top: calc(50% - 8px);
    left: calc(50% - 8px);
    width: 16px;
    height: 16px;
    background: #4a8c6a;
    transform: rotate(45deg);
}

.loop-traveler {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #d4a855;
    transform: rotate(45deg);
    animation: travelLoop 8s ease-in-out infinite;
    z-index: 5;
    box-shadow: 0 0 8px rgba(212, 168, 85, 0.4);
}

@keyframes travelLoop {
    0%     { top: -2px; left: calc(50% - 7px); }
    12.5%  { top: 13%; right: 3%; left: auto; }
    25%    { top: calc(50% - 7px); right: -2px; left: auto; }
    37.5%  { bottom: 13%; right: 3%; top: auto; left: auto; }
    50%    { bottom: -2px; left: calc(50% - 7px); top: auto; right: auto; }
    62.5%  { bottom: 13%; left: 3%; top: auto; right: auto; }
    75%    { top: calc(50% - 7px); left: -2px; bottom: auto; right: auto; }
    87.5%  { top: 13%; left: 3%; bottom: auto; right: auto; }
    100%   { top: -2px; left: calc(50% - 7px); bottom: auto; right: auto; }
}

/* ===== CARD FINAL ===== */
.card-final {
    border: none;
    box-shadow: none;
    background: transparent;
}

.card-text-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.scroll-up-arrow {
    font-family: 'Space Mono', monospace;
    font-size: 2rem;
    color: #4a8c6a;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: inline-block;
}

.scroll-up-arrow:hover {
    transform: translateY(-4px);
}

/* ===== TIMELINE FADE ===== */
/* Pool Teal depth accent */

#timeline-fade {
    height: 60vh;
    position: relative;
    pointer-events: none;
}

#timeline-fade::before {
    content: '';
    position: absolute;
    left: calc(12% - 1px);
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #1a3a2a, transparent);
}

/* ===== ANGULAR CLIP-PATH ON VISUALS ===== */
.roots-visual,
.flow-visual,
.branches-visual {
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    #timeline-spine {
        left: 4%;
    }

    .timeline-node {
        padding-left: 6%;
        flex-direction: column;
    }

    .diamond-marker {
        position: relative;
        left: auto;
        top: auto;
        margin-bottom: 16px;
    }

    .connector-line {
        display: none;
    }

    .content-card,
    .card-narrow,
    .card-wide {
        width: 88vw;
        max-width: none;
    }

    .card-inner {
        grid-template-columns: 1fr;
        padding: 24px 16px;
    }

    .card-text,
    .card-text-full {
        grid-column: 1;
    }

    .card-visual {
        grid-column: 1;
        min-height: 150px;
    }

    .origin-content {
        padding-left: 10%;
    }

    .origin-title {
        font-size: clamp(2rem, 8vw, 4rem);
    }

    #bubble-container {
        left: -30px;
        width: 60px;
    }

    .node-origin {
        padding-left: 0;
    }
}

/* ===== LINK STYLES ===== */
a {
    color: #4a8c6a;
    text-decoration: underline;
    text-decoration-color: #a8cfb8;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

a:hover {
    color: #2d5a3f;
}

/* ===== SELECTION ===== */
::selection {
    background: #a8cfb8;
    color: #1a3a2a;
}
