/* === namu.farm — Contemplative Digital Arboretum === */

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

:root {
    --burgundy-heartwood: #5e1a2e;
    --washed-burgundy: #c8a0ad;
    --hanji-cream: #f5efe6;
    --persimmon-blush: #d4826a;
    --celadon-mist: #8fb5a3;
    --deep-green: #4a7a5c;
    --bark-umber: #3a0e1e;
    --veined-stone: #d1c4b7;
    --body-text: #4a2030;
    --accent-label: #7a4a58;

    --canopy-color: #8fb5a3;
    --canopy-opacity: 1;
}

html {
    scroll-behavior: smooth;
}

body.namu {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--hanji-cream);
    color: var(--body-text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Hanji paper texture === */
.canopy-panel {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(209,196,183,0.04) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 60%, rgba(209,196,183,0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(122,74,88,0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 10% 90%, rgba(209,196,183,0.03) 0%, transparent 40%),
        var(--hanji-cream);
}

/* === LAYOUT: Split-Screen === */
body.namu {
    display: grid;
    grid-template-columns: 38fr 62fr;
    min-height: 100vh;
}

.root-panel {
    position: fixed;
    left: 0;
    top: 0;
    width: 38vw;
    height: 100vh;
    background: var(--hanji-cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

/* Watercolor bleeding edge */
.root-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: -30px;
    width: 60px;
    height: 100%;
    background: linear-gradient(to right, var(--hanji-cream) 0%, transparent 100%);
    filter: blur(8px);
    z-index: 5;
    pointer-events: none;
}

.canopy-panel {
    margin-left: 38vw;
    width: 62vw;
    min-height: 100vh;
    padding: clamp(3rem, 8vw, 6rem);
    padding-top: 10vh;
}

.progress-vine {
    position: fixed;
    right: 24px;
    top: 10vh;
    height: 80vh;
    width: 2px;
    background: rgba(94, 26, 46, 0.15);
    z-index: 20;
}

.vine-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--burgundy-heartwood);
    border-radius: 1px;
    transition: height 0.1s linear;
}

.node {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) scale(1);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--burgundy-heartwood);
    opacity: 0.3;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.node.active {
    opacity: 1;
    transform: translateX(-50%) scale(1.5);
}

.node-spring { top: 12.5%; }
.node-summer { top: 37.5%; }
.node-autumn { top: 62.5%; }
.node-winter { top: 87.5%; }

/* === TREE ILLUSTRATION === */
.tree {
    position: relative;
    width: 280px;
    height: 380px;
    transition: transform 0.6s ease-out;
}

.tree.shake {
    animation: seasonal-shake 600ms ease-out;
}

@keyframes seasonal-shake {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-3px) rotate(-0.5deg); }
    50%  { transform: translateX(2px) rotate(0.3deg); }
    75%  { transform: translateX(-1px) rotate(-0.2deg); }
    100% { transform: translateX(0); }
}

.trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 180px;
    background: var(--bark-umber);
    opacity: 0.7;
    border-radius: 4px 4px 8px 8px;
}

.trunk::before {
    content: '';
    position: absolute;
    top: 30px;
    left: -8px;
    width: 14px;
    height: 60px;
    background: var(--bark-umber);
    opacity: 0.5;
    border-radius: 4px;
    transform: rotate(-25deg);
}

.trunk::after {
    content: '';
    position: absolute;
    top: 50px;
    right: -10px;
    width: 12px;
    height: 50px;
    background: var(--bark-umber);
    opacity: 0.45;
    border-radius: 4px;
    transform: rotate(20deg);
}

.canopy-blob {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    background: var(--canopy-color);
    opacity: var(--canopy-opacity);
    filter: blur(2px);
    transition: background-color 1.2s ease, opacity 1.2s ease;
}

.canopy-1 {
    width: 140px;
    height: 120px;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    filter: blur(3px);
    opacity: calc(var(--canopy-opacity) * 0.9);
}

.canopy-2 {
    width: 110px;
    height: 100px;
    top: 50px;
    left: 20%;
    border-radius: 50% 40% 60% 50% / 45% 55% 45% 55%;
    filter: blur(2px);
    opacity: calc(var(--canopy-opacity) * 0.8);
}

.canopy-3 {
    width: 120px;
    height: 110px;
    top: 40px;
    right: 15%;
    border-radius: 55% 45% 50% 50% / 50% 50% 40% 60%;
    filter: blur(2.5px);
    opacity: calc(var(--canopy-opacity) * 0.85);
}

.canopy-4 {
    width: 90px;
    height: 80px;
    top: 100px;
    left: 15%;
    border-radius: 60% 40% 45% 55% / 40% 60% 50% 50%;
    filter: blur(3px);
    opacity: calc(var(--canopy-opacity) * 0.7);
}

.canopy-5 {
    width: 100px;
    height: 90px;
    top: 90px;
    right: 10%;
    border-radius: 45% 55% 60% 40% / 55% 45% 50% 50%;
    filter: blur(2px);
    opacity: calc(var(--canopy-opacity) * 0.75);
}

