/* simulai.org - Fairycore Terrarium Design */
/* Colors: #0a0f0d #132118 #1a3328 #3ee8c4 #e8c94a #b47eed #d4e8d9 #8fa89c */
/* Fonts: Playfair Display 900, Nunito 400/700, Space Grotesk 500 */

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

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

body {
    background: #0a0f0d;
    color: #d4e8d9;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ============================================
   TERRARIUM GLASS FRAME
   ============================================ */

#terrarium-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 1000;
}

.condensation {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.condensation-tl {
    top: 0;
    left: 0;
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

.condensation-tr {
    top: 0;
    right: 0;
    background: radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

.condensation-bl {
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 0 100%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

.condensation-br {
    bottom: 0;
    right: 0;
    background: radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
}

/* ============================================
   VINE SCROLL PROGRESS INDICATOR
   ============================================ */

#vine-indicator {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60vh;
    z-index: 900;
    pointer-events: none;
}

#vine-svg {
    width: 100%;
    height: 100%;
}

#vine-path,
#vine-path-glow {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.1s linear;
}

.vine-leaf {
    transition: opacity 0.6s ease;
}

/* ============================================
   ATMOSPHERIC SPORE PARTICLES
   ============================================ */

#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    overflow: hidden;
}

.spore {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%;
    left: var(--x-start);
    top: var(--y-start);
    animation: spore-float var(--dur) var(--delay) infinite linear;
}

.spore-gold {
    background: rgba(232, 201, 74, 0.15);
}

.spore-violet {
    background: rgba(180, 126, 237, 0.2);
}

@keyframes spore-float {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(var(--x-end) - var(--x-start)),
            calc(var(--y-end) - var(--y-start))
        ) scale(0.6);
        opacity: 0;
    }
}

/* ============================================
   MAIN CONTENT / CLEARINGS
   ============================================ */

#terrarium-content {
    position: relative;
    z-index: 10;
}

.clearing {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 6vh 8vw;
    overflow: hidden;
}

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

/* Individual clearing gradients */
#clearing-1 .clearing-gradient {
    background: linear-gradient(165deg, #0a0f0d 0%, #132118 35%, #1a3328 65%, #0a0f0d 100%);
}

#clearing-2 .clearing-gradient {
    background: linear-gradient(195deg, #0a0f0d 0%, #132118 40%, #1a3328 60%, #0a0f0d 100%);
}

#clearing-3 .clearing-gradient {
    background: linear-gradient(170deg, #132118 0%, #0a0f0d 30%, #1a3328 70%, #132118 100%);
}

#clearing-4 .clearing-gradient {
    background: linear-gradient(180deg, #1a3328 0%, #132118 50%, #0a0f0d 100%);
}

#clearing-5 .clearing-gradient {
    background: linear-gradient(180deg, #0a0f0d 0%, #132118 30%, #1a3328 60%, #d4e8d9 200%);
}

.clearing-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.clearing-visual {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Z-pattern positioning */
.z-left {
    grid-column: 1;
}

.z-right {
    grid-column: 2;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

.display-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: #3ee8c4;
    text-shadow: 0 0 20px rgba(62, 232, 196, 0.4), 0 0 60px rgba(62, 232, 196, 0.15);
    line-height: 1.1;
    animation: glow-pulse 4s ease-in-out infinite;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    color: #3ee8c4;
    text-shadow: 0 0 20px rgba(62, 232, 196, 0.4), 0 0 60px rgba(62, 232, 196, 0.15);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: glow-pulse 4s ease-in-out infinite;
}

.subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #d4e8d9;
    max-width: 38ch;
    line-height: 1.75;
    margin-top: 1.5rem;
}

.ring-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    fill: #8fa89c;
}

@keyframes glow-pulse {
    0%, 100% {
        text-shadow: 0 0 18px rgba(62, 232, 196, 0.4), 0 0 60px rgba(62, 232, 196, 0.15);
    }
    50% {
        text-shadow: 0 0 24px rgba(62, 232, 196, 0.5), 0 0 80px rgba(62, 232, 196, 0.2);
    }
}

/* ============================================
   BLOB TEXT CONTAINERS
   ============================================ */

