/* ============================================
   footprint.market — Compressed Earth
   ============================================ */

/* --- Color Palette --- */
:root {
    --bedrock: #1A2118;
    --deep-moss: #2C3E2D;
    --living-lichen: #4A6B4E;
    --sage-line: #6B8F71;
    --fossil-amber: #C4A265;
    --pressed-clay: #8B5E3C;
    --chalk-dust: #D4DFD0;
    --bleached-sediment: #E8DCC8;
    --forest-shadow: #3B4A3C;
    --mid-green: #3B5A3F;
    --geo-ease: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

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

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--forest-shadow);
    letter-spacing: 0.01em;
    background-color: var(--bedrock);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Grain Texture Overlay --- */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    mix-blend-mode: multiply;
    opacity: 0.05;
}

#grain-overlay::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}

/* --- Generative Contour Map SVG --- */
#contour-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Fossil Layer --- */
#fossil-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Erosion Lines --- */
#erosion-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Depth Indicator --- */
#depth-indicator {
    position: fixed;
    left: 0;
    top: 0;
    width: 20px;
    height: 100vh;
    z-index: 200;
    pointer-events: none;
}

#depth-label {
    font-family: 'Inclusive Sans', sans-serif;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    fill: var(--sage-line);
    opacity: 0.6;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: 0.04em;
    color: var(--deep-moss);
}

h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
}

h2 {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
}

/* --- Strata Sections --- */
.stratum {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 1.2s var(--geo-ease);
}

/* --- The Impression (first 100vh) --- */
#impression {
    height: 100vh;
    background: var(--bedrock);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.impression-content {
    position: relative;
    text-align: center;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#impression-contours {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vmin;
    height: 90vmin;
    z-index: -1;
}

#site-title {
    color: var(--fossil-amber);
    text-shadow: 1px 1px 2px var(--bedrock);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1.5s var(--geo-ease) 2.8s, transform 1.5s var(--geo-ease) 2.8s;
}

#site-title.visible {
    opacity: 1;
    transform: translateY(0);
}

#site-tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(0.95rem, 1.6vw, 1.2rem);
    color: var(--chalk-dust);
    opacity: 0;
    margin-top: 1.2rem;
    letter-spacing: 0.02em;
    transition: opacity 1.8s var(--geo-ease) 3.5s;
}

#site-tagline.visible {
    opacity: 0.7;
}

/* --- Stratum 1: Surface Layer --- */
#stratum-1 {
    background: linear-gradient(
        to bottom,
        var(--bedrock) 0%,
        #1e2b1c 3%,
        #213020 5%,
        #243523 8%,
        #273a26 12%,
        #2a3f29 16%,
        var(--deep-moss) 22%,
        #2f422f 28%,
        #324632 33%,
        #364a35 38%,
        #394e38 42%,
        #3c523b 46%,
        #3f563e 50%,
        #425a41 54%,
        #455e44 58%,
        #485f47 62%,
        #4a634a 66%,
        var(--living-lichen) 72%,
        #4c6d50 78%,
        #4a6b4e 85%,
        var(--living-lichen) 100%
    );
    padding: 8rem 0;
}

/* --- Stratum 2: Subsoil --- */
#stratum-2 {
    background: linear-gradient(
        to bottom,
        var(--living-lichen) 0%,
        #4a694d 3%,
        #49674c 5%,
        #48654b 8%,
        #47634a 12%,
        #466149 16%,
        #455f48 20%,
        #445d47 25%,
        #435b46 30%,
        #425945 35%,
        #415744 40%,
        #405543 45%,
        #3f5342 50%,
        #3e5141 55%,
        var(--mid-green) 60%,
        #3c5840 65%,
        #3b5a3f 70%,
        #3b5a3f 80%,
        var(--mid-green) 100%
    );
    padding: 8rem 0;
}

/* --- Stratum 3: Clay Layer --- */
#stratum-3 {
    background: linear-gradient(
        to bottom,
        var(--mid-green) 0%,
        #3a583e 4%,
        #39563d 8%,
        #38543c 12%,
        #37523b 16%,
        #36503a 20%,
        #354e39 25%,
        #344c38 30%,
        #334a37 35%,
        #324836 40%,
        #314635 45%,
        #304434 50%,
        #2f4233 55%,
        #2e4032 60%,
        var(--deep-moss) 70%,
        #2c3e2d 80%,
        var(--deep-moss) 100%
    );
    padding: 8rem 0;
}

