:root {
    --midnight-loam: #0A1C10;
    --deep-emerald: #1B4332;
    --living-chlorophyll: #52B788;
    --pale-lichen: #A7C4A0;
    --golden-spore: #D4A843;
    --bioluminescent-white: #E8F5E2;
    --ancient-bark: #5C3A1E;
    --forest-fog: #1E3A28;
    color-scheme: dark;
}

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

body {
    background-color: var(--midnight-loam);
    color: var(--pale-lichen);
    font-family: 'Source Serif 4', serif;
    font-weight: 300;
    font-size: clamp(1.05rem, 1.8vw, 1.22rem);
    line-height: 1.72;
    overflow-x: hidden;
    letter-spacing: 0.005em;
}

/* Generative Canvas */
#genCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Progress Indicator */
.progress-track {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60vh;
    background: rgba(167, 196, 160, 0.15);
    z-index: 50;
}

.progress-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--pale-lichen);
    opacity: 0.5;
    transition: height 0.1s linear;
}

.progress-diamond {
    position: absolute;
    left: 50%;
    bottom: calc(var(--pos) * 100%);
    transform: translate(-50%, 50%) rotate(45deg);
    width: 6px;
    height: 6px;
    border: 1px solid var(--pale-lichen);
    opacity: 0.4;
}

/* Floating Glyph Layer */
.glyph-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.hex-mote {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0.06;
    animation: moteFloat 20s linear infinite;
}

@keyframes moteFloat {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.06; }
    90% { opacity: 0.06; }
    100% { transform: translateY(-100px) rotate(72deg); opacity: 0; }
}

/* Epochs */
.epoch {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12rem 24px;
}

.epoch-column {
    width: 65%;
    max-width: 780px;
    background: rgba(10, 28, 16, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 64px 48px;
    border-radius: 2px;
    position: relative;
    mask-image: radial-gradient(ellipse at center, black 70%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 70%, transparent 100%);
}

.epoch-column-deep {
    background: rgba(10, 28, 16, 0.88);
}

.epoch-column-narrow {
    max-width: 580px;
    width: 50%;
}

/* Display Headings */
.display-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: clamp(2.6rem, 5.5vw, 4.8rem);
    letter-spacing: 0.03em;
    line-height: 1.08;
    color: var(--bioluminescent-white);
    margin-bottom: 48px;
}

.display-heading-final {
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
}

/* Section Headings */
.section-heading {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.03em;
    line-height: 1.15;
    color: var(--living-chlorophyll);
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.section-heading.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Section Label */
.section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pale-lichen);
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 1s ease 0.2s;
}

.section-label.revealed {
    opacity: 0.7;
}

/* Body Text */
.body-text {
    font-family: 'Source Serif 4', serif;
    font-weight: 300;
    max-width: 62ch;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.body-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.body-text-final {
    color: var(--bioluminescent-white);
}

/* Timestamp */
.timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pale-lichen);
    margin-bottom: 32px;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.timestamp.revealed {
    opacity: 0.6;
}

/* Pull Quote */
.pull-quote {
    font-family: 'Commissioner', sans-serif;
    font-weight: 100;
    font-size: 2.2rem;
    line-height: 1.3;
    color: var(--golden-spore);
    border-left: 2px solid var(--living-chlorophyll);
    padding-left: 24px;
    margin: 48px 0;
    transform: rotate(-1.5deg);
    opacity: 0;
    transition: opacity 1.5s ease;
}

.pull-quote.revealed {
    opacity: 1;
}

/* Card-Flip Sentinels */
.flip-sentinel {
    position: relative;
    z-index: 2;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Closing Cell */
.closing-cell {
    width: 100px;
    height: 100px;
    margin: 48px auto 0;
    position: relative;
}

.closing-cell svg {
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .epoch {
        padding: 6rem 16px;
    }

    .epoch-column {
        width: 100%;
        padding: 32px 24px;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .epoch-column-narrow {
        width: 100%;
    }

    .progress-track {
        display: none;
    }

    .pull-quote {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .section-heading,
    .body-text,
    .section-label,
    .timestamp,
    .pull-quote {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hex-mote {
        animation: none;
        display: none;
    }

    .display-heading {
        opacity: 1;
    }
}
