/* ============================================
   munju.im - Nocturnal Botanical Luxury
   Palette: gold-black-luxury
   Layout: organic-flow (vine structure)
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --obsidian: #0a0a0a;
    --charcoal-loam: #1a1a18;
    --burnished-gold: #c9a84c;
    --antique-brass: #b08d3a;
    --pale-gold: #e8d5a0;
    --parchment-cream: #f0ead6;
    --faded-sage: #9a9a82;
    --deep-moss: #2a3a20;

    --font-display: 'Josefin Sans', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-accent: 'Cormorant Garamond', serif;

    --stem-position: 33vw;
    --scroll-depth: 0px;
    --stem-sway: 0px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--obsidian);
    color: var(--parchment-cream);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(232, 213, 160, 0.15);
    color: var(--parchment-cream);
}

a {
    color: var(--parchment-cream);
    text-decoration: none;
    transition: color 300ms ease, border-bottom-color 300ms ease;
    border-bottom: 1px solid transparent;
}

a:hover {
    color: var(--burnished-gold);
    border-bottom-color: var(--burnished-gold);
}

/* --- Loading Wave --- */
.loading-wave {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background-color: var(--obsidian);
    transition: opacity 600ms ease;
    pointer-events: none;
}

.loading-wave svg {
    width: 60%;
    max-width: 600px;
    height: 100px;
}

.loading-wave.is-hidden {
    opacity: 0;
}

.loading-wave.is-removed {
    display: none;
}

/* --- Golden Stem --- */
.golden-stem {
    position: fixed;
    top: 0;
    left: var(--stem-position);
    width: 2px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    transform: translateX(var(--stem-sway));
    will-change: transform;
}

.stem-line {
    width: 2px;
    height: var(--scroll-depth);
    background-color: var(--burnished-gold);
    will-change: height;
    max-height: 100%;
    transition: none;
}

/* --- Root Zone (Header) --- */
.root-zone {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    z-index: 5;
}

.root-zone__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, rgba(10,10,10,0.4), rgba(201,168,76,0.08)),
        radial-gradient(ellipse at 40% 30%, rgba(201,168,76,0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(42,58,32,0.06) 0%, transparent 50%);
    background-color: var(--obsidian);
    opacity: 0;
    transition: opacity 1500ms ease;
}

.root-zone__bg.is-visible {
    opacity: 0.12;
}

.root-zone__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-bottom: 15vh;
    opacity: 0;
    transition: opacity 600ms ease;
}

.root-zone__content.is-visible {
    opacity: 1;
}

.root-zone__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.root-zone__name {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--parchment-cream);
    line-height: 1.1;
}

.root-zone__ext {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 4vw, 3.25rem);
    letter-spacing: 0.03em;
    color: var(--burnished-gold);
    line-height: 1.2;
}

.root-zone__scroll-hint {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 600ms ease 3200ms;
    z-index: 3;
}

.root-zone__scroll-hint.is-visible {
    opacity: 1;
}

.scroll-hint__text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faded-sage);
}

.scroll-hint__chevron {
    display: block;
    animation: bounceChevron 2s ease-in-out infinite;
}

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

/* --- Leaf Sections (Content) --- */
.leaf-section {
    position: relative;
    padding: 0 5vw;
    margin-top: 20vh;
    z-index: 5;
}

.leaf-section:first-of-type {
    margin-top: 10vh;
}

.leaf-section__grid {
    display: grid;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

.leaf-section__grid--left {
    grid-template-columns: minmax(0, 2fr) 2px minmax(0, 1fr);
}

.leaf-section__grid--right {
    grid-template-columns: minmax(0, 1fr) 2px minmax(0, 2fr);
}

/* Slide-reveal initial states */
.leaf-section--left .leaf-section__content {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.leaf-section--right .leaf-section__content {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.leaf-section--left .leaf-section__aside {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1) 150ms, transform 700ms cubic-bezier(0.22, 1, 0.36, 1) 150ms;
}

.leaf-section--right .leaf-section__aside {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1) 150ms, transform 700ms cubic-bezier(0.22, 1, 0.36, 1) 150ms;
}

.leaf-section.is-revealed .leaf-section__content,
.leaf-section.is-revealed .leaf-section__aside {
    opacity: 1;
    transform: translateX(0);
}

.leaf-section__stem-col {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
}

.stem-node {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--burnished-gold);
    transition: width 200ms ease, height 200ms ease, box-shadow 200ms ease;
    transform: scale(0);
    cursor: default;
}

.leaf-section.is-revealed .stem-node {
    transform: scale(1);
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 200ms;
}

.stem-node:hover {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 12px rgba(201,168,76,0.4);
}

.leaf-section__content {
    padding: 2rem 3rem;
}

.leaf-section__aside {
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* --- Specimen Labels --- */
.specimen-label {
    display: inline-block;
    border: 0.5px solid var(--burnished-gold);
    padding: 0.25rem 0.6rem;
    margin-bottom: 1.5rem;
    position: relative;
    top: -0.5rem;
    left: -0.5rem;
}

.specimen-label__text {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--faded-sage);
}

