/* haskell.quest - Parallax Storytelling Journey */
/* Palette: #0f172a, #1e293b, #334155, #475569, #64748b, #94a3b8, #f1f5f9, #a78bfa, #22c55e */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0f172a;
    color: #f1f5f9;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ========================================
   HERO / BASE CAMP
   ======================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    overflow: hidden;
}

/* Stars scattered in the night sky */
.stars-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.star-dot {
    position: absolute;
    border-radius: 50%;
    background: #f1f5f9;
    animation: starTwinkle 3s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
    0% { opacity: 0.2; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

/* Mountain silhouette layers with parallax depth */
.mountain-layers {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    z-index: 2;
}

.mountain {
    position: absolute;
    bottom: 0;
    width: 100%;
    will-change: transform;
}

.mountain-far {
    height: 100%;
    background: #334155;
    clip-path: polygon(0 60%, 10% 40%, 20% 50%, 30% 25%, 42% 45%, 55% 15%, 65% 35%, 78% 20%, 88% 40%, 100% 30%, 100% 100%, 0 100%);
    z-index: 1;
}

.mountain-mid {
    height: 75%;
    background: #475569;
    clip-path: polygon(0 70%, 12% 50%, 25% 60%, 38% 35%, 50% 50%, 62% 30%, 75% 45%, 85% 35%, 100% 55%, 100% 100%, 0 100%);
    z-index: 2;
}

.mountain-near {
    height: 50%;
    background: #64748b;
    clip-path: polygon(0 75%, 15% 55%, 28% 65%, 40% 48%, 52% 60%, 65% 42%, 78% 58%, 90% 50%, 100% 65%, 100% 100%, 0 100%);
    z-index: 3;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 4;
    text-align: center;
    padding: 0 2rem;
}

.brand {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    color: #f1f5f9;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

/* Scroll hint arrow */
.scroll-hint {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.scroll-arrow {
    display: block;
    width: 24px;
    height: 24px;
    border-right: 2px solid #a78bfa;
    border-bottom: 2px solid #a78bfa;
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
    50% { transform: rotate(45deg) translateY(8px); opacity: 1; }
}

/* ========================================
   QUEST PATH - Vertical dotted line
   ======================================== */

.quest-path-container {
    position: fixed;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    transform: translateX(-1px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.quest-path-container.visible {
    opacity: 1;
}

.quest-path-line {
    width: 2px;
    height: 100%;
    background-image: repeating-linear-gradient(
        to bottom,
        #a78bfa 0px,
        #a78bfa 6px,
        transparent 6px,
        transparent 14px
    );
    opacity: 0.35;
}

/* ========================================
   QUEST STAGES
   ======================================== */

.quest-stage {
    position: relative;
    padding: 6rem 2rem;
    display: flex;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.stage-1 { background: #334155; }
.stage-2 { background: #475569; }
.stage-3 { background: #64748b; }
.stage-4 { background: #64748b; }
.stage-5 { background: #94a3b8; }

.stage-inner {
    max-width: 560px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.stage-inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Milestone marker */
.milestone-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.milestone-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: relative;
    z-index: 101;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.milestone-dot.filled {
    background: #a78bfa;
    border: 3px solid #a78bfa;
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.4);
}

.milestone-dot.outlined {
    background: transparent;
    border: 3px solid #a78bfa;
}

.milestone-dot.active {
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.6);
}

.stage-badge {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.6rem;
}

/* Stage content */
.stage-title {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.stage-description {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #f1f5f9;
    opacity: 0.85;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Code blocks */
.code-block {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(167, 139, 250, 0.15);
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #a78bfa;
    line-height: 1.6;
    white-space: pre;
}

/* Stage progress indicator */
.stage-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.progress-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.progress-indicator.complete {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.progress-indicator.pending {
    background: transparent;
    border: 2px solid #22c55e;
}

.progress-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #f1f5f9;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Stage 5 text adjustments (lighter bg) */
.stage-5 .stage-title,
.stage-5 .stage-description,
.stage-5 .stage-badge,
.stage-5 .progress-label {
    color: #1e293b;
}

.stage-5 .stage-description {
    opacity: 0.8;
}

.stage-5 .stage-badge {
    color: #6d28d9;
}

.stage-5 .code-block {
    border-color: rgba(15, 23, 42, 0.2);
}

/* ========================================
   SUMMIT
   ======================================== */

.summit-section {
    background: #94a3b8;
    padding: 8rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.summit-content {
    max-width: 500px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.summit-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* CSS Flag */
.flag-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    height: 60px;
}

.flag-pole {
    width: 3px;
    height: 60px;
    background: #1e293b;
    position: relative;
}

.flag-cloth {
    position: absolute;
    top: 0;
    left: calc(50% + 1.5px);
    width: 30px;
    height: 20px;
    background: #a78bfa;
    clip-path: polygon(0 0, 100% 25%, 80% 50%, 100% 75%, 0 100%);
    animation: flagWave 2s ease-in-out infinite alternate;
    transform-origin: left center;
}

@keyframes flagWave {
    0% { transform: skewY(0deg); }
    100% { transform: skewY(-3deg); }
}

.summit-heading {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #1e293b;
    margin-bottom: 1rem;
}

.summit-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Completion badges */
.completion-badges {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.completion-badge {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.completion-badge.filled-green {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.completion-badge.animate-in {
    animation: badgePop 0.4s ease forwards;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.summit-brand {
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    color: #475569;
    letter-spacing: 0.05em;
}

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

@media (max-width: 768px) {
    .quest-stage {
        padding: 4rem 1.5rem;
    }

    .code-block {
        padding: 1rem;
    }

    .code-block code {
        font-size: 0.75rem;
    }

    .summit-section {
        padding: 5rem 1.5rem;
    }

    .mountain-layers {
        height: 40%;
    }
}

@media (max-width: 480px) {
    .quest-stage {
        padding: 3rem 1rem;
    }

    .stage-description {
        font-size: 0.9rem;
    }

    .code-block {
        padding: 0.75rem;
        border-radius: 6px;
    }

    .quest-path-container {
        display: none;
    }
}
