/* ===========================================
   ppuzzl.dev - Generative Zen Garden
   Palette: Warm-Earthy
   Fonts: Space Grotesk, DM Sans
   Layout: Broken Grid (16-col)
   =========================================== */

:root {
    --deep-loam: #2B1F14;
    --worn-bark: #5C4033;
    --dried-clay: #A0785A;
    --amber-resin: #C8943E;
    --pale-straw: #E8D8B4;
    --morning-mist: #F4EDE0;
    --moss-whisper: #6B7B5E;
    --dappled-light: #F9F4E8;

    --ease-zen: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    color: var(--worn-bark);
    background-color: var(--morning-mist);
    overflow-x: hidden;
}

/* ---- Bokeh Canvas ---- */
#bokeh-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---- Ripple Layer ---- */
#ripple-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 148, 62, 0.05) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-expand 1.5s cubic-bezier(0.1, 0.4, 0.2, 1) forwards;
}

@keyframes ripple-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ---- Leaf Scatter ---- */
#leaf-scatter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.falling-leaf {
    position: absolute;
    top: -20px;
    opacity: 0.6;
    animation: leaf-fall linear forwards;
}

@keyframes leaf-fall {
    0% {
        opacity: 0.6;
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    80% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateX(var(--leaf-drift)) translateY(100vh) rotate(var(--leaf-rotation));
    }
}

/* ---- Leaf Venation SVG ---- */
.leaf-venation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.footer-venation {
    opacity: 0.05;
}

/* ---- Leaf Silhouettes ---- */
.leaf-silhouette {
    position: absolute;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

.leaf-ginkgo {
    width: 120px;
    height: 120px;
    background: var(--dried-clay);
    clip-path: path('M60 0 C30 30, 0 60, 10 90 C20 110, 40 120, 60 120 C80 120, 100 110, 110 90 C120 60, 90 30, 60 0Z');
    top: 10%;
    left: 45%;
}

.leaf-maple {
    width: 100px;
    height: 100px;
    background: var(--dried-clay);
    clip-path: polygon(50% 0%, 35% 30%, 0% 25%, 20% 50%, 5% 75%, 30% 65%, 50% 100%, 70% 65%, 95% 75%, 80% 50%, 100% 25%, 65% 30%);
    bottom: 15%;
    right: 10%;
}

.leaf-oak {
    width: 90px;
    height: 110px;
    background: var(--dried-clay);
    clip-path: path('M45 0 C30 15, 10 20, 15 35 C5 40, 5 55, 15 60 C5 70, 10 85, 20 90 C25 100, 40 110, 45 110 C50 110, 65 100, 70 90 C80 85, 85 70, 75 60 C85 55, 85 40, 75 35 C80 20, 60 15, 45 0Z');
    top: 5%;
    right: 20%;
}

.leaf-willow {
    width: 40px;
    height: 130px;
    background: var(--dried-clay);
    clip-path: ellipse(20px 65px at 50% 50%);
}

.leaf-birch {
    width: 70px;
    height: 90px;
    background: var(--dried-clay);
    clip-path: path('M35 0 C15 20, 0 45, 10 70 C15 80, 25 90, 35 90 C45 90, 55 80, 60 70 C70 45, 55 20, 35 0Z');
}

/* ===== THE CLEARING (Hero) ===== */
.clearing {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background-color: var(--dappled-light);
    z-index: 1;
    overflow: hidden;
}

.hero-text {
    position: relative;
    z-index: 2;
    margin-top: 35vh;
    margin-left: 15%;
}

#hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    color: var(--deep-loam);
    line-height: 1.1;
}

#hero-title .letter {
    display: inline-block;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 400ms var(--ease-zen), filter 400ms var(--ease-zen);
}

#hero-title .letter.revealed {
    opacity: 1;
    filter: blur(0);
}

.domain-ext {
    display: inline-block;
    color: var(--moss-whisper);
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 400ms var(--ease-zen), transform 600ms var(--ease-zen);
}

