/* ===================================
   economic.wiki - Tropical Noir
   ===================================
   Color Palette:
   Deep Undergrowth   #2B1E16
   Warm Parchment     #FAF0E4
   Sunset Coral       #E66043
   Burnt Sienna       #C95A2F
   Canopy Gold        #E8B84A
   Midnight Moss      #1A2E1A
   Blushing Peach     #F4B99C
   Fog Lilac          #C4A8D4
   =================================== */

:root {
    /* Colors */
    --deep-undergrowth: #2B1E16;
    --warm-parchment: #FAF0E4;
    --sunset-coral: #E66043;
    --burnt-sienna: #C95A2F;
    --canopy-gold: #E8B84A;
    --midnight-moss: #1A2E1A;
    --blushing-peach: #F4B99C;
    --fog-lilac: #C4A8D4;

    /* Timing */
    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
    --smooth-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --entrance-duration: 600ms;
    --micro-duration: 400ms;
    --leaf-drift-min: 4s;
    --leaf-drift-max: 7s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: rgba(43, 30, 22, 0.92);
    background-color: var(--warm-parchment);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--deep-undergrowth);
}

.site-title {
    font-size: clamp(2.4rem, 7vw, 5rem);
    text-align: center;
}

.section-heading {
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    margin-bottom: 1rem;
}

.section-heading--light {
    color: var(--warm-parchment);
}

mark {
    background: linear-gradient(120deg, rgba(230, 96, 67, 0.25) 0%, rgba(230, 96, 67, 0.45) 100%);
    border-radius: 0.3em;
    padding: 0.05em 0.2em;
    color: inherit;
}

p {
    max-width: 62ch;
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

/* Monospace accent for data */
.data-value {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.9em;
    color: var(--burnt-sienna);
}

/* ===================================
   SCENES - General
   =================================== */
.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 1.5rem;
}

/* ===================================
   SCENE 1: THE CANOPY
   =================================== */
.scene--canopy {
    background: var(--warm-parchment);
}

.canopy-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(232, 184, 74, 0.12) 0%, transparent 70%);
    animation: dappled-light 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes dappled-light {
    0% { background-position: 50% 50%; transform: scale(1); }
    25% { background-position: 55% 45%; transform: scale(1.05); }
    50% { background-position: 50% 55%; transform: scale(1.02); }
    75% { background-position: 45% 50%; transform: scale(1.08); }
    100% { background-position: 50% 50%; transform: scale(1); }
}

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

.site-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: rgba(43, 30, 22, 0.7);
    margin-top: 1rem;
    font-style: italic;
}

