/* continua.quest - Generative Art Terrain Experience */
/* Palette: #0f1729, #1a2744, #2a3f5f, #1a3a2a, #fbbf24, #e2e8f0, #ffffff */

:root {
    --sky: #0f1729;
    --mountain-far: #1a2744;
    --mountain-mid: #2a3f5f;
    --ground: #1a3a2a;
    --gold: #fbbf24;
    --text: #e2e8f0;
    --star: #ffffff;
    --path-gold: rgba(251, 191, 36, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--sky);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    min-height: 500vh;
    overflow-x: hidden;
}

/* ===== Star Field ===== */
.star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #ffffff;
}

.star-dim {
    animation: twinkle-dim 4s ease-in-out infinite;
}

.star-mid {
    animation: twinkle-mid 3s ease-in-out infinite;
}

.star-bright {
    animation: twinkle-bright 2.5s ease-in-out infinite;
}

@keyframes twinkle-dim {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.5; }
}

@keyframes twinkle-mid {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@keyframes twinkle-bright {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== Shooting Stars ===== */
.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.shooting-star {
    position: absolute;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
    transform-origin: left center;
    opacity: 0;
    animation: shoot 1s ease-out forwards;
}

@keyframes shoot {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) scaleX(0);
    }
    10% {
        opacity: 1;
        transform: translateX(0) translateY(0) scaleX(1);
    }
    100% {
        opacity: 0;
        transform: translateX(200px) translateY(80px) scaleX(1.5);
    }
}

/* ===== Compass ===== */
.compass {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.compass-icon {
    display: block;
}

.compass-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: rgba(226, 232, 240, 0.35);
    letter-spacing: 0.1em;
}

/* ===== Distance Counter ===== */
.distance-counter {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--gold);
    z-index: 20;
    opacity: 0.7;
}

.dist-label {
    color: rgba(226, 232, 240, 0.4);
    margin-right: 4px;
}

.dist-value {
    font-variant-numeric: tabular-nums;
}

/* ===== Quest Path ===== */
.quest-path {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* ===== Terrain Layers ===== */
.terrain-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    will-change: transform;
}

.mountain-svg {
    width: 200%;
    height: 100%;
    display: block;
}

.terrain-far {
    z-index: 1;
    height: 45vh;
}

.terrain-mid {
    z-index: 2;
    height: 40vh;
}

.terrain-near {
    z-index: 3;
    height: 30vh;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    z-index: 5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: var(--gold);
    text-shadow: 0 0 40px rgba(251, 191, 36, 0.25), 0 0 80px rgba(251, 191, 36, 0.1);
    letter-spacing: -0.02em;
}

.brand-sub {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.45);
    margin-top: 0.75rem;
    letter-spacing: 0.05em;
}

.scroll-hint {
    position: absolute;
    bottom: 8vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: hint-pulse 2.5s ease-in-out infinite;
}

.scroll-hint-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: rgba(226, 232, 240, 0.3);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-arrow {
    color: rgba(226, 232, 240, 0.25);
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(4px); }
}

/* ===== Milestones ===== */
.milestone-section {
    position: relative;
    z-index: 5;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.milestone {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    max-width: 560px;
}

/* Flag & Pole */
.flag-pole {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-top: 4px;
}

.flag {
    width: 0;
    height: 0;
    border-left: 14px solid var(--gold);
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    opacity: 0.35;
    transition: opacity 0.6s ease;
}

.flag-active {
    opacity: 1;
}

.flag-summit {
    border-left-color: #ffffff;
    opacity: 0.85;
}

.pole {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.05));
}

.pole-summit {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.05));
}

/* Panel */
.milestone-panel {
    padding-top: 2px;
}

.milestone-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--gold);
    letter-spacing: 0.12em;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.65;
}

.milestone-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.milestone-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.65);
    line-height: 1.75;
}

.horizon-title {
    color: var(--gold);
    font-size: 1.2rem;
    opacity: 0.55;
}

.horizon-section {
    min-height: 60vh;
}

/* ===== Fade In ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Summit Section Stars Brightening ===== */
.summit-section .milestone-title {
    text-shadow: 0 0 20px rgba(226, 232, 240, 0.15);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .milestone {
        flex-direction: column;
    }

    .flag-pole {
        flex-direction: row;
        gap: 0;
    }

    .pole {
        width: 40px;
        height: 1px;
        background: linear-gradient(to right, rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.05));
    }

    .compass {
        top: 12px;
        right: 12px;
    }

    .distance-counter {
        bottom: 12px;
        left: 12px;
    }
}
