/* monopole.boo - Fairycore haunted laboratory */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    color: #d8e8e0;
    background: #0a0e12;
    overflow-x: hidden;
    line-height: 1.85;
    font-size: 16px;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* Spore field */
#spore-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.spore {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: floatUp var(--float-duration) linear infinite;
    animation-delay: var(--float-delay);
    opacity: 0;
}

.spore-green {
    background: radial-gradient(circle, #7ff5c8 0%, transparent 70%);
}

.spore-purple {
    background: radial-gradient(circle, #c8a0ff 0%, transparent 70%);
}

.spore-pink {
    background: radial-gradient(circle, #ff9eb8 0%, transparent 70%);
}

.spore-amber {
    background: radial-gradient(circle, #ffc87a 0%, transparent 70%);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* Nav dot */
#nav-dot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

#nav-dot::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #7ff5c8;
    border-radius: 50%;
    animation: navPulse 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes navPulse {
    0%, 100% { box-shadow: 0 0 4px #7ff5c8; opacity: 0.7; }
    50% { box-shadow: 0 0 12px #7ff5c8; opacity: 1; }
}

.nav-expand {
    display: none;
    flex-direction: column;
    gap: 8px;
    position: absolute;
    bottom: 16px;
    right: 0;
}

#nav-dot:hover .nav-expand {
    display: flex;
}

.nav-blob {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 12px;
    color: #d8e8e0;
    text-decoration: none;
    padding: 6px 14px;
    background: rgba(10, 14, 18, 0.85);
    border-radius: 20px;
    border: 1px solid rgba(127, 245, 200, 0.15);
    white-space: nowrap;
    transition: border-color 300ms ease;
}

.nav-blob:hover {
    border-color: rgba(127, 245, 200, 0.5);
}

/* Sections */
.section {
    position: relative;
    z-index: 1;
}

/* Section 1: Surface */
.section-surface {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0e12;
    position: relative;
}

.field-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ghost-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.ghost-line.drawn {
    transition: stroke-dashoffset 5s ease;
    stroke-dashoffset: 0;
}

.surface-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 56px;
    color: #7ff5c8;
    position: relative;
    z-index: 2;
    letter-spacing: 0.04em;
}

.ghost-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #7ff5c8;
    border-radius: 50%;
    margin: 0 4px;
    vertical-align: middle;
    animation: ghostPulse 2.5s ease-in-out infinite;
}

@keyframes ghostPulse {
    0%, 100% { box-shadow: 0 0 6px #7ff5c8; transform: scale(1); }
    50% { box-shadow: 0 0 20px #7ff5c8; transform: scale(1.3); }
}

/* Section 2: Mycelium */
.section-mycelium {
    min-height: 150vh;
    background: #0a0e12;
    position: relative;
    padding: 80px 24px;
}

.mycelium-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.node {
    animation: nodeGlow 3s ease-in-out infinite alternate;
}

.node:nth-child(2n) { animation-duration: 4s; }
.node:nth-child(3n) { animation-duration: 5s; }

@keyframes nodeGlow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Blob containers */
.blob-container {
    position: relative;
    z-index: 2;
    background: rgba(10, 14, 18, 0.7);
    padding: 32px;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(127, 245, 200, 0.08), inset 0 0 20px rgba(127, 245, 200, 0.03);
    will-change: transform, opacity;
}

.blob-1 {
    border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
    margin: 80px auto 0 15%;
}

.blob-2 {
    border-radius: 50% 40% 60% 45% / 45% 55% 40% 60%;
    margin: 60px 10% 0 auto;
}

.blob-3 {
    border-radius: 55% 45% 50% 50% / 40% 60% 45% 55%;
    margin: 0 auto 0 10%;
}

.blob-4 {
    border-radius: 45% 55% 40% 60% / 55% 45% 55% 45%;
    margin: 60px 15% 0 auto;
}

.blob-5 {
    border-radius: 50% 50% 45% 55% / 50% 45% 55% 50%;
    margin: 60px auto 0 20%;
}

.blob-heading {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 28px;
    color: #7ff5c8;
    margin-bottom: 12px;
}

.blob-text {
    color: #d8e8e0;
    opacity: 0.85;
    margin-bottom: 8px;
}

.fira {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #7a8a80;
    display: block;
    margin-bottom: 8px;
}

/* Spring-in animation */
.spring-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spring-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Section 3: Spore Chamber */
.section-spore {
    min-height: 100vh;
    background: #0a0e12;
    padding: 100px 24px;
    position: relative;
}

/* Section 4: Deep Lab */
.section-deep {
    min-height: 100vh;
    background: #060810;
    padding: 100px 24px;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.deep-col {
    max-width: 40vw;
    padding: 32px;
    background: rgba(6, 8, 16, 0.8);
    box-shadow: 0 0 30px rgba(127, 245, 200, 0.08);
}

.deep-col-left {
    border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%;
    align-self: flex-start;
    margin-left: 10%;
}

.deep-col-right {
    border-radius: 50% 45% 55% 50% / 45% 55% 45% 55%;
    align-self: flex-end;
    margin-right: 10%;
}

.equipment {
    display: block;
    margin-bottom: 16px;
}

/* Section 5: Ghost Signal */
.section-signal {
    height: 50vh;
    background: #050709;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding-bottom: 100px;
}

.heartbeat-svg {
    width: 90vw;
    height: 60px;
}

.heartbeat-line {
    opacity: 0.3;
    animation: heartbeatPulse 3s ease-in-out infinite;
}

@keyframes heartbeatPulse {
    0% { opacity: 0.3; }
    15% { opacity: 0.7; }
    25% { opacity: 0.3; }
    40% { opacity: 0.7; }
    50% { opacity: 0.3; }
    65% { opacity: 0.7; }
    75% { opacity: 0.3; }
    100% { opacity: 0.3; }
}

.signal-domain {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #7a8a80;
    opacity: 0.4;
    letter-spacing: 0.04em;
}

/* Mobile */
@media (max-width: 768px) {
    .surface-title {
        font-size: 32px;
    }

    .blob-container {
        max-width: 90vw;
        margin-left: 5% !important;
        margin-right: 5% !important;
    }

    .deep-col {
        max-width: 90vw;
        margin-left: 5% !important;
        margin-right: 5% !important;
    }

    .blob-heading {
        font-size: 24px;
    }
}
