/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #0a0a0a;
    --bark: #1a1610;
    --gold: #c9a84c;
    --muted-gold: #8a7a42;
    --parchment: #e8e0d0;
    --brass: #b8a456;
    --ember: #c45a28;
    --green: #3a5a2a;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background: var(--black);
    color: var(--parchment);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* ===== CANOPY HEADER ===== */
#canopy {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 100;
    background: var(--black);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

.canopy-inner {
    max-width: 960px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.logo {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--gold);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 2px;
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
}

.tree-dot {
    margin: 0 1px;
}

.progress-bar {
    display: flex;
    gap: 4px;
}

.progress-segment {
    width: 32px;
    height: 3px;
    background: rgba(201, 168, 76, 0.15);
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.progress-segment.active {
    background: var(--gold);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.25);
}

.progress-segment.filled {
    background: var(--muted-gold);
}

/* ===== TRAIL SVG ===== */
.trail-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#trailPath {
    stroke: var(--gold);
    stroke-width: 1;
    filter: drop-shadow(0 0 2px rgba(201, 168, 76, 0.3));
}

/* ===== SEAL SECTION ===== */
.seal-section {
    padding-top: 120px;
    padding-bottom: 40px;
    display: flex;
    justify-content: center;
}

.quest-seal {
    opacity: 0.6;
    transition: opacity 0.3s;
}

/* ===== OPENING ===== */
.opening {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
}

.opening-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.95;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
    margin-bottom: 24px;
}

.opening-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
}

.opening-title .char.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.opening-subtitle {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.15em;
    color: var(--muted-gold);
    font-size: 1.1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}

.opening.visible .opening-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* ===== STATIONS ===== */
.station {
    max-width: 960px;
    margin: 80px auto;
    padding: 0 24px;
    position: relative;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.station.visible {
    opacity: 1;
}

.station-content {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.station-left .station-content {
    flex-direction: row;
    transform: translateX(-60px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.station-right .station-content {
    flex-direction: row;
    transform: translateX(60px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.station.visible .station-content {
    transform: translateX(0);
}

.station-border {
    position: absolute;
    top: 0;
    width: 1px;
    height: 0;
    background: var(--muted-gold);
    box-shadow: 0 0 1px rgba(201, 168, 76, 0.6);
    transition: height 0.3s ease, background 0.2s ease;
}

.station-left .station-border {
    left: 24px;
}

.station-right .station-border {
    right: 24px;
}

.station.visible .station-border {
    height: 100%;
}

.station:hover .station-border {
    background: var(--gold);
}

/* Specimen Plate */
.specimen-plate {
    flex: 0 0 280px;
    position: relative;
}

.specimen-image {
    aspect-ratio: 3 / 4;
    border: 0.5px solid var(--muted-gold);
    overflow: hidden;
    background: var(--black);
    position: relative;
    opacity: 0;
    transition: opacity 0.4s ease 0.3s, filter 0.2s ease;
}

.station.visible .specimen-image {
    opacity: 1;
}

.station:hover .specimen-image {
    filter: brightness(1.05);
}

.duotone-tree {
    width: 100%;
    height: 100%;
}

.specimen-caption {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.specimen-number,
.specimen-coords {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--brass);
    letter-spacing: 0.05em;
}

/* Station Text */
.station-text {
    flex: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease 0.5s, transform 0.35s ease 0.5s;
}

.station.visible .station-text {
    opacity: 1;
    transform: translateY(0);
}

.station-label {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.15em;
    color: var(--muted-gold);
    font-size: 12px;
    display: block;
    margin-bottom: 12px;
}

.station-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.95;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
    margin-bottom: 20px;
}

.station-body {
    color: var(--parchment);
    font-size: 0.95rem;
    margin-bottom: 24px;
    max-width: 480px;
}

.station-data {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.data-point {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-label {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.15em;
    color: var(--muted-gold);
    font-size: 10px;
}

.data-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--brass);
}

/* Root Circuit */
.root-circuit {
    margin-top: 16px;
    height: 40px;
    opacity: 0.5;
}

.root-circuit svg {
    width: 100%;
    height: 100%;
}

/* Gold Dust Particles */
.gold-dust {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.station:hover .gold-dust {
    opacity: 1;
}

.gold-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--gold);
    animation: dustFloat 1.5s ease-out forwards;
}

@keyframes dustFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.5); }
}

/* ===== CLEARINGS ===== */
.clearing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    padding: 48px 24px;
}

.clearing-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    pointer-events: none;
}

.clearing-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.clearing-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 7rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 0.95;
    color: var(--gold);
    text-shadow: 0 0 30px rgba(201, 168, 76, 0.15);
    margin-bottom: 40px;
}

.clearing-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px);
}

.clearing-title .char.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.clearing-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 350;
    color: var(--parchment);
    font-size: 1.1rem;
    opacity: 0.7;
    margin-top: 20px;
}

.clearing-image {
    max-width: 300px;
    margin: 0 auto;
    opacity: 0.4;
}

.clearing-image svg {
    width: 100%;
    height: auto;
}

/* Trail Markers */
.trail-marker {
    position: absolute;
    bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.marker-direction {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-size: 8px;
    color: var(--muted-gold);
    letter-spacing: 0.15em;
}

.marker-distance {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--brass);
    opacity: 0.6;
}

.clearing-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Final Clearing */
.clearing-final {
    min-height: 80vh;
}

.quest-seal-final {
    margin-top: 40px;
    opacity: 0.7;
}

/* ===== FOOTER ===== */
#footer {
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(201, 168, 76, 0.1);
}

.footer-text {
    font-family: 'Oswald', sans-serif;
    font-weight: 300;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.15em;
    color: var(--muted-gold);
    font-size: 11px;
}

.footer-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--brass);
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .station-content {
        flex-direction: column !important;
    }

    .station-left .station-content,
    .station-right .station-content {
        transform: translateX(0);
    }

    .specimen-plate {
        flex: none;
        width: 100%;
    }

    .station {
        border-left: 2px solid var(--gold);
        margin-left: 0;
        padding-left: 20px;
    }

    .station-border {
        display: none;
    }

    .station-left .station-content,
    .station-right .station-content {
        flex-direction: column !important;
    }

    .clearing-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .progress-bar {
        position: fixed;
        bottom: 16px;
        right: 16px;
        top: auto;
        flex-direction: column;
        z-index: 100;
        background: var(--black);
        padding: 8px;
        border-radius: 12px;
        border: 1px solid rgba(201, 168, 76, 0.2);
    }

    .progress-segment {
        width: 3px;
        height: 16px;
    }

    #canopy .progress-bar {
        display: none;
    }
}
