/* ============================================================
   iggi.boo — 이끼 · the hidden world of moss
   goblincore earthy chaos × forest nature organic
   ============================================================ */

:root {
    --forest-floor: #0a120a;     /* background dark */
    --moss-deep:    #1a5c2a;     /* moss green */
    --moss-bright:  #3a8a4a;     /* living green */
    --moss-light:   #7aad6a;     /* lichen sage */
    --bark:         #3a2a1a;     /* damp bark */
    --biolum:       #4adfb0;     /* ghostly cyan-green */
    --spore-gold:   #b8952a;     /* pollen amber */
    --mist:         #d0dac0;     /* misty white text */
    --lab-black:    #080c08;     /* microscope bg */
    --night-black:  #050a05;     /* deepest dark */
}

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

html { scroll-behavior: smooth; }

html, body { width: 100%; overflow-x: hidden; }

body {
    background:
        radial-gradient(circle at 20% 10%, rgba(26,92,42,0.18) 0%, transparent 45%),
        radial-gradient(circle at 85% 60%, rgba(58,42,26,0.16) 0%, transparent 40%),
        linear-gradient(to bottom, var(--night-black) 0%, var(--forest-floor) 30%, #0d160d 70%, var(--forest-floor) 100%);
    background-attachment: fixed;
    color: var(--mist);
    font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1vw, 1.1rem);
    line-height: 1.8;
    position: relative;
}

/* fine organic moss-grain overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23000' fill-opacity='0'/%3E%3Crect width='1' height='1' x='0' y='0' fill='%237aad6a' fill-opacity='0.10'/%3E%3Crect width='1' height='1' x='2' y='1' fill='%231a5c2a' fill-opacity='0.10'/%3E%3Crect width='1' height='1' x='1' y='3' fill='%233a8a4a' fill-opacity='0.08'/%3E%3Crect width='1' height='1' x='3' y='2' fill='%233a2a1a' fill-opacity='0.08'/%3E%3C/svg%3E");
    background-size: 4px 4px;
}

main { position: relative; z-index: 2; width: 100%; }

.sci {
    font-family: 'Crimson Pro', Georgia, serif;
    font-style: italic;
    color: var(--moss-light);
}

/* ============================================================
   The Spore — Hero
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #060c06 0%, #000 100%);
    overflow: hidden;
}

.moss-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 1rem;
    opacity: 0;
    animation: sporeEmerge 3s ease-out 0.8s forwards;
}

@keyframes sporeEmerge {
    0%   { opacity: 0; transform: scale(0.7); filter: blur(8px); }
    100% { opacity: 1; transform: scale(1);   filter: blur(0); }
}

.moss-title {
    font-family: 'Nanum Myeongjo', 'Crimson Pro', serif;
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--biolum);
    letter-spacing: 0.06em;
    text-shadow:
        0 0 28px rgba(74,223,176,0.55),
        0 0 64px rgba(74,223,176,0.30),
        0 0 120px rgba(26,92,42,0.4);
    animation: breath 4.5s ease-in-out infinite;
}

@keyframes breath {
    0%, 100% { text-shadow: 0 0 28px rgba(74,223,176,0.55), 0 0 64px rgba(74,223,176,0.30), 0 0 120px rgba(26,92,42,0.4); }
    50%      { text-shadow: 0 0 44px rgba(74,223,176,0.80), 0 0 96px rgba(74,223,176,0.45), 0 0 160px rgba(58,138,74,0.5); }
}

.moss-subtitle {
    margin-top: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1.05rem, 2vw, 1.6rem);
    letter-spacing: 0.35em;
    color: var(--spore-gold);
    text-transform: lowercase;
}

.moss-tagline {
    margin-top: 0.4rem;
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(208,218,192,0.55);
}

.scroll-hint {
    position: absolute;
    bottom: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(122,173,106,0.7);
    opacity: 0;
    animation: fadeUp 1.4s ease-out 3.4s forwards;
}

@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.scroll-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--biolum);
    box-shadow: 0 0 10px rgba(74,223,176,0.8);
    animation: drip 2.4s ease-in-out infinite;
}

@keyframes drip {
    0%   { transform: translateY(0); opacity: 1; }
    70%  { transform: translateY(14px); opacity: 0.2; }
    100% { transform: translateY(14px); opacity: 0; }
}

/* ============================================================
   Sections — Forest Floor
   ============================================================ */
