/* ==============================================
   mysterious.quest - Styles
   Botanical Naturalist Field Journal
   ============================================== */

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

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

body {
    background-color: #E8DCC8;
    color: #2A2820;
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 15px);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Field Journal Cover (100vh Hero) --- */
#journal-cover {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #E8DCC8;
    overflow: hidden;
}

/* Leather grain texture via CSS noise */
.leather-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(90, 74, 56, 0.15) 2px,
            rgba(90, 74, 56, 0.15) 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 4px,
            rgba(90, 74, 56, 0.08) 4px,
            rgba(90, 74, 56, 0.08) 5px
        );
    pointer-events: none;
}

.leather-grain::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(168, 120, 64, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(90, 74, 56, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(42, 40, 32, 0.04) 100%);
}

.cover-tendril {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 400px;
    height: 400px;
    z-index: 1;
    pointer-events: none;
}

.site-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(36px, 5vw, 72px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2A2820;
    z-index: 2;
    opacity: 0;
    position: relative;
}

.site-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.site-title .char.visible {
    opacity: 1;
    transform: translateY(0);
}

.journal-subtitle {
    font-family: 'Merriweather', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 14px;
    color: #5A4A38;
    z-index: 2;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.8s ease 1.2s;
}

.journal-subtitle.visible {
    opacity: 1;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.6s ease 2s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #A87840;
}

.scroll-arrow {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- Classification Sidebar (Sticky) --- */
#classification-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    padding: 20px 16px;
    background-color: rgba(240, 237, 228, 0.95);
    border-left: 1px solid #5A4A38;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#classification-sidebar.visible {
    opacity: 1;
}

.sidebar-ornament-top,
.sidebar-ornament-bottom {
    width: 100%;
    height: 20px;
}

.sidebar-ornament-top svg,
.sidebar-ornament-bottom svg {
    width: 100%;
    height: 100%;
}

.sidebar-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5A4A38;
    margin: 12px 0 16px;
    text-align: center;
}

.sidebar-categories {
    list-style: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.sidebar-item:hover {
    border-left-color: #A87840;
}

.sidebar-item.active {
    border-left-color: #4A7858;
    background-color: rgba(74, 120, 88, 0.06);
}

.category-marker {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #5A4A38;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.sidebar-item.active .category-marker {
    background-color: #4A7858;
}

.category-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2A2820;
}

/* --- Main Specimen Cabinet --- */
#specimen-cabinet {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px 40px;
    padding-right: 220px;
}

/* --- Specimen Row (3-column grid) --- */
.specimen-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

/* --- Specimen Block --- */
.specimen-block {
    position: relative;
    width: 100%;
    min-height: 380px;
    background-color: #F0EDE4;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    /* Slide-reveal initial state */
    opacity: 0;
    clip-path: inset(100% 0 0 0);
    transform: translateY(8px);
}

.specimen-block.revealed {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0);
    transition: clip-path 0.1s ease, opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.specimen-block:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(42, 40, 32, 0.12);
}

.specimen-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.specimen-content {
    position: relative;
    padding: 20px 16px 16px;
    z-index: 1;
}

.specimen-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2vw, 28px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2A2820;
    margin-bottom: 10px;
}

.specimen-illustration {
    width: 100%;
    height: 120px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copper-illustration {
    width: 100%;
    height: 100%;
}

.copper-illustration path,
.copper-illustration line,
.copper-illustration circle,
.copper-illustration ellipse {
    stroke: #A87840;
    stroke-width: 1;
    fill: none;
    transition: stroke-width 0.2s ease;
}

.specimen-block:hover .copper-illustration path,
.specimen-block:hover .copper-illustration line,
.specimen-block:hover .copper-illustration circle,
.specimen-block:hover .copper-illustration ellipse {
    stroke-width: 1.5;
}

.specimen-classification {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.classification-tag {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #F0EDE4;
    background-color: #3A7878;
    padding: 2px 8px;
    display: inline-block;
}

.classification-date {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5A4A38;
}

.specimen-latin {
    font-family: 'Merriweather', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 14px;
    color: #5A4A38;
    margin-bottom: 8px;
}

.specimen-description {
    font-family: 'Merriweather', serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 15px);
    line-height: 1.7;
    color: #2A2820;
}

/* --- Growth Interludes --- */
.growth-interlude {
    width: 100%;
    height: 80px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

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

.growth-svg path {
    stroke: #4A7858;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
}

/* --- Footer --- */
#journal-footer {
    text-align: center;
    padding: 60px 20px 40px;
    padding-right: 220px;
    border-top: 1px solid rgba(90, 74, 56, 0.2);
}

.footer-ornament {
    width: 300px;
    margin: 0 auto 20px;
}

.footer-ornament svg {
    width: 100%;
    height: 30px;
}

.footer-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2vw, 24px);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2A2820;
    margin-bottom: 8px;
}

.footer-classification {
    font-family: 'Merriweather', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 13px;
    color: #5A4A38;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    #classification-sidebar {
        display: none;
    }

    #specimen-cabinet {
        padding-right: 20px;
    }

    #journal-footer {
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    .specimen-row {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .site-title {
        font-size: clamp(28px, 8vw, 48px);
    }
}
