/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #0f0d15;
    color: #e8e0d0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* === COLOR MAP === */
:root {
    --bg-primary: #0f0d15;
    --bg-secondary: #1a1528;
    --bg-tertiary: #151220;
    --text-primary: #e8e0d0;
    --text-secondary: #9b9580;
    --emerald: #1b7a4e;
    --amethyst: #7b3fa0;
    --ruby: #a83244;
    --topaz: #c9952b;
    --sapphire: #2e5fa1;
    --morph-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === TYPOGRAPHY === */
.hero-title, .section-heading, .card-title {
    font-family: 'Playfair Display', Georgia, serif;
}

.tag, .mono, .journal-date {
    font-family: 'JetBrains Mono', monospace;
}

/* === THE ATRIUM (Hero) === */
.atrium {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    background: linear-gradient(180deg, #0f0d15 0%, #1a1528 40%, #151220 100%);
    overflow: hidden;
}

.petal-burst {
    position: absolute;
    width: min(800px, 90vw);
    height: min(800px, 90vh);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.petal {
    fill: none;
    stroke-width: 1.5px;
}

.petal-1 { fill: var(--emerald); opacity: 0.1; animation: petal-rotate 120s linear infinite; transform-origin: 400px 400px; }
.petal-2 { fill: var(--amethyst); opacity: 0.08; animation: petal-rotate 150s linear infinite reverse; transform-origin: 400px 400px; }
.petal-3 { fill: var(--ruby); opacity: 0.09; animation: petal-rotate 130s linear infinite; transform-origin: 400px 400px; }
.petal-4 { fill: var(--topaz); opacity: 0.1; animation: petal-rotate 140s linear infinite reverse; transform-origin: 400px 400px; }
.petal-5 { fill: var(--sapphire); opacity: 0.08; animation: petal-rotate 160s linear infinite; transform-origin: 400px 400px; }
.petal-6 { fill: var(--emerald); opacity: 0.07; animation: petal-rotate 170s linear infinite reverse; transform-origin: 400px 400px; }
.petal-7 { fill: var(--amethyst); opacity: 0.09; animation: petal-rotate 145s linear infinite; transform-origin: 400px 400px; }

@keyframes petal-rotate {
    to { transform: rotate(360deg); }
}

.atrium-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--text-primary);
    text-shadow: 0 0 80px rgba(123, 63, 160, 0.3);
}

.hero-dot {
    color: var(--topaz);
}

.hero-subtitle {
    margin-top: 1.5rem;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 400;
}

.scroll-vine {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: vine-sway 3s ease-in-out infinite;
}

@keyframes vine-sway {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/* === THE CORRIDOR === */
.corridor {
    height: 15vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #151220, var(--bg-secondary));
    overflow: hidden;
}

.stem-border {
    width: 100%;
    height: 60px;
}

/* === THE SPECIMEN GALLERY === */
.gallery {
    position: relative;
    padding: clamp(2rem, 4vw, 4rem);
    background: var(--bg-primary);
}

.gallery-heading {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-heading {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Corner ornaments */
.corner-ornament {
    position: absolute;
    pointer-events: none;
    opacity: 1;
}
.corner-tl { top: 1rem; left: 1rem; }
.corner-tr { top: 1rem; right: 1rem; }
.corner-bl { bottom: 1rem; left: 1rem; }
.corner-br { bottom: 1rem; right: 1rem; }

/* Grid */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.specimen-card {
    background: var(--bg-secondary);
    border-radius: 2px;
    position: relative;
    outline: 1px solid rgba(155, 149, 128, 0.08);
    outline-offset: 3px;
    clip-path: inset(0 round 0 0 12px 0);
    transition:
        outline-color 0.4s var(--morph-ease),
        outline-offset 0.4s var(--morph-ease),
        box-shadow 0.4s var(--morph-ease),
        clip-path 0.4s var(--morph-ease);
}

.specimen-card.featured {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .specimen-card.featured {
        grid-column: span 1;
    }
}

/* Color assignments */
.specimen-card[data-color="emerald"] .card-top-border { background: var(--emerald); }
.specimen-card[data-color="emerald"] { border: 1px solid rgba(27, 122, 78, 0.25); }
.specimen-card[data-color="emerald"]:hover { border-color: rgba(27, 122, 78, 0.8); outline-color: rgba(27, 122, 78, 0.08); box-shadow: 0 4px 30px rgba(27, 122, 78, 0.12); }

.specimen-card[data-color="amethyst"] .card-top-border { background: var(--amethyst); }
.specimen-card[data-color="amethyst"] { border: 1px solid rgba(123, 63, 160, 0.25); }
.specimen-card[data-color="amethyst"]:hover { border-color: rgba(123, 63, 160, 0.8); outline-color: rgba(123, 63, 160, 0.08); box-shadow: 0 4px 30px rgba(123, 63, 160, 0.12); }

.specimen-card[data-color="ruby"] .card-top-border { background: var(--ruby); }
.specimen-card[data-color="ruby"] { border: 1px solid rgba(168, 50, 68, 0.25); }
.specimen-card[data-color="ruby"]:hover { border-color: rgba(168, 50, 68, 0.8); outline-color: rgba(168, 50, 68, 0.08); box-shadow: 0 4px 30px rgba(168, 50, 68, 0.12); }

.specimen-card[data-color="topaz"] .card-top-border { background: var(--topaz); }
.specimen-card[data-color="topaz"] { border: 1px solid rgba(201, 149, 43, 0.25); }
.specimen-card[data-color="topaz"]:hover { border-color: rgba(201, 149, 43, 0.8); outline-color: rgba(201, 149, 43, 0.08); box-shadow: 0 4px 30px rgba(201, 149, 43, 0.12); }

.specimen-card[data-color="sapphire"] .card-top-border { background: var(--sapphire); }
.specimen-card[data-color="sapphire"] { border: 1px solid rgba(46, 95, 161, 0.25); }
.specimen-card[data-color="sapphire"]:hover { border-color: rgba(46, 95, 161, 0.8); outline-color: rgba(46, 95, 161, 0.08); box-shadow: 0 4px 30px rgba(46, 95, 161, 0.12); }

.specimen-card:hover {
    outline-offset: 4px;
    clip-path: inset(0 round 0 0 0 0);
}

.card-top-border {
    height: 4px;
    border-radius: 2px 2px 0 0;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid rgba(155, 149, 128, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
}

/* === MORPH REVEAL (IntersectionObserver) === */
.specimen-card,
.herbarium-content {
    opacity: 0;
    transform: translateY(20px);
}

.specimen-card.visible,
.herbarium-content.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s var(--morph-ease), transform 0.6s var(--morph-ease);
}

/* === THE HERBARIUM === */
.herbarium {
    background: var(--bg-secondary);
    padding-block: clamp(4rem, 10vh, 8rem);
    display: flex;
    justify-content: center;
}

.herbarium-content {
    max-width: 720px;
    padding-inline: 2rem;
}

.herbarium .section-heading {
    margin-bottom: 2rem;
}

.journal-date {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-bottom: 1.5rem;
}

.journal-entry p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

.journal-entry p:last-child {
    margin-bottom: 0;
}

.journal-entry em {
    color: var(--topaz);
    font-style: italic;
}

/* === THE ROOT SYSTEM (Footer) === */
.roots {
    background: var(--bg-primary);
    padding: clamp(3rem, 6vh, 5rem) 2rem clamp(2rem, 4vh, 3rem);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.root-tendrils {
    width: min(800px, 100%);
    height: 200px;
    display: block;
    margin: 0 auto 2rem;
}

.root-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

.root-dot {
    color: var(--topaz);
}

/* === LINK UNDERLINES === */
a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--sapphire);
    transition: border-color 0.3s var(--morph-ease);
}

a:hover {
    border-color: var(--topaz);
}
