/* ═══════════ CUSTOM PROPERTIES ═══════════ */
:root {
    --abyss-indigo: #0d0b1e;
    --haunted-forest: #0a1a12;
    --midnight-slate: #161225;
    --fog-white: #e8e4f0;
    --phantom-gray: #8b8697;
    --spectral-lilac: #c8a2e8;
    --bio-teal: #5ef4d1;
    --foxfire-gold: #f0c75e;
    --spore-pink: #f07e9e;
    --skyline-faint: #12102a;
    --base-unit: 64px;
    --h-pad: clamp(2rem, 8vw, 6rem);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--abyss-indigo);
    color: var(--fog-white);
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

/* ═══════════ TYPOGRAPHY ═══════════ */
h1, h2 {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--spectral-lilac);
}

h1 {
    font-size: clamp(2.4rem, 7vw, 5.6rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.panel-caption {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--phantom-gray);
    display: block;
    margin-top: 1.5rem;
}

/* ═══════════ AMBIENT BLOBS ═══════════ */
.ambient-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ambient-blob {
    position: absolute;
    mix-blend-mode: screen;
    will-change: transform, opacity;
}

.ambient-blob path {
    fill: var(--spectral-lilac);
}

.blob-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -5%;
    opacity: 0.05;
    animation: blobDrift1 55s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-2 {
    width: 400px;
    height: 400px;
    top: 20%;
    right: -8%;
    opacity: 0.04;
    animation: blobDrift2 48s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-2 path {
    fill: var(--bio-teal);
}

.blob-3 {
    width: 350px;
    height: 350px;
    top: 55%;
    left: 10%;
    opacity: 0.06;
    animation: blobDrift3 60s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-4 {
    width: 450px;
    height: 450px;
    bottom: 15%;
    right: 5%;
    opacity: 0.04;
    animation: blobDrift4 52s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.blob-4 path {
    fill: var(--bio-teal);
}

.blob-5 {
    width: 300px;
    height: 300px;
    top: 75%;
    left: 50%;
    opacity: 0.05;
    animation: blobDrift5 45s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes blobDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(60px, 40px) scale(1.05) rotate(5deg); }
    50% { transform: translate(-30px, 80px) scale(0.95) rotate(-3deg); }
    75% { transform: translate(40px, -20px) scale(1.02) rotate(4deg); }
}

@keyframes blobDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(-50px, 60px) scale(1.04) rotate(-4deg); }
    50% { transform: translate(40px, -40px) scale(0.97) rotate(6deg); }
    75% { transform: translate(-20px, 30px) scale(1.03) rotate(-2deg); }
}

@keyframes blobDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(70px, -50px) scale(1.06) rotate(3deg); }
    66% { transform: translate(-40px, 60px) scale(0.96) rotate(-5deg); }
}

@keyframes blobDrift4 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-60px, -70px) scale(1.08); }
}

@keyframes blobDrift5 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    40% { transform: translate(50px, 30px) scale(0.94) rotate(7deg); }
    80% { transform: translate(-30px, -40px) scale(1.05) rotate(-4deg); }
}

/* ═══════════ SKYLINE LAYERS ═══════════ */
.skyline-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.skyline-layer svg {
    width: 100%;
    height: auto;
    display: block;
}

.skyline-far {
    opacity: 0.35;
}

.skyline-mid {
    opacity: 0.5;
}

.skyline-near {
    opacity: 0.6;
}

/* ═══════════ ZONE 1: THRESHOLD ═══════════ */
.zone-threshold {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 0 var(--h-pad);
}

.threshold-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: -8%;
}

.threshold-title {
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    color: var(--spectral-lilac);
    opacity: 0;
    transition: opacity 1.2s ease;
}

.threshold-title.visible {
    opacity: 1;
}

.threshold-underline {
    width: clamp(200px, 40vw, 600px);
    height: 4px;
    margin-bottom: 1rem;
}

.threshold-underline line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.threshold-underline.visible line {
    stroke-dashoffset: 0;
}

