:root {
    --ferric-black: #1A1210;
    --saddlebrown-rust: #8B4513;
    --molten-sienna: #D4600A;
    --calcium-white: #E8DFD0;
    --patina: #7A8B6F;
    --sandstone: #B8A898;
    --aurora-teal: #2E8B8B;
    --aurora-violet: #6B4E8B;
    --aurora-green: #3D8B6B;
    --deep-umber: #3A2F28;
}

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

body {
    background: var(--ferric-black);
    color: var(--calcium-white);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* Horizontal Scroll Container */
.h-scroll {
    display: flex;
    flex-direction: row;
    width: fit-content;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--deep-umber);
    z-index: 100;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.3), inset 0 -1px 0 rgba(0,0,0,0.3);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--saddlebrown-rust), var(--deep-umber) 50%, var(--molten-sienna));
    transition: width 0.1s linear;
}

.progress-marker {
    position: absolute;
    top: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--sandstone) 30%, var(--deep-umber) 100%);
    transform: translateX(-50%);
    border: 1px solid var(--saddlebrown-rust);
}

/* Strata */
.stratum {
    min-width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stratum-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.stratum-content {
    position: relative;
    z-index: 5;
    max-width: 600px;
    padding: 3rem;
}

/* Typography */
.stratum-title {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--calcium-white);
    line-height: 1;
    margin-bottom: 2rem;
}

.title-aurora {
    background: linear-gradient(135deg, var(--aurora-teal) 0%, var(--aurora-violet) 50%, var(--aurora-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-forge {
    color: var(--molten-sienna);
    text-shadow: 0 0 30px rgba(212, 96, 10, 0.3);
}

.stratum-body {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.75;
    color: var(--sandstone);
    margin-bottom: 1.5rem;
    max-width: 38em;
}

.mono-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: var(--patina);
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 1.5rem;
}

.domain-mark {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--saddlebrown-rust);
    margin-top: 3rem;
}

/* Stratum Backgrounds */
.stratum-surface {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(139,69,19,0.2) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(212,96,10,0.1) 0%, transparent 50%),
        var(--ferric-black);
}

.stratum-sediment {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(139,69,19,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(184,168,152,0.08) 0%, transparent 50%),
        #1A1410;
}

.stratum-metamorphic {
    background:
        linear-gradient(135deg, rgba(46,139,139,0.08) 0%, rgba(107,78,139,0.08) 50%, rgba(61,139,107,0.08) 100%),
        var(--ferric-black);
}

.crystal-bg {
    background: linear-gradient(135deg, rgba(46,139,139,0.06) 0%, rgba(107,78,139,0.06) 50%, rgba(61,139,107,0.06) 100%);
}

.stratum-igneous {
    background:
        radial-gradient(ellipse at 50% 60%, rgba(212,96,10,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 30%, rgba(139,69,19,0.15) 0%, transparent 50%),
        #1A0E08;
}

.magma-bg {
    animation: magma-pulse 10s ease-in-out infinite;
}

@keyframes magma-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.stratum-vein {
    background:
        linear-gradient(135deg, rgba(46,139,139,0.12) 0%, rgba(107,78,139,0.12) 50%, rgba(61,139,107,0.12) 100%),
        var(--ferric-black);
}

.stratum-forge {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(139,69,19,0.1) 0%, transparent 60%),
        linear-gradient(90deg, var(--ferric-black), #0D0A08);
}

/* Fault Lines */
.fault-line {
    min-width: 8vw;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--ferric-black);
}

.fault-svg {
    width: 80px;
    height: 100%;
}

/* Crystal Elements */
.crystal-cluster {
    position: absolute;
    z-index: 3;
}

.crystal-left { left: 5%; top: 20%; }
.crystal-right { right: 5%; bottom: 15%; }

.crystal {
    width: 0;
    height: 0;
    position: absolute;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform: scale(0.3);
}

.crystal.grown {
    opacity: 1;
    transform: scale(1);
}

.c1 { border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 50px solid rgba(46,139,139,0.15); top: 0; left: 0; }
.c2 { border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 40px solid rgba(107,78,139,0.2); top: 20px; left: 30px; }
.c3 { border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 45px solid rgba(61,139,107,0.15); top: -10px; left: 55px; }
.c4 { border-left: 18px solid transparent; border-right: 18px solid transparent; border-bottom: 55px solid rgba(46,139,139,0.2); top: 0; right: 0; }
.c5 { border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 35px solid rgba(107,78,139,0.15); top: 25px; right: 40px; }
.c6 { border-left: 14px solid transparent; border-right: 14px solid transparent; border-bottom: 48px solid rgba(46,139,139,0.25); top: 0; left: 0; }
.c7 { border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 38px solid rgba(61,139,107,0.2); top: 15px; left: 35px; }
.c8 { border-left: 16px solid transparent; border-right: 16px solid transparent; border-bottom: 52px solid rgba(107,78,139,0.25); top: 0; right: 0; }
.c9 { border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 42px solid rgba(46,139,139,0.2); top: 20px; right: 35px; }
.c10 { border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 35px solid rgba(61,139,107,0.2); top: -5px; right: 70px; }

/* Marble texture overlay */
.stratum::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 30%, rgba(184,168,152,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 70%, rgba(184,168,152,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(184,168,152,0.02) 0%, transparent 60%);
    pointer-events: none;
}

/* Responsive - vertical fallback */
@media (max-width: 768px) {
    body { overflow: auto; height: auto; }
    .h-scroll {
        flex-direction: column;
        width: 100%;
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
    }
    .stratum {
        min-width: 100%;
        min-height: 100vh;
        scroll-snap-align: start;
    }
    .fault-line {
        min-width: 100%;
        height: 80px;
    }
    .fault-svg {
        width: 100%;
        height: 80px;
    }
    .progress-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .magma-bg { animation: none; }
    .crystal { transition: none; opacity: 0.7; transform: scale(1); }
}
