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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: #3a4a3e;
    background: #f0f4e8;
    --fern-green: #7eb89e;
    overflow-x: hidden;
    line-height: 1.72;
}

/* === Animations === */
@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.08); opacity: 1; }
    80% { transform: scale(0.96); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes rotateHex {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes floatLeaf {
    0% { transform: translateY(-60px) translateX(0px); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translateY(50vh) translateX(20px); }
    90% { opacity: 1; }
    100% { transform: translateY(110vh) translateX(-15px); opacity: 0; }
}

@keyframes floatSpore {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-30vh) translateX(10px); }
    50% { transform: translateY(-60vh) translateX(-8px); }
    75% { transform: translateY(-90vh) translateX(12px); }
    100% { transform: translateY(-120vh) translateX(0); }
}

@keyframes drawLine {
    from { stroke-dashoffset: var(--path-length); }
    to { stroke-dashoffset: 0; }
}

/* === Section 1: Hero Canopy === */
.hero-canopy {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(170deg, #f0f4e8 0%, #e8f0f4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #3a4a3e;
    position: relative;
    z-index: 10;
}

.hero-hexagons {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(80vw, 500px);
    height: min(80vw, 500px);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hex-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
}

.hex-ring-outer {
    animation: rotateHex 120s linear infinite;
}

.hex-ring-middle {
    animation: rotateHex 80s linear infinite reverse;
}

.hex-ring-inner {
    animation: rotateHex 40s linear infinite;
}

/* Falling Leaves */
.falling-leaves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.leaf {
    position: absolute;
    top: -60px;
    width: 30px;
    height: 50px;
    opacity: 0;
    animation: floatLeaf var(--leaf-duration) var(--leaf-delay) linear infinite;
}

.leaf svg {
    width: 100%;
    height: 100%;
}

/* Spore Particles */
.spore-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.spore {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #e8d4a0 0%, transparent 70%);
    pointer-events: none;
    animation: floatSpore var(--spore-duration) var(--spore-delay) linear infinite;
}

/* === Section 2: Honeycomb Manifesto === */
.honeycomb-manifesto {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: #f0f4e8;
}

.honeycomb-grid {
    display: grid;
    grid-template-columns: repeat(3, min(300px, 40vw));
    gap: 0.5rem;
    justify-content: center;
    align-content: center;
}

.honeycomb-grid .hex-cell:nth-child(1) { grid-column: 1; grid-row: 1; }
.honeycomb-grid .hex-cell:nth-child(2) { grid-column: 2; grid-row: 1; }
.honeycomb-grid .hex-cell:nth-child(3) { grid-column: 3; grid-row: 1; }
.honeycomb-grid .hex-cell:nth-child(4) { grid-column: 1; grid-row: 2; transform: translateX(50%); }
.honeycomb-grid .hex-cell:nth-child(5) { grid-column: 2; grid-row: 2; transform: translateX(50%); }
.honeycomb-grid .hex-cell:nth-child(6) { grid-column: 1; grid-row: 3; }

.hex-cell {
    position: relative;
    width: min(300px, 40vw);
    aspect-ratio: 1 / 1.1547;
    opacity: 0;
    transform: scale(0);
}

.hex-cell.visible {
    animation: bounceIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--stagger-delay, 0ms);
}

.hex-cell-border {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: #e8d4a0;
    opacity: 0.6;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hex-cell-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: radial-gradient(circle at center, var(--cell-color) 0%, var(--cell-color-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20%;
}

.hex-cell-inner p {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 1.5vw, 0.95rem);
    letter-spacing: 0.02em;
    color: #3a4a3e;
    text-align: center;
    line-height: 1.5;
}

/* === Section 3: Undergrowth Network === */
.undergrowth-network {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    background: #f0f4e8;
    overflow: hidden;
}

.leaf-vein-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
}

.undergrowth-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cpath d='M100,0 L100,100 M100,100 L60,160 M100,100 L140,160 M60,160 L35,200 M60,160 L75,200 M140,160 L125,200 M140,160 L165,200 M100,50 L70,80 M100,50 L130,80 M70,80 L50,120 M130,80 L150,120 M0,50 L40,90 M200,50 L160,90 M40,90 L30,140 M160,90 L170,140' fill='none' stroke='%237eb89e' stroke-width='0.5' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
}

.undergrowth-content {
    position: relative;
    max-width: 720px;
    z-index: 2;
}

.undergrowth-content h2 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    letter-spacing: 0.08em;
    color: #3d6b5e;
    margin-bottom: 2rem;
}

.undergrowth-content p {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #3a4a3e;
    max-width: 65ch;
    margin-bottom: 1.5rem;
}

.undergrowth-content p:last-child {
    margin-bottom: 0;
}

/* === Section 4: Spore Cloud === */
.spore-cloud {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: linear-gradient(170deg, #e8f0f4 0%, #f0f4e8 100%);
    overflow: hidden;
}

.spore-badges {
    position: relative;
    width: min(900px, 90vw);
    height: min(700px, 80vh);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spore-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3a4a3e;
    background: var(--badge-bg, #b8d8c8);
    width: 110px;
    aspect-ratio: 1 / 1.1547;
    opacity: 0;
    transform: scale(0) translate(var(--offset-x, 0px), var(--offset-y, 0px));
}

.spore-badge.visible {
    animation: bounceIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--stagger-delay, 0ms);
}

/* Badge color cycling */
.spore-badge:nth-child(6n+1) { --badge-bg: #b8d8c8; }
.spore-badge:nth-child(6n+2) { --badge-bg: #f4d9e0; }
.spore-badge:nth-child(6n+3) { --badge-bg: #d4e8f0; }
.spore-badge:nth-child(6n+4) { --badge-bg: #e8d4a0; }
.spore-badge:nth-child(6n+5) { --badge-bg: #e8f0e8; }
.spore-badge:nth-child(6n+6) { --badge-bg: #b8d8c8; }

/* === Section 5: Root System === */
.root-system {
    position: relative;
    width: 100%;
    min-height: 50vh;
    background: #2a3d2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 4rem 2rem;
    overflow: hidden;
}

.root-lines {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(800px, 100%);
    height: 300px;
}

.root-path {
    stroke-dasharray: var(--path-length);
    stroke-dashoffset: var(--path-length);
}

.root-path.visible {
    animation: drawLine 2s ease-in-out forwards;
    animation-delay: var(--draw-delay, 0ms);
}

.root-domain {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #f0f4e8;
    position: relative;
    z-index: 2;
}

/* === Mobile Responsive === */
@media (max-width: 767px) {
    .honeycomb-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        justify-items: center;
    }

    .honeycomb-grid .hex-cell:nth-child(4),
    .honeycomb-grid .hex-cell:nth-child(5) {
        transform: none;
    }

    .honeycomb-grid .hex-cell:nth-child(n) {
        grid-column: 1;
        grid-row: auto;
    }

    .hex-cell {
        width: min(300px, 70vw);
    }

    .spore-badges {
        height: auto;
        min-height: 60vh;
    }

    .spore-badge {
        width: 90px;
        font-size: 0.65rem;
        padding: 0.8rem 1rem;
    }
}
