/* yongzoon.net — A Digital Archive of Time */
/* Geological Cross-Section Stratigraphy */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    line-height: 1.8;
    background: #F5E6D0;
    overflow-x: hidden;
}

/* ----- Stratum Color System ----- */
:root {
    --s1-bg: #F5E6D0;
    --s1-text: #5A4030;
    --s1-accent: #C4956A;

    --s2-bg: #D4C4A8;
    --s2-text: #4A3A28;
    --s2-accent: #8B7355;

    --s3-bg: #B8A88C;
    --s3-text: #3A2A18;
    --s3-accent: #6B5B45;

    --s4-bg: #6B6050;
    --s4-text: #E8E0D0;
    --s4-accent: #A09070;

    --s5-bg: #2A2520;
    --s5-text: #C8C0B0;
    --s5-accent: #5A5040;

    --formation-1-2: #8B7355;
    --formation-2-3: #7A6A4A;
    --formation-3-4: #5A5040;
    --formation-4-5: #3A3530;
}

/* ----- Strata Container ----- */
.strata-container {
    position: relative;
    width: 100%;
}

/* ----- Stratum Section ----- */
.stratum {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0 80px;
}

.stratum-1 {
    background: var(--s1-bg);
    color: var(--s1-text);
    --stratum-accent: var(--s1-accent);
    justify-content: flex-start;
    padding-top: 18vh;
}

.stratum-2 {
    background: var(--s2-bg);
    color: var(--s2-text);
    --stratum-accent: var(--s2-accent);
    justify-content: flex-start;
    padding-top: 32vh;
}

.stratum-3 {
    background: var(--s3-bg);
    color: var(--s3-text);
    --stratum-accent: var(--s3-accent);
    justify-content: flex-start;
    padding-top: 42vh;
}

.stratum-4 {
    background: var(--s4-bg);
    color: var(--s4-text);
    --stratum-accent: var(--s4-accent);
    justify-content: flex-start;
    padding-top: 52vh;
}

.stratum-5 {
    background: var(--s5-bg);
    color: var(--s5-text);
    --stratum-accent: var(--s5-accent);
    justify-content: flex-start;
    padding-top: 60vh;
}

/* ----- Stratigraphy Marks (horizontal lines pattern) ----- */
.stratigraphy-marks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.stratum-1 .stratigraphy-marks,
.stratum-2 .stratigraphy-marks {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 7.5px,
        rgba(0, 0, 0, 0.0) 7.5px,
        currentColor 7.5px,
        currentColor 8px
    );
    opacity: 0.10;
}

.stratum-3 .stratigraphy-marks {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 9.5px,
        currentColor 9.5px,
        currentColor 10px
    );
    opacity: 0.12;
}

.stratum-4 .stratigraphy-marks,
.stratum-5 .stratigraphy-marks {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 11.5px,
        currentColor 11.5px,
        currentColor 12px
    );
    opacity: 0.10;
}

/* ----- Erosion Particles ----- */
.erosion-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* ----- Clock Mechanism Fragments ----- */
.clock-mechanism {
    position: absolute;
    width: 280px;
    height: 280px;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    color: var(--stratum-accent);
    opacity: 0.20;
    z-index: 3;
    pointer-events: none;
}

.clock-mechanism .rotor {
    transform-origin: 100px 100px;
    animation: geologicalRotate 120s linear infinite;
}

.mechanism-2 .rotor {
    animation-duration: 130s;
    animation-direction: reverse;
}
.mechanism-3 .rotor {
    animation-duration: 140s;
}
.mechanism-4 .rotor {
    animation-duration: 150s;
    animation-direction: reverse;
}
.mechanism-5 .rotor {
    animation-duration: 160s;
}

@keyframes geologicalRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ----- Stratum Content ----- */
.stratum-content {
    position: relative;
    z-index: 4;
    max-width: 560px;
    margin-left: 8%;
}

.formation-name {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stratum-accent);
    margin-bottom: 24px;
    opacity: 0.85;
}

.stratum-title {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 52px;
    line-height: 1.1;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}

