/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --electric-chartreuse: #c8ff00;
    --hot-magenta: #ff00ff;
    --bioluminescent-cyan: #00ffd5;
    --mycelium-black: #0a0a0a;
    --undergrowth-dark: #1a1c14;
    --pale-lichen: #d4e8c2;
    --spore-gray: #8b9a7c;
    --neon-amber: #ffc400;
    --deep-forest: #0d1f0a;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--mycelium-black);
    color: var(--pale-lichen);
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === SCAN-LINE OVERLAY === */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(200, 255, 0, 0.02) 2px,
        rgba(200, 255, 0, 0.02) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* === HUD CORNER BRACKETS === */
.hud-bracket {
    position: fixed;
    width: 40px;
    height: 40px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hud-bracket::before,
.hud-bracket::after {
    content: '';
    position: absolute;
    background: var(--electric-chartreuse);
    border-radius: 2px;
}

.hud-bracket-tl {
    top: 12px;
    left: 12px;
}
.hud-bracket-tl::before {
    top: 0; left: 0; width: 2px; height: 40px;
}
.hud-bracket-tl::after {
    top: 0; left: 0; width: 40px; height: 2px;
}

.hud-bracket-tr {
    top: 12px;
    right: 12px;
}
.hud-bracket-tr::before {
    top: 0; right: 0; width: 2px; height: 40px;
}
.hud-bracket-tr::after {
    top: 0; right: 0; width: 40px; height: 2px;
}

.hud-bracket-bl {
    bottom: 12px;
    left: 12px;
}
.hud-bracket-bl::before {
    bottom: 0; left: 0; width: 2px; height: 40px;
}
.hud-bracket-bl::after {
    bottom: 0; left: 0; width: 40px; height: 2px;
}

.hud-bracket-br {
    bottom: 12px;
    right: 12px;
}
.hud-bracket-br::before {
    bottom: 0; right: 0; width: 2px; height: 40px;
}
.hud-bracket-br::after {
    bottom: 0; right: 0; width: 40px; height: 2px;
}

.hud-bracket.visible {
    opacity: 1;
}

.hud-bracket.pulse {
    animation: bracketPulse 2s ease-in-out;
}

@keyframes bracketPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === STATUS RAIL === */
.status-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 998;
    overflow: hidden;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.status-rail.visible {
    opacity: 1;
}

.status-rail-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--electric-chartreuse);
    opacity: 0.7;
    white-space: nowrap;
    animation: scrollRail 40s linear infinite;
}

@keyframes scrollRail {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === SPORE PARTICLES === */
.spores {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.spore {
    position: absolute;
    border-radius: 50%;
    animation: sporeDrift linear infinite;
}

@keyframes sporeDrift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--spore-opacity, 0.3);
    }
    90% {
        opacity: var(--spore-opacity, 0.3);
    }
    100% {
        transform: translateY(-110vh) translateX(var(--spore-drift-x, 20px));
        opacity: 0;
    }
}

/* === CONTOUR BACKGROUND === */
.contour-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.15;
}

/* === MYCELIUM NETWORK === */
.mycelium-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.mycelium-network path {
    animation: myceliumPulse 6s ease-in-out infinite;
}

@keyframes myceliumPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.4; }
}

/* === SECTIONS === */
.act {
    position: relative;
    z-index: 5;
    min-height: 100vh;
}

.act-1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* === BOOT SEQUENCE === */
.boot-sequence {
    text-align: center;
    margin-bottom: 2rem;
}

.boot-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--electric-chartreuse);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin: 0.4rem 0;
}

.boot-line.visible {
    opacity: 0.7;
    transform: translateY(0);
}

.boot-line.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

/* === TITLE === */
.title-block {
    text-align: center;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.title-block.visible {
    opacity: 1;
    transform: scale(1);
}

.site-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 15vw, 12rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--electric-chartreuse);
    text-shadow: 0 0 20px rgba(200, 255, 0, 0.3), 0 0 60px rgba(200, 255, 0, 0.15);
    line-height: 1;
}

