/* ===================================
   mujun.day — Scholarly Herbarium
   =================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body.herbarium {
    background-color: #0B1A14;
    color: #A8B8A0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-optical-sizing: auto;
    line-height: 1.72;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    color: #C8D4BC;
    letter-spacing: 0.02em;
}

.classification-tag,
.terminus-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #6B8C6B;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Navigation --- */
.taxonomy-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 16px 32px;
    background: rgba(11, 26, 20, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #1E3A2A;
}

.mujun-emblem {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.category {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6B8C6B;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 1.5px solid transparent;
    transition: color 0.35s ease, border-color 0.35s ease;
}

.category:hover {
    color: #C8D4BC;
}

.category.active {
    color: #C8D4BC;
    border-bottom-color: #4E9B78;
}

/* --- Prologue --- */
.prologue {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0B1A14;
    padding-top: 64px;
}

.isometric-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 10rem);
    color: #C8D4BC;
    letter-spacing: 0.04em;
    transform: perspective(800px) rotateX(8deg) rotateZ(-3deg);
    transform-origin: center center;
    line-height: 1;
}

.subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #6B8C6B;
    margin-top: 24px;
}

/* --- Section Strip --- */
.section-strip {
    height: 4px;
    background: linear-gradient(90deg, #4E9B78, #C4A54E, #8B3A3A, #4E9B78);
    opacity: 0.3;
    transition: opacity 0.6s ease;
    position: relative;
    z-index: 2;
}

.section-strip.pulse {
    animation: stripPulse 0.8s ease;
}

@keyframes stripPulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* --- Masonry Grid --- */
.specimen-masonry {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense;
    gap: 16px;
    padding: 32px;
    background: #0B1A14;
    min-height: 60vh;
}

/* --- Specimen Cards --- */
.specimen-card {
    background: linear-gradient(180deg, #142A20 0%, #0B1A14 100%);
    border: 1px solid #1E3A2A;
    border-radius: 2px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen-card.exiting {
    opacity: 0;
    transform: translateY(-16px);
    transition-duration: 0.3s;
}

.specimen-card:hover {
    transform: translateY(-4px) translateX(2px);
    box-shadow: -4px 8px 24px rgba(11, 26, 20, 0.6);
    transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.specimen-card:hover .specimen-svg path,
.specimen-card:hover .specimen-svg line,
.specimen-card:hover .specimen-svg ellipse,
.specimen-card:hover .specimen-svg circle {
    stroke: #C4A54E;
    transition: stroke 1.2s ease;
}

/* Span classes */
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.tall { grid-row: span 2; }

/* --- Illustration --- */
.isometric-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.isometric-illustration svg {
    width: 100%;
    max-width: 180px;
    height: auto;
    transform: rotateX(25deg) rotateZ(-30deg) scale(0.9);
    transform-origin: center bottom;
    transition: transform 0.6s ease;
}

.tall .isometric-illustration svg {
    max-width: 200px;
}

.specimen-svg path,
.specimen-svg line,
.specimen-svg ellipse,
.specimen-svg circle,
.specimen-svg rect {
    transition: stroke 1.2s ease;
}

/* --- Card Content --- */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rosette {
    display: inline-flex;
    margin-bottom: 8px;
}

.paradox-title {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.taxonomic-desc {
    font-size: 14px;
    line-height: 1.72;
    color: #A8B8A0;
    margin-bottom: 12px;
    flex: 1;
}

.classification-tag {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #1E3A2A;
}

/* --- Isometric Dividers (via pseudo-elements on nav) --- */

/* --- Terminus / Footer --- */
.terminus {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 32px;
    background: #0B1A14;
}

.terminus-illustration svg {
    width: 160px;
    height: auto;
    opacity: 0.5;
    transform: perspective(600px) rotateX(10deg) rotateZ(-5deg);
}

.terminus-text {
    margin-top: 24px;
    font-size: 12px;
    color: #6B8C6B;
    letter-spacing: 0.15em;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .specimen-masonry {
        grid-template-columns: repeat(3, 1fr);
    }
    .span-3 { grid-column: span 2; }
}

@media (max-width: 768px) {
    .specimen-masonry {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }
    .span-2, .span-3 { grid-column: span 2; }
    .taxonomy-nav {
        gap: 16px;
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    .prologue {
        height: 80vh;
    }
}

@media (max-width: 480px) {
    .specimen-masonry {
        grid-template-columns: 1fr;
    }
    .span-1, .span-2, .span-3 { grid-column: span 1; }
    .taxonomy-nav {
        gap: 12px;
        padding: 10px 12px;
    }
    .category {
        font-size: 10px;
    }
}