.floating-leaves {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-leaf {
    position: absolute;
    opacity: 0;
    animation: leaf-drift var(--leaf-drift-min) ease-in-out infinite;
}

@keyframes leaf-drift {
    0% { transform: translateY(0) rotate(0deg); opacity: var(--leaf-opacity, 0.12); }
    50% { transform: translateY(-8px) rotate(5deg); opacity: var(--leaf-opacity, 0.12); }
    100% { transform: translateY(0) rotate(0deg); opacity: var(--leaf-opacity, 0.12); }
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce-hint 2s ease-in-out infinite;
    color: var(--burnt-sienna);
    opacity: 0.5;
}

@keyframes bounce-hint {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ===================================
   BREATHING ZONES
   =================================== */
.breathing-zone {
    position: relative;
    height: 20vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--warm-parchment);
}

.breathing-zone--dark {
    background: linear-gradient(180deg, var(--warm-parchment) 0%, #e8ddd0 50%, var(--midnight-moss) 100%);
}

.breathing-zone--transition {
    background: linear-gradient(180deg, var(--midnight-moss) 0%, #3a4a2a 50%, var(--warm-parchment) 100%);
}

.vine-connector {
    width: 100px;
    height: 100%;
}

.drifting-leaves {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bud-leaf {
    position: absolute;
}

.bud-leaf--1 {
    top: 20%;
    left: calc(50% + 40px);
}

.bud-leaf--2 {
    top: 55%;
    left: calc(50% - 50px);
}

.bud-leaf--3 {
    top: 75%;
    left: calc(50% + 30px);
}

/* ===================================
   SCENE 2: THE MARKETPLACE
   =================================== */
.scene--marketplace {
    background: linear-gradient(180deg, var(--warm-parchment) 0%, var(--blushing-peach) 100%);
    padding-top: 6rem;
    padding-bottom: 6rem;
    gap: 2rem;
}

.marketplace-image {
    width: min(70%, 800px);
    aspect-ratio: 8/5;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.vine-side {
    position: absolute;
    width: 50px;
    height: 400px;
    pointer-events: none;
}

.vine-side--left {
    left: 2%;
    top: 50%;
    transform: translateY(-50%);
}

/* Duotone treatment */
.duotone-container {
    position: relative;
    overflow: hidden;
    background: #888;
}

.duotone-container .duotone-placeholder {
    width: 100%;
    height: 100%;
    display: block;
}

.duotone-container .duotone-placeholder svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: grayscale(100%) contrast(1.1);
    mix-blend-mode: multiply;
}

.duotone-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #E66043;
    mix-blend-mode: multiply;
    z-index: 1;
    pointer-events: none;
}

.duotone-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #E8B84A;
    mix-blend-mode: screen;
    z-index: 2;
    pointer-events: none;
}

/* Leaf Pod Containers */
.leaf-pod {
    background: radial-gradient(ellipse at center, var(--warm-parchment) 0%, #f0e4d4 100%);
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    padding: clamp(2rem, 4vw, 3.5rem);
    max-width: min(680px, 88vw);
    box-shadow: 0 8px 32px rgba(201, 87, 47, 0.15);
    position: relative;
    z-index: 3;
    transition: box-shadow var(--micro-duration) var(--spring-ease),
                border-radius var(--micro-duration) var(--spring-ease),
                border-color var(--micro-duration) var(--spring-ease);
    border: 1px solid transparent;
}

.leaf-pod:hover {
    box-shadow: 0 12px 44px rgba(201, 87, 47, 0.28);
    border-radius: 42% 58% 53% 47% / 48% 42% 58% 52%;
    border-color: rgba(196, 168, 212, 0.4);
}

.leaf-pod--overlay {
    margin-top: -8rem;
}

.leaf-pod--dark {
    background: radial-gradient(ellipse at center, var(--midnight-moss) 0%, #0f1a0f 100%);
    color: var(--warm-parchment);
    border: 1px solid rgba(201, 90, 47, 0.3);
}

.leaf-pod--dark p {
    color: rgba(250, 240, 228, 0.88);
}

.leaf-pod--dark:hover {
    border-color: rgba(196, 168, 212, 0.5);
    box-shadow: 0 12px 44px rgba(196, 168, 212, 0.15);
}

.leaf-pod--large {
    max-width: min(720px, 90vw);
    padding: clamp(2.5rem, 5vw, 4rem);
}

.leaf-pod--final {
    max-width: min(720px, 90vw);
    padding: clamp(2.5rem, 5vw, 4rem);
    border-radius: 45% 55% 50% 50% / 45% 50% 50% 55%;
}

/* Reveal animation */
.reveal-element {
    opacity: 0;
    transform: translateY(12px) scale(0.8);
    transition: opacity var(--entrance-duration) var(--spring-ease),
                transform var(--entrance-duration) var(--spring-ease);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===================================
   SCENE 3: THE ROOT SYSTEM
   =================================== */
.scene--roots {
    background: var(--midnight-moss);
    gap: 3rem;
}

.root-network-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 90, 47, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.root-veins {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.data-figures {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    z-index: 3;
    max-width: min(680px, 88vw);
}

.data-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    background: rgba(26, 46, 26, 0.8);
    border: 1px solid rgba(201, 90, 47, 0.25);
    border-radius: 30% 70% 60% 40% / 55% 35% 65% 45%;
    min-width: 160px;
    transition: border-color var(--micro-duration) var(--spring-ease),
                box-shadow var(--micro-duration) var(--spring-ease);
}

.data-card:hover {
    border-color: rgba(196, 168, 212, 0.4);
    box-shadow: 0 4px 20px rgba(196, 168, 212, 0.1);
}

.data-value {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    color: var(--burnt-sienna);
    line-height: 1.2;
    transition: color 300ms ease;
}

.data-value.pulse {
    color: var(--canopy-gold);
}

.data-label {
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    color: rgba(250, 240, 228, 0.6);
    text-align: center;
    font-weight: 600;
}

/* ===================================
   SCENE 4: THE NEW GROWTH
   =================================== */
.scene--growth {
    background: linear-gradient(180deg, var(--midnight-moss) 0%, #2a3a1a 15%, var(--warm-parchment) 40%, var(--warm-parchment) 100%);
    gap: 3rem;
    padding-top: 8rem;
}

.growth-dawn-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 20%, rgba(232, 184, 74, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.growth-image {
    width: min(60%, 700px);
    aspect-ratio: 2/1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.duotone-container--bright::before {
    background: #E66043;
    opacity: 0.6;
}

.duotone-container--bright::after {
    background: #E8B84A;
    opacity: 0.8;
}

.large-leaves {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* ===================================
   SCENE 5: THE CLEARING
   =================================== */
.scene--clearing {
    background: var(--warm-parchment);
    gap: 3rem;
    padding-bottom: 6rem;
}

.clearing-vein-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.explore-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    z-index: 3;
}

.seed-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--deep-undergrowth);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    transition: color var(--micro-duration) var(--smooth-ease),
                background var(--micro-duration) var(--smooth-ease);
    position: relative;
}

.seed-link:hover {
    color: var(--sunset-coral);
    background: rgba(230, 96, 67, 0.08);
}

.seed-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--canopy-gold);
    transition: transform 300ms var(--spring-ease);
}

.seed-link:hover .seed-icon {
    transform: scale(1.2) rotate(15deg);
}

.seed-link::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12c0 5.5 6 10 10 10 0-4.5-1.5-8.5-4-11C11 8 12 5 12 2z' fill='%23E66043'/%3E%3C/svg%3E") no-repeat center/contain;
    transform: scale(0);
    transition: transform 300ms var(--spring-ease);
    margin-left: 2px;
}

.seed-link:hover::after {
    transform: scale(1);
}

/* ===================================
   SEED NAVIGATION
   =================================== */
.seed-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.seed-nav__trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--warm-parchment);
    box-shadow: 0 4px 20px rgba(201, 87, 47, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--micro-duration) var(--spring-ease),
                box-shadow var(--micro-duration) var(--spring-ease);
    animation: seed-pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes seed-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(232, 184, 74, 0.2); }
    50% { box-shadow: 0 4px 30px rgba(232, 184, 74, 0.45); }
}