.section {
    position: relative;
    width: min(1100px, 92vw);
    margin: clamp(2rem, 6vw, 5rem) auto;
    padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.section-heading {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    color: var(--biolum);
    letter-spacing: 0.02em;
    margin-bottom: 1.6rem;
    text-shadow: 0 2px 14px rgba(74,223,176,0.18);
}

.patch-label {
    display: inline-block;
    margin-bottom: 0.7rem;
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--spore-gold);
    opacity: 0.75;
}

h2 {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.4vw, 2.4rem);
    color: var(--biolum);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

h3 {
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.4vw, 1.7rem);
    color: var(--moss-light);
    margin-bottom: 0.5rem;
}

p { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }

strong { color: var(--spore-gold); font-weight: 700; }

.sci-block { margin-bottom: 0.8rem; font-size: 0.9rem; }

/* ============================================================
   Organic Blob Containers
   ============================================================ */
.organic-blob {
    position: relative;
    background:
        linear-gradient(135deg, rgba(26,92,42,0.22) 0%, rgba(8,12,8,0.35) 100%);
    border: 1px solid rgba(74,223,176,0.18);
    padding: clamp(1.8rem, 4vw, 3rem);
    box-shadow:
        0 0 0 1px rgba(122,173,106,0.06) inset,
        0 14px 40px rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease, background 0.5s ease;
    will-change: transform;
}

.organic-blob:hover {
    border-color: rgba(74,223,176,0.4);
    box-shadow:
        0 0 0 1px rgba(122,173,106,0.12) inset,
        0 18px 50px rgba(0,0,0,0.4),
        0 0 36px rgba(74,223,176,0.16);
}

/* eight+ unique amorphous radii */
.blob-a { border-radius: 42% 58% 53% 47% / 48% 42% 58% 52%; }
.blob-b { border-radius: 60% 40% 35% 65% / 55% 60% 40% 45%; }
.blob-c { border-radius: 38% 62% 60% 40% / 55% 38% 62% 45%; }
.blob-d { border-radius: 55% 45% 48% 52% / 40% 58% 42% 60%; }
.blob-e { border-radius: 47% 53% 62% 38% / 52% 47% 53% 48%; }
.blob-f { border-radius: 30% 70% 52% 48% / 62% 32% 68% 38%; }
.blob-g { border-radius: 58% 42% 40% 60% / 45% 55% 45% 55%; }
.blob-h { border-radius: 44% 56% 58% 42% / 60% 48% 52% 40%; }
.blob-i { border-radius: 52% 48% 36% 64% / 42% 56% 44% 58%; }
.blob-j { border-radius: 64% 36% 50% 50% / 38% 60% 40% 62%; }

/* overlapping patch feel */
.offset-right { margin-left: auto; }

.forest-floor .organic-blob + .organic-blob { margin-top: -1.5rem; }

.forest-floor .organic-blob,
.cultivation .organic-blob {
    width: min(640px, 100%);
}

.forest-floor .blob-b {
    background: linear-gradient(135deg, rgba(58,42,26,0.24) 0%, rgba(8,12,8,0.4) 100%);
    border-color: rgba(184,149,42,0.2);
}

.cultivation .blob-j {
    background: linear-gradient(135deg, rgba(184,149,42,0.14) 0%, rgba(8,12,8,0.4) 100%);
    border-color: rgba(184,149,42,0.3);
}

/* ============================================================
   Species cluster
   ============================================================ */
.species-cluster,
.ecosystem-cluster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.4rem);
}

.species-card, .eco-card { height: 100%; }

.species-card:nth-child(2) { transform: translateY(1.8rem); }
.species-card:nth-child(3) { transform: translateY(-0.8rem); }

.ecosystem-cluster .offset-right { margin-left: 0; }
.eco-card:nth-child(2) { transform: translateY(1.6rem); }

/* ============================================================
   The Microscope View
   ============================================================ */
.microscope-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.microscope-intro {
    max-width: 560px;
    margin-bottom: 2rem;
    color: rgba(208,218,192,0.85);
}

.microscope-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}

.microscope-lens {
    --r: min(40vw, 300px);
    position: relative;
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 2);
    background: var(--lab-black);
    clip-path: circle(var(--r) at 50% 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 6px rgba(74,223,176,0.18),
        0 0 0 14px rgba(8,12,8,0.9),
        0 0 60px rgba(74,223,176,0.18);
}

.microscope-lens::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: circle(var(--r) at 50% 50%);
    background:
        radial-gradient(circle at 32% 30%, rgba(74,223,176,0.12) 0%, transparent 45%),
        radial-gradient(circle at 70% 75%, rgba(26,92,42,0.18) 0%, transparent 50%);
    pointer-events: none;
}

