/* mystery.boo - Goblincore Forest Floor Oracle */

:root {
    --forest-floor: #141210;
    --deep-bark: #2a2420;
    --branch-brown: #5a4a38;
    --parchment-warm: #d8d4cc;
    --lichen-glow: #a89040;
    --terracotta: #c87850;
    --mushroom-purple: #6a4878;
    --dried-grass: #c8b898;
    --spring-moss: #88CC44;
    --font-display: 'Playfair Display', serif;
    --font-body: 'Crimson Text', serif;
    --font-mono: 'Space Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--forest-floor);
    color: var(--parchment-warm);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.7;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

/* Firefly Cursor */
.firefly {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lichen-glow);
    box-shadow: 0 0 12px rgba(168, 144, 64, 0.6), 0 0 30px rgba(168, 144, 64, 0.3);
    pointer-events: none;
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

.firefly.active {
    opacity: 1;
}

/* ============================================
   Section 1: The Clearing
   ============================================ */

.section-clearing {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.found-objects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.found-obj {
    position: absolute;
    width: 40px;
    height: auto;
    transform: rotate(var(--rot, 0deg));
    opacity: 0;
    animation: foundFade 1.5s ease-out forwards;
}

.found-obj:nth-child(1) { animation-delay: 0.5s; }
.found-obj:nth-child(2) { animation-delay: 0.8s; width: 30px; }
.found-obj:nth-child(3) { animation-delay: 1.1s; width: 20px; }
.found-obj:nth-child(4) { animation-delay: 1.4s; width: 28px; }
.found-obj:nth-child(5) { animation-delay: 1.7s; width: 22px; }

@keyframes foundFade {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

.clearing-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--lichen-glow);
    z-index: 2;
    opacity: 0;
    transform: translateY(60px);
    animation: growUp 1.2s ease-out 0.3s forwards;
}

@keyframes growUp {
    to { opacity: 1; transform: translateY(0); }
}

.clearing-whisper {
    font-family: var(--font-body);
    font-size: 16px;
    font-style: italic;
    color: var(--dried-grass);
    opacity: 0;
    z-index: 2;
    animation: whisperFade 1s ease-out 1.5s forwards;
    margin-top: 12px;
}

@keyframes whisperFade {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

/* ============================================
   Section 2: Mushroom Ring
   ============================================ */

.section-mushrooms {
    padding: 100px 5%;
    position: relative;
    z-index: 1;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--lichen-glow);
    text-align: center;
    margin-bottom: 60px;
}

.riddle-circle {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 28px;
}

.mushroom-card {
    background: var(--deep-bark);
    border: 1px solid rgba(168, 144, 64, 0.1);
    border-radius: 6px;
    padding: 28px 24px;
    text-align: center;
    transition: border-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
}

.mushroom-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease;
}

.mushroom-card:hover {
    border-color: rgba(168, 144, 64, 0.35);
    transform: translateY(-3px);
}

.mushroom-svg {
    width: 44px;
    height: 55px;
    margin: 0 auto 16px;
    display: block;
}

.riddle-text {
    font-family: var(--font-body);
    font-size: 15px;
    font-style: italic;
    color: var(--dried-grass);
    line-height: 1.7;
}

/* ============================================
   Section 3: The Moss Tablet
   ============================================ */

.section-tablet {
    padding: 80px 5%;
    position: relative;
    z-index: 1;
}

.tablet-stone {
    max-width: 650px;
    margin: 0 auto;
    background: var(--deep-bark);
    border: 1px solid rgba(90, 74, 56, 0.3);
    border-radius: 4px;
    padding: 50px 40px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.moss-edge {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--lichen-glow), transparent 30%, var(--lichen-glow) 70%, transparent);
    opacity: 0.15;
}

.moss-top { top: 0; background: linear-gradient(90deg, var(--spring-moss), transparent 30%, var(--spring-moss) 70%, transparent); }
.moss-bottom { bottom: 0; }

.tablet-inscription {
    text-align: center;
}

.inscription-line {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 400;
    color: var(--parchment-warm);
    line-height: 2;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.inscription-line.revealed {
    opacity: 0.85;
}

/* ============================================
   Section 4: Decomposition Notes
   ============================================ */

.section-decomp {
    padding: 80px 5%;
    position: relative;
    z-index: 1;
}

.decomp-entries {
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.decomp-note {
    background: rgba(42, 36, 32, 0.6);
    border-left: 2px solid var(--terracotta);
    padding: 20px 24px;
    border-radius: 2px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.decomp-note.visible {
    opacity: 1;
    transform: translateX(0);
}

.note-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--terracotta);
    letter-spacing: 0.08em;
    text-transform: lowercase;
    display: block;
    margin-bottom: 8px;
}

.note-body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--dried-grass);
    line-height: 1.8;
}

/* ============================================
   Footer
   ============================================ */

.section-footer {
    padding: 50px 5%;
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(90, 74, 56, 0.15);
}

.footer-roots {
    margin-bottom: 20px;
}

.roots-svg {
    width: 200px;
    height: auto;
    display: inline-block;
}

.footer-brand {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--lichen-glow);
    margin-bottom: 4px;
}

.footer-whisper {
    display: block;
    font-family: var(--font-body);
    font-size: 13px;
    font-style: italic;
    color: var(--branch-brown);
    opacity: 0.6;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .riddle-circle {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .tablet-stone {
        padding: 36px 28px;
    }

    .section-mushrooms,
    .section-tablet,
    .section-decomp {
        padding: 60px 4%;
    }
}

@media (max-width: 480px) {
    .riddle-circle {
        grid-template-columns: 1fr;
    }

    .found-obj {
        display: none;
    }
}
