/* ============================================
   namu.land — a land of trees
   Wabi-sabi aesthetic, neon-electric accent
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Serif', serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.85;
    color: #E0D8C8;
    background-color: #1A2018;
    overflow-x: hidden;
}

/* --- Neon Threading Lines (fixed, all layers) --- */
.neon-thread {
    position: fixed;
    top: 0;
    width: 1px;
    height: 100vh;
    background: #00E880;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    transition: opacity 800ms ease;
}

.neon-thread.visible {
    opacity: 0.15;
}

.neon-thread-1 {
    left: 15%;
}

.neon-thread-2 {
    left: 50%;
    opacity: 0;
}

.neon-thread-2.visible {
    opacity: 0.08;
}

.neon-thread-3 {
    left: 82%;
}

/* --- Forest Layer Base --- */
.forest-layer {
    position: relative;
    width: 100%;
    overflow: hidden;
    transition: background-color 600ms ease;
}

.layer-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 24px;
    position: relative;
    z-index: 10;
}

/* --- CANOPY LAYER --- */
#canopy {
    min-height: 100vh;
    background-color: #1A2018;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.canopy-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

.domain-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(32px, 4.5vw, 64px);
    color: #E0D8C8;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    display: inline-block;
}

.jitter-letter {
    display: inline-block;
    animation: jitter 150ms infinite alternate;
    animation-delay: var(--jitter-delay, 0ms);
}

@keyframes jitter {
    0% {
        transform: translate(0px, 0px);
    }
    25% {
        transform: translate(-0.8px, 0.5px);
    }
    50% {
        transform: translate(0.5px, -0.8px);
    }
    75% {
        transform: translate(-0.5px, -0.3px);
    }
    100% {
        transform: translate(0.7px, 0.6px);
    }
}

.canopy-subtitle {
    font-family: 'Noto Serif KR', 'Noto Serif', serif;
    font-weight: 500;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #688860;
    letter-spacing: 0.06em;
    opacity: 0;
    animation: fadeInUp 1000ms 400ms ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Canopy SVGs */
.canopy-svgs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.nature-svg {
    position: absolute;
    opacity: 0;
    transition: opacity 600ms ease, transform 500ms ease;
}

.nature-svg.visible {
    opacity: 1;
}

.nature-svg:hover {
    cursor: default;
}

.leaf-1 {
    top: 12%;
    left: 8%;
    animation: svgFadeIn 600ms 200ms ease forwards;
}

.branch-1 {
    top: 20%;
    right: 5%;
    animation: svgFadeIn 600ms 400ms ease forwards;
}

.leaf-2 {
    bottom: 25%;
    left: 15%;
    animation: svgFadeIn 600ms 600ms ease forwards;
}

.leaf-3 {
    top: 35%;
    right: 18%;
    animation: svgFadeIn 600ms 800ms ease forwards;
}

.branch-2 {
    bottom: 15%;
    right: 10%;
    animation: svgFadeIn 600ms 1000ms ease forwards;
}

@keyframes svgFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nature SVG sway on hover (canopy + understory) */
#canopy .nature-svg:hover,
#understory .nature-svg:hover {
    animation: sway 500ms ease-in-out;
}

@keyframes sway {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    50% { transform: rotate(2deg); }
    75% { transform: rotate(-1deg); }
    100% { transform: rotate(0deg); }
}

/* Neon pulse lines in canopy */
.neon-pulse {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #00E880, transparent);
    opacity: 0;
    animation: neonPulseIn 800ms ease forwards;
    z-index: 3;
    pointer-events: none;
}

.neon-pulse-1 {
    top: 0;
    left: 30%;
    height: 60%;
    animation-delay: 0ms;
}

.neon-pulse-2 {
    top: 10%;
    left: 55%;
    height: 50%;
    animation-delay: 200ms;
}

.neon-pulse-3 {
    top: 5%;
    left: 75%;
    height: 70%;
    animation-delay: 400ms;
}

@keyframes neonPulseIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.6;
    }
}

/* --- UNDERSTORY LAYER --- */
#understory {
    background-color: #3A5038;
    position: relative;
    padding: 0;
}

.section-label {
    font-family: 'Noto Serif', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #688860;
    margin-bottom: 32px;
    text-transform: lowercase;
}

.section-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 42px);
    color: #E0D8C8;
    margin-bottom: 20px;
    line-height: 1.3;
}

.section-body {
    color: #E0D8C8;
    opacity: 0.88;
    margin-bottom: 32px;
}