.site-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--pale-lichen);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* === TWO-TRACK LAYOUT === */
.two-track {
    display: flex;
    gap: 2rem;
    padding: 4rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

.track-left {
    flex: 0 0 65%;
    max-width: 65%;
}

.track-right {
    flex: 0 0 calc(35% - 2rem);
    max-width: calc(35% - 2rem);
}

.two-track.reverse .track-left {
    flex: 0 0 35%;
    max-width: 35%;
}

.two-track.reverse .track-right {
    flex: 0 0 calc(65% - 2rem);
    max-width: calc(65% - 2rem);
}

/* === SLIDE REVEAL === */
.slide-reveal {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-from-left {
    transform: translateX(-80px);
}

.slide-from-right {
    transform: translateX(80px);
}

.slide-from-bottom {
    transform: translateY(80px);
}

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

.slide-reveal.revealed::before {
    content: '';
    position: absolute;
    z-index: 10;
    animation: glowFade 1s ease-out forwards;
}

.slide-from-left.revealed::before {
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--hot-magenta);
    box-shadow: 0 0 15px var(--hot-magenta), 0 0 30px var(--hot-magenta);
}

.slide-from-right.revealed::before {
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--hot-magenta);
    box-shadow: 0 0 15px var(--hot-magenta), 0 0 30px var(--hot-magenta);
}

.slide-from-bottom.revealed::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--hot-magenta);
    box-shadow: 0 0 15px var(--hot-magenta), 0 0 30px var(--hot-magenta);
}

@keyframes glowFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* === CONTENT PANELS === */
.content-panel {
    background: var(--undergrowth-dark);
    padding: 2.5rem;
    border-radius: 4px;
    position: relative;
}

.section-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--electric-chartreuse);
    text-shadow: 0 0 20px rgba(200, 255, 0, 0.3);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.content-panel p {
    margin-bottom: 1rem;
    color: var(--pale-lichen);
}

.content-panel p:last-child {
    margin-bottom: 0;
}

/* === SPECIMEN CARDS === */
.specimen-card {
    border: 1px solid var(--bioluminescent-cyan);
    background: rgba(26, 28, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.specimen-card.evolved {
    border-color: var(--neon-amber);
    box-shadow: 0 0 20px rgba(255, 196, 0, 0.1);
}

.specimen-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bioluminescent-cyan);
    opacity: 0.8;
    display: block;
    margin-bottom: 1rem;
    animation: labelPulse 3s ease-in-out infinite;
}

.specimen-card.evolved .specimen-label {
    color: var(--neon-amber);
}

@keyframes labelPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.5; }
}

.specimen-meta {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.55rem, 0.8vw, 0.7rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--spore-gray);
    display: block;
    margin-top: 1rem;
}

/* === ORGANISMS === */
.organism {
    width: 120px;
    height: 120px;
    margin: 1rem auto;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphOrganism1 8s ease-in-out infinite;
    position: relative;
}

.organism-1 {
    background: radial-gradient(circle at 40% 40%, var(--electric-chartreuse), var(--bioluminescent-cyan));
    animation: morphOrganism1 8s ease-in-out infinite;
}

@keyframes morphOrganism1 {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 34% 66% / 63% 68% 32% 37%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

.organism-2 {
    background: radial-gradient(circle at 60% 30%, var(--bioluminescent-cyan), var(--electric-chartreuse));
    width: 100px;
    height: 100px;
    animation: morphOrganism2 10s ease-in-out infinite;
}

@keyframes morphOrganism2 {
    0% { border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%; transform: rotate(0deg); }
    33% { border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%; transform: rotate(60deg); }
    66% { border-radius: 30% 70% 50% 50% / 60% 30% 70% 40%; transform: rotate(120deg); }
    100% { border-radius: 40% 60% 60% 40% / 40% 40% 60% 60%; transform: rotate(0deg); }
}

.organism-3 {
    background: radial-gradient(circle at 50% 50%, var(--hot-magenta), var(--bioluminescent-cyan));
    width: 90px;
    height: 90px;
    animation: morphOrganism3 6s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(0, 255, 213, 0.3);
}

@keyframes morphOrganism3 {
    0% { border-radius: 50% 50% 50% 50%; transform: scale(1); }
    50% { border-radius: 30% 70% 40% 60% / 60% 30% 70% 40%; transform: scale(1.1); }
    100% { border-radius: 50% 50% 50% 50%; transform: scale(1); }
}

.organism-4 {
    background: radial-gradient(circle at 30% 70%, var(--neon-amber), var(--electric-chartreuse));
    width: 80px;
    height: 80px;
    animation: morphOrganism4 7s ease-in-out infinite;
}

.organism-4b {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 70% 30%, var(--bioluminescent-cyan), var(--hot-magenta));
    animation: morphOrganism4b 5s ease-in-out infinite;
    margin-top: -20px;
}

