/* recycle.digital — styles.css */

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

:root {
    --parchment: #f3ede4;
    --moss-blush: #e8dfd3;
    --canopy-green: #4a5545;
    --warm-charcoal: #5a5650;
    --sage: #7d8b72;
    --spore-violet: #c8b8d4;
    --petal-rose: #e6c8c3;
    --brass: #8b7e6a;
    --mycelium: #c9b99a;
    --earth: #3a332c;
    --green-tint: #d8e0d2;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--parchment);
    font-family: 'Inter', sans-serif;
    color: var(--warm-charcoal);
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* Specimen Index */
#specimen-index {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
}

.index-pill {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: rgba(243, 237, 228, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1), height 400ms cubic-bezier(0.22, 1, 0.36, 1), border-radius 400ms ease;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 85, 69, 0.08);
}

.index-icon {
    color: var(--canopy-green);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.index-list {
    list-style: none;
    display: none;
    padding: 0.5rem 1rem;
    opacity: 0;
    transition: opacity 200ms ease 200ms;
}

.index-list li {
    margin: 0.4rem 0;
    transform: translateX(-8px);
    opacity: 0;
    transition: transform 300ms ease, opacity 300ms ease;
}

.index-pill:hover {
    width: 240px;
    height: auto;
    min-height: 48px;
    border-radius: 16px;
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
}

.index-pill:hover .index-list {
    display: block;
    opacity: 1;
}

.index-pill:hover .index-list li {
    transform: translateX(0);
    opacity: 1;
}

.index-pill:hover .index-list li:nth-child(1) { transition-delay: 100ms; }
.index-pill:hover .index-list li:nth-child(2) { transition-delay: 150ms; }
.index-pill:hover .index-list li:nth-child(3) { transition-delay: 200ms; }
.index-pill:hover .index-list li:nth-child(4) { transition-delay: 250ms; }
.index-pill:hover .index-list li:nth-child(5) { transition-delay: 300ms; }

.index-list a {
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--sage);
    letter-spacing: 0.03em;
}

.index-list a:hover {
    color: var(--canopy-green);
}

/* Spore Particle Field */
#spore-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.spore-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--spore-violet);
    pointer-events: none;
    animation: spore-drift linear infinite;
}

@keyframes spore-drift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--spore-opacity, 0.3);
    }
    90% {
        opacity: var(--spore-opacity, 0.3);
    }
    100% {
        transform: translateY(-100vh) translateX(var(--spore-drift-x, 20px));
        opacity: 0;
    }
}

@keyframes spore-drift-down {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: var(--spore-opacity, 0.3);
    }
    90% {
        opacity: var(--spore-opacity, 0.3);
    }
    100% {
        transform: translateY(100vh) translateX(var(--spore-drift-x, 20px));
        opacity: 0;
    }
}

/* Canopy Panel */
.canopy-panel {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(175deg, #f3ede4 0%, #e8dfd3 40%, #d8e0d2 100%);
    position: relative;
    overflow: hidden;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(3.5rem, 10vw, 9rem);
    color: var(--canopy-green);
    letter-spacing: -0.02em;
    line-height: 0.92;
    animation: hero-scale 3s ease-out forwards;
    position: relative;
    z-index: 2;
}

@keyframes hero-scale {
    from { transform: scale(0.95); opacity: 0.7; }
    to { transform: scale(1); opacity: 1; }
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--sage);
    letter-spacing: 0.03em;
    opacity: 0;
    animation: fade-in 1.5s ease forwards 1.5s;
    position: relative;
    z-index: 2;
    margin-top: 1rem;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.leaf-sequence {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0.4;
}

.leaf-svg {
    width: 200px;
    height: 200px;
    animation: leaf-breathe 12s ease-in-out infinite;
}

@keyframes leaf-breathe {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    25% { transform: scale(1.05); opacity: 0.6; }
    50% { transform: scale(0.95); opacity: 0.3; }
    75% { transform: scale(1.02); opacity: 0.5; }
}

.leaf-sequence.reverse .leaf-svg {
    animation: leaf-breathe-reverse 12s ease-in-out infinite;
}

@keyframes leaf-breathe-reverse {
    0%, 100% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.scroll-chevron {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: chevron-pulse 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(6px); }
}

/* Root Network Strips */
.root-strip {
    width: 100%;
    height: 80px;
    overflow: hidden;
    background: var(--parchment);
}

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

.root-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease;
}

