:root {
    --bleached-sand: #F2E8D9;
    --warm-clay: #D4A574;
    --charred-umber: #2C1810;
    --terracotta-ridge: #A0522D;
    --sage-trail: #6B7F5E;
    --signal-ochre: #C8860A;
    --basalt-dark: #1A120B;
    --peak-gold: #D4A017;
    --altitude: 0;
    --scroll: 0;
}

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

body {
    background-color: var(--bleached-sand);
    color: var(--charred-umber);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* Altitude Indicator Bar */
.altitude-bar {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    height: 60vh;
    width: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.altitude-track {
    position: relative;
    width: 2px;
    height: 100%;
    background: var(--terracotta-ridge);
    opacity: 0.2;
    border-radius: 1px;
}

.altitude-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--sage-trail);
    opacity: 0.6;
    border-radius: 1px;
    height: 0%;
    transition: height 0.15s linear;
}

.altitude-tick {
    position: absolute;
    left: -4px;
    bottom: calc(var(--tick-pos) * 100%);
    width: 10px;
    height: 1px;
    background: var(--terracotta-ridge);
    opacity: 0.4;
}

.tick-label {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: var(--signal-ochre);
    opacity: 0.6;
    white-space: nowrap;
}

.hiker {
    position: absolute;
    left: -11px;
    bottom: 0%;
    transition: bottom 0.15s linear;
    animation: hikerBounce 0.4s ease-in-out infinite alternate;
}

@keyframes hikerBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-2px); }
}

/* Contour Layer */
.contour-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.contour-line {
    fill: none;
    will-change: transform;
}

/* Sections */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 128px 24px;
    z-index: 1;
}

.section-content {
    max-width: 680px;
    width: 100%;
    position: relative;
}

.section-content.narrow {
    max-width: 520px;
}

/* Hero Title */
.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--charred-umber);
    line-height: 1;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.hero-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Section Headings */
.section-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--charred-umber);
    line-height: 1.1;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.section-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

.summit-heading {
    color: var(--peak-gold);
}

/* Vista Text */
.vista {
    font-family: 'Source Sans 3', sans-serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.25rem;
    color: var(--terracotta-ridge);
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s,
                transform 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s;
}

.vista.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Body Text */
.body-text {
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.3s,
                transform 1s ease 0.3s;
}

.body-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Annotation */
.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--signal-ochre);
    opacity: 0;
    margin-top: 48px;
    transition: opacity 1.2s ease 0.5s;
}

.annotation.revealed {
    opacity: 0.6;
}

/* Elevation Markers */
.elevation-marker {
    position: absolute;
    left: calc(50% - 340px - 48px);
    top: 128px;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.elevation-marker.revealed {
    opacity: 1;
    transform: scale(1);
}

.marker-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--signal-ochre);
    position: relative;
}

.marker-circle::before,
.marker-circle::after {
    content: '';
    position: absolute;
    background: var(--signal-ochre);
    opacity: 0.5;
}

.marker-circle::before {
    width: 1px;
    height: 12px;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.marker-circle::after {
    width: 1px;
    height: 12px;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
}

.marker-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    color: var(--signal-ochre);
    white-space: nowrap;
}

.marker-summit {
    border-color: var(--peak-gold);
}

.marker-summit .marker-text {
    color: var(--peak-gold);
}

.marker-summit::before,
.marker-summit::after {
    background: var(--peak-gold);
}

/* Summit Starburst */
.summit-starburst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.section-summit.in-view .summit-starburst {
    opacity: 1;
}

.starburst-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 1px;
    background: var(--peak-gold);
    transform-origin: 0 0;
    opacity: 0.4;
}

/* Summit Revelation */
.summit-revelation {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.8;
    color: var(--charred-umber);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s,
                transform 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s;
}

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

/* Switchback Dividers */
.switchback-divider {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 24px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.switchback-divider.revealed {
    opacity: 1;
}

.switchback-divider svg {
    width: 100%;
    height: 40px;
}

/* Section-specific backgrounds handled by JS altitude gradient */
.section-basecamp {
    min-height: 100vh;
    justify-content: center;
}

.section-summit {
    min-height: 100vh;
    justify-content: center;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .altitude-bar {
        display: none;
    }

    .elevation-marker {
        position: relative;
        left: auto;
        top: auto;
        margin-bottom: 24px;
    }

    .section-content.narrow {
        max-width: 560px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 64px 24px;
    }

    .section-content {
        max-width: 100%;
    }

    .section-content.narrow {
        max-width: 100%;
    }

    .elevation-marker {
        position: relative;
        left: auto;
        top: auto;
        margin-bottom: 24px;
    }

    .switchback-divider {
        padding: 0 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-title,
    .section-heading,
    .vista,
    .body-text,
    .annotation,
    .summit-revelation {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .elevation-marker {
        opacity: 1;
        transform: scale(1);
        transition: none;
    }

    .switchback-divider {
        opacity: 1;
        transition: none;
    }

    .hiker {
        animation: none;
    }

    .contour-line {
        will-change: auto;
    }
}