.seed-nav__trigger:hover {
    transform: rotate(15deg);
    box-shadow: 0 4px 35px rgba(232, 184, 74, 0.5);
    animation: none;
}

.seed-nav__trigger:active {
    transform: rotate(15deg) translateY(2px);
    filter: brightness(0.95);
}

.seed-nav__menu {
    position: absolute;
    bottom: 0;
    right: 0;
    pointer-events: none;
}

.seed-nav__petal {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--warm-parchment);
    color: var(--deep-undergrowth);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(201, 87, 47, 0.15);
    transform: scale(0);
    opacity: 0;
    transition: transform 300ms var(--spring-ease),
                opacity 300ms var(--smooth-ease),
                background var(--micro-duration) var(--smooth-ease),
                color var(--micro-duration) var(--smooth-ease);
    pointer-events: none;
    text-align: center;
    line-height: 1.1;
}

.seed-nav__petal:hover {
    background: var(--sunset-coral);
    color: var(--warm-parchment);
}

.seed-nav.open .seed-nav__petal {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.seed-nav.open .seed-nav__petal[data-index="0"] {
    bottom: 80px;
    right: 50px;
    transition-delay: 0ms;
}

.seed-nav.open .seed-nav__petal[data-index="1"] {
    bottom: 100px;
    right: -5px;
    transition-delay: 50ms;
}

.seed-nav.open .seed-nav__petal[data-index="2"] {
    bottom: 65px;
    right: -45px;
    transition-delay: 100ms;
}

.seed-nav.open .seed-nav__petal[data-index="3"] {
    bottom: 20px;
    right: -55px;
    transition-delay: 150ms;
}

.seed-nav.open .seed-nav__petal[data-index="4"] {
    bottom: -25px;
    right: -35px;
    transition-delay: 200ms;
}

/* ===================================
   FALLING LEAVES
   =================================== */
.falling-leaves-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.falling-leaf {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

/* ===================================
   BUTTONS (general ripple effect)
   =================================== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: var(--blushing-peach);
    opacity: 0.5;
    transform: scale(0);
    animation: ripple-expand 400ms ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-expand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 640px) {
    .scene {
        padding: 3rem 1rem;
    }

    .marketplace-image {
        width: 92%;
    }

    .growth-image {
        width: 90%;
    }

    .leaf-pod {
        border-radius: 30% 70% 60% 40% / 50% 40% 60% 50%;
        padding: clamp(1.5rem, 3vw, 2.5rem);
    }

    .leaf-pod--overlay {
        margin-top: -4rem;
    }

    .data-figures {
        flex-direction: column;
        align-items: center;
    }

    .data-card {
        min-width: 200px;
    }

    .seed-nav {
        bottom: 1rem;
        right: 1rem;
    }

    .vine-side {
        display: none;
    }
}

@media (max-width: 400px) {
    .leaf-pod {
        border-radius: 24px;
    }
}

/* ===================================
   REDUCED MOTION
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-element {
        opacity: 1;
        transform: none;
    }

    .floating-leaf {
        animation: none;
        opacity: var(--leaf-opacity, 0.12);
    }
}