.struct-blob-1 {
    position: absolute;
    width: 250px;
    height: 250px;
    top: 15%;
    right: 10%;
    opacity: 0;
    filter: blur(20px);
    mix-blend-mode: screen;
    will-change: transform, opacity;
    transition: opacity 3s ease 2.5s;
}

.struct-blob-1.visible {
    opacity: 0.18;
}

.struct-blob-2 {
    position: absolute;
    width: 200px;
    height: 200px;
    bottom: 20%;
    left: 5%;
    opacity: 0;
    filter: blur(25px);
    mix-blend-mode: screen;
    will-change: transform, opacity;
    transition: opacity 3s ease 3s;
}

.struct-blob-2.visible {
    opacity: 0.15;
}

/* ═══════════ ZONE 2: ALLEY ═══════════ */
.zone-alley {
    min-height: 150vh;
    position: relative;
    z-index: 2;
    padding: calc(var(--base-unit) * 3) var(--h-pad);
    display: flex;
    flex-direction: column;
    gap: calc(var(--base-unit) * 2.5);
}

.alley-panel {
    position: relative;
    max-width: 680px;
    will-change: transform, opacity;
}

.alley-panel[data-offset='left'] {
    align-self: flex-start;
    margin-left: 4%;
}

.alley-panel[data-offset='right'] {
    align-self: flex-end;
    margin-right: 4%;
}

.alley-panel[data-offset='center'] {
    align-self: center;
    margin-left: -4%;
}

.panel-content {
    background: var(--midnight-slate);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(40px) saturate(1.2);
    -webkit-backdrop-filter: blur(40px) saturate(1.2);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.6s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.6s;
}

.panel-reveal.visible .panel-content {
    opacity: 1;
    transform: translateY(0);
}

.panel-content p {
    opacity: 0;
    transition: opacity 0.4s ease 1s;
}

.panel-reveal.visible .panel-content p {
    opacity: 1;
}

.panel-content .panel-caption {
    opacity: 0;
    transition: opacity 0.4s ease 1.1s;
}

.panel-reveal.visible .panel-content .panel-caption {
    opacity: 1;
}

.panel-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--spectral-lilac);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.panel-text {
    color: var(--fog-white);
    margin-bottom: 0.5rem;
}

.panel-underline {
    width: 100%;
    height: 4px;
    margin-bottom: 1rem;
    display: block;
}

.panel-underline line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel-reveal.visible .panel-underline line {
    stroke-dashoffset: 0;
}

.struct-blob-alley {
    position: absolute;
    width: 280px;
    height: 280px;
    right: -3%;
    top: 40%;
    opacity: 0.18;
    filter: blur(20px);
    mix-blend-mode: screen;
    pointer-events: none;
    will-change: transform;
}

/* ═══════════ SECTION DIVIDERS ═══════════ */
.section-divider {
    width: 100%;
    padding: calc(var(--base-unit) * 0.5) 0;
}

.section-divider svg {
    width: 100%;
    height: 4px;
}

.section-divider line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.divider-reveal.visible line {
    stroke-dashoffset: 0;
}

/* ═══════════ MUSHROOM ACCENTS ═══════════ */
.mushroom-accent {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.mushroom-accent svg {
    width: 40px;
    height: auto;
}

.mushroom-1 {
    margin-left: 20%;
}

.mushroom-2 {
    margin-left: 65%;
}

.mushroom-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 0;
    align-items: flex-end;
}

.mushroom-3 svg { width: 24px; }
.mushroom-4 svg { width: 18px; }
.mushroom-5 svg { width: 28px; }

/* ═══════════ ZONE 3: ARCHIVE ═══════════ */
.zone-archive {
    min-height: 200vh;
    position: relative;
    z-index: 2;
    padding: 0 var(--h-pad);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--base-unit) * 3);
}

.archive-transition {
    height: 100vh;
    width: 100%;
    background: linear-gradient(to bottom, var(--abyss-indigo), var(--haunted-forest));
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

.zone-archive::after {
    content: '';
    position: absolute;
    top: 100vh;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--haunted-forest);
    z-index: -1;
}

