/* ============================================
   p9.rs - Botanical Luxury Greenhouse
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Typography Colors */
    --color-cream-light: #F0E8D8;
    --color-muted-gold: #A09878;
    --color-candy-pink: #F04080;
    --color-candy-yellow: #F0D040;
    --color-candy-cyan: #40D0D0;

    /* Background Colors */
    --color-dark-earth: #0C0A08;
    --color-green-black: #080C08;
    --color-leaf-green: #60A040;
    --color-scaffolding: #404030;

    /* Typography */
    --font-family-mono: 'JetBrains Mono', monospace;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-bold: 700;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-mono);
    background: var(--color-dark-earth);
    color: var(--color-muted-gold);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Geometric Scaffolding Background --- */
.scaffolding-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

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

.scaffold-shape {
    fill: none;
    stroke: var(--color-scaffolding);
    stroke-width: 1;
    opacity: 0.06;
}

/* --- Tier (Section) Base --- */
.tier {
    position: relative;
    width: 100%;
    padding: clamp(80px, 10vw, 140px) 0;
    z-index: 1;
}

.tier--dark-earth {
    background: var(--color-dark-earth);
}

.tier--green-black {
    background: var(--color-green-black);
}

.tier--colophon {
    padding: clamp(40px, 6vw, 80px) 0;
}

.tier__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 60px);
    position: relative;
}

/* --- Wave Dividers --- */
.wave-divider {
    position: absolute;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.wave-divider--top {
    top: 0;
}

.wave-divider--bottom {
    bottom: 0;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

.wave-path {
    fill: var(--color-leaf-green);
    opacity: 0.1;
    animation: waveOscillate 8s ease-in-out infinite alternate;
}

@keyframes waveOscillate {
    0% {
        d: path("M0,30 C240,0 480,60 720,30 C960,0 1200,60 1440,30 L1440,60 L0,60 Z");
    }
    100% {
        d: path("M0,30 C240,60 480,0 720,30 C960,60 1200,0 1440,30 L1440,60 L0,60 Z");
    }
}

/* --- Typography --- */
.specimen-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--color-candy-pink);
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.tier__heading {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-cream-light);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tier__body {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.85;
    color: var(--color-muted-gold);
    max-width: 680px;
    margin-bottom: 3rem;
}

.accent-pink {
    color: var(--color-candy-pink);
}

.accent-cyan {
    color: var(--color-candy-cyan);
}

.accent-yellow {
    color: var(--color-candy-yellow);
}

.accent-muted {
    color: var(--color-muted-gold);
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#hero .tier__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero__title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--color-cream-light);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

.hero__subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--color-muted-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

.hero__desc {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.85;
    color: var(--color-muted-gold);
    max-width: 520px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

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

/* --- Specimen Cards --- */
.specimen-card {
    background: rgba(64, 64, 48, 0.08);
    border: 1px solid rgba(64, 64, 48, 0.2);
    border-radius: 2px;
    overflow: hidden;
    transition: border-color 300ms ease;
}

.specimen-card:hover {
    border-color: rgba(240, 64, 128, 0.4);
}

.specimen-card__visual {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: rgba(8, 12, 8, 0.4);
}

.specimen-svg {
    width: 140px;
    height: auto;
    transition: transform 400ms ease-out;
}

.specimen-card:hover .specimen-svg {
    transform: scale(1.4);
}

.specimen-card__info {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid rgba(64, 64, 48, 0.15);
}

.specimen-card__label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-candy-pink);
    margin-bottom: 0.3rem;
}

.specimen-card__class {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--color-muted-gold);
    letter-spacing: 0.05em;
}

.specimen-card--hero {
    max-width: 280px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1.2s forwards;
}

.specimen-card--hero .specimen-svg {
    width: 160px;
}

/* --- Specimens Grid --- */
.specimens-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .specimens-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .specimens-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Classification Grid --- */
.classification-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 700px) {
    .classification-grid {
        grid-template-columns: 1fr;
    }
}

