/* ============================================
   concurrent.quest — Styles
   Botanical Illustration Garden / Naturalist Field Museum
   ============================================ */

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

:root {
    --parchment: #f5efe0;
    --card: #fffdf8;
    --ink: #2c2417;
    --botanical: #4a7c59;
    --label: #8b6914;
    --pin: #b85c38;
    --border: #d4c9b4;
    --muted: #8a7e6b;
}

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

body {
    background-color: var(--parchment);
    color: var(--ink);
    font-family: 'EB Garamond', 'Georgia', serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.8;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* --- Hero / Title Plate --- */
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
}

.title-plate {
    text-align: center;
    padding: 80px 40px;
    border: 1px solid var(--border);
    outline: 1px solid var(--border);
    outline-offset: 4px;
    max-width: 700px;
    width: 100%;
    background-color: var(--parchment);
    position: relative;
}

.site-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--ink);
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.ornament-leaf {
    display: block;
    width: 120px;
    height: 40px;
    margin: 0 auto 16px;
    opacity: 0.85;
}

.subtitle {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* --- Specimen Board (Masonry) --- */
#specimen-board {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.masonry-container {
    columns: 3 300px;
    column-gap: 24px;
}

/* --- Specimen Card --- */
.specimen-card {
    break-inside: avoid;
    margin-bottom: 24px;
    background-color: var(--card);
    border: 1px solid var(--border);
    padding: 32px 24px 24px;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.specimen-card::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pin);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.specimen-card:hover {
    box-shadow: 0 4px 16px rgba(44, 36, 23, 0.1);
    transform: translateY(-2px);
}

/* --- Taxonomy Label --- */
.taxonomy-label {
    font-family: 'Spectral', 'Georgia', serif;
    font-weight: 400;
    font-size: 0.75rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    color: var(--label);
    border: 1px solid var(--border);
    display: inline-block;
    padding: 3px 10px;
    margin-bottom: 14px;
    line-height: 1.4;
}

.taxonomy-label span {
    white-space: nowrap;
}

/* --- Specimen Name --- */
.specimen-name {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: var(--ink);
    margin-bottom: 2px;
    line-height: 1.3;
}

.specimen-latin {
    font-family: 'EB Garamond', 'Georgia', serif;
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 16px;
}

/* --- Specimen Illustration --- */
.specimen-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 16px;
}

.specimen-illustration svg {
    width: 120px;
    height: 120px;
}

/* --- Field Notes --- */
.field-notes {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.field-notes p {
    font-family: 'EB Garamond', 'Georgia', serif;
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--ink);
}

/* --- Index Drawer --- */
#index-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card);
    border-top: 1px solid var(--border);
    transform: translateY(calc(100% - 40px));
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(44, 36, 23, 0.08);
}

#index-drawer.open {
    transform: translateY(0);
}

.drawer-tab {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border);
}

.drawer-tab-text {
    font-family: 'Spectral', 'Georgia', serif;
    font-variant: small-caps;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--muted);
}

.drawer-chevron {
    width: 14px;
    height: 10px;
    color: var(--muted);
    transition: transform 0.35s ease;
}

#index-drawer.open .drawer-chevron {
    transform: rotate(180deg);
}

.drawer-content {
    max-height: 50vh;
    overflow-y: auto;
    padding: 24px 32px 32px;
}

.index-columns {
    columns: 3 220px;
    column-gap: 32px;
}

.index-family {
    break-inside: avoid;
    margin-bottom: 20px;
}

.index-family-name {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.index-family ul {
    list-style: none;
    padding: 0;
}

.index-family li {
    font-family: 'EB Garamond', 'Georgia', serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--ink);
    padding-left: 8px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.index-family li:hover {
    color: var(--botanical);
}

.index-genus {
    font-family: 'Spectral', 'Georgia', serif;
    font-variant: small-caps;
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.05em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .title-plate {
        padding: 50px 24px;
    }

    #specimen-board {
        padding: 40px 16px 80px;
    }

    .masonry-container {
        columns: 1;
    }

    .index-columns {
        columns: 1;
    }

    .drawer-content {
        padding: 16px 20px 24px;
    }
}

@media (max-width: 480px) {
    .title-plate {
        padding: 36px 16px;
        outline-offset: 2px;
    }

    .specimen-card {
        padding: 24px 16px 18px;
    }

    .taxonomy-label {
        font-size: 0.68rem;
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.specimen-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.specimen-card:nth-child(1) { animation-delay: 0.1s; }
.specimen-card:nth-child(2) { animation-delay: 0.18s; }
.specimen-card:nth-child(3) { animation-delay: 0.26s; }
.specimen-card:nth-child(4) { animation-delay: 0.34s; }
.specimen-card:nth-child(5) { animation-delay: 0.42s; }
.specimen-card:nth-child(6) { animation-delay: 0.5s; }
.specimen-card:nth-child(7) { animation-delay: 0.58s; }
.specimen-card:nth-child(8) { animation-delay: 0.66s; }
.specimen-card:nth-child(9) { animation-delay: 0.74s; }
.specimen-card:nth-child(10) { animation-delay: 0.82s; }
.specimen-card:nth-child(11) { animation-delay: 0.9s; }
.specimen-card:nth-child(12) { animation-delay: 0.98s; }

/* Hero title fade-in */
.title-plate {
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.1s forwards;
}

/* --- Selection Styling --- */
::selection {
    background-color: rgba(74, 124, 89, 0.2);
    color: var(--ink);
}

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

.drawer-content::-webkit-scrollbar-track {
    background: var(--parchment);
}

.drawer-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}
