/* ============================================
   lower.bar — Pop-Art Wilderness Descent
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --midnight-indigo: #1B1B3A;
    --alpine-cobalt: #2D4FA2;
    --ridgeline-violet: #6B3FA0;
    --magenta-pop: #D63384;
    --sunset-blaze: #F26430;
    --parchment-cream: #F5ECD7;
    --worn-leather: #8B6F47;
    --snow-cap: #F0F0FA;

    --font-heading: 'Space Mono', monospace;
    --font-secondary: 'Overpass Mono', monospace;
    --font-body: 'Inter', sans-serif;
    --font-accent: 'Permanent Marker', cursive;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-body);
    color: var(--midnight-indigo);
    background: var(--midnight-indigo);
    overflow-x: hidden;
}

/* --- SVG Defs (hidden) --- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Leather Grain Overlay --- */
#leather-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.1;
}

#leather-overlay svg {
    width: 100%;
    height: 100%;
}

/* --- Altitude Navigation --- */
#altitude-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.altitude-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sunset-blaze);
    border: 3px solid var(--midnight-indigo);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.altitude-marker:hover {
    transform: scale(1.3);
}

.marker-label {
    position: absolute;
    right: 42px;
    white-space: nowrap;
    font-family: var(--font-secondary);
    font-size: 0.6rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--snow-cap);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.altitude-marker:hover .marker-label {
    opacity: 1;
}

/* --- Band Base Styles --- */
.band {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Ben-Day dot overlay on each band */
.band::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.band-summit::before,
.band-treeline::before {
    background: radial-gradient(circle, rgba(240, 240, 250, 0.04) 1px, transparent 1px);
    background-size: 8px 8px;
}

.band-valley::before,
.band-bedrock::before {
    background: radial-gradient(circle, rgba(27, 27, 58, 0.06) 1px, transparent 1px);
    background-size: 8px 8px;
}

/* Wobbly divider lines between bands */
.band + .band::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--midnight-indigo);
    z-index: 5;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='5'%3E%3Cpath d='M0,2 Q30,0 60,3 Q90,5 120,2 Q150,0 180,3 Q210,5 240,2 Q270,0 300,3 Q330,5 360,2 Q390,0 420,3 Q450,5 480,2 Q510,0 540,3 Q570,5 600,2 Q630,0 660,3 Q690,5 720,2 Q750,0 780,3 Q810,5 840,2 Q870,0 900,3 Q930,5 960,2 Q990,0 1020,3 Q1050,5 1080,2 Q1110,0 1140,3 Q1170,5 1200,2' stroke='white' stroke-width='5' fill='none'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='5'%3E%3Cpath d='M0,2 Q30,0 60,3 Q90,5 120,2 Q150,0 180,3 Q210,5 240,2 Q270,0 300,3 Q330,5 360,2 Q390,0 420,3 Q450,5 480,2 Q510,0 540,3 Q570,5 600,2 Q630,0 660,3 Q690,5 720,2 Q750,0 780,3 Q810,5 840,2 Q870,0 900,3 Q930,5 960,2 Q990,0 1020,3 Q1050,5 1080,2 Q1110,0 1140,3 Q1170,5 1200,2' stroke='white' stroke-width='5' fill='none'/%3E%3C/svg%3E");
    mask-size: 1200px 5px;
    -webkit-mask-size: 1200px 5px;
    mask-repeat: repeat-x;
    -webkit-mask-repeat: repeat-x;
}

.band-inner {
    position: relative;
    z-index: 3;
    max-width: 720px;
    width: 100%;
    padding: 80px 24px;
    margin: 0 auto;
}

/* --- SUMMIT BAND --- */
.band-summit {
    background: var(--alpine-cobalt);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.band-content {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Mountain silhouettes */
.mountain-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    will-change: transform;
}

.mountain-back {
    clip-path: polygon(0% 100%, 0% 78%, 5% 72%, 12% 68%, 18% 75%, 25% 65%, 32% 70%, 40% 60%, 48% 55%, 55% 62%, 62% 58%, 70% 52%, 78% 58%, 85% 50%, 92% 56%, 100% 48%, 100% 100%);
    background: #8B6FCC;
    opacity: 0.5;
    z-index: 1;
}

.mountain-mid {
    clip-path: polygon(0% 100%, 0% 75%, 6% 68%, 14% 72%, 20% 60%, 28% 65%, 35% 55%, 40% 58%, 48% 48%, 55% 52%, 62% 45%, 68% 50%, 75% 42%, 82% 48%, 90% 40%, 95% 45%, 100% 52%, 100% 100%);
    background: var(--ridgeline-violet);
    opacity: 0.7;
    z-index: 2;
}

.mountain-front {
    clip-path: polygon(0% 100%, 0% 70%, 8% 55%, 15% 62%, 22% 45%, 30% 52%, 38% 35%, 42% 40%, 50% 28%, 58% 38%, 65% 32%, 72% 48%, 80% 42%, 88% 55%, 95% 48%, 100% 60%, 100% 100%);
    background: var(--alpine-cobalt);
    filter: brightness(0.7);
    z-index: 3;
}

.summit-title-wrap {
    position: relative;
    z-index: 10;
    text-align: center;
}

.summit-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--snow-cap);
    -webkit-text-stroke: 3px var(--midnight-indigo);
    paint-order: stroke fill;
    line-height: 1.1;
}

