/* ppzz.lu - Botanical Sketchbook Scroll */

/* Paper grain texture */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

:root {
    --bg: #f7f3eb;
    --ink-dark: #2d5016;
    --green-mid: #5a8c3c;
    --gold: #c4a940;
    --marigold: #e8a838;
    --olive: #6b7c4e;
    --brown: #4a3728;
    --cream: #eae2c8;
    --paper-light: #e8e4d4;
    --paper-mid: #ddd5bc;
    --grain: #d4cbb5;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    background-color: var(--bg);
    color: var(--ink-dark);
    overflow-x: hidden;
    transition: background-color 0.8s ease;
    background-image: radial-gradient(circle, var(--grain) 0.5px, transparent 0.5px);
    background-size: 4px 4px;
}

/* Vine SVG */
#vine-svg {
    position: fixed;
    left: 8%;
    top: 0;
    width: 120px;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#vine-svg.visible {
    opacity: 1;
}

#main-vine,
.vine-branch,
.vine-tendril {
    will-change: stroke-dashoffset;
}

/* Scenes */
.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem;
}

.scene-tall {
    min-height: 150vh;
    flex-direction: column;
    gap: 10vh;
}

/* Section 1: Seedling */
#seedling {
    flex-direction: column;
}

.seedling-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 3;
}

#hero-title-svg {
    width: clamp(280px, 60vw, 600px);
    height: auto;
}

.seedling-subtitle {
    font-family: 'Patrick Hand', cursive;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    letter-spacing: 0.05em;
    color: var(--olive);
    opacity: 0;
    transition: opacity 1.5s ease 1.8s;
}

.seedling-subtitle.visible {
    opacity: 1;
}

.germination-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 600px);
    height: min(90vw, 600px);
    z-index: 1;
    pointer-events: none;
}

.germ-line {
    transition: opacity 0.6s ease;
}

.scroll-arrow {
    animation: bob 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

.scroll-arrow.visible {
    opacity: 0.6;
}

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

/* Leaf panels */
.leaf-panel {
    background: rgba(234, 226, 200, 0.5);
    border: 2px solid var(--olive);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    padding: 3rem 2.5rem;
    max-width: 480px;
    transform: rotate(var(--leaf-tilt, 0deg));
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: transform;
    z-index: 3;
    filter: url(#sketchy-line);
}

.leaf-panel.visible {
    opacity: 1;
}

.leaf-panel-1 { align-self: flex-end; margin-right: 10%; }
.leaf-panel-2 { align-self: flex-start; margin-left: 20%; }
.leaf-panel-3 { align-self: flex-end; margin-right: 5%; }

.leaf-panel-inner {
    transform: rotate(calc(var(--leaf-tilt, 0deg) * -1));
}

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

.body-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.75;
    color: var(--brown);
}

/* Seed pod decorations */
.seed-pod-decoration {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 3;
}

.seed-pod-decoration.visible {
    opacity: 0.7;
    transform: translateY(0);
}

.seed-pod-1 { align-self: center; }
.seed-pod-2 { align-self: center; margin-left: 30%; }

/* Ink splatters */
.ink-splatter {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.ink-splatter-1 { margin-left: 65%; margin-top: -3rem; margin-bottom: -2rem; }
.ink-splatter-2 { margin-left: 70%; margin-top: -2rem; margin-bottom: -2rem; }
.ink-splatter-3 { margin-left: 60%; margin-top: -2rem; margin-bottom: -2rem; }

/* Canopy scenes */
.canopy-scene {
    flex-direction: column;
    overflow: hidden;
}

.canopy-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 900px;
    min-height: 60vh;
    z-index: 3;
}

.canopy-text-wrap {
    text-align: center;
    max-width: 550px;
    padding: 2rem;
    z-index: 5;
}

.canopy-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.02em;
    color: var(--ink-dark);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.canopy-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.canopy-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.75;
    color: var(--brown);
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.canopy-body.visible {
    opacity: 1;
}

.annotation {
    font-family: 'Patrick Hand', cursive;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    letter-spacing: 0.05em;
    color: var(--olive);
    opacity: 0;
    transition: opacity 1s ease 0.6s;
}

.annotation.visible {
    opacity: 0.8;
}

/* Floating leaves */
.canopy-leaves-back,
.canopy-leaves-front {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.canopy-leaves-front {
    z-index: 4;
}

.floating-leaf {
    position: absolute;
    will-change: transform;
}

/* Counter-animations */
.leaf-back-1 { top: 10%; left: 5%; animation: drift-back 8s ease-in-out infinite; }
.leaf-back-2 { top: 60%; right: 8%; animation: drift-back 6s ease-in-out infinite 1s; }
.leaf-back-3 { top: 15%; right: 10%; animation: drift-back 7s ease-in-out infinite 0.5s; }
.leaf-back-4 { top: 20%; left: 8%; animation: drift-back 8s ease-in-out infinite; }
.leaf-front-1 { bottom: 15%; right: 12%; animation: drift-front 6s ease-in-out infinite; }
.leaf-front-2 { bottom: 20%; left: 10%; animation: drift-front 4s ease-in-out infinite 0.5s; }
.leaf-front-3 { bottom: 10%; right: 15%; animation: drift-front 5s ease-in-out infinite 1s; }

@keyframes drift-back {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(15px) translateX(-8px); }
}

@keyframes drift-front {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-10px) translateX(6px); }
}

/* Seed counter-rotate */
@keyframes seed-float-up {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(20deg); }
}

@keyframes petal-float-down {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(10px) rotate(-15deg); }
}

/* Bloom section */
#bloom {
    flex-direction: column;
}

.bloom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.flower-container {
    position: relative;
    width: clamp(280px, 50vw, 400px);
    height: clamp(280px, 50vw, 400px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#flower-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.petal {
    opacity: 0;
    transform-origin: 200px 200px;
    transition: opacity 0.6s ease;
}

.petal.visible {
    opacity: 1;
}

.bloom-message {
    position: relative;
    z-index: 5;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.bloom-message.visible {
    opacity: 1;
}

.bloom-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--ink-dark);
    letter-spacing: 0.02em;
}

.bloom-text {
    font-family: 'Patrick Hand', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--olive);
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* Root network */
.root-network {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    z-index: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .leaf-panel {
        padding: 2rem 1.5rem;
        max-width: 90%;
    }
    .leaf-panel-1, .leaf-panel-3 { margin-right: 5%; align-self: center; }
    .leaf-panel-2 { margin-left: 5%; align-self: center; }
    #vine-svg { display: none; }
}
