/* === Palette Reference ===
   #5a4a3a #5e8a7a #d4a9a0 #3a322a #6b7c5a
   #c8cdb5 #f4ede3 #4a3f35 #8a7e6f
   #c9a84c #d4b86a #e8e0d4
*/

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #f4ede3;
    color: #5a4a3a;
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* === Typography === */
.hero-title,
.section-heading,
.closing-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: #5a4a3a;
    letter-spacing: 0.02em;
}

.hero-title {
    font-size: clamp(4rem, 10vw, 7.5rem);
    line-height: 1;
}

.section-heading {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.closing-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    line-height: 1.15;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6b7c5a;
    margin-top: 1rem;
}

.section-body,
.aside-body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: #4a3f35;
    max-width: 55ch;
    line-height: 1.8;
}

.aside-quote {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    color: #5a4a3a;
    max-width: 45ch;
    line-height: 1.8;
}

.aside-caption {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #8a7e6f;
    margin-top: 0.5rem;
}

.diagram-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    fill: #8a7e6f;
}

.diagram-label-sm {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 9px;
    fill: #8a7e6f;
}

/* === Sections === */
.section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Meadow (Hero) === */
.section--meadow {
    background: linear-gradient(180deg, #f4ede3 0%, #f4ede3 60%, #c8cdb5 100%);
    overflow: hidden;
}

.meadow-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.7;
}

.meadow-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.scroll-hint {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.6;
    animation: fadeInUp 2s ease-out 1s both, gentleBob 3s ease-in-out infinite 3s;
}

.scroll-hint__text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: #8a7e6f;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 0.6; transform: translateY(0); }
}

@keyframes gentleBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* === Content Sections === */
.section--network {
    background-color: #f4ede3;
}

.section--seeds {
    background: linear-gradient(180deg, #f4ede3 0%, #f0e8db 100%);
}

.section--resilience {
    background-color: #f4ede3;
}

.section-inner {
    width: 100%;
    max-width: 1100px;
    padding: 6rem 2rem;
    margin: 0 auto;
}

/* === F-Pattern Layout === */
.f-pattern__top {
    margin-bottom: 3rem;
    max-width: 70%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.f-pattern__top.visible {
    opacity: 1;
    transform: translateY(0);
}

.f-pattern__middle {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out 0.2s, transform 0.8s ease-out 0.2s;
}

.f-pattern__middle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Botanical Diagrams === */
.botanical-diagram {
    background: rgba(200, 205, 181, 0.15);
    border: 1px solid rgba(107, 124, 90, 0.2);
    border-radius: 4px;
    padding: 1rem;
}

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

/* === Closing Section === */
.section--closing {
    background: linear-gradient(180deg, #f4ede3 0%, #c8cdb5 40%, #6b7c5a 100%);
    min-height: 80vh;
}

.closing-content {
    text-align: center;
    padding: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

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

.closing-body {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: #3a322a;
    max-width: 50ch;
    margin: 1.5rem auto 2rem;
    line-height: 1.8;
}

.closing-sigil {
    opacity: 0.5;
    margin-top: 1rem;
}

/* Accent elements using full palette */
.section--seeds .f-pattern__top .section-heading {
    border-bottom: 2px solid #d4b86a;
    display: inline-block;
    padding-bottom: 0.25rem;
}

.section--resilience .f-pattern__top .section-heading {
    border-bottom: 2px solid #c9a84c;
    display: inline-block;
    padding-bottom: 0.25rem;
}

.section--network .aside-quote {
    border-left: 3px solid #d4a9a0;
    padding-left: 1rem;
}

.section--closing {
    border-top: 1px solid #e8e0d4;
}

.botanical-diagram {
    box-shadow: 0 2px 12px rgba(94, 138, 122, 0.08);
}

/* === Spores Canvas === */
#spores-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* === Node animations === */
.node-group circle,
.flower {
    animation: gentleSway 6s ease-in-out infinite;
}

.node-group--2 circle {
    animation-delay: -2s;
}

.flower--2 {
    animation-delay: -3s;
}

@keyframes gentleSway {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(2px) translateY(-1px); }
    75% { transform: translateX(-2px) translateY(1px); }
}

.mycelium {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: drawLine 4s ease-out forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* === Seeds animation === */
.seed {
    opacity: 0;
    animation: seedFloat 3s ease-out forwards;
}

.seed--1 { animation-delay: 0.5s; }
.seed--2 { animation-delay: 0.8s; }
.seed--3 { animation-delay: 1.1s; }
.seed--4 { animation-delay: 1.4s; }
.seed--5 { animation-delay: 1.7s; }
.seed--6 { animation-delay: 2.0s; }

@keyframes seedFloat {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .f-pattern__top {
        max-width: 100%;
    }

    .f-pattern__middle {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-inner {
        padding: 4rem 1.5rem;
    }
}