.microscope-content {
    position: relative;
    z-index: 2;
    width: 78%;
    padding: 1rem;
}

.cell-diagram { width: 100%; height: auto; }
.cell-diagram path,
.cell-diagram ellipse,
.cell-diagram circle,
.cell-diagram line {
    fill: none;
    stroke: var(--moss-light);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.cell-diagram circle:last-of-type { fill: rgba(122,173,106,0.12); }

.cell-annotations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    color: var(--moss-light);
}
.anno { white-space: nowrap; }
.anno-1 { position: absolute; top: 6%;  right: -6%; }
.anno-2 { position: absolute; top: 30%; left: -10%; }
.anno-3 { position: absolute; bottom: 28%; right: -8%; }

.microscope-base {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.rhizoid-diagram { width: clamp(120px, 24vw, 180px); height: auto; }
.rhizoid-diagram path,
.rhizoid-diagram ellipse {
    fill: none;
    stroke: var(--moss-light);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.microscope-base .anno {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: rgba(122,173,106,0.7);
}

/* ============================================================
   Life Cycle
   ============================================================ */
.life-cycle .blob-f { width: min(720px, 100%); }

.life-list {
    list-style: none;
    counter-reset: stage;
}
.life-list li {
    counter-increment: stage;
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: 1.1rem;
}
.life-list li:last-child { margin-bottom: 0; }
.life-list li::before {
    content: counter(stage);
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 1.7rem;
    height: 1.7rem;
    background: radial-gradient(circle, var(--biolum) 0%, var(--moss-bright) 100%);
    color: var(--night-black);
    border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    box-shadow: 0 0 12px rgba(74,223,176,0.4);
}

/* ============================================================
   The Midnight Garden
   ============================================================ */
.midnight-garden {
    width: 100%;
    margin: 0;
    margin-top: clamp(3rem, 8vw, 6rem);
    padding: clamp(4rem, 10vw, 8rem) 0 clamp(4rem, 9vw, 7rem);
    background: linear-gradient(to bottom, var(--forest-floor) 0%, var(--night-black) 60%, #020402 100%);
    border-top: 1px solid rgba(74,223,176,0.12);
    position: relative;
    overflow: hidden;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.firefly-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.midnight-content {
    position: relative;
    z-index: 2;
    width: min(640px, 90vw);
    text-align: center;
}

.midnight-heading {
    text-shadow: 0 0 24px rgba(74,223,176,0.4), 0 0 60px rgba(74,223,176,0.2);
}

.midnight-content p { color: rgba(208,218,192,0.82); }

.closing-line {
    margin-top: 2rem;
    font-family: 'Nanum Myeongjo', serif;
    font-weight: 700;
    font-size: clamp(1rem, 2.4vw, 1.4rem);
    color: var(--biolum);
    text-shadow: 0 0 18px rgba(74,223,176,0.35);
}
.closing-line .sci { font-size: 0.85em; color: rgba(122,173,106,0.85); }

/* fireflies */
.firefly {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--biolum);
    box-shadow: 0 0 8px 1px rgba(74,223,176,0.8);
    opacity: 0;
    animation-name: glow, fireflyDrift;
    animation-timing-function: ease-in-out, ease-in-out;
    animation-iteration-count: infinite, infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0; }
    50%      { opacity: 0.85; }
}

@keyframes fireflyDrift {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(18px, -22px); }
    100% { transform: translate(0, 0); }
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--night-black); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--moss-bright), var(--moss-deep));
    border-radius: 6px;
    border: 2px solid var(--night-black);
}
::-webkit-scrollbar-thumb:hover { background: var(--biolum); }

/* ============================================================
   Reveal-on-scroll state (set via JS)
   ============================================================ */
.reveal-pending { opacity: 0; transform: translateY(28px); }
.reveal-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
    .species-card:nth-child(2),
    .species-card:nth-child(3),
    .eco-card:nth-child(2) { transform: none; }
    .forest-floor .organic-blob + .organic-blob { margin-top: -0.8rem; }
    .anno-1 { right: -2%; }
    .anno-2 { left: -2%; }
    .anno-3 { right: -2%; }
}

@media (max-width: 480px) {
    .hero { min-height: 480px; }
    .moss-subtitle { letter-spacing: 0.22em; font-size: 0.95rem; }
    .life-list li { padding-left: 2.3rem; }
}
