/* =========================================================
   PPEBBL.com — Botanical-Neon, Zen-Contemplative
   Palette: #ffb627 #c4b5fd #2a2a3e #6b8f71 #b8b5ad #0d3b1a #1a1a2e #39ff14
   Fonts:   Barlow Condensed, IBM Plex Sans
   ========================================================= */

:root {
    --void:        #0a0a0f;
    --indigo:      #12002e;
    --indigo-2:    #1a1a2e;
    --indigo-3:    #2a2a3e;
    --moss-deep:   #0d3b1a;
    --sage:        #6b8f71;
    --stone:       #b8b5ad;
    --chartreuse:  #39ff14;
    --magenta:     #ff2eaa;
    --lavender:    #c4b5fd;
    --amber:       #ffb627;

    --font-head: "Barlow Condensed", "Inter", system-ui, sans-serif;
    --font-body: "IBM Plex Sans", "Inter", system-ui, sans-serif;

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

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

html, body {
    background: var(--void);
    color: var(--stone);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.85;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body { min-height: 100vh; position: relative; }

/* ---------------------------------------------------------
   Background plane — drifting indigo clouds
   --------------------------------------------------------- */
.bg-plane {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(18,0,46,0.55) 0%, transparent 60%),
        var(--void);
}
.cloud {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    will-change: transform;
}
.cloud-1 {
    width: 70vw; height: 70vw;
    top: 10vh; left: -20vw;
    background: radial-gradient(circle, rgba(18,0,46,0.55), transparent 70%);
    animation: drift-1 60s linear infinite;
}
.cloud-2 {
    width: 60vw; height: 60vw;
    top: 80vh; right: -15vw;
    background: radial-gradient(circle, rgba(42,42,62,0.5), transparent 70%);
    animation: drift-2 80s linear infinite;
}
.cloud-3 {
    width: 50vw; height: 50vw;
    top: 160vh; left: 10vw;
    background: radial-gradient(circle, rgba(18,0,46,0.4), transparent 70%);
    animation: drift-1 75s linear infinite reverse;
}
@keyframes drift-1 {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-5%); }
}
@keyframes drift-2 {
    0%   { transform: translateX(0); }
    100% { transform: translateX(5%); }
}

/* ---------------------------------------------------------
   Botanical plane — fixed fern silhouettes that breathe
   --------------------------------------------------------- */
.botanical-plane {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
.fern {
    position: absolute;
    will-change: transform;
    animation: breathe 8s ease-in-out infinite alternate;
}
.fern-tl {
    top: -40px; left: -40px;
    width: 32vw; max-width: 360px; min-width: 200px;
    height: auto;
}
.fern-br {
    bottom: -40px; right: -40px;
    width: 36vw; max-width: 400px; min-width: 220px;
    height: auto;
    animation-duration: 10s;
}
.fern-ml {
    top: 50%; left: -30px;
    transform: translateY(-50%);
    width: 18vw; max-width: 220px; min-width: 140px;
    height: auto;
    animation-duration: 9s;
    opacity: 0.6;
}
@keyframes breathe {
    0%   { transform: scale(1); }
    100% { transform: scale(1.03); }
}
.fern-ml { animation-name: breathe-ml; }
@keyframes breathe-ml {
    0%   { transform: translateY(-50%) scale(1); }
    100% { transform: translateY(-50%) scale(1.03); }
}

/* ---------------------------------------------------------
   Timeline stem — the central luminous spine
   --------------------------------------------------------- */
.timeline-stem {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.stem-line {
    position: absolute;
    top: 0; left: 0;
    width: 2px;
    height: 100%;
    background: var(--chartreuse);
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
    transform-origin: top center;
    transform: scaleY(var(--stem-progress, 0));
    transition: transform 80ms linear;
}
.stem-tip {
    position: absolute;
    left: -4px;
    top: calc(var(--stem-progress, 0) * 100%);
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--chartreuse);
    box-shadow:
        0 0 20px var(--chartreuse),
        0 0 40px rgba(57, 255, 20, 0.5);
    transform: translateY(-50%);
    transition: top 80ms linear;
    opacity: 0.95;
}

/* ---------------------------------------------------------
   Timeline + nodes
   --------------------------------------------------------- */
.timeline {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
}

.node {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding: 8vh 4vw;
}

/* Pebble indicator on the stem */
.node-pebble {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pebble-color, var(--chartreuse));
    box-shadow:
        0 0 6px var(--pebble-color, var(--chartreuse)),
        0 0 14px rgba(57, 255, 20, 0.25);
    z-index: 3;
    opacity: 0.55;
    transition: opacity 600ms ease, box-shadow 600ms ease;
}
.node.is-active .node-pebble {
    opacity: 1;
    animation: pebble-pulse 3s ease-in-out infinite;
}
@keyframes pebble-pulse {
    0%, 100% {
        box-shadow:
            0 0 4px var(--pebble-color),
            0 0 8px rgba(57,255,20,0.25);
    }
    50% {
        box-shadow:
            0 0 12px var(--pebble-color),
            0 0 24px rgba(57,255,20,0.45);
    }
}

