/* =========================================================
   footprint.broker — Styles
   Palette: The Forest Floor
   Fonts: Cormorant Garamond, Libre Baskerville, Source Sans 3
   ========================================================= */

/* --- CSS Custom Properties --- */
:root {
    /* Colors */
    --ancient-bark: #1C2418;
    --fern-canopy: #2D5A27;
    --moss-stone: #4A7A3F;
    --spring-growth: #7BAE6E;
    --forest-amber: #C4A35A;
    --lichen-gray: #8A9E8F;
    --morning-mist: #F4F1EC;
    --stone-wash: #E8E4DC;

    /* Fibonacci spacing scale */
    --sp-1: 8px;
    --sp-2: 13px;
    --sp-3: 21px;
    --sp-4: 34px;
    --sp-5: 55px;
    --sp-6: 89px;
    --sp-7: 144px;

    /* Easing */
    --ease-organic: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.3rem, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--ancient-bark);
    background: var(--morning-mist);
    background-image: linear-gradient(170deg, var(--morning-mist), var(--stone-wash));
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Leaf Venation Background SVG --- */
#venation-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    will-change: opacity;
    opacity: 1;
}

/* --- Progress Line (Fern Rhizome) --- */
#progress-line {
    position: fixed;
    top: 0;
    left: 24px;
    width: 20px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#progress-svg {
    width: 100%;
    height: 100%;
}

#progress-path {
    stroke-dasharray: 2800;
    stroke-dashoffset: 2800;
}

.branch-node {
    opacity: 0;
    transition: opacity 0.6s var(--ease-organic);
}

.branch-node.visible {
    opacity: 1;
}

/* --- Clearings (Sections) --- */
.clearing {
    position: relative;
    min-height: 100vh;
    padding: var(--sp-6) var(--sp-5);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clearing-content {
    max-width: 1100px;
    width: 100%;
    position: relative;
}

.clearing-deep {
    background: linear-gradient(170deg, var(--stone-wash) 0%, rgba(232, 228, 220, 0.6) 100%);
}

.clearing-light {
    background: linear-gradient(170deg, var(--morning-mist) 0%, rgba(244, 241, 236, 0.95) 100%);
}

/* --- Fade Reveal Animation --- */
.fade-reveal {
    opacity: 0;
    transition: opacity 0.8s var(--ease-organic);
    will-change: opacity;
}

.fade-reveal.revealed {
    opacity: 1;
}

/* --- Typography --- */
h1, #site-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 6vw + 0.5rem, 5.5rem);
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--ancient-bark);
}

.section-title {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw + 0.2rem, 2.4rem);
    letter-spacing: 0.03em;
    line-height: 1.3;
    color: var(--ancient-bark);
    margin-bottom: var(--sp-5);
}

.body-text {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw + 0.3rem, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--ancient-bark);
    max-width: 640px;
}

.botanical-caption {
    display: block;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 0.9vw + 0.2rem, 0.9rem);
    color: var(--lichen-gray);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: var(--sp-2);
    text-align: center;
}

#closing-quote {
    font-family: 'Libre Baskerville', 'Georgia', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw + 0.2rem, 1.6rem);
    line-height: 1.6;
    color: var(--ancient-bark);
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Links (no pointer cursor per design spec) --- */
a {
    color: var(--fern-canopy);
    text-decoration: none;
    cursor: default;
    background-image: linear-gradient(var(--fern-canopy), var(--fern-canopy));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: color 0.4s var(--ease-organic), background-size 0.4s var(--ease-organic);
}

a:hover {
    color: var(--spring-growth);
    background-size: 100% 1px;
}

/* =========================================================
   SECTION 1: The Arrival
   ========================================================= */
#arrival {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0;
}

#arrival .clearing-content {
    padding-top: 38.2vh;
    padding-left: 38.2%;
    max-width: none;
}

#site-title {
    margin-bottom: var(--sp-4);
}

#site-subtitle {
    max-width: 480px;
    opacity: 0;
}

/* =========================================================
   SECTION DIVIDERS: Leaf Vein
   ========================================================= */
.section-divider {
    height: 40px;
    position: relative;
    z-index: 1;
    overflow: visible;
    margin: var(--sp-4) 0;
}

.vein-divider {
    width: 100%;
    height: 40px;
    display: block;
}

.vein-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.8s var(--ease-organic);
}

.vein-branch {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.8s var(--ease-organic);
}

.vein-path.drawn {
    stroke-dashoffset: 0;
}

.vein-branch.drawn {
    stroke-dashoffset: 0;
}

/* =========================================================
   SECTION 2: The Impression
   ========================================================= */
.impression-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
    align-items: start;
}

.impression-text {
    padding-right: var(--sp-5);
}

.impression-text .body-text {
    margin-bottom: var(--sp-4);
}

.impression-illustration {
    position: relative;
    justify-self: end;
    width: 100%;
    max-width: 500px;
}

.soil-illustration {
    width: 100%;
    height: auto;
    filter: contrast(1.02) brightness(1.01);
    border-radius: 2px;
    border: 1px solid rgba(138, 158, 143, 0.4);
    box-shadow: 0 8px 34px rgba(28, 36, 24, 0.08);
    clip-path: inset(0 0 100% 0);
}

/* Root threads */
.root-thread {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0.5px;
    height: 0;
    background-color: rgba(28, 36, 24, 0.08);
    transition: height 1.2s var(--ease-organic);
    z-index: 0;
}

.root-thread.growing {
    height: var(--sp-7);
}

/* =========================================================
   SECTION 3: The Growth
   ========================================================= */
.growth-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-6);
}

.growth-text-block {
    max-width: 640px;
    padding-left: 38.2%;
    width: 100%;
}

.growth-text-block.growth-text-right {
    padding-left: 10%;
    padding-right: 0;
}