.domain-ext.revealed {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--worn-bark);
    margin-top: 1.5rem;
    max-width: 38ch;
    opacity: 0;
    transition: opacity 800ms var(--ease-zen);
}

.hero-subtitle.revealed {
    opacity: 1;
}

/* ===== THE UNDERGROWTH ===== */
.undergrowth {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: auto;
    column-gap: clamp(0.8rem, 2vw, 2rem);
    row-gap: clamp(3rem, 8vh, 8rem);
    padding: clamp(4rem, 10vh, 10rem) clamp(1rem, 3vw, 3rem);
    background-color: var(--morning-mist);
}

.undergrowth-block {
    position: relative;
    padding: clamp(2rem, 4vw, 4rem);
    background-color: var(--pale-straw);
    border-radius: 2px;
    mix-blend-mode: multiply;
}

.undergrowth-block .label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dried-clay);
    display: block;
    margin-bottom: 1rem;
}

.undergrowth-block h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    letter-spacing: -0.03em;
    color: var(--deep-loam);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.undergrowth-block p {
    max-width: 38ch;
    color: var(--worn-bark);
}

.block-a {
    grid-column: 2 / span 5;
    grid-row: 1;
}

.undergrowth-pattern {
    grid-column: 6 / span 4;
    grid-row: 1 / span 2;
    opacity: 0.15;
    pointer-events: none;
    align-self: center;
}

.block-b {
    grid-column: 10 / span 5;
    grid-row: 1;
    margin-top: -4vh;
}

/* ===== Generative Canvases ===== */
.gen-canvas {
    border-radius: 50%;
    margin-top: 2rem;
    display: block;
    opacity: 0.8;
}

/* ===== THE CANOPY ===== */
.canopy {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: auto;
    column-gap: clamp(0.8rem, 2vw, 2rem);
    row-gap: clamp(3rem, 8vh, 8rem);
    padding: clamp(4rem, 10vh, 10rem) clamp(1rem, 3vw, 3rem);
    background: linear-gradient(
        to bottom,
        var(--morning-mist) 0%,
        rgba(160, 120, 90, 0.08) 50%,
        rgba(160, 120, 90, 0.12) 100%
    );
}

.canopy-panel {
    position: relative;
    padding: clamp(2rem, 4vw, 4rem);
    background-color: var(--pale-straw);
    border-radius: 2px;
}

.canopy-panel .label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dried-clay);
    display: block;
    margin-bottom: 1rem;
}

.canopy-panel h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    letter-spacing: -0.03em;
    color: var(--deep-loam);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.canopy-panel p {
    max-width: 38ch;
    color: var(--worn-bark);
}

.panel-one {
    grid-column: 1 / span 6;
    grid-row: 1;
}

.panel-two {
    grid-column: 4 / span 7;
    grid-row: 2;
}

.panel-three {
    grid-column: 7 / span 8;
    grid-row: 3;
}

/* ===== THE ROOT SYSTEM (Footer) ===== */
.root-system {
    position: relative;
    z-index: 1;
    background-color: var(--deep-loam);
    padding: 6vh 8vw;
    overflow: hidden;
}

.footer-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30vh;
}

.footer-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--morning-mist);
}

/* ===== Fade-in Animation ===== */
.fade-in-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms var(--ease-zen), transform 600ms var(--ease-zen);
}

.fade-in-block.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Links ===== */
a {
    color: var(--amber-resin);
    text-decoration: none;
    position: relative;
    transition: color 300ms var(--ease-zen);
}

a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 0;
    height: 1px;
    background-color: var(--amber-resin);
    transition: width 300ms var(--ease-zen);
}

a:hover {
    color: #d4a34a;
}

a:hover::after {
    width: 100%;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .undergrowth,
    .canopy {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .block-b {
        margin-top: 0;
    }

    .hero-text {
        margin-left: 8%;
    }

    .undergrowth-pattern {
        display: none;
    }

    .leaf-silhouette {
        display: none;
    }
}