.blob-text-container {
    background: rgba(62, 232, 196, 0.06);
    border: 1px solid rgba(62, 232, 196, 0.1);
    border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%;
    padding: 3rem 2.5rem;
    margin-bottom: 1.5rem;
    max-width: 480px;
    box-shadow: 0 0 15px rgba(62, 232, 196, 0.05), inset 0 0 15px rgba(62, 232, 196, 0.03);
    animation: blob-morph-container 16s ease-in-out infinite;
}

.blob-text-container p {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.75;
    color: #d4e8d9;
    max-width: 38ch;
}

@keyframes blob-morph-container {
    0%, 100% {
        border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%;
    }
    25% {
        border-radius: 52% 48% 57% 43% / 48% 52% 54% 46%;
    }
    50% {
        border-radius: 38% 62% 47% 53% / 58% 42% 64% 36%;
    }
    75% {
        border-radius: 48% 52% 37% 63% / 42% 58% 34% 66%;
    }
}

/* ============================================
   BLOB DECORATIONS (Clearing 1)
   ============================================ */

.blob-decoration {
    position: absolute;
    border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%;
    pointer-events: none;
}

.blob-1a {
    width: 300px;
    height: 280px;
    background: rgba(62, 232, 196, 0.06);
    border: 1px solid rgba(62, 232, 196, 0.12);
    top: -60px;
    left: -80px;
    animation: blob-morph-a 14s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(62, 232, 196, 0.1);
}

.blob-1b {
    width: 200px;
    height: 220px;
    background: rgba(180, 126, 237, 0.05);
    border: 1px solid rgba(180, 126, 237, 0.1);
    bottom: -40px;
    right: -30px;
    animation: blob-morph-b 18s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(180, 126, 237, 0.08);
}

.blob-1c {
    width: 150px;
    height: 140px;
    background: rgba(232, 201, 74, 0.04);
    border: 1px solid rgba(232, 201, 74, 0.08);
    top: 40%;
    right: -60px;
    animation: blob-morph-c 20s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(232, 201, 74, 0.06);
}