.botanical-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 320px;
}

.botanical-moss {
    align-self: flex-start;
    margin-left: 15%;
}

.botanical-fern {
    align-self: flex-end;
    margin-right: 10%;
}

.botanical-lichen {
    align-self: flex-start;
    margin-left: 25%;
}

.botanical-svg {
    width: 100%;
    height: auto;
    filter: contrast(1.02) brightness(1.01);
}

/* =========================================================
   SECTION 4: The Forest
   ========================================================= */
.forest-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-6);
}

.forest-text-block {
    max-width: 640px;
    width: 100%;
    padding-left: 38.2%;
}

.botanical-network {
    max-width: 600px;
    width: 90%;
}

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

/* Growth rings decorative element */
.growth-rings {
    position: absolute;
    top: 50%;
    left: 5%;
    width: 200px;
    height: 200px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
}

.growth-rings svg {
    width: 100%;
    height: 100%;
}

/* =========================================================
   SECTION 5: The Return
   ========================================================= */
.return-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-6);
    text-align: center;
}

.return-text {
    max-width: 560px;
}

.return-text .body-text {
    max-width: none;
}

#footprint-glyph {
    width: 200px;
    height: auto;
    margin: var(--sp-5) auto;
}

#footprint-glyph svg {
    width: 100%;
    height: auto;
}

.final-space {
    height: 200px;
}

/* =========================================================
   SPORE DOTS
   ========================================================= */
.spore-cluster {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.spore-cluster::before,
.spore-cluster::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background-color: var(--spring-growth);
}

/* Cluster 1 - top right of Arrival */
.spore-cluster-1 {
    top: 15%;
    right: 12%;
}

.spore-cluster-1::before {
    width: 4px;
    height: 4px;
    opacity: 0.3;
    top: 0;
    left: 0;
}

.spore-cluster-1::after {
    width: 3px;
    height: 3px;
    opacity: 0.25;
    top: 12px;
    left: 8px;
}

/* Cluster 2 - bottom left of Arrival */
.spore-cluster-2 {
    bottom: 20%;
    left: 8%;
}

.spore-cluster-2::before {
    width: 5px;
    height: 5px;
    opacity: 0.35;
    top: 0;
    left: 0;
}

.spore-cluster-2::after {
    width: 3px;
    height: 3px;
    opacity: 0.2;
    top: -8px;
    left: 14px;
}

/* Cluster 3 - Growth section top */
.spore-cluster-3 {
    top: 10%;
    right: 18%;
}

.spore-cluster-3::before {
    width: 4px;
    height: 4px;
    opacity: 0.3;
    top: 0;
    left: 0;
}

.spore-cluster-3::after {
    width: 3px;
    height: 3px;
    opacity: 0.2;
    top: 10px;
    left: -6px;
}

/* Cluster 4 - Growth section bottom */
.spore-cluster-4 {
    bottom: 15%;
    left: 5%;
}

.spore-cluster-4::before {
    width: 5px;
    height: 5px;
    opacity: 0.4;
    top: 0;
    left: 0;
}

.spore-cluster-4::after {
    width: 3px;
    height: 3px;
    opacity: 0.25;
    top: 14px;
    left: 10px;
}

/* Cluster 5 - Forest section */
.spore-cluster-5 {
    top: 25%;
    right: 6%;
}

.spore-cluster-5::before {
    width: 4px;
    height: 4px;
    opacity: 0.3;
    top: 0;
    left: 0;
}

.spore-cluster-5::after {
    width: 3px;
    height: 3px;
    opacity: 0.2;
    top: 8px;
    left: 12px;
}

/* =========================================================
   SUBSTRATE LAYER (Dappled light background)
   ========================================================= */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(122, 174, 110, 0.03), transparent),
        radial-gradient(ellipse 500px 500px at 70% 60%, rgba(138, 158, 143, 0.04), transparent),
        radial-gradient(ellipse 700px 350px at 50% 80%, rgba(74, 122, 63, 0.02), transparent),
        radial-gradient(ellipse 400px 300px at 85% 15%, rgba(196, 163, 90, 0.015), transparent);
    z-index: 0;
    pointer-events: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .impression-layout {
        grid-template-columns: 1fr;
        gap: var(--sp-5);
    }

    .impression-text {
        padding-right: 0;
    }

    .impression-illustration {
        justify-self: center;
        max-width: 400px;
    }

    #arrival .clearing-content {
        padding-left: var(--sp-5);
        padding-top: 30vh;
    }

    .growth-text-block,
    .forest-text-block {
        padding-left: var(--sp-4);
    }

    .growth-text-block.growth-text-right {
        padding-left: var(--sp-4);
    }

    .botanical-moss,
    .botanical-fern,
    .botanical-lichen {
        margin-left: 0;
        margin-right: 0;
        align-self: center;
    }

    #progress-line {
        left: 8px;
    }

    .growth-rings {
        display: none;
    }
}

@media (max-width: 600px) {
    .clearing {
        padding: var(--sp-5) var(--sp-3);
    }

    #arrival .clearing-content {
        padding-left: var(--sp-3);
        padding-top: 25vh;
    }

    .growth-text-block,
    .forest-text-block {
        padding-left: var(--sp-3);
    }

    .botanical-item {
        max-width: 260px;
    }

    #progress-line {
        display: none;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .fade-reveal {
        opacity: 1;
        transition: none;
    }

    .vein-path,
    .vein-branch {
        stroke-dashoffset: 0;
        transition: none;
    }

    #progress-path {
        stroke-dashoffset: 0;
    }

    .soil-illustration {
        clip-path: none;
    }

    .root-thread {
        transition: none;
    }

    .branch-node {
        opacity: 1;
        transition: none;
    }
}
