/* lowest.dev - Scandinavian Botanical Sketchbook */

:root {
    --c-bg: #faf8f3;
    --c-bg-alt: #f0ece3;
    --c-text: #3b2e1e;
    --c-text-muted: #7a6b56;
    --c-accent-green: #5a7d5e;
    --c-accent-violet: #8b6b8a;
    --c-accent-gold: #c9a24e;
    --c-fern: #e8ede5;
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --ease-settle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* ========== ROOT NAVIGATION ========== */

.root-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 70px;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s var(--ease-settle), transform 0.8s var(--ease-elastic);
    pointer-events: none;
}

.root-nav.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.root-svg {
    position: absolute;
    left: 10px;
    top: 0;
    width: 50px;
    height: 100%;
}

.root-trunk,
.root-branch {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s var(--ease-settle);
}

.root-nav.visible .root-trunk {
    stroke-dashoffset: 0;
}

.root-nav.visible .root-branch {
    stroke-dashoffset: 0;
}

.root-nav.visible .root-branch-1 { transition-delay: 0.3s; }
.root-nav.visible .root-branch-2 { transition-delay: 0.5s; }
.root-nav.visible .root-branch-3 { transition-delay: 0.7s; }
.root-nav.visible .root-branch-4 { transition-delay: 0.9s; }

.root-labels {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    padding: 90px 0 60px;
    z-index: 2;
}

.root-label {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--c-text-muted);
    text-decoration: none;
    transform: rotate(-1.5deg);
    display: block;
    padding: 4px 8px;
    transition: color 0.4s var(--ease-settle), transform 0.3s var(--ease-elastic);
    white-space: nowrap;
}

.root-label:hover {
    color: var(--c-accent-green);
    transform: rotate(0deg) translateX(3px);
}

.root-label.active {
    color: var(--c-accent-green);
    font-weight: 700;
}

/* ========== HERO MEADOW ========== */

.hero-meadow {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: var(--c-bg);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
}

.hero-content {
    margin-left: 12vw;
    margin-top: 40vh;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 5.5rem);
    color: var(--c-text);
    letter-spacing: 0.02em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    animation: heroEnter 0.8s var(--ease-elastic) 0.3s forwards;
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    color: var(--c-text-muted);
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: heroEnter 0.8s var(--ease-elastic) 0.6s forwards;
}

@keyframes heroEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Botanical Fern - bottom left of hero */
.botanical-fern {
    position: absolute;
    bottom: -20px;
    left: 5vw;
    width: clamp(120px, 15vw, 200px);
    height: auto;
    z-index: 1;
    opacity: 0;
    animation: fernEnter 1.5s var(--ease-settle) 0.8s forwards;
}

.botanical-fern .fern-stem,
.botanical-fern .fern-leaf,
.botanical-fern .fern-tip {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 1.5s var(--ease-settle) 1s forwards;
}

.botanical-fern .fern-leaf:nth-child(3) { animation-delay: 1.1s; }
.botanical-fern .fern-leaf:nth-child(4) { animation-delay: 1.2s; }
.botanical-fern .fern-leaf:nth-child(5) { animation-delay: 1.3s; }
.botanical-fern .fern-leaf:nth-child(6) { animation-delay: 1.4s; }
.botanical-fern .fern-leaf:nth-child(7) { animation-delay: 1.5s; }
.botanical-fern .fern-leaf:nth-child(8) { animation-delay: 1.6s; }
.botanical-fern .fern-leaf:nth-child(9) { animation-delay: 1.7s; }
.botanical-fern .fern-leaf:nth-child(10) { animation-delay: 1.8s; }
.botanical-fern .fern-leaf:nth-child(11) { animation-delay: 1.9s; }
.botanical-fern .fern-leaf:nth-child(12) { animation-delay: 2.0s; }
.botanical-fern .fern-leaf:nth-child(13) { animation-delay: 2.1s; }
.botanical-fern .fern-leaf:nth-child(14) { animation-delay: 2.2s; }

@keyframes fernEnter {
    to { opacity: 1; }
}

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

/* Hero Seed - bottom right */
.hero-seed {
    position: absolute;
    bottom: 10vh;
    right: 10vw;
    width: 120px;
    height: auto;
    z-index: 1;
    opacity: 0;
    transform: translateY(-40px);
    animation: seedDrop 1.5s var(--ease-elastic) 1.2s forwards;
}

@keyframes seedDrop {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== CONTENT SECTIONS ========== */

.content-section {
    position: relative;
    width: 100%;
    padding: 0 8vw;
    overflow: hidden;
}

.section-roots {
    margin-top: 12vh;
    padding-top: 8vh;
    padding-bottom: 8vh;
}

.section-stems {
    margin-top: 10vh;
    padding-top: 8vh;
    padding-bottom: 8vh;
    background-color: var(--c-bg-alt);
}

.section-leaves {
    margin-top: 10vh;
    padding-top: 8vh;
    padding-bottom: 16vh;
}

.section-content {
    position: relative;
    z-index: 2;
}

.section-left {
    width: 55%;
    max-width: 600px;
    margin-left: 8vw;
}

.section-right {
    width: 55%;
    max-width: 600px;
    margin-left: auto;
    margin-right: 8vw;
}

.section-wide {
    width: 70%;
    max-width: 800px;
    margin: 0 auto;
}

.section-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--c-text);
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.section-text {
    color: var(--c-text);
    margin-bottom: 1.25rem;
    max-width: 60ch;
}