/* --- Section Headings --- */
.leaf-section__heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.1em;
    color: var(--burnished-gold);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
    cursor: default;
}

.leaf-section__heading::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--burnished-gold);
    transition: width 400ms ease;
}

.leaf-section__heading:hover::after {
    width: 100%;
}

/* Wave underline SVG overlay for headings */
.heading-wave-underline {
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 10px;
    pointer-events: none;
}

.heading-wave-underline path {
    stroke: var(--burnished-gold);
    stroke-width: 1;
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 400ms ease;
}

.leaf-section__heading:hover .heading-wave-underline path {
    stroke-dashoffset: 0;
}

/* --- Body Text --- */
.leaf-section__body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--parchment-cream);
    margin-bottom: 1.25rem;
    max-width: 600px;
}

/* --- Pull Quotes --- */
.leaf-section__pullquote {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    letter-spacing: 0.03em;
    color: var(--pale-gold);
    line-height: 1.6;
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 1px solid var(--antique-brass);
    max-width: 550px;
}

/* Pull-quote word animation */
.leaf-section__pullquote .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 350ms ease-out, transform 350ms ease-out;
}

.leaf-section__pullquote .word.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Botanical SVG Images --- */
.leaf-section__photo-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    border-radius: 2px;
}

.leaf-section__photo-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10,10,10,0.4), rgba(201,168,76,0.08));
    transition: background 500ms ease;
    pointer-events: none;
}

.leaf-section__photo-container:hover::after {
    background: linear-gradient(135deg, rgba(10,10,10,0.2), rgba(201,168,76,0.04));
}

.leaf-section__botanical-svg {
    display: block;
    width: 100%;
    height: auto;
}

/* --- Wave Dividers --- */
.wave-divider {
    padding: 4rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.wave-divider svg {
    width: 100%;
    height: 60px;
}

.wave-divider__path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1200ms ease;
}

.wave-divider.is-drawn .wave-divider__path {
    stroke-dashoffset: 0;
}

/* --- Contact Details --- */
.contact-details {
    margin: 2rem 0;
}

.contact-link {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.1em;
    color: var(--burnished-gold);
    border-bottom: 1px solid var(--antique-brass);
    padding-bottom: 2px;
    transition: color 300ms ease, border-bottom-color 300ms ease;
}

.contact-link:hover {
    color: var(--pale-gold);
    border-bottom-color: var(--pale-gold);
}

/* --- Soil Footer --- */
.soil-footer {
    position: relative;
    padding: 6rem 5vw 3rem;
    margin-top: 20vh;
    overflow: hidden;
}

.soil-footer__roots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
}

.soil-footer__roots-svg {
    width: 100%;
    height: 100%;
}

.soil-footer__content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 6rem;
}

.soil-footer__nav {
    display: flex;
    gap: 2rem;
}

.soil-footer__link {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faded-sage);
    transition: color 300ms ease;
}

.soil-footer__link:hover {
    color: var(--burnished-gold);
    border-bottom-color: transparent;
}

.soil-footer__info {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.soil-footer__domain {
    font-family: var(--font-accent);
    font-weight: 300;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--faded-sage);
    letter-spacing: 0.03em;
}

.soil-footer__year {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--faded-sage);
    letter-spacing: 0.1em;
}

/* --- Background Wave Texture --- */
.wave-bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading-wave {
        display: none;
    }

    .leaf-section--left .leaf-section__content,
    .leaf-section--right .leaf-section__content,
    .leaf-section--left .leaf-section__aside,
    .leaf-section--right .leaf-section__aside {
        opacity: 1;
        transform: none;
    }

    .stem-node {
        transform: scale(1);
    }

    .root-zone__content,
    .root-zone__scroll-hint {
        opacity: 1;
    }

    .root-zone__bg {
        opacity: 0.12;
    }

    .wave-divider__path {
        stroke-dashoffset: 0;
    }

    .leaf-section__pullquote .word {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    :root {
        --stem-position: 20px;
    }

    .leaf-section__grid--left,
    .leaf-section__grid--right {
        grid-template-columns: 2px 1fr;
    }

    .leaf-section__aside {
        display: none;
    }

    .leaf-section__grid--left .leaf-section__content {
        order: 2;
    }

    .leaf-section__grid--left .leaf-section__stem-col {
        order: 1;
    }

    .leaf-section__grid--right .leaf-section__aside {
        display: none;
    }

    .leaf-section__grid--right .leaf-section__stem-col {
        order: 1;
    }

    .leaf-section__grid--right .leaf-section__content {
        order: 2;
    }

    .leaf-section__content {
        padding: 1.5rem 1rem 1.5rem 2rem;
    }

    .leaf-section {
        padding: 0 1rem;
        margin-top: 12vh;
    }

    .soil-footer__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .root-zone__content {
        padding-bottom: 20vh;
    }
}