.glow-halo {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center, rgba(62, 232, 196, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

@keyframes blob-morph-a {
    0%, 100% { border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%; transform: scale(1); }
    25% { border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%; }
    50% { border-radius: 38% 62% 55% 45% / 60% 40% 55% 45%; transform: scale(1.005); }
    75% { border-radius: 50% 50% 42% 58% / 35% 65% 48% 52%; }
}

@keyframes blob-morph-b {
    0%, 100% { border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%; transform: scale(1); }
    33% { border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%; }
    66% { border-radius: 48% 52% 37% 63% / 52% 48% 64% 36%; transform: scale(1.005); }
}

@keyframes blob-morph-c {
    0%, 100% { border-radius: 48% 52% 37% 63% / 52% 48% 64% 36%; transform: scale(1); }
    50% { border-radius: 55% 45% 60% 40% / 40% 60% 45% 55%; transform: scale(1.005); }
}

/* ============================================
   SVG VISUALIZATIONS
   ============================================ */

.node-cluster {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.sim-node {
    animation: node-breathe 8s ease-in-out infinite;
}

@keyframes node-breathe {
    0%, 100% { transform-origin: center; opacity: 1; }
    50% { opacity: 0.7; }
}

.tendril {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: tendril-draw 3s ease-out forwards;
}

@keyframes tendril-draw {
    to { stroke-dashoffset: 0; }
}

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

/* Mycelial Network */
.mycelial-network {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.myc-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.myc-line.animated {
    animation: myc-draw 2s ease-out forwards;
}

@keyframes myc-draw {
    to { stroke-dashoffset: 0; }
}

.myc-node {
    animation: node-breathe 10s ease-in-out infinite;
}

.nutrient-pulse {
    opacity: 0.7;
}

/* Fairy Rings */
.fairy-rings {
    width: 100%;
    max-width: 450px;
    height: auto;
}

.fairy-ring {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.5s ease-out;
}

.fairy-ring.drawn {
    stroke-dashoffset: 0;
}

.ring-dot {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.ring-dot.visible {
    opacity: 0.8;
}

/* ============================================
   CLEARING 4 - CANOPY VIEW
   ============================================ */

#clearing-4 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.canopy-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.canopy-blob {
    position: absolute;
    border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%;
    animation: canopy-sway 12s ease-in-out infinite;
}

.canopy-1 {
    width: 45vw;
    height: 40vh;
    background: rgba(26, 51, 40, 0.6);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
    animation-duration: 14s;
}

.canopy-2 {
    width: 35vw;
    height: 35vh;
    background: rgba(19, 33, 24, 0.7);
    top: 5%;
    right: -3%;
    animation-delay: -2s;
    animation-duration: 16s;
}

.canopy-3 {
    width: 30vw;
    height: 30vh;
    background: rgba(62, 232, 196, 0.04);
    top: 30%;
    left: 10%;
    animation-delay: -4s;
    animation-duration: 18s;
}

.canopy-4 {
    width: 40vw;
    height: 35vh;
    background: rgba(26, 51, 40, 0.5);
    top: 25%;
    right: 15%;
    animation-delay: -1s;
    animation-duration: 15s;
}

.canopy-5 {
    width: 25vw;
    height: 25vh;
    background: rgba(143, 168, 156, 0.08);
    bottom: 15%;
    left: 25%;
    animation-delay: -3s;
    animation-duration: 20s;
}

.canopy-6 {
    width: 35vw;
    height: 30vh;
    background: rgba(19, 33, 24, 0.6);
    bottom: -5%;
    right: 10%;
    animation-delay: -5s;
    animation-duration: 13s;
}

.canopy-7 {
    width: 20vw;
    height: 20vh;
    background: rgba(62, 232, 196, 0.03);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -6s;
    animation-duration: 17s;
}

@keyframes canopy-sway {
    0%, 100% { border-radius: 42% 58% 67% 33% / 38% 62% 44% 56%; }
    25% { border-radius: 52% 48% 57% 43% / 48% 52% 54% 46%; }
    50% { border-radius: 38% 62% 47% 53% / 58% 42% 64% 36%; }
    75% { border-radius: 48% 52% 37% 63% / 42% 58% 34% 66%; }
}

.canopy-text-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    padding: 3rem;
}

.canopy-title {
    text-align: center;
}

.canopy-paragraph {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.75;
    color: #d4e8d9;
    text-shadow: 0 2px 10px rgba(10, 15, 13, 0.8);
    margin-bottom: 1.5rem;
    max-width: 55ch;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   CLEARING 5 - THE CLEARING (DAWN)
   ============================================ */

#clearing-5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0a0f0d 0%, #132118 30%, #1a3328 70%, rgba(212, 232, 217, 0.1) 100%);
}

.centered-clearing {
    text-align: center;
    max-width: 800px;
    padding: 3rem;
}

.dawn-title {
    margin-bottom: 2rem;
}

.dawn-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: #d4e8d9;
    max-width: 50ch;
    margin: 0 auto;
    line-height: 1.75;
}

.dawn-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.dawn-spore {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--dx);
    top: var(--dy);
    border-radius: 50%;
    background: rgba(212, 232, 217, 0.3);
    animation: dawn-rise var(--dur) var(--delay) infinite ease-in-out;
}

@keyframes dawn-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
    15% {
        opacity: 0.6;
    }
    85% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-40vh) scale(0.3);
        opacity: 0;
    }
}

/* ============================================
   FADE-REVEAL ANIMATION SYSTEM
   ============================================ */

.fade-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .clearing {
        grid-template-columns: 1fr;
        padding: 4vh 6vw;
        gap: 2rem;
    }

    .z-left,
    .z-right {
        grid-column: 1;
    }

    .clearing-visual {
        order: -1;
    }

    .display-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .section-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .blob-text-container {
        padding: 2rem 1.5rem;
        border-radius: 30% 70% 60% 40% / 50% 50% 50% 50%;
    }

    .blob-decoration {
        display: none;
    }

    #vine-indicator {
        display: none;
    }

    .node-cluster,
    .mycelial-network,
    .fairy-rings {
        max-width: 300px;
    }

    .canopy-text-overlay {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .clearing {
        padding: 3vh 4vw;
    }

    .blob-text-container {
        padding: 1.5rem 1rem;
    }
}