/* oning.stream - Geological Reasoning Stream */

:root {
    --surface: #E8E0D4;
    --alluvial: #C4AA82;
    --clay: #6B7B6A;
    --slate: #3A3A42;
    --magma: #2A1A1A;
    --core-bg: #0A0A0A;
    --stream-surface: #8BA4B8;
    --stream-deep: #A0C8E0;
    --text-light: #F2EDE6;
    --text-dark: #2C2C2C;
    --fossil: #B8864A;
    --glow: #7EC8C8;
    --current-text: #2C2C2C;
    --current-stratum: #E8E0D4;
}

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

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    color: var(--current-text);
    background-color: var(--current-stratum);
    overflow-x: hidden;
    transition: background-color 0.8s ease;
}

/* Stream SVG */
#stream-svg {
    position: fixed;
    top: 40vh;
    left: 0;
    width: 100vw;
    height: 120px;
    z-index: 10;
    pointer-events: none;
    transform: translateZ(0);
    will-change: transform;
}

#stream-path {
    transition: d 0.1s ease;
}

/* Scroll Indicator */
#scroll-indicator {
    position: fixed;
    right: 8px;
    top: 20vh;
    height: 60vh;
    width: 4px;
    background: rgba(255,255,255,0.1);
    z-index: 100;
    border-radius: 2px;
}

#scroll-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--current-stratum);
    border-radius: 2px;
    transition: height 0.15s ease, background-color 0.5s ease;
}

.scroll-notch {
    position: absolute;
    left: -3px;
    width: 10px;
    height: 2px;
    background: rgba(255,255,255,0.3);
}

/* Depth Markers */
#depth-markers {
    position: fixed;
    right: 24px;
    top: 20vh;
    height: 60vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.depth-mark {
    font-family: 'Inconsolata', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--stream-surface);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.depth-mark.active {
    opacity: 1;
}

/* Strata base */
.stratum {
    position: relative;
    min-height: 120vh;
    overflow: hidden;
}

.stratum-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    will-change: transform;
}

.stratum-striations {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
}

.stratum-content {
    position: relative;
    z-index: 5;
    padding: 15vh 8vw;
    max-width: 900px;
}

/* Layer 1: Surface */
#surface {
    background: #E8E0D4;
}

#surface .stratum-bg {
    background: #E8E0D4;
}

#surface .stratum-striations {
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 8px,
        rgba(196, 170, 130, 0.03) 8px,
        rgba(196, 170, 130, 0.03) 9px
    );
}

#surface .layer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    color: #2C2C2C;
    margin-bottom: 0.5em;
}

#surface .layer-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.04em;
    color: #8BA4B8;
    margin-bottom: 2em;
}

#surface .reasoning-text {
    max-width: 600px;
    color: #2C2C2C;
}

/* Layer 2: Alluvial */
#alluvial {
    background: #C4AA82;
}

#alluvial .stratum-bg {
    background: #C4AA82;
}

#alluvial .stratum-striations {
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 8px,
        rgba(107, 123, 106, 0.03) 8px,
        rgba(107, 123, 106, 0.03) 9px
    );
}

#alluvial .layer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    color: #2C2C2C;
    margin-bottom: 1.5em;
}

.sediment-text {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.premise {
    color: #2C2C2C;
    font-weight: 400;
    padding-left: 0;
    border-left: 2px solid rgba(139, 164, 184, 0.4);
    padding-left: 1.2em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.premise.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Layer 3: Clay */
#clay {
    background: #6B7B6A;
}

#clay .stratum-bg {
    background: #6B7B6A;
}

#clay .stratum-striations {
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 8px,
        rgba(58, 58, 66, 0.03) 8px,
        rgba(58, 58, 66, 0.03) 9px
    );
}

#clay .layer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    color: #F2EDE6;
    margin-bottom: 1.5em;
}

.logic-chain {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
}

.logic-node {
    color: #F2EDE6;
    padding: 0.8em 1.2em;
    border: 1px solid rgba(160, 200, 224, 0.3);
    border-radius: 4px;
    background: rgba(58, 58, 66, 0.3);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.logic-node.visible {
    opacity: 1;
    transform: translateX(0);
}

.logic-connector {
    width: 200px;
    height: 60px;
    margin-left: 2em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.logic-connector.visible {
    opacity: 1;
}

/* Layer 4: Bedrock */
#bedrock {
    background: #3A3A42;
}

#bedrock .stratum-bg {
    background: #3A3A42;
}

#bedrock .stratum-striations {
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 8px,
        rgba(42, 26, 26, 0.03) 8px,
        rgba(42, 26, 26, 0.03) 9px
    );
}

#bedrock .layer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    color: #A0C8E0;
    margin-bottom: 1.5em;
}

.conclusion-text {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.conclusion {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: #F2EDE6;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1s ease, transform 1s ease;
}

.conclusion.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Layer 5: Magma */
#magma {
    background: #2A1A1A;
}

#magma .stratum-bg {
    background: #2A1A1A;
}

#magma .stratum-striations {
    background: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 8px,
        rgba(10, 10, 10, 0.03) 8px,
        rgba(10, 10, 10, 0.03) 9px
    );
}

#magma .layer-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    color: #7EC8C8;
    margin-bottom: 1.5em;
}

.question-text {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.question {
    color: #F2EDE6;
    opacity: 0.7;
    font-style: italic;
}

/* Layer 6: Core */
#core {
    background: #0A0A0A;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#core .stratum-bg {
    background: #0A0A0A;
}

.core-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 200, 200, 0.3) 0%, rgba(126, 200, 200, 0.05) 40%, transparent 70%);
    animation: core-pulse 4s ease-in-out infinite;
    z-index: 2;
}

@keyframes core-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }
}

#core .stratum-content {
    text-align: center;
    padding: 0;
    z-index: 5;
}

.core-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.08em;
    color: #7EC8C8;
    opacity: 0;
    transition: opacity 2s ease;
}

.core-text.visible {
    opacity: 1;
}

/* Fossil shapes */
.fossil {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
}

/* Stream particles */
.stream-particles {
    position: absolute;
    top: 40vh;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 11;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(160, 200, 224, 0.4);
    top: 50%;
    left: -10px;
    animation: particle-flow var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes particle-flow {
    0% {
        left: -10px;
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        left: 100vw;
        opacity: 0;
    }
}

/* Stream animation */
#stream-svg path {
    animation: stream-drift 20s linear infinite;
}

@keyframes stream-drift {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-15px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .stratum-content {
        padding: 10vh 6vw;
    }

    #depth-markers {
        display: none;
    }

    .logic-connector {
        width: 120px;
    }
}