.archive-statement {
    text-align: center;
    max-width: 800px;
    padding: calc(var(--base-unit) * 2) 0;
    position: relative;
}

.archive-text {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.8;
    color: var(--spectral-lilac);
    opacity: 0;
    transition: opacity 0.8s ease 0.8s;
}

.statement-reveal.visible .archive-text {
    opacity: 1;
}

.statement-underline {
    width: clamp(150px, 30vw, 400px);
    height: 4px;
    margin: 0 auto 2rem;
    display: block;
}

.statement-underline line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.statement-reveal.visible .statement-underline line {
    stroke-dashoffset: 0;
}

/* Pulsing blobs */
.pulse-blob {
    width: 200px;
    height: 200px;
    opacity: 0.12;
    filter: blur(15px);
    mix-blend-mode: screen;
    will-change: transform;
    animation: blobPulse 8s ease-in-out infinite;
}

.pulse-blob-1 {
    align-self: flex-start;
    margin-left: 10%;
}

.pulse-blob-2 {
    align-self: flex-end;
    margin-right: 15%;
    animation-delay: -3s;
}

.pulse-blob-3 {
    align-self: center;
    animation-delay: -5s;
}

@keyframes blobPulse {
    0%, 100% { transform: scale(1); filter: blur(15px) brightness(1); }
    50% { transform: scale(1.03); filter: blur(15px) brightness(1.15); }
}

.archive-divider {
    width: 60%;
}

/* ═══════════ ZONE 4: DISSIPATION ═══════════ */
.zone-dissipation {
    height: 80vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--h-pad);
    background: linear-gradient(to bottom, var(--haunted-forest), var(--abyss-indigo));
}

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

.foxfire-blob {
    position: absolute;
    opacity: 0.3;
    filter: blur(8px);
    mix-blend-mode: screen;
    will-change: transform;
}

.foxfire-1 {
    width: 60px;
    left: 15%;
    bottom: 30%;
    animation: foxfireDrift 12s ease-in-out infinite;
}

.foxfire-2 {
    width: 40px;
    left: 35%;
    bottom: 20%;
    animation: foxfireDrift 10s ease-in-out infinite -2s;
}

.foxfire-3 {
    width: 50px;
    right: 25%;
    bottom: 40%;
    animation: foxfireDrift 14s ease-in-out infinite -4s;
}

.foxfire-4 {
    width: 35px;
    right: 40%;
    bottom: 15%;
    animation: foxfireDrift 11s ease-in-out infinite -6s;
}

.foxfire-5 {
    width: 45px;
    left: 55%;
    bottom: 50%;
    animation: foxfireDrift 13s ease-in-out infinite -3s;
}

@keyframes foxfireDrift {
    0% { transform: translateY(0) translateX(0); opacity: 0.3; }
    50% { transform: translateY(-120px) translateX(20px); opacity: 0.15; }
    100% { transform: translateY(-240px) translateX(-10px); opacity: 0; }
}

.dissipation-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.dissipation-text {
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--spectral-lilac);
    opacity: 0;
    transition: opacity 1.5s ease;
    line-height: 1.4;
}

.dissipation-text.visible {
    opacity: 0.7;
}

.dissipation-underline {
    width: clamp(100px, 20vw, 300px);
    height: 4px;
    margin: 1rem auto 0;
    display: block;
}

.dissipation-underline line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dissipation-underline.visible line {
    stroke-dashoffset: 0;
}

.dissipation-underline.fade-out {
    opacity: 0;
    transition: opacity 3s ease;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
    .alley-panel {
        max-width: 100%;
    }
    .alley-panel[data-offset='left'],
    .alley-panel[data-offset='right'],
    .alley-panel[data-offset='center'] {
        margin-left: 0;
        margin-right: 0;
        align-self: stretch;
    }
    .threshold-content {
        margin-left: 0;
        align-items: center;
    }
    .struct-blob-1,
    .struct-blob-2 {
        display: none;
    }
    .struct-blob-alley {
        display: none;
    }
    .panel-content {
        padding: 1.5rem;
    }
    .zone-alley {
        gap: calc(var(--base-unit) * 1.5);
    }
}