.root-path.animate {
    stroke-dashoffset: 0;
}

.rp2 { transition-delay: 400ms; }
.rp3 { transition-delay: 800ms; }
.rp4 { transition-delay: 1200ms; }

/* Specimen Grid */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2px;
    background: var(--mycelium);
    padding: 2px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Panel Base */
.panel {
    background: var(--parchment);
    padding: 2rem;
    position: relative;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1), opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 400ms ease;
}

.panel.visible {
    transform: scale(1);
    opacity: 1;
}

.panel:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(74, 85, 69, 0.12);
    z-index: 10;
}

.panel:hover .mushroom-glyph {
    transform: rotate(8deg);
}

/* Panel Corners */
.panel-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.panel-corner.tl {
    top: 8px;
    left: 8px;
    border-top: 1px solid var(--mycelium);
    border-left: 1px solid var(--mycelium);
}

.panel-corner.tr {
    top: 8px;
    right: 8px;
    border-top: 1px solid var(--mycelium);
    border-right: 1px solid var(--mycelium);
}

.panel-corner.bl {
    bottom: 8px;
    left: 8px;
    border-bottom: 1px solid var(--mycelium);
    border-left: 1px solid var(--mycelium);
}

.panel-corner.br {
    bottom: 8px;
    right: 8px;
    border-bottom: 1px solid var(--mycelium);
    border-right: 1px solid var(--mycelium);
}

/* Panel Types */
.understory-panel {
    min-height: 300px;
    box-shadow: inset 0 2px 16px rgba(74, 85, 69, 0.12);
}

.floor-panel {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.blush-bg {
    background: rgba(230, 200, 195, 0.3);
}

/* Mushroom Glyph */
.mushroom-glyph {
    width: 32px;
    height: 32px;
    margin-bottom: 1rem;
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Panel Labels */
.panel-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass);
    display: block;
    margin-bottom: 0.75rem;
}

/* Panel Titles */
.panel-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--canopy-green);
    letter-spacing: -0.02em;
    line-height: 0.92;
    margin-bottom: 1rem;
}

/* Panel Body */
.panel-body {
    color: var(--warm-charcoal);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 500ms ease, opacity 500ms ease;
}

.panel.visible .panel-body {
    transform: translateY(0);
    opacity: 1;
}

/* Data Numbers */
.data-number {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--canopy-green);
    line-height: 1;
    display: block;
    margin: 0.5rem 0;
}

.data-unit {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brass);
}

/* Compost Panel */
.compost-panel {
    width: 100%;
    min-height: 60vh;
    background: var(--earth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
}

.compost-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--parchment);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-align: center;
    max-width: 700px;
    margin-bottom: 2rem;
}

.compost-panel .leaf-sequence {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    opacity: 0.6;
    margin: 2rem 0;
}

.compost-panel .leaf-svg {
    width: 120px;
    height: 120px;
}

.compost-panel .leaf-svg path,
.compost-panel .leaf-svg circle {
    stroke: var(--brass);
}

.compost-footer {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--brass);
    letter-spacing: 0.03em;
    margin-top: 2rem;
}

/* Spore Burst (hover effect) */
.spore-burst {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--spore-violet);
    pointer-events: none;
    animation: spore-burst-anim 2s ease-out forwards;
}

@keyframes spore-burst-anim {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    100% {
        transform: translate(var(--burst-x, 50px), var(--burst-y, -50px)) scale(0);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        background: transparent;
        padding: 16px;
    }

    .root-strip {
        height: 48px;
    }

    #specimen-index {
        top: auto;
        bottom: 1rem;
        right: 50%;
        transform: translateX(50%);
    }
}