.wabi-divider {
    width: 60px;
    height: 1px;
    background: #00E880;
    opacity: 0.5;
    margin: 48px 0;
    transform: rotate(-1.5deg);
}

/* Wabi-sabi geometric frames */
.wabi-frame {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.wabi-circle-1 {
    width: 180px;
    height: 180px;
    border: 1px solid #00E880;
    border-radius: 48% 52% 45% 55% / 50% 46% 54% 50%;
    opacity: 0.15;
    top: 60px;
    right: 8%;
    transform: rotate(5deg);
}

.wabi-rect-1 {
    width: 120px;
    height: 90px;
    border: 1px solid #00E880;
    opacity: 0.12;
    bottom: 80px;
    left: 6%;
    transform: rotate(-2deg);
    border-radius: 2px 4px 1px 3px;
}

/* Understory SVGs */
.understory-svgs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.sapling-1 {
    bottom: 10%;
    right: 12%;
    opacity: 0.6;
}

.leaf-cluster {
    top: 15%;
    left: 5%;
    opacity: 0.5;
}

/* --- FOREST FLOOR LAYER --- */
#forest-floor {
    background-color: #4A3828;
    position: relative;
}

#forest-floor .layer-content {
    padding-top: 100px;
    padding-bottom: 100px;
}

/* Earthy glow on hover for forest floor content blocks */
#forest-floor .section-body:hover {
    box-shadow: 0 0 30px rgba(74, 56, 40, 0.6), 0 0 60px rgba(104, 136, 96, 0.15);
    border-radius: 4px;
    padding: 8px 12px;
    margin: -8px -12px 32px;
    transition: box-shadow 400ms ease, padding 200ms ease, margin 200ms ease;
}

.floor-svgs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.fungi-1 {
    top: 10%;
    right: 8%;
    opacity: 0.5;
}

.seedling-1 {
    bottom: 15%;
    left: 10%;
    opacity: 0.5;
}

.bark-frag {
    top: 50%;
    left: 3%;
    opacity: 0.4;
}

/* --- ROOT SYSTEM LAYER --- */
#root-system {
    min-height: 100vh;
    background-color: #0A0A08;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.root-content {
    padding-top: 100px;
    padding-bottom: 60px;
}

/* Root network SVG background */
.root-network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.root-network {
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* Root cards with hover-lift */
.root-card {
    position: relative;
    z-index: 10;
    background: rgba(26, 32, 24, 0.5);
    border: 1px solid rgba(0, 232, 128, 0.1);
    border-radius: 3px;
    padding: 28px 32px;
    margin-bottom: 24px;
    transition: transform 400ms ease, box-shadow 400ms ease;
    cursor: default;
}

.root-card::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 20%;
    right: 20%;
    height: 12px;
    background: linear-gradient(to bottom, rgba(0, 232, 128, 0.08), transparent);
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
    z-index: -1;
}

.root-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 232, 128, 0.08);
}

.root-card:hover::after {
    opacity: 1;
}

.root-card-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 30px);
    color: #00E880;
    margin-bottom: 10px;
    line-height: 1.3;
}

.root-card-body {
    color: #E0D8C8;
    opacity: 0.82;
    font-size: clamp(14px, 0.95vw, 16px);
    line-height: 1.8;
}

/* Root footer */
.root-footer {
    text-align: center;
    padding: 60px 24px 48px;
    position: relative;
    z-index: 10;
}

.root-footer-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 24px;
    color: #688860;
    margin-bottom: 6px;
}

.root-footer-sub {
    font-family: 'Noto Serif', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 12px;
    color: #688860;
    letter-spacing: 0.04em;
    opacity: 0.6;
}

/* --- Scroll Fade-In for content --- */
.layer-content,
.root-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.layer-content.in-view,
.root-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Canopy content is always visible (hero) */
.canopy-content {
    opacity: 1;
    transform: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .layer-content {
        padding: 60px 20px;
    }

    .wabi-circle-1 {
        width: 120px;
        height: 120px;
        top: 30px;
        right: 4%;
    }

    .wabi-rect-1 {
        width: 80px;
        height: 60px;
        bottom: 40px;
        left: 3%;
    }

    .root-card {
        padding: 20px 24px;
    }

    .canopy-svgs .nature-svg {
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .domain-title {
        font-size: clamp(28px, 8vw, 48px);
    }

    .section-heading {
        font-size: clamp(22px, 5vw, 32px);
    }

    .neon-thread-1 {
        left: 8%;
    }

    .neon-thread-3 {
        left: 92%;
    }

    .wabi-circle-1,
    .wabi-rect-1 {
        display: none;
    }
}