/* --- Stratum 4: Bedrock Return --- */
#stratum-4 {
    background: linear-gradient(
        to bottom,
        var(--deep-moss) 0%,
        #2b3c2c 4%,
        #2a3a2b 8%,
        #29382a 12%,
        #283629 16%,
        #273428 20%,
        #263227 25%,
        #253026 30%,
        #242e25 35%,
        #232c24 40%,
        #222a23 45%,
        #212822 50%,
        #202621 55%,
        #1f2420 60%,
        #1e221f 65%,
        #1d201e 70%,
        #1c1f1d 75%,
        #1b1e1c 80%,
        var(--bedrock) 90%,
        var(--bedrock) 100%
    );
    padding: 8rem 0;
}

/* --- The Ascent --- */
#ascent {
    min-height: 100vh;
    background: linear-gradient(
        to bottom,
        var(--bedrock) 0%,
        #1e2920 4%,
        #233425 8%,
        #283f2a 12%,
        #2d4a2f 16%,
        #325534 20%,
        #3a6039 25%,
        #426b3e 28%,
        #4c7548 30%,
        #587f54 33%,
        #648960 36%,
        #70936c 39%,
        #7c9d78 42%,
        #88a784 46%,
        #94b190 50%,
        #9fb89a 54%,
        #a8c0a4 58%,
        #b1c8ae 62%,
        #bad0b8 66%,
        #c2d6c0 70%,
        var(--chalk-dust) 76%,
        #d8e1d4 80%,
        #dce4d8 84%,
        #e0e5da 88%,
        #e4e2d4 92%,
        #e6dfce 95%,
        var(--bleached-sediment) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

.ascent-content {
    text-align: center;
    max-width: 800px;
}

#ascent-heading {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: var(--deep-moss);
    line-height: 1.25;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s var(--geo-ease), transform 2s var(--geo-ease);
}

#ascent-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Stratum Content --- */
.stratum-content {
    max-width: 720px;
    padding: 4rem 2rem;
    position: relative;
    margin: 0 auto;
}

.stratum-heading {
    margin-bottom: 2rem;
    color: var(--chalk-dust);
}

.stratum-body {
    color: var(--chalk-dust);
    opacity: 0.85;
    margin-bottom: 1.8rem;
    max-width: 620px;
}

/* --- Clay Accent (Stratum 3) --- */
.clay-accent {
    color: var(--pressed-clay);
    font-weight: 600;
    position: relative;
}

.clay-rule {
    border: none;
    height: 1px;
    background: var(--pressed-clay);
    opacity: 0.25;
    margin: 3rem 0;
    width: 60%;
}

/* --- Stratum 4 specifics --- */
#stratum-4 .stratum-heading {
    color: var(--fossil-amber);
}

#stratum-4 .stratum-body {
    color: var(--chalk-dust);
    opacity: 0.75;
}

/* --- Reveal Animation --- */
.reveal-element {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 1.2s var(--geo-ease), transform 1.2s var(--geo-ease);
}

.reveal-element.visible {
    opacity: 1;
    transform: translateY(0);
}

.stratum-body.reveal-element.visible {
    opacity: 0.85;
}

#stratum-4 .stratum-body.reveal-element.visible {
    opacity: 0.75;
}

/* --- Fossil Imprints in Strata --- */
.stratum-fossil {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0.04;
    transition: opacity 2s var(--geo-ease);
    pointer-events: none;
}

#stratum-1 .stratum-fossil {
    top: 15%;
    right: -60px;
}

#stratum-2 .stratum-fossil {
    top: 25%;
    left: -70px;
    opacity: 0.06;
}

#stratum-3 .stratum-fossil {
    bottom: 20%;
    right: -50px;
    opacity: 0.07;
}

#stratum-4 .stratum-fossil {
    top: 30%;
    left: -80px;
    opacity: 0.05;
}

.stratum-fossil.excavated {
    opacity: 0.15;
}

/* --- Pressure Halos --- */
#stratum-4 .stratum-heading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 162, 101, 0.06) 0%, transparent 70%);
    pointer-events: none;
    transition: all 1.5s var(--geo-ease);
    z-index: -1;
}

#stratum-4 .stratum-heading {
    position: relative;
}

#stratum-4 .stratum-heading:hover::before {
    opacity: 1;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(196, 162, 101, 0.1) 0%, transparent 70%);
}

/* --- Annotation-style labels --- */
.annotation {
    font-family: 'Inclusive Sans', sans-serif;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    color: var(--sage-line);
    opacity: 0.6;
    letter-spacing: 0.02em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .stratum-content {
        padding: 3rem 1.5rem;
    }

    #depth-indicator {
        display: none;
    }

    .stratum-fossil {
        display: none;
    }

    #impression-contours {
        width: 95vmin;
        height: 95vmin;
    }
}

@media (max-width: 480px) {
    .stratum-content {
        padding: 2.5rem 1.2rem;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    h2 {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }
}