.summit-tagline {
    font-family: var(--font-secondary);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--parchment-cream);
    margin-top: 16px;
    opacity: 0.8;
}

/* --- TREELINE BAND --- */
.band-treeline {
    background: var(--ridgeline-violet);
}

/* Decorative leather-stitching borders */
.band-treeline .band-inner {
    border-left: 3px dashed var(--worn-leather);
    border-right: 3px dashed var(--worn-leather);
    padding-left: 40px;
    padding-right: 40px;
    border-radius: 2px;
}

/* --- VALLEY BAND --- */
.band-valley {
    background: var(--parchment-cream);
}

.band-valley .band-inner {
    border-left: 3px dashed var(--worn-leather);
    border-right: 3px dashed var(--worn-leather);
    padding-left: 40px;
    padding-right: 40px;
}

.band-valley .body-text {
    color: var(--midnight-indigo);
}

/* --- BEDROCK BAND --- */
.band-bedrock {
    background: var(--midnight-indigo);
    min-height: 60vh;
}

.band-bedrock .band-inner {
    padding-top: 60px;
    padding-bottom: 60px;
}

.band-bedrock .section-heading {
    color: var(--snow-cap);
    -webkit-text-stroke: 2px var(--parchment-cream);
}

.band-bedrock .body-text,
.band-bedrock .bedrock-text {
    color: var(--parchment-cream);
    line-height: 1.5;
}

/* --- Typography --- */
.section-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--snow-cap);
    -webkit-text-stroke: 3px var(--midnight-indigo);
    paint-order: stroke fill;
    margin-bottom: 24px;
    display: inline-block;
    line-height: 1.2;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.75;
    color: var(--parchment-cream);
    margin-bottom: 40px;
    max-width: 640px;
}

/* --- Underline Draw Animation --- */
.draw-underline {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: center bottom;
    background-size: 0% 3px;
    background-repeat: no-repeat;
    padding-bottom: 6px;
    transition: none;
}

.draw-underline[data-accent="magenta"] {
    background-image: linear-gradient(var(--magenta-pop), var(--magenta-pop));
}

.draw-underline[data-accent="blaze"] {
    background-image: linear-gradient(var(--sunset-blaze), var(--sunset-blaze));
}

.draw-underline.animate {
    animation: underline-draw 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes underline-draw {
    from {
        background-size: 0% 3px;
    }
    to {
        background-size: 100% 3px;
    }
}

/* --- Annotations (hand-scrawled margin notes) --- */
.annotation {
    position: relative;
    margin-bottom: 40px;
    padding-left: 20px;
}

.annotation-text {
    font-family: var(--font-accent);
    font-size: 0.875rem;
    color: var(--magenta-pop);
    display: inline-block;
}

.annotation-1 .annotation-text {
    transform: rotate(-3deg);
}

.annotation-2 .annotation-text {
    transform: rotate(-5deg);
}

.annotation-3 .annotation-text {
    transform: rotate(-7deg);
}

.annotation-4 .annotation-text {
    transform: rotate(-4deg);
}

/* --- Stamp Badges --- */
.stamp {
    position: absolute;
    top: 80px;
    right: 24px;
    opacity: 0.55;
    mix-blend-mode: multiply;
    z-index: 5;
}

.stamp-treeline {
    transform: rotate(5deg);
}

.stamp-valley {
    transform: rotate(-3deg);
}

.stamp-bedrock {
    transform: rotate(7deg);
}

/* --- Lower Bar Element (Bedrock closing) --- */
.lower-bar-element {
    margin-top: 60px;
    position: relative;
    text-align: center;
    padding-bottom: 20px;
}

.lower-repeat {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--parchment-cream);
    opacity: 0.7;
    margin: 0 4px;
}

.lower-1 {
    font-size: 2rem;
}

.lower-2 {
    font-size: 1.6rem;
    opacity: 0.55;
}

.lower-3 {
    font-size: 1.2rem;
    opacity: 0.4;
}

.lower-4 {
    font-size: 0.9rem;
    opacity: 0.3;
}

.lower-5 {
    font-size: 0.65rem;
    opacity: 0.2;
}

.the-bar {
    display: block;
    width: 100%;
    max-width: 720px;
    height: 5px;
    background: var(--magenta-pop);
    margin: 16px auto 0;
    transform: scaleX(0);
    transition: none;
}

.the-bar.animate {
    animation: bar-draw 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes bar-draw {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* --- Section Divider Bars --- */
.band-treeline .band-inner::before,
.band-valley .band-inner::before {
    content: '';
    display: block;
    width: 60%;
    height: 4px;
    margin: 0 auto 60px;
    background: var(--magenta-pop);
}

.band-valley .band-inner::before {
    background: var(--sunset-blaze);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #altitude-nav {
        right: 12px;
        gap: 14px;
    }

    .altitude-marker {
        width: 26px;
        height: 26px;
    }

    .marker-label {
        display: none;
    }

    .band-inner {
        padding: 60px 20px;
    }

    .band-treeline .band-inner,
    .band-valley .band-inner {
        padding-left: 28px;
        padding-right: 28px;
    }

    .stamp {
        display: none;
    }

    .summit-title {
        -webkit-text-stroke: 2px var(--midnight-indigo);
    }

    .section-heading {
        -webkit-text-stroke: 2px var(--midnight-indigo);
    }
}

@media (max-width: 480px) {
    .section-heading {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .summit-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .lower-bar-element .lower-repeat {
        display: block;
        margin: 4px 0;
    }
}