/* Tag — small specimen label, sits next to stem */
.node-tag {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-head);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sage);
    opacity: 0;
    transition: opacity 1200ms var(--reveal-ease) 600ms;
}
.node.is-revealed .node-tag { opacity: 0.85; }

/* Odd nodes branch left, even branch right */
.node:nth-child(odd) {
    justify-content: flex-start;
}
.node:nth-child(odd) .node-content {
    width: 45%;
    margin-right: 5%;
    text-align: right;
    padding-right: 3vw;
}
.node:nth-child(odd) .node-tag {
    left: calc(50% + 22px);
}

.node:nth-child(even) {
    justify-content: flex-end;
}
.node:nth-child(even) .node-content {
    width: 45%;
    margin-left: 5%;
    text-align: left;
    padding-left: 3vw;
}
.node:nth-child(even) .node-tag {
    right: calc(50% + 22px);
}

/* Content */
.node-content > * {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 1200ms var(--reveal-ease),
        transform 1200ms var(--reveal-ease);
}
.node.is-revealed .node-title { transition-delay: 0ms;   opacity: 1; transform: translateY(0); }
.node.is-revealed .node-body  { transition-delay: 150ms; opacity: 1; transform: translateY(0); }
.node.is-revealed .node-illu  { transition-delay: 300ms; opacity: 1; transform: translateY(0); }

/* Titles */
.node-title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--chartreuse);
    margin-bottom: 1.6rem;
    position: relative;
}
.node-title.alt     { color: var(--lavender); }
.node-title.amber   { color: var(--amber); }
.node-title.magenta { color: var(--magenta); }

/* Glow halo via ::after blur trick */
.node-title::after {
    content: attr(data-glow);
    position: absolute;
    inset: 0;
    pointer-events: none;
    filter: blur(10px);
    opacity: 0.35;
}

/* Body */
.node-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    color: var(--stone);
    max-width: 38ch;
    margin-bottom: 2.5rem;
}
.node:nth-child(odd) .node-body { margin-left: auto; }
.node-body.small { font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sage); }

.emphasis {
    color: var(--amber);
    font-weight: 600;
}

/* Illustrations */
.node-illu {
    width: 100%;
    max-width: 360px;
    margin-top: 1rem;
    display: inline-block;
}
.node:nth-child(odd) .node-illu { margin-left: auto; }
.node-illu svg { width: 100%; height: auto; display: block; }

/* Closing node — centered & minimal */
.node-closing {
    justify-content: center !important;
    text-align: center;
    min-height: 60dvh;
}
.node-closing .node-content {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    max-width: 600px;
}
.node-closing .node-tag {
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -200%);
    top: 50%;
}

/* ---------------------------------------------------------
   Responsive — collapse timeline to left edge below 768px
   --------------------------------------------------------- */
@media (max-width: 768px) {
    .timeline-stem {
        left: 8%;
        transform: none;
    }
    .fern-tl, .fern-ml { display: none; }
    .fern-br {
        opacity: 0.5;
        width: 50vw;
    }
    .node {
        justify-content: flex-end !important;
        padding-right: 6vw;
    }
    .node-pebble {
        left: 8%;
    }
    .node:nth-child(odd) .node-content,
    .node:nth-child(even) .node-content {
        width: 80%;
        margin: 0 0 0 0;
        padding-left: 4vw;
        padding-right: 0;
        text-align: left;
    }
    .node:nth-child(odd) .node-tag,
    .node:nth-child(even) .node-tag {
        left: calc(8% + 18px);
        right: auto;
    }
    .node:nth-child(odd) .node-body,
    .node:nth-child(odd) .node-illu {
        margin-left: 0;
    }
    .node-closing {
        justify-content: center !important;
    }
    .node-closing .node-pebble {
        left: 50% !important;
    }
}

/* ---------------------------------------------------------
   Reduced motion
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .node-content > * { opacity: 1 !important; transform: none !important; }
    .stem-line { transform: scaleY(1) !important; }
}