.section-text em {
    color: var(--c-accent-green);
    font-style: italic;
}

.section-text code {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.85em;
    background-color: var(--c-fern);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--c-text);
}

.highlight {
    color: var(--c-accent-gold);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(201, 162, 78, 0.3);
    text-underline-offset: 3px;
}

/* ========== BOTANICAL ILLUSTRATIONS ========== */

.section-botanical {
    width: clamp(80px, 10vw, 130px);
    height: auto;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 1.2s var(--ease-settle);
}

.section-botanical path,
.section-botanical circle {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s var(--ease-settle);
}

.reveal-section.revealed .section-botanical {
    opacity: 1;
}

.reveal-section.revealed .section-botanical path,
.reveal-section.revealed .section-botanical circle {
    stroke-dashoffset: 0;
}

/* ========== ORGANIC BLOBS ========== */

.blob {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s var(--ease-settle);
}

.blob.breathing {
    opacity: 1;
    animation: blobBreathe 8s ease-in-out infinite;
}

.blob-1 {
    width: 400px;
    height: 350px;
    top: -50px;
    right: 5vw;
    border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
    background: linear-gradient(135deg, rgba(90, 125, 94, 0.06), rgba(139, 107, 138, 0.04));
}

.blob-2 {
    width: 450px;
    height: 400px;
    top: -80px;
    left: -50px;
    border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%;
    background: linear-gradient(135deg, rgba(139, 107, 138, 0.05), rgba(201, 162, 78, 0.04));
}

.blob-3 {
    width: 500px;
    height: 420px;
    bottom: -60px;
    right: 10vw;
    border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
    background: linear-gradient(135deg, rgba(201, 162, 78, 0.05), rgba(90, 125, 94, 0.04));
}

@keyframes blobBreathe {
    0%, 100% {
        border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
        transform: scale(1);
    }
    50% {
        border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%;
        transform: scale(1.03);
    }
}

/* ========== ANNOTATION ARROWS ========== */

.annotation-arrow {
    position: absolute;
    width: 60px;
    height: 30px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.8s var(--ease-settle);
}

.arrow-1 {
    right: 25vw;
    bottom: 15%;
}

.arrow-2 {
    left: 12vw;
    bottom: 15%;
}

.arrow-3 {
    left: 15vw;
    bottom: 12%;
}

.annotation-text {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--c-text-muted);
    transform: rotate(-1.5deg);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.8s var(--ease-settle) 0.2s;
    white-space: nowrap;
}

.annotation-1 {
    right: 20vw;
    bottom: 12%;
}

.annotation-2 {
    left: 18vw;
    bottom: 12%;
}

.annotation-3 {
    left: 20vw;
    bottom: 9%;
}

/* ========== REVEAL ANIMATIONS ========== */

.reveal-section .reveal-child {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-elastic), transform 0.8s var(--ease-elastic);
}

.reveal-section.revealed .reveal-child {
    opacity: 1;
    transform: translateY(0);
}

.reveal-section.revealed .reveal-child:nth-child(1) { transition-delay: 0.1s; }
.reveal-section.revealed .reveal-child:nth-child(2) { transition-delay: 0.2s; }
.reveal-section.revealed .reveal-child:nth-child(3) { transition-delay: 0.3s; }
.reveal-section.revealed .reveal-child:nth-child(4) { transition-delay: 0.4s; }
.reveal-section.revealed .reveal-child:nth-child(5) { transition-delay: 0.5s; }

.content-section.section-visible .annotation-arrow,
.content-section.section-visible .annotation-text {
    opacity: 1;
}

/* ========== SEED FOOTER ========== */

.seed-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 0 10vh;
    background-color: var(--c-bg);
}

.footer-seed {
    width: 60px;
    height: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-settle), transform 0.8s var(--ease-elastic);
}

.seed-footer.revealed .footer-seed {
    opacity: 1;
    transform: translateY(0);
}

.footer-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    color: var(--c-text-muted);
    margin-top: 1rem;
    transform: rotate(-1.5deg);
    opacity: 0;
    transition: opacity 0.8s var(--ease-settle) 0.3s;
}

.seed-footer.revealed .footer-text {
    opacity: 1;
}

/* ========== LINKS ========== */

a {
    color: var(--c-accent-green);
    text-decoration: none;
    transition: color 0.3s var(--ease-settle);
}

a:hover {
    color: var(--c-accent-violet);
}

a:visited {
    color: var(--c-accent-violet);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .root-nav {
        display: none;
    }

    .hero-content {
        margin-left: 8vw;
        margin-top: 35vh;
    }

    .section-left,
    .section-right,
    .section-wide {
        width: 90%;
        margin-left: 5vw;
        margin-right: 5vw;
    }

    .content-section {
        padding: 0 5vw;
    }

    .blob {
        display: none;
    }

    .botanical-fern {
        width: 100px;
        left: 3vw;
    }

    .hero-seed {
        width: 80px;
        right: 5vw;
        bottom: 8vh;
    }

    .annotation-arrow,
    .annotation-text {
        display: none;
    }

    .section-botanical {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        margin-left: 6vw;
        margin-top: 30vh;
    }

    .section-left,
    .section-right,
    .section-wide {
        width: 92%;
        margin-left: 4vw;
        margin-right: 4vw;
    }
}