.canopy-6 {
    width: 80px;
    height: 70px;
    top: 0;
    left: 35%;
    border-radius: 50% 50% 40% 60% / 60% 40% 55% 45%;
    filter: blur(4px);
    opacity: calc(var(--canopy-opacity) * 0.6);
}

.canopy-7 {
    width: 70px;
    height: 65px;
    top: 130px;
    left: 45%;
    border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%;
    filter: blur(3.5px);
    opacity: calc(var(--canopy-opacity) * 0.65);
}

.root-label {
    position: absolute;
    bottom: 5vh;
    font-family: 'Caveat', cursive;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--accent-label);
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/* === TYPOGRAPHY === */
.chapter-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    color: var(--bark-umber);
    letter-spacing: 0.01em;
    margin-bottom: 0.3em;
}

.chapter-title em {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-style: italic;
}

.chapter-subtitle {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    color: var(--accent-label);
    margin-bottom: 1.5em;
}

.caveat {
    font-family: 'Caveat', cursive;
}

.passage {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.9;
    letter-spacing: 0.015em;
    color: var(--body-text);
    max-width: 60%;
    margin-bottom: 2.5em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.passage.visible {
    opacity: 1;
}

/* === MARBLE DIVIDERS === */
.marble-divider {
    width: 40%;
    height: 2px;
    margin: 0 auto 3em 0;
    background:
        linear-gradient(110deg,
            transparent 20%,
            #d1c4b7 20.5%,
            transparent 21%,
            transparent 45%,
            rgba(209,196,183,0.5) 45.5%,
            transparent 46%,
            transparent 70%,
            rgba(209,196,183,0.3) 70.5%,
            transparent 71%
        );
}

/* === SEASONAL CHAPTERS === */
.chapter {
    min-height: 80vh;
    padding-top: 10vh;
    padding-bottom: 15vh;
}

/* === BOTANICAL MOTIFS === */
.chapter-motif {
    margin-bottom: 2em;
    position: relative;
    width: 60px;
    height: 60px;
}

/* Spring: Cherry blossom */
.spring-motif {
    width: 70px;
    height: 70px;
}

.petal {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(200, 160, 173, 0.6);
    top: 50%;
    left: 50%;
}

.petal-1 { transform: translate(-50%, -50%) translateY(-16px); }
.petal-2 { transform: translate(-50%, -50%) rotate(72deg) translateY(-16px); }
.petal-3 { transform: translate(-50%, -50%) rotate(144deg) translateY(-16px); }
.petal-4 { transform: translate(-50%, -50%) rotate(216deg) translateY(-16px); }
.petal-5 { transform: translate(-50%, -50%) rotate(288deg) translateY(-16px); }

.petal-center {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--persimmon-blush);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Summer: Leaf */
.summer-motif {
    width: 50px;
    height: 70px;
}

.leaf-shape {
    width: 40px;
    height: 60px;
    background: var(--celadon-mist);
    clip-path: polygon(50% 0%, 100% 40%, 80% 100%, 50% 85%, 20% 100%, 0% 40%);
    opacity: 0.8;
}

.leaf-vein {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 35px;
    background: rgba(58, 14, 30, 0.3);
}

/* Autumn: Ginkgo fan */
.autumn-motif {
    width: 50px;
    height: 60px;
}

.ginkgo-fan {
    width: 45px;
    height: 45px;
    background: var(--persimmon-blush);
    border-radius: 0 100% 0 0;
    transform: rotate(-45deg);
    opacity: 0.8;
    box-shadow: 0 0 20px rgba(212, 130, 106, 0.3);
}

/* Winter: Bare branches */
.winter-motif {
    width: 60px;
    height: 60px;
}

.branch {
    position: absolute;
    background: var(--bark-umber);
    opacity: 0.5;
    border-radius: 1px;
}

.branch-1 {
    width: 2px;
    height: 50px;
    top: 5px;
    left: 30px;
    transform: rotate(-10deg);
}

.branch-2 {
    width: 1.5px;
    height: 30px;
    top: 10px;
    left: 22px;
    transform: rotate(-35deg);
}

.branch-3 {
    width: 1.5px;
    height: 28px;
    top: 12px;
    left: 38px;
    transform: rotate(25deg);
}

/* === CODA === */
.coda {
    padding: 15vh 0 20vh;
    text-align: center;
}

.coda-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--accent-label);
    opacity: 0;
    transition: opacity 0.8s ease;
}

.coda-text.visible {
    opacity: 0.7;
}

/* === MOBILE === */
@media (max-width: 768px) {
    body.namu {
        display: block;
        grid-template-columns: none;
    }

    .root-panel {
        position: sticky;
        width: 100%;
        height: 30vh;
    }

    .root-panel::after {
        display: none;
    }

    .canopy-panel {
        margin-left: 0;
        width: 100%;
        padding: clamp(2rem, 6vw, 4rem);
    }

    .tree {
        width: 160px;
        height: 200px;
    }

    .trunk {
        height: 100px;
        width: 16px;
    }

    .canopy-blob {
        transform: scale(0.6);
    }

    .passage {
        max-width: 90%;
    }

    .progress-vine {
        right: 12px;
    }
}
