/* ==========================================================================
   mang.quest -- The Glitched Fairy Terminal
   Aesthetic: fairycore + Art Deco + glitch
   Palette: neon-electric on midnight indigo
   ========================================================================== */

:root {
    --void: #0B0B1A;
    --deep: #1A1035;
    --neon-magenta: #FF2D95;
    --neon-cyan: #00F0FF;
    --neon-gold: #FFD700;
    --mushroom-blush: #D4A58C;
    --lavender-mist: #E0D6F0;
    --pure-white: #FFFFFF;

    --font-display: 'Poiret One', 'Inter', sans-serif;
    --font-label: 'Josefin Sans', 'Inter', sans-serif;
    --font-body: 'Quicksand', 'Inter', sans-serif;

    --scroll-y: 0;
    --section-progress: 0;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background-color: var(--void);
    color: var(--lavender-mist);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ==========================================================================
   GLOBAL TEXTURES & OVERLAYS
   ========================================================================== */

.scanline-texture {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.02) 0px,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: screen;
    opacity: 0.55;
}

.scanline-texture::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 45, 149, 0.04) 30%,
        transparent 60%,
        rgba(0, 240, 255, 0.04) 80%,
        transparent 100%
    );
    background-size: 100% 800px;
    animation: phosphorDrift 12s linear infinite;
}

@keyframes phosphorDrift {
    0% { background-position: 0 0; }
    100% { background-position: 0 800px; }
}

.glitch-tear-overlay {
    position: fixed;
    left: 0;
    right: 0;
    top: 50%;
    height: 30px;
    pointer-events: none;
    z-index: 90;
    opacity: 0;
    transform: translateY(-50%);
    background: linear-gradient(
        90deg,
        rgba(255, 45, 149, 0.6) 0%,
        rgba(255, 255, 255, 0.4) 30%,
        rgba(0, 240, 255, 0.6) 70%,
        transparent 100%
    );
    mix-blend-mode: screen;
}

.glitch-tear-overlay.fire {
    animation: glitchTear 280ms steps(6) 1;
}

@keyframes glitchTear {
    0% { opacity: 0; transform: translateY(-50%) translateX(0); }
    20% { opacity: 0.9; transform: translateY(-48%) translateX(-12px); }
    40% { opacity: 0.7; transform: translateY(-52%) translateX(14px); }
    60% { opacity: 0.85; transform: translateY(-50%) translateX(-6px); }
    80% { opacity: 0.5; transform: translateY(-50%) translateX(8px); }
    100% { opacity: 0; transform: translateY(-50%) translateX(0); }
}

/* ==========================================================================
   PROGRESS VINE (LEFT EDGE)
   ========================================================================== */

.progress-vine {
    position: fixed;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 50;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vine-svg {
    width: 60px;
    height: 100vh;
    overflow: visible;
    filter: drop-shadow(0 0 4px rgba(255, 45, 149, 0.6));
}

#vinePath {
    transition: stroke-dashoffset 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vine-node {
    transition: transform 400ms ease-out, filter 400ms ease;
    transform-box: fill-box;
    transform-origin: center;
}

.vine-node circle:first-child {
    transition: r 400ms ease, stroke-width 400ms ease;
}

.vine-node.active {
    filter: drop-shadow(0 0 6px var(--neon-magenta)) drop-shadow(0 0 12px rgba(255, 45, 149, 0.6));
}

.vine-node.active circle:first-child {
    stroke: var(--neon-magenta);
    stroke-width: 1.6;
}

.vine-node.active circle:nth-child(2) {
    fill: var(--neon-magenta);
}

.vine-labels {
    position: absolute;
    left: 64px;
    top: 0;
    list-style: none;
    height: 100vh;
    width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 60px 0 60px;
    pointer-events: none;
}

.vine-labels li {
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    opacity: 0.35;
    transition: opacity 400ms ease, color 400ms ease, transform 400ms ease;
}

.vine-labels li.active {
    opacity: 1;
    color: var(--neon-magenta);
    transform: translateX(8px);
    text-shadow: 0 0 6px rgba(255, 45, 149, 0.6);
}

@media (max-width: 720px) {
    .vine-labels { display: none; }
    .progress-vine { width: 40px; left: 8px; }
    .vine-svg { width: 40px; }
}

/* ==========================================================================
   FIREFLY FIELD
   ========================================================================== */

.firefly-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    overflow: hidden;
}

