/* npc.quest - Digital Herbarium Styles */

:root {
    --color-cream: #F0EDE6;
    --color-dark-green: #2A3632;
    --color-gold: #C4A84A;
    --color-plum: #8B4A6A;
    --color-sage: #E8E2D4;
    --color-teal: #3A8A7A;
    --color-forest: #4A6858;
    --color-muted-teal: #6A8A7A;

    --font-display: 'Recursive', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-body: 'Inter', sans-serif;

    --gutter: 16px;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--color-cream);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-dark-green);
}

/* Entry Sequence Animation */
.stamp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOutOverlay 1000ms 1000ms ease-out forwards;
}

.rubber-stamp {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 800;
    font-variation-settings: "slnt" -8, "CASL" 0.5;
    color: var(--color-dark-green);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transform: rotate(-10deg) scale(0.8);
    opacity: 0;
    animation: stampEntrance 500ms 500ms ease-out forwards;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

@keyframes stampEntrance {
    from {
        transform: rotate(-10deg) scale(0.8);
        opacity: 0;
    }
    to {
        transform: rotate(-3deg) scale(1);
        opacity: 1;
    }
}

@keyframes fadeOutOverlay {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Masonry Grid */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gutter);
    padding: 3rem var(--gutter);
    max-width: 1400px;
    margin: 0 auto;
    animation: gridFadeIn 800ms 1500ms ease-out forwards;
    opacity: 0;
}

@keyframes gridFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Specimen Card */
.specimen-card {
    background: linear-gradient(135deg, var(--color-cream) 0%, rgba(232, 226, 212, 0.5) 100%);
    border: 2px solid;
    border-color: var(--color-gold);
    border-radius: 2px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cardSlideUp 600ms ease-out forwards;
    opacity: 0;
    transition: transform 300ms ease-out, box-shadow 300ms ease-out;
    position: relative;
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.specimen-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(42, 54, 50, 0.15);
}

/* SVG Composition Container */
.specimen-visual {
    width: 100%;
    height: 200px;
    background: linear-gradient(180deg, #F5F3F0 0%, #EAE6E0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    filter: sepia(0.3) contrast(0.9) brightness(0.95);
}

.specimen-visual svg {
    width: 80%;
    height: 80%;
    max-width: 180px;
}

/* Specimen Label */
.specimen-label {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top: 1px solid var(--color-gold);
}

.specimen-name {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 700;
    font-variation-settings: "slnt" -6, "CASL" 0.3;
    color: var(--color-dark-green);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.specimen-description {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-dark-green);
    opacity: 0.8;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.specimen-metadata {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-plum);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Variation in card heights */
.specimen-card:nth-child(1) { grid-row: span 1; animation-delay: 1600ms; }
.specimen-card:nth-child(2) { grid-row: span 1; animation-delay: 1650ms; }
.specimen-card:nth-child(3) { grid-row: span 1; animation-delay: 1700ms; }
.specimen-card:nth-child(4) { grid-row: span 2; animation-delay: 1750ms; }
.specimen-card:nth-child(5) { grid-row: span 1; animation-delay: 1800ms; }
.specimen-card:nth-child(6) { grid-row: span 1; animation-delay: 1850ms; }
.specimen-card:nth-child(7) { grid-row: span 1; animation-delay: 1900ms; }
.specimen-card:nth-child(8) { grid-row: span 1; animation-delay: 1950ms; }
.specimen-card:nth-child(9) { grid-row: span 2; animation-delay: 2000ms; }
.specimen-card:nth-child(10) { grid-row: span 1; animation-delay: 2050ms; }
.specimen-card:nth-child(11) { grid-row: span 1; animation-delay: 2100ms; }
.specimen-card:nth-child(12) { grid-row: span 1; animation-delay: 2150ms; }

/* Responsive Design */
@media (max-width: 1200px) {
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 2rem var(--gutter);
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem var(--gutter);
    }

    .specimen-card {
        grid-row: auto !important;
    }
}

/* Subtle generative variations */
.specimen-card {
    --seed-hue: 0deg;
    --seed-brightness: 1;
    --seed-rotation: 0deg;
}

.specimen-card:nth-child(1) {
    --seed-hue: 15deg;
    --seed-brightness: 1.05;
    --seed-rotation: 2deg;
}

.specimen-card:nth-child(2) {
    --seed-hue: 210deg;
    --seed-brightness: 0.98;
    --seed-rotation: -1deg;
}

.specimen-card:nth-child(3) {
    --seed-hue: 135deg;
    --seed-brightness: 1.02;
    --seed-rotation: 1deg;
}

.specimen-card:nth-child(4) {
    --seed-hue: 280deg;
    --seed-brightness: 0.96;
    --seed-rotation: -2deg;
}

.specimen-card:nth-child(5) {
    --seed-hue: 45deg;
    --seed-brightness: 1.03;
    --seed-rotation: 1.5deg;
}

.specimen-card:nth-child(6) {
    --seed-hue: 185deg;
    --seed-brightness: 0.99;
    --seed-rotation: -0.5deg;
}

.specimen-card:nth-child(7) {
    --seed-hue: 100deg;
    --seed-brightness: 1.04;
    --seed-rotation: 2deg;
}

.specimen-card:nth-child(8) {
    --seed-hue: 300deg;
    --seed-brightness: 0.97;
    --seed-rotation: -1.5deg;
}

.specimen-card:nth-child(9) {
    --seed-hue: 60deg;
    --seed-brightness: 1.01;
    --seed-rotation: 0.5deg;
}

.specimen-card:nth-child(10) {
    --seed-hue: 250deg;
    --seed-brightness: 1.02;
    --seed-rotation: -2deg;
}

.specimen-card:nth-child(11) {
    --seed-hue: 30deg;
    --seed-brightness: 0.99;
    --seed-rotation: 1deg;
}

.specimen-card:nth-child(12) {
    --seed-hue: 160deg;
    --seed-brightness: 1.03;
    --seed-rotation: -0.5deg;
}

.specimen-visual {
    filter: sepia(0.3) contrast(0.9) brightness(var(--seed-brightness)) hue-rotate(var(--seed-hue));
}

.specimen-card {
    transform: rotate(var(--seed-rotation));
}

/* Prose-like text alignment */
.specimen-name {
    text-align: left;
}

.specimen-description {
    text-align: justify;
}
