/* thethird.quest - Autumn Adventure Magazine */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --deep-bark: #3A2018;
    --warm-ivory: #FAF0E8;
    --terracotta: #C87850;
    --burnt-sienna: #8A4830;
    --dark-earth: #4A3828;
    --autumn-sage: #7A9868;
    --dusty-rose: #D0B8A0;
    --light-parchment: #F0E0D0;
    --fold-line: rgba(208, 184, 160, 0.10);
    --ridge-brown: #8A7060;
}

body {
    background: var(--warm-ivory);
    color: var(--deep-bark);
    font-family: 'Cardo', serif;
    font-size: 1.0625rem;
    line-height: 1.85;
    font-weight: 400;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Noise Texture */
.noise-texture {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Leaf Canvas */
#leaf-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* Spreads */
.spread {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    z-index: 1;
    opacity: 0;
    transform: rotateY(-90deg);
    transform-origin: left center;
    transition: opacity 0.8s ease, transform 0.8s ease;
    background: var(--warm-ivory);
    perspective: 1200px;
}
.spread.active {
    opacity: 1;
    transform: rotateY(0deg);
}
.spread.exit-left {
    opacity: 0;
    transform: rotateY(90deg);
    transform-origin: right center;
}

/* Spread Text */
.spread-text {
    width: 55%;
    padding: 4rem 6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.spread-text.right {
    margin-left: auto;
    margin-right: 6%;
}

/* Spread Atmosphere */
.spread-atmosphere {
    width: 45%;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.spread-atmosphere.left {
    order: -1;
}

/* Fold Line */
.fold-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--fold-line);
    z-index: 3;
}

/* Watercolor Washes */
.watercolor-wash {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
}
.wash-1 { width: 400px; height: 400px; background: var(--terracotta); top: 20%; right: 10%; }
.wash-2 { width: 300px; height: 300px; background: var(--autumn-sage); bottom: 15%; right: 25%; opacity: 0.25; }
.wash-3 { width: 350px; height: 350px; background: var(--burnt-sienna); top: 15%; left: 10%; }
.wash-4 { width: 250px; height: 250px; background: var(--dusty-rose); bottom: 20%; left: 20%; opacity: 0.4; }
.wash-5 { width: 380px; height: 380px; background: var(--autumn-sage); top: 25%; right: 5%; }
.wash-6 { width: 280px; height: 280px; background: var(--terracotta); bottom: 10%; right: 15%; opacity: 0.3; }
.wash-7 { width: 420px; height: 420px; background: var(--dusty-rose); top: 10%; left: 5%; }
.wash-8 { width: 360px; height: 360px; background: var(--burnt-sienna); top: 20%; right: 8%; opacity: 0.3; }
.wash-9 { width: 260px; height: 260px; background: var(--autumn-sage); bottom: 20%; right: 20%; }
.wash-10 { width: 400px; height: 400px; background: var(--terracotta); top: 15%; left: 8%; opacity: 0.3; }

/* Mountain Silhouette */
.mountain-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
}
.mountain-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawMountain 2s ease forwards 0.5s;
}
@keyframes drawMountain {
    to { stroke-dashoffset: 0; }
}

/* Quest Title */
.quest-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 400;
    color: var(--terracotta);
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInTitle 1.5s ease forwards 1s;
}
@keyframes fadeInTitle {
    to { opacity: 1; }
}
.quest-subtitle {
    font-family: 'Cardo', serif;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--dark-earth);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInTitle 1.5s ease forwards 1.5s;
}
.quest-note {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--ridge-brown);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInTitle 1s ease forwards 2s;
}

/* Chapter Styles */
.chapter-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--ridge-brown);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}
.chapter-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    color: var(--deep-bark);
    letter-spacing: 0.02em;
    margin-bottom: 1.25rem;
}
.chapter-body {
    font-family: 'Cardo', serif;
    font-size: 1.0625rem;
    color: #4A3028;
    line-height: 1.85;
    margin-bottom: 1.5rem;
}
.chapter-data {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--burnt-sienna);
    letter-spacing: 0.06em;
}

/* Footer */
.spread-footer {
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-content {
    text-align: center;
}
.footer-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--ridge-brown);
    letter-spacing: 0.06em;
}

/* Navigation Dots */
.spread-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10;
}
.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--burnt-sienna);
    background: transparent;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    padding: 0;
}
.nav-dot.active {
    background: var(--terracotta);
    transform: scale(1.2);
}
.nav-dot:hover {
    background: var(--dusty-rose);
}

/* Responsive */
@media (max-width: 768px) {
    .spread {
        flex-direction: column;
    }
    .spread-text {
        width: 100%;
        padding: 2rem;
        max-width: 100%;
    }
    .spread-atmosphere {
        width: 100%;
        height: 30vh;
        position: absolute;
        top: 0;
        opacity: 0.3;
    }
    .spread-atmosphere.left {
        order: 0;
    }
    .fold-line { display: none; }
    .spread-nav {
        right: 1rem;
    }
}