.firefly {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--neon-gold);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0;
    filter: drop-shadow(0 0 4px var(--neon-gold)) drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    will-change: transform, opacity;
}

.firefly.cyan {
    background: var(--neon-cyan);
    filter: drop-shadow(0 0 4px var(--neon-cyan)) drop-shadow(0 0 8px rgba(0, 240, 255, 0.5));
}

.firefly.magenta {
    background: var(--neon-magenta);
    filter: drop-shadow(0 0 4px var(--neon-magenta)) drop-shadow(0 0 8px rgba(255, 45, 149, 0.5));
}

@keyframes fireflyFloat {
    0% {
        transform: translate3d(0, 0, 0);
        opacity: 0;
    }
    10% { opacity: 0.9; }
    25% {
        transform: translate3d(15px, -50px, 0);
        opacity: 0.5;
    }
    50% {
        transform: translate3d(-25px, -120px, 0);
        opacity: 1;
    }
    75% {
        transform: translate3d(20px, -180px, 0);
        opacity: 0.4;
    }
    100% {
        transform: translate3d(-10px, -240px, 0);
        opacity: 0;
    }
}

@keyframes fireflyPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ==========================================================================
   GLADE STRUCTURE
   ========================================================================== */

.glade-container {
    position: relative;
    z-index: 1;
}

.glade {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
    isolation: isolate;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    will-change: transform;
}

