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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    color: #2A3A4A;
    background-color: #F0F4F8;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===== GRAIN OVERLAY ===== */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    mix-blend-mode: multiply;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractal' baseFrequency='0.9' numOctaves='3' result='noise'/%3E%3CfeColorMatrix type='saturate' values='0' in='noise'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

/* ===== SECTION BASE STYLES ===== */
.section {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ===== SECTION 1: BASE CAMP ===== */
.section-base-camp {
    height: 100vh;
    background-color: #F0F4F8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: #2A3A4A;
    text-align: center;
    position: absolute;
    top: 35%;
    transform: translateY(-50%);
    z-index: 10;
}

.mountain-hero {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 50vw;
    max-width: 600px;
    height: auto;
    z-index: 5;
}

/* ===== SECTION 2: TRAVERSE (MASONRY) ===== */
.section-traverse {
    background-color: #E8EEF4;
    padding: 4rem 2rem;
    position: relative;
}

.masonry-container {
    max-width: 1100px;
    margin: 0 auto;
    column-count: 3;
    column-gap: 1.5rem;
}

/* Responsive masonry columns */
@media (max-width: 1024px) {
    .masonry-container {
        column-count: 2;
    }
}

@media (max-width: 640px) {
    .masonry-container {
        column-count: 1;
    }
}

/* ===== TERRAIN CARDS ===== */
.terrain-card {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    opacity: 0;
    animation: scrollIn 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.terrain-card.in-view {
    animation: scrollIn 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes scrollIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation delays */
.terrain-card:nth-child(1) { animation-delay: 0ms; }
.terrain-card:nth-child(2) { animation-delay: 100ms; }
.terrain-card:nth-child(3) { animation-delay: 200ms; }
.terrain-card:nth-child(4) { animation-delay: 100ms; }
.terrain-card:nth-child(5) { animation-delay: 200ms; }
.terrain-card:nth-child(6) { animation-delay: 300ms; }
.terrain-card:nth-child(7) { animation-delay: 0ms; }
.terrain-card:nth-child(8) { animation-delay: 100ms; }
.terrain-card:nth-child(9) { animation-delay: 200ms; }
.terrain-card:nth-child(10) { animation-delay: 100ms; }
.terrain-card:nth-child(11) { animation-delay: 200ms; }
.terrain-card:nth-child(12) { animation-delay: 300ms; }

.card-heading {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2A3A4A;
    margin-bottom: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
}

.card-body {
    font-size: 0.95rem;
    color: #3A5A7A;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-icon {
    width: 40px;
    height: 40px;
    display: block;
    margin-top: 0.8rem;
}

/* ===== SECTION 3: SUMMIT ===== */
.section-summit {
    height: 100vh;
    background-color: #D8E4F0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summit-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.summit-text {
    font-size: 1.6rem;
    font-weight: 300;
    color: #3A5A7A;
    text-align: center;
    position: absolute;
    top: 30%;
    transform: translateY(-50%);
    z-index: 10;
    max-width: 80%;
    line-height: 1.4;
}

.mountain-summit {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 70vw;
    max-width: 700px;
    height: auto;
    z-index: 5;
}

.flag {
    animation: windFlag 3s ease-in-out infinite;
    transform-origin: 200px 50px;
}

@keyframes windFlag {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* ===== SECTION 4: DESCENT ===== */
.section-descent {
    height: 50vh;
    background-color: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.descent-container {
    text-align: center;
    opacity: 0;
    animation: fadeIn 1.5s ease-out forwards;
}

.descent-text {
    font-size: 1rem;
    color: #8AA0B8;
    font-weight: 400;
    letter-spacing: 0.05em;
}

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

.section-descent.in-view .descent-container {
    animation: fadeIn 1.5s ease-out forwards;
}

/* ===== TYPOGRAPHY & TEXT UTILITIES ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Sans 3', sans-serif;
    line-height: 1.2;
}

p {
    font-family: 'Source Sans 3', sans-serif;
}

/* Category/metadata labels */
.label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #5A7A9A;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 7vw, 5rem);
    }

    .mountain-hero {
        width: 70vw;
    }

    .section-traverse {
        padding: 2rem 1rem;
    }

    .masonry-container {
        column-gap: 1rem;
    }

    .terrain-card {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }

    .card-heading {
        font-size: 1.1rem;
    }

    .card-body {
        font-size: 0.9rem;
    }

    .summit-text {
        font-size: 1.3rem;
        top: 35%;
    }

    .mountain-summit {
        width: 80vw;
    }

    .descent-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 3rem);
    }

    .mountain-hero {
        width: 90vw;
        bottom: 20%;
    }

    .section-traverse {
        padding: 1.5rem 1rem;
    }

    .terrain-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .card-heading {
        font-size: 1rem;
    }

    .card-body {
        font-size: 0.85rem;
    }

    .summit-text {
        font-size: 1.1rem;
        top: 40%;
        max-width: 90%;
    }

    .mountain-summit {
        width: 90vw;
    }

    .section-descent {
        height: 60vh;
    }

    .descent-text {
        font-size: 0.85rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .terrain-card {
        animation: none;
        opacity: 1;
    }

    .flag {
        animation: none;
    }

    .descent-container {
        animation: none;
        opacity: 1;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .grain-overlay {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }
}