@keyframes morphOrganism4 {
    0% { border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%; }
    50% { border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%; }
    100% { border-radius: 40% 60% 50% 50% / 50% 40% 60% 50%; }
}

@keyframes morphOrganism4b {
    0% { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; transform: translateX(0); }
    50% { border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%; transform: translateX(20px); }
    100% { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; transform: translateX(0); }
}

.organism-5 {
    background: radial-gradient(circle at 50% 50%, var(--neon-amber), var(--hot-magenta));
    width: 110px;
    height: 110px;
    animation: morphOrganism5 9s ease-in-out infinite;
    box-shadow: 0 0 25px rgba(255, 196, 0, 0.3);
}

@keyframes morphOrganism5 {
    0% { border-radius: 45% 55% 55% 45% / 45% 55% 45% 55%; transform: rotate(0deg) scale(1); }
    33% { border-radius: 60% 40% 30% 70% / 55% 45% 55% 45%; transform: rotate(40deg) scale(1.05); }
    66% { border-radius: 35% 65% 60% 40% / 50% 50% 50% 50%; transform: rotate(-20deg) scale(0.95); }
    100% { border-radius: 45% 55% 55% 45% / 45% 55% 45% 55%; transform: rotate(0deg) scale(1); }
}

.organism-final {
    width: 160px;
    height: 160px;
    background: conic-gradient(
        var(--electric-chartreuse),
        var(--bioluminescent-cyan),
        var(--hot-magenta),
        var(--neon-amber),
        var(--electric-chartreuse)
    );
    animation: morphFinal 12s ease-in-out infinite, rotateFinal 20s linear infinite;
    box-shadow: 0 0 40px rgba(200, 255, 0, 0.2), 0 0 80px rgba(255, 0, 255, 0.1);
}

@keyframes morphFinal {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    20% { border-radius: 58% 42% 34% 66% / 63% 68% 32% 37%; }
    40% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    60% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    80% { border-radius: 45% 55% 45% 55% / 35% 65% 35% 65%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

@keyframes rotateFinal {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === BIOME TRANSITION === */
.biome-transition {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--mycelium-black), var(--undergrowth-dark), var(--deep-forest));
    position: relative;
    margin: 4rem 0;
    overflow: hidden;
}

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

.biome-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--electric-chartreuse);
    text-shadow: 0 0 30px rgba(200, 255, 0, 0.4);
    z-index: 2;
}

.biome-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--spore-gray);
    z-index: 2;
    margin-top: 0.5rem;
}

/* === ACT V: CANOPY === */
.canopy-reveal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.canopy-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--electric-chartreuse);
    text-shadow: 0 0 30px rgba(200, 255, 0, 0.4), 0 0 80px rgba(200, 255, 0, 0.15);
    margin-bottom: 3rem;
    line-height: 1.15;
}

.final-specimen {
    margin-bottom: 3rem;
    width: fit-content;
    min-width: 250px;
}

.canopy-closing {
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--spore-gray);
    max-width: 600px;
    font-style: italic;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .two-track,
    .two-track.reverse {
        flex-direction: column;
    }

    .track-left,
    .track-right,
    .two-track.reverse .track-left,
    .two-track.reverse .track-right {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .two-track {
        padding: 2rem 1.2rem;
    }

    .hud-bracket {
        width: 24px;
        height: 24px;
    }
    .hud-bracket-tl::before,
    .hud-bracket-tr::before,
    .hud-bracket-bl::before,
    .hud-bracket-br::before {
        height: 24px;
    }
    .hud-bracket-tl::after,
    .hud-bracket-tr::after,
    .hud-bracket-bl::after,
    .hud-bracket-br::after {
        width: 24px;
    }

    .section-headline {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}
