/* munju.wiki - A midnight atlas of imaginary mountains */

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

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

body {
    background-color: #0B0F1A;
    color: #C8D0DE;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ==========================================
   STAR PARTICLES
   ========================================== */
#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #F0F4FA;
    border-radius: 50%;
    animation: starPulse 4s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* ==========================================
   PANELS - FULL BLEED STRUCTURE
   ========================================== */
.panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background-color: #0B0F1A;
}

.panel-content {
    position: relative;
    z-index: 2;
}

/* ==========================================
   MOUNTAIN SVG ILLUSTRATIONS
   ========================================== */
.mountain-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    will-change: opacity, transform;
    opacity: 0;
    transition: opacity 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mountain-svg.visible {
    opacity: 1;
}

.mountain-svg.faded {
    opacity: 0.3;
    transition: opacity 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mountain-fill {
    fill: #141B2D;
}

/* ==========================================
   CONTOUR LINES - NEON GLOW
   ========================================== */
.contour-line {
    fill: none;
    stroke-width: 1;
    opacity: 0;
    animation: contourFadeIn 600ms ease forwards;
    will-change: opacity;
}

.contour-green {
    stroke: #00FFB2;
    filter: drop-shadow(0 0 4px rgba(0, 255, 178, 0.4)) drop-shadow(0 0 12px rgba(0, 255, 178, 0.15));
}

.contour-cyan {
    stroke: #00D4FF;
    filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.4)) drop-shadow(0 0 12px rgba(0, 212, 255, 0.15));
}

.summit-contour {
    stroke-width: 1.5;
}

@keyframes contourFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Contour lines only animate when parent SVG is visible */
.mountain-svg:not(.visible) .contour-line {
    animation: none;
    opacity: 0;
}

.mountain-svg.visible .contour-line {
    animation: contourFadeIn 600ms ease forwards;
}

/* ==========================================
   PANEL 1 - THE DISTANT RANGE
   ========================================== */
.panel-1 {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.panel-1-content {
    padding-top: clamp(6rem, 15vh, 12rem);
    text-align: center;
}

.site-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 8vw, 6rem);
    color: #F0F4FA;
    letter-spacing: 0.04em;
    text-shadow: 0 0 8px rgba(0, 255, 178, 0.4), 0 0 25px rgba(0, 255, 178, 0.15);
    margin-bottom: 1rem;
}

.site-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.05rem);
    color: #C8D0DE;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
}

.mountain-distant {
    height: 50vh;
}

/* ==========================================
   PANEL 2 - THE MIDDLE DISTANCE
   ========================================== */
.panel-2 {
    display: flex;
    flex-direction: column;
}

.panel-2-content {
    padding: clamp(3rem, 6vw, 8rem);
    padding-bottom: 0;
    max-width: 700px;
}

.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #F0F4FA;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 8px rgba(0, 255, 178, 0.2), 0 0 25px rgba(0, 255, 178, 0.08);
}

.section-text {
    color: #C8D0DE;
    margin-bottom: 1.5rem;
    line-height: 1.85;
}

.mountain-middle {
    height: 65vh;
    margin-top: auto;
}

/* ==========================================
   PANEL 3 - THE CLOSE VIEW
   ========================================== */
.panel-3 {
    display: flex;
    flex-direction: column;
}

.panel-3-content {
    position: relative;
    z-index: 3;
    padding: clamp(3rem, 6vw, 8rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
}

.knowledge-card {
    background: #1E2940;
    background: rgba(30, 41, 64, 0.7);
    border: 1px solid rgba(0, 255, 178, 0.15);
    border-radius: 2px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(0, 255, 178, 0.03);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.knowledge-card:hover {
    border-color: rgba(0, 255, 178, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 178, 0.06);
}

.card-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: #F0F4FA;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 8px rgba(0, 255, 178, 0.15);
}

.card-text {
    color: #C8D0DE;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.8;
}

.mountain-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==========================================
   PANEL 4 - THE SUMMIT
   ========================================== */
.panel-4 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.panel-4-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    width: 90%;
    max-width: 700px;
}

.summit-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: #F0F4FA;
    line-height: 1.9;
    text-shadow: 0 0 12px #FFD166, 0 0 30px rgba(255, 209, 102, 0.1);
}

.mountain-summit {
    height: 60vh;
    bottom: 0;
    top: auto;
}

/* ==========================================
   PANEL 5 - THE VALLEY
   ========================================== */
.panel-5 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.panel-5-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: clamp(3rem, 6vw, 8rem);
}

.valley-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.valley-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #F0F4FA;
    text-shadow: 0 0 8px rgba(0, 255, 178, 0.4), 0 0 25px rgba(0, 255, 178, 0.15);
}

.valley-description {
    color: #C8D0DE;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 1.8;
    max-width: 500px;
}

.valley-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00FFB2, transparent);
    box-shadow: 0 0 8px rgba(0, 255, 178, 0.4);
    margin: 0.5rem 0;
}

.valley-footnote {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: #C8D0DE;
    opacity: 0.5;
    letter-spacing: 0.1em;
}

.mountain-valley {
    height: 100%;
    top: 0;
}

/* ==========================================
   FADE ELEMENTS (Scroll Reveal)
   ========================================== */
.fade-element {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 800ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

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

.fade-element.ghost {
    opacity: 0.3;
    transform: translateY(0);
    transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   PARALLAX LAYER SPEEDS
   ========================================== */
.layer-far {
    transform: translateZ(-2px) scale(3);
}

.layer-mid {
    transform: translateZ(-1px) scale(2);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .panel-3-content {
        max-width: 100%;
    }

    .knowledge-card {
        padding: 1.25rem;
    }

    .summit-text {
        font-size: clamp(1.1rem, 4vw, 1.6rem);
    }

    .panel-2-content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .panel-1-content {
        padding-top: clamp(4rem, 12vh, 8rem);
    }
}
