/* ==========================================================================
   ppuzzl.party — Botanical Cool-Gray Garden
   ========================================================================== */

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

/* ---------- Custom Properties ---------- */
:root {
    --storm-dark: #1A2028;
    --cool-slate: #404850;
    --greenhouse-grey: #687880;
    --specimen-silver: #A0A8B0;
    --garden-mist: #F4F6F8;
    --petal-white: #FAFBFC;
    --botanical-green: #508060;
    --glitch-magenta: #C04080;
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--garden-mist);
    color: var(--cool-slate);
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Greenhouse Grid Overlay ---------- */
#greenhouse-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image:
        linear-gradient(to right, #A0A8B0 1px, transparent 1px),
        linear-gradient(to bottom, #A0A8B0 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.04;
}

/* ---------- Garden Mist (Loading Overlay) ---------- */
#garden-mist {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--garden-mist);
    z-index: 1000;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.5s ease-out;
}

#garden-mist.cleared {
    opacity: 0;
}

/* ---------- Specimen Display (Main Container) ---------- */
#specimen-display {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 clamp(40px, 8vw, 120px);
    position: relative;
    z-index: 2;
}

/* ---------- Specimen Sections ---------- */
.specimen-section {
    padding-top: clamp(80px, 12vh, 140px);
    padding-bottom: clamp(80px, 12vh, 140px);
    text-align: center;
    position: relative;
}

#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
}

/* ---------- Typography ---------- */
.display-heading {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    color: var(--storm-dark);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease-out;
}

.body-text {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.85;
    color: var(--cool-slate);
    max-width: 520px;
    margin: 0 auto 2rem;
}

.body-text--small {
    font-size: clamp(0.82rem, 1vw, 0.95rem);
    line-height: 1.7;
}

.specimen-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--greenhouse-grey);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.2rem;
    display: block;
}

/* ---------- Magnetic Elements ---------- */
.magnetic-element {
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* ---------- Botanical Illustrations ---------- */
.botanical-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2.5rem auto;
}

.plant-svg {
    width: 140px;
    height: auto;
}

.card-plant {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.wide-plant-svg {
    width: 260px;
    height: auto;
}

.footer-plant-svg {
    width: 80px;
    height: auto;
}

/* ---------- Glitch-Art Botanical Corruption ---------- */
.glitch-botanical .glitch-layer {
    transition: opacity 0.05s;
}

@keyframes botanicalGlitch {
    0%, 92%, 100% {
        opacity: 0;
        transform: translate(0, 0);
    }
    93% {
        opacity: 0.8;
        transform: translate(3px, -1px);
    }
    94% {
        opacity: 0;
        transform: translate(-2px, 2px);
    }
    95% {
        opacity: 0.6;
        transform: translate(1px, -3px);
    }
    96% {
        opacity: 0;
        transform: translate(0, 0);
    }
}

.glitch-botanical .glitch-layer {
    animation: botanicalGlitch 8s ease-in-out infinite;
}

/* Offset each plant's glitch timing */
#plant-2 .glitch-layer { animation-delay: -2s; }
#plant-3 .glitch-layer { animation-delay: -4s; }
#plant-4 .glitch-layer { animation-delay: -6s; }
#plant-5 .glitch-layer { animation-delay: -1s; }
#plant-6 .glitch-layer { animation-delay: -3s; }

/* ---------- Specimen Grid ---------- */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 40px);
    margin-top: 3rem;
}

.specimen-card {
    background: var(--petal-white);
    border: 1px solid rgba(160, 168, 176, 0.2);
    padding: clamp(20px, 3vw, 32px) clamp(12px, 2vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
}

.specimen-card:hover {
    box-shadow: 0 8px 32px rgba(26, 32, 40, 0.06);
}

.specimen-card .specimen-tag {
    margin-bottom: 0.6rem;
    font-size: 0.65rem;
}

.specimen-card .body-text {
    margin-bottom: 0;
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    line-height: 1.65;
}

/* ---------- Archive Entries ---------- */
.archive-entries {
    margin-top: 3rem;
    border-top: 1px solid rgba(160, 168, 176, 0.15);
}

.archive-entry {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(160, 168, 176, 0.12);
    transition: transform 0.15s ease-out;
    gap: 1rem;
}

.archive-entry .specimen-tag {
    margin-bottom: 0;
    flex-shrink: 0;
    min-width: 60px;
}

.archive-name {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    color: var(--storm-dark);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    flex: 1;
    text-align: left;
}

.archive-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.68rem;
    color: var(--specimen-silver);
    letter-spacing: 0.08em;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ---------- Footer ---------- */
#garden-footer {
    padding-bottom: clamp(60px, 10vh, 120px);
}

#garden-footer .specimen-tag {
    margin-bottom: 0.4rem;
}

#garden-footer .body-text {
    margin-bottom: 0;
    color: var(--specimen-silver);
}

/* ---------- Hero entrance animations ---------- */
#hero .specimen-tag,
#hero .display-heading,
#hero .body-text,
#hero .botanical-illustration {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#hero.visible .specimen-tag {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

#hero.visible .display-heading {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

#hero.visible .body-text {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

#hero.visible .botanical-illustration {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.2s;
}

/* ---------- Scroll reveal for other sections ---------- */
#exhibition,
#garden,
#archive,
#garden-footer {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

#exhibition.visible,
#garden.visible,
#archive.visible,
#garden-footer.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .archive-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        text-align: left;
    }

    .archive-date {
        align-self: flex-start;
    }

    .wide-plant-svg {
        width: 200px;
    }
}

@media (max-width: 480px) {
    #specimen-display {
        padding: 0 clamp(20px, 6vw, 40px);
    }
}