.class-card {
    padding: 2rem;
    border: 1px solid rgba(64, 64, 48, 0.15);
    border-radius: 2px;
    background: rgba(8, 12, 8, 0.3);
    transition: border-color 300ms ease, transform 400ms ease-out;
}

.class-card:hover {
    border-color: rgba(240, 64, 128, 0.3);
    transform: scale(1.03);
}

.class-card__icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.2rem;
}

.class-card__icon svg {
    width: 100%;
    height: 100%;
}

.class-card__title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-cream-light);
    margin-bottom: 0.8rem;
}

.class-card__desc {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    line-height: 1.85;
    color: var(--color-muted-gold);
    margin-bottom: 1rem;
}

.class-card__count {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--color-candy-yellow);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- Environment Panels --- */
.environment-panels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 700px) {
    .environment-panels {
        grid-template-columns: 1fr;
    }
}

.env-panel {
    text-align: center;
    padding: 2rem 1.5rem;
    border: 1px solid rgba(64, 64, 48, 0.15);
    border-radius: 2px;
    background: rgba(12, 10, 8, 0.4);
    transition: border-color 300ms ease, transform 400ms ease-out;
}

.env-panel:hover {
    border-color: rgba(64, 208, 208, 0.3);
    transform: scale(1.05);
}

.env-panel__meter {
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.env-panel__meter svg {
    width: 100%;
    height: 100%;
}

.env-panel__title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-cream-light);
    margin-bottom: 0.6rem;
}

.env-panel__value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    line-height: 1.75;
    color: var(--color-muted-gold);
}

/* --- Herbarium Entries --- */
.herbarium-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.herb-entry {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border: 1px solid rgba(64, 64, 48, 0.15);
    border-radius: 2px;
    background: rgba(8, 12, 8, 0.3);
    transition: border-color 300ms ease, transform 400ms ease-out;
    overflow: hidden;
}

.herb-entry:hover {
    border-color: rgba(240, 64, 128, 0.3);
    transform: scale(1.02);
}

.herb-entry__number {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.8rem;
    color: rgba(240, 232, 216, 0.12);
    flex-shrink: 0;
    line-height: 1;
    min-width: 60px;
}

.herb-entry__content {
    flex: 1;
    min-width: 0;
}

.herb-entry__name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-cream-light);
    margin-bottom: 0.4rem;
}

.herb-entry__meta {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.68rem;
    color: var(--color-candy-pink);
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.herb-entry__notes {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.78rem, 0.9vw, 0.88rem);
    line-height: 1.85;
    color: var(--color-muted-gold);
}

.herb-entry__color {
    width: 8px;
    flex-shrink: 0;
    align-self: stretch;
    border-radius: 2px;
    opacity: 0.6;
    transition: opacity 300ms ease;
}

.herb-entry:hover .herb-entry__color {
    opacity: 1;
}

@media (max-width: 600px) {
    .herb-entry {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1.2rem 1.2rem;
    }

    .herb-entry__number {
        font-size: 1.2rem;
    }

    .herb-entry__color {
        width: 100%;
        height: 4px;
        order: -1;
    }
}

/* --- Colophon / Footer --- */
.colophon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.colophon-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.colophon-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-cream-light);
}

.colophon-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--color-muted-gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.colophon-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.colophon-line {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.72rem;
    color: var(--color-muted-gold);
    opacity: 0.6;
}

.colophon-decoration {
    width: 200px;
}

.colophon-wave {
    width: 100%;
    height: auto;
}

/* --- Scroll Reveal Animations --- */
.tier__inner {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.tier__inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hero inner starts visible (has its own animations) */
#hero .tier__inner {
    opacity: 1;
    transform: none;
}

/* --- Selection Color --- */
::selection {
    background: rgba(240, 64, 128, 0.3);
    color: var(--color-cream-light);
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-dark-earth);
}

::-webkit-scrollbar-thumb {
    background: var(--color-scaffolding);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-leaf-green);
}