.layer-0 { z-index: 1; }
.layer-1 { z-index: 2; position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.layer-2 { z-index: 3; pointer-events: none; }
.layer-3 { z-index: 4; pointer-events: none; }

/* ==========================================================================
   GLADE 1 -- THE THRESHOLD
   ========================================================================== */

.glade-threshold {
    background: var(--void);
}

.starburst-bg {
    overflow: hidden;
}

.starburst-distant {
    position: absolute;
    width: 200px;
    height: 200px;
    opacity: 0.4;
    animation: distantPulse 6s ease-in-out infinite;
}

.starburst-distant-1 {
    top: 12%;
    left: 18%;
    animation-delay: 0s;
}

.starburst-distant-2 {
    bottom: 14%;
    right: 16%;
    width: 140px;
    height: 140px;
    animation-delay: 2s;
}

@keyframes distantPulse {
    0%, 100% { opacity: 0.2; transform: scale(0.95); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.threshold-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.threshold-stage {
    position: relative;
    width: min(800px, 90vw);
    aspect-ratio: 1 / 1;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.art-deco-sunburst {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(255, 45, 149, 0.5));
}

.sunburst-rays line {
    stroke-dasharray: 320;
    stroke-dashoffset: 320;
    animation: rayDraw 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ray-1 { animation-delay: 0.1s; }
.ray-2 { animation-delay: 0.15s; }
.ray-3 { animation-delay: 0.2s; }
.ray-4 { animation-delay: 0.25s; }
.ray-5 { animation-delay: 0.3s; }
.ray-6 { animation-delay: 0.35s; }
.ray-7 { animation-delay: 0.4s; }
.ray-8 { animation-delay: 0.45s; }
.ray-9 { animation-delay: 0.5s; }
.ray-10 { animation-delay: 0.55s; }
.ray-11 { animation-delay: 0.6s; }
.ray-12 { animation-delay: 0.65s; }
.ray-13 { animation-delay: 0.7s; }
.ray-14 { animation-delay: 0.75s; }
.ray-15 { animation-delay: 0.8s; }
.ray-16 { animation-delay: 0.85s; }

@keyframes rayDraw {
    0% { stroke-dashoffset: 320; opacity: 0; }
    20% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

.sunburst-arcs circle {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: arcDraw 2.4s ease-out forwards;
}

.arc-1 { animation-delay: 1s; }
.arc-2 { animation-delay: 1.3s; }
.arc-3 { animation-delay: 1.6s; }

@keyframes arcDraw {
    to { stroke-dashoffset: 0; }
}

.sunburst-core {
    opacity: 0;
    animation: coreReveal 1.6s ease-out 1.5s forwards;
}

@keyframes coreReveal {
    to { opacity: 1; }
}

.threshold-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(48px, 9vw, 96px);
    letter-spacing: 0.08em;
    line-height: 1.05;
    color: var(--pure-white);
    text-shadow:
        0 0 10px var(--neon-magenta),
        0 0 30px rgba(255, 45, 149, 0.5),
        0 0 60px rgba(255, 45, 149, 0.25);
    margin-bottom: 16px;
    user-select: none;
}

.title-glyph,
.title-dot {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: glyphReveal 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.title-dot {
    color: var(--neon-gold);
    text-shadow:
        0 0 8px var(--neon-gold),
        0 0 18px rgba(255, 215, 0, 0.6);
}

.title-glyph:nth-child(1) { animation-delay: 1.6s; }
.title-glyph:nth-child(2) { animation-delay: 1.7s; }
.title-glyph:nth-child(3) { animation-delay: 1.8s; }
.title-glyph:nth-child(4) { animation-delay: 1.9s; }
.title-dot { animation-delay: 2.0s; }
.title-glyph:nth-child(6) { animation-delay: 2.1s; }
.title-glyph:nth-child(7) { animation-delay: 2.2s; }
.title-glyph:nth-child(8) { animation-delay: 2.3s; }
.title-glyph:nth-child(9) { animation-delay: 2.4s; }
.title-glyph:nth-child(10) { animation-delay: 2.5s; }

@keyframes glyphReveal {
    0% {
        opacity: 0;
        transform: translateY(8px);
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.threshold-sub {
    position: relative;
    z-index: 2;
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    opacity: 0;
    animation: subReveal 1.6s ease-out 2.6s forwards;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

@keyframes subReveal {
    to { opacity: 1; }
}

.scroll-hint {
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: scrollHintFade 2s ease-in-out 3.4s infinite;
    color: var(--lavender-mist);
}

@keyframes scrollHintFade {
    0%, 100% { opacity: 0.2; transform: translate(-50%, 0); }
    50% { opacity: 0.9; transform: translate(-50%, 8px); }
}

.threshold-foreground { pointer-events: none; }

.corner-deco {
    position: absolute;
    width: 200px;
    height: 200px;
}

.corner-tl { top: 24px; left: 70px; }
.corner-br { bottom: 24px; right: 24px; }

/* ==========================================================================
   GLADE 2 -- THE MUSHROOM GROVE
   ========================================================================== */

.glade-mushroom {
    background: var(--void);
}

.mushroom-bg-radial {
    background: radial-gradient(
        ellipse at 65% 50%,
        var(--deep) 0%,
        var(--void) 70%
    );
}

.mushroom-content {
    display: grid;
    grid-template-columns: 5fr 6fr;
    align-items: center;
    gap: 48px;
    padding: 80px 80px 80px 140px;
    width: 100%;
}

@media (max-width: 900px) {
    .mushroom-content {
        grid-template-columns: 1fr;
        padding: 80px 24px 80px 80px;
    }
}

.text-block {
    max-width: 540px;
}

.text-block.left {
    margin-left: 0;
}

.text-block.right {
    margin-left: auto;
    text-align: right;
}

.glade-label {
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
    margin-bottom: 18px;
    opacity: 0.85;
}

.glade-label.gold {
    color: var(--neon-gold);
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

.glade-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(36px, 5.5vw, 64px);
    letter-spacing: 0.08em;
    line-height: 1.05;
    color: var(--pure-white);
    text-shadow:
        0 0 10px var(--neon-magenta),
        0 0 30px rgba(255, 45, 149, 0.5),
        0 0 60px rgba(255, 45, 149, 0.25);
    margin-bottom: 28px;
}

.glade-title.cyan {
    text-shadow:
        0 0 10px var(--neon-cyan),
        0 0 30px rgba(0, 240, 255, 0.5),
        0 0 60px rgba(0, 240, 255, 0.25);
}

.glade-title.gold {
    color: var(--neon-gold);
    text-shadow:
        0 0 10px var(--neon-gold),
        0 0 30px rgba(255, 215, 0, 0.5),
        0 0 60px rgba(255, 215, 0, 0.25);
}

.glade-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: var(--lavender-mist);
    margin-bottom: 18px;
}

.glade-body.subtle {
    opacity: 0.6;
    font-style: italic;
    font-size: 15px;
}

.mushroom-grove {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
}

.mushroom {
    height: 65%;
    filter: drop-shadow(0 0 6px rgba(212, 165, 140, 0.4));
}

.mushroom-1 {
    height: 55%;
    transform: translateY(-20px);
    z-index: 2;
}

.mushroom-2 {
    height: 45%;
    transform: translateY(20px);
    z-index: 1;
    opacity: 0.85;
}

.mushroom-3 {
    height: 75%;
    transform: translateY(-40px);
    z-index: 3;
    filter: drop-shadow(0 0 10px rgba(255, 45, 149, 0.3));
}

.mushroom-strokes path,
.mushroom-strokes line,
.mushroom-strokes ellipse {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.glade.in-view .mushroom-strokes path,
.glade.in-view .mushroom-strokes line,
.glade.in-view .mushroom-strokes ellipse {
    animation: pathDraw 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.glade.in-view .mushroom-1 .mushroom-strokes > * { animation-delay: calc(var(--i, 0) * 80ms); }
.glade.in-view .mushroom-2 .mushroom-strokes > * { animation-delay: calc(0.2s + var(--i, 0) * 80ms); }
.glade.in-view .mushroom-3 .mushroom-strokes > * { animation-delay: calc(0.4s + var(--i, 0) * 80ms); }

@keyframes pathDraw {
    to { stroke-dashoffset: 0; }
}

.spore {
    animation: sporePulse 3.4s ease-in-out infinite;
}

.spore:nth-child(2) { animation-delay: 1s; }
.spore:nth-child(3) { animation-delay: 2s; }

@keyframes sporePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.mushroom-foreground { pointer-events: none; }

.fern-frag-bl {
    position: absolute;
    bottom: -10px;
    left: -20px;
    width: 280px;
    height: 360px;
    opacity: 0.5;
}

/* ==========================================================================
   GLADE 3 -- THE FERN CATHEDRAL
   ========================================================================== */

.glade-fern {
    background: var(--void);
}

.fern-bg-radial {
    background: radial-gradient(
        ellipse at center 30%,
        rgba(0, 240, 255, 0.08) 0%,
        var(--deep) 35%,
        var(--void) 75%
    );
}

.fern-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    height: 100vh;
}

.cathedral-arch {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 80vw);
    height: 78vh;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.arch-strokes path,
.arch-strokes line,
.arch-strokes circle {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
}

.glade-fern.in-view .arch-strokes path,
.glade-fern.in-view .arch-strokes line,
.glade-fern.in-view .arch-strokes circle {
    animation: pathDraw 2.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.glade-fern.in-view .keystone path,
.glade-fern.in-view .keystone line {
    animation-delay: 1.2s;
}

.fern {
    position: absolute;
    bottom: 0;
    height: 100vh;
    width: 30vw;
    max-width: 380px;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.4));
}

.fern-left { left: 0; }
.fern-right { right: 0; }

.fern-strokes path,
.fern-strokes line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.glade-fern.in-view .fern-strokes path,
.glade-fern.in-view .fern-strokes line {
    animation: pathDraw 2.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.glade-fern.in-view .fern-right .fern-strokes path,
.glade-fern.in-view .fern-right .fern-strokes line {
    animation-delay: 0.4s;
}

.fern-text {
    position: relative;
    z-index: 2;
    max-width: 480px;
    text-align: center;
    padding: 40px 32px;
}

.fern-foreground {
    z-index: 4;
}

.fern-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
}

/* ==========================================================================
   GLADE 4 -- THE WING CHAMBER
   ========================================================================== */

.glade-wing {
    background: var(--void);
}

.wing-bg {
    background: radial-gradient(
        ellipse at 50% 35%,
        rgba(255, 45, 149, 0.06) 0%,
        var(--void) 60%
    );
}

.wing-content {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.dragonfly-wing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    max-width: 1600px;
    height: auto;
    transform: translate(-50%, -55%);
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(255, 45, 149, 0.3));
}

.wing-strokes path,
.wing-strokes line,
.wing-strokes circle {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.glade-wing.in-view .wing-strokes path,
.glade-wing.in-view .wing-strokes line,
.glade-wing.in-view .wing-strokes circle {
    animation: pathDraw 3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.glade-wing.in-view .wing-veins > * { animation-delay: calc(0.3s + var(--vi, 0) * 80ms); }

.wing-cells .cell {
    animation: cellPulse 4.2s ease-in-out infinite;
    transform-origin: center;
}

.wing-cells .cell:nth-child(1) { animation-delay: 0s; }
.wing-cells .cell:nth-child(2) { animation-delay: 0.5s; }
.wing-cells .cell:nth-child(3) { animation-delay: 1s; }
.wing-cells .cell:nth-child(4) { animation-delay: 1.5s; }
.wing-cells .cell:nth-child(5) { animation-delay: 2s; }
.wing-cells .cell:nth-child(6) { animation-delay: 2.5s; }

@keyframes cellPulse {
    0%, 100% { fill-opacity: 0.02; }
    50% { fill-opacity: 0.18; }
}

.wing-text {
    position: absolute;
    bottom: 80px;
    left: 80px;
    max-width: 460px;
    z-index: 5;
    background: rgba(11, 11, 26, 0.55);
    backdrop-filter: blur(2px);
    padding: 32px 28px;
    border-left: 1px solid var(--neon-magenta);
    box-shadow: 0 0 24px rgba(255, 45, 149, 0.15);
}

@media (max-width: 720px) {
    .wing-text {
        left: 24px;
        right: 24px;
        bottom: 32px;
        padding: 24px 20px;
        max-width: none;
    }
}

.wing-foreground { z-index: 4; pointer-events: none; }

.wing-frag {
    position: absolute;
    top: 60px;
    right: 80px;
    width: 120px;
    height: 120px;
    opacity: 0.5;
    animation: slowSpin 32s linear infinite;
}

@keyframes slowSpin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   GLADE 5 -- THE CIRCUIT GARDEN
   ========================================================================== */

.glade-circuit {
    background: var(--void);
}

.circuit-bg {
    background:
        radial-gradient(
            ellipse at 30% 50%,
            rgba(255, 215, 0, 0.06) 0%,
            transparent 60%
        ),
        var(--void);
}

.circuit-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 215, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.circuit-content {
    display: grid;
    grid-template-columns: 5fr 6fr;
    align-items: center;
    gap: 48px;
    padding: 100px 100px 100px 140px;
    width: 100%;
    height: 100%;
}

@media (max-width: 900px) {
    .circuit-content {
        grid-template-columns: 1fr;
        padding: 100px 24px 100px 80px;
    }
    .text-block.right { text-align: left; margin-left: 0; }
}

.circuit-stage {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.circuit-mushroom {
    height: 80%;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

.circuit-fern {
    height: 80%;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
    transform: translateY(20px);
}

.circuit-strokes path,
.circuit-strokes line,
.circuit-strokes circle {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.glade-circuit.in-view .circuit-strokes path,
.glade-circuit.in-view .circuit-strokes line,
.glade-circuit.in-view .circuit-strokes circle {
    animation: pathDraw 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.pcb-edge-frame {
    position: absolute;
    left: 80px;
    right: 80px;
    height: 14px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.pcb-edge-frame.top {
    top: 40px;
    border-top: 1px solid rgba(255, 215, 0, 0.5);
    align-items: flex-start;
    padding-top: 4px;
}

.pcb-edge-frame.bottom {
    bottom: 40px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.5);
    align-items: flex-end;
    padding-bottom: 4px;
}

.pcb-pad {
    width: 6px;
    height: 10px;
    background: var(--neon-gold);
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.8);
    border-radius: 1px;
    animation: padPulse 4s ease-in-out infinite;
}

.pcb-pad:nth-child(odd) { animation-delay: 0.5s; }
.pcb-pad:nth-child(3n) { animation-delay: 1s; }

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

/* ==========================================================================
   GLADE 6 -- THE CONVERGENCE
   ========================================================================== */

.glade-convergence {
    background: var(--void);
}

.convergence-bg {
    background:
        radial-gradient(
            ellipse at 50% 50%,
            var(--deep) 0%,
            var(--void) 70%
        );
}

.convergence-content {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 80px 80px 140px;
}

@media (max-width: 900px) {
    .convergence-content { padding: 80px 24px 80px 80px; }
}

.convergence-split {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    gap: 40px;
    margin-bottom: 60px;
}

@media (max-width: 720px) {
    .convergence-split {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .conv-axis { display: none; }
}

.conv-half {
    display: flex;
    align-items: center;
    justify-content: center;
}

.conv-illust {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 0 6px rgba(255, 45, 149, 0.3));
}

.conv-circuit .conv-illust {
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
}

.conv-axis {
    width: 60px;
    height: 480px;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
}

.convergence-text {
    text-align: center;
    max-width: 720px;
    z-index: 3;
}

.convergence-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(28px, 4.5vw, 48px);
    letter-spacing: 0.08em;
    line-height: 1.1;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--neon-magenta) 0%, var(--neon-gold) 50%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(255, 45, 149, 0.4));
}

.convergence-sub {
    font-family: var(--font-label);
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--lavender-mist);
    opacity: 0.8;
}

.convergence-foreground {
    z-index: 0;
    pointer-events: none;
}

.final-sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90vw;
    max-width: 800px;
    height: auto;
    transform: translate(-50%, -50%);
    opacity: 0.18;
    pointer-events: none;
}

.glade-convergence.in-view .final-sunburst {
    animation: finalGlow 8s ease-in-out infinite;
}

@keyframes finalGlow {
    0%, 100% { opacity: 0.12; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.32; transform: translate(-50%, -50%) scale(1.05); }
}

/* ==========================================================================
   GLITCH HOVER STATE -- chromatic aberration on illustrations
   ========================================================================== */

.glitching {
    animation: chromaticAberration 240ms steps(4) 1;
}

@keyframes chromaticAberration {
    0% {
        transform: translate(0, 0);
        filter: drop-shadow(0 0 6px rgba(255, 45, 149, 0.5));
    }
    25% {
        transform: translate(-4px, 0);
        filter: hue-rotate(120deg) drop-shadow(4px 0 0 rgba(0, 240, 255, 0.7));
    }
    50% {
        transform: translate(4px, 0);
        filter: hue-rotate(240deg) drop-shadow(-4px 0 0 rgba(255, 45, 149, 0.7));
    }
    75% {
        transform: translate(-2px, 1px);
        filter: hue-rotate(60deg);
    }
    100% {
        transform: translate(0, 0);
        filter: drop-shadow(0 0 6px rgba(255, 45, 149, 0.5));
    }
}

/* ==========================================================================
   IN-VIEW REVEAL FOR TEXT
   ========================================================================== */

.glade .text-block,
.glade .fern-text,
.glade .wing-text,
.glade .convergence-text {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.2s, transform 1.2s ease 0.2s;
}

.glade.in-view .text-block,
.glade.in-view .fern-text,
.glade.in-view .wing-text,
.glade.in-view .convergence-text {
    opacity: 1;
    transform: translateY(0);
}

.glade-threshold .threshold-stage { opacity: 1; }

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

@media (max-width: 720px) {
    .corner-deco { width: 120px; height: 120px; }
    .corner-tl { left: 40px; top: 12px; }
    .corner-br { right: 12px; bottom: 12px; }
    .pcb-edge-frame { left: 50px; right: 16px; }
    .mushroom-grove { gap: 8px; height: 50vh; }
    .fern { width: 40vw; }
}