.stratum-1 .stratum-title { color: #3A2A18; }
.stratum-2 .stratum-title { color: #2A1F10; }
.stratum-3 .stratum-title { color: #2A1810; }
.stratum-4 .stratum-title { color: #F5E6D0; }
.stratum-5 .stratum-title { color: #E8DFCB; }

.time-label {
    font-family: 'Azeret Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--stratum-accent);
    margin-bottom: 32px;
    letter-spacing: 0.04em;
}

.time-label sup {
    font-size: 10px;
    vertical-align: super;
}

.stratum-text {
    font-family: 'Literata', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 18px;
}

.stratum-1 .stratum-text { color: #6A4F38; }
.stratum-2 .stratum-text { color: #5A4730; }
.stratum-3 .stratum-text { color: #4A3826; }
.stratum-4 .stratum-text { color: #D8D0C0; }
.stratum-5 .stratum-text { color: #B8B0A0; }

.end-mark {
    margin-top: 40px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--stratum-accent);
    text-transform: uppercase;
    opacity: 0.7;
}

/* ----- Formation Lines (between strata) ----- */
.formation-line {
    position: relative;
    width: 100%;
    height: 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.formation-line svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.formation-line.visible svg {
    opacity: 1;
}

.formation-line .formation-label {
    position: relative;
    z-index: 2;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: var(--label-bg, #EAD9BD);
    padding: 4px 16px;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.4s;
}

.formation-line.visible .formation-label {
    opacity: 0.85;
}

#formation-1 {
    background: linear-gradient(to bottom, var(--s1-bg) 0%, var(--s1-bg) 50%, var(--s2-bg) 50%, var(--s2-bg) 100%);
    color: var(--formation-1-2);
}
#formation-1 .formation-label {
    background: var(--s1-bg);
    color: var(--formation-1-2);
}

#formation-2 {
    background: linear-gradient(to bottom, var(--s2-bg) 0%, var(--s2-bg) 50%, var(--s3-bg) 50%, var(--s3-bg) 100%);
    color: var(--formation-2-3);
}
#formation-2 .formation-label {
    background: var(--s2-bg);
    color: var(--formation-2-3);
}

#formation-3 {
    background: linear-gradient(to bottom, var(--s3-bg) 0%, var(--s3-bg) 50%, var(--s4-bg) 50%, var(--s4-bg) 100%);
    color: var(--formation-3-4);
}
#formation-3 .formation-label {
    background: var(--s3-bg);
    color: var(--formation-3-4);
}

#formation-4 {
    background: linear-gradient(to bottom, var(--s4-bg) 0%, var(--s4-bg) 50%, var(--s5-bg) 50%, var(--s5-bg) 100%);
    color: var(--formation-4-5);
}
#formation-4 .formation-label {
    background: var(--s4-bg);
    color: #C8C0B0;
}

/* ----- Core Sample Navigation ----- */
.core-sample {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.core-strip {
    width: 20px;
    flex-shrink: 0;
    transition: filter 0.3s ease;
}

.core-strip:hover {
    filter: brightness(1.15);
}

.core-strip-1 { background: var(--s1-bg); }
.core-strip-2 { background: var(--s2-bg); }
.core-strip-3 { background: var(--s3-bg); }
.core-strip-4 { background: var(--s4-bg); }
.core-strip-5 { background: var(--s5-bg); }

.core-indicator {
    position: absolute;
    left: -3px;
    width: 26px;
    height: 4px;
    background: #FFFFFF;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    top: 0;
    transition: top 0.08s linear;
    pointer-events: none;
}

/* ----- Site Header ----- */
.site-header {
    position: fixed;
    top: 32px;
    left: 40px;
    z-index: 90;
    pointer-events: none;
    mix-blend-mode: multiply;
    transition: color 0.6s ease;
}

.site-mark {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: #3A2A18;
    transition: color 0.6s ease;
}

.site-subtitle {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #6B5B45;
    margin-top: 4px;
    transition: color 0.6s ease;
}

.site-header.deep .site-mark {
    color: #E8DFCB;
}
.site-header.deep .site-subtitle {
    color: #A09070;
}

/* ----- Depth Reading ----- */
.depth-reading {
    position: fixed;
    bottom: 32px;
    left: 40px;
    z-index: 90;
    font-family: 'Azeret Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #6B5B45;
    transition: color 0.6s ease;
    text-transform: uppercase;
}

.depth-reading.deep {
    color: #A09070;
}

.depth-label {
    opacity: 0.6;
    margin-right: 8px;
}

.depth-value {
    font-weight: 400;
}

/* ----- Erosion Particle Element (created by JS) ----- */
.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--stratum-accent);
    pointer-events: none;
}

/* ----- Reveal animation for stratum content ----- */
.stratum-content {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1.4s ease-out, transform 1.4s ease-out;
}

.stratum.in-view .stratum-content {
    opacity: 1;
    transform: translateY(0);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .stratum {
        padding: 0 32px;
    }

    .stratum-content {
        margin-left: 0;
        max-width: 100%;
    }

    .stratum-title {
        font-size: 38px;
    }

    .clock-mechanism {
        width: 180px;
        height: 180px;
        right: -40px;
        opacity: 0.12;
    }

    .core-sample {
        right: 8px;
    }

    .site-header {
        left: 24px;
        top: 20px;
    }

    .site-mark {
        font-size: 16px;
    }

    .depth-reading {
        left: 24px;
        bottom: 20px;
    }
}
