/* ============================================
   archaic.studio — Digital Herbarium Styles
   ============================================ */

/* Custom Properties */
:root {
    --cream: #faf3e6;
    --ivory: #f0e8d4;
    --teal: #1a5653;
    --coral: #c85a3a;
    --lavender: #7b6b8a;
    --charcoal: #2a2420;
    --forest: #2d5a27;
    --sage: #c4d4b8;
    --sage-wash: #f4f7f0;
    --lavender-wash: #f5f0f8;
}

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

html {
    scroll-behavior: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: var(--charcoal);
    background-color: var(--cream);
    overflow: hidden;
}

/* ============================================
   Typography
   ============================================ */

.title-text,
.specimen-title,
#nav-list a,
.closing-domain {
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.subtitle-text,
.specimen-description,
.closing-quote {
    font-family: 'Libre Baskerville', Georgia, serif;
}

.specimen-label,
.annotation-text,
.closing-year {
    font-family: 'Caveat', cursive;
    color: var(--forest);
}

/* ============================================
   Navigation Trigger
   ============================================ */

#nav-trigger {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#nav-trigger:hover {
    opacity: 1;
}

/* ============================================
   Navigation Overlay
   ============================================ */

#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--teal);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-100%);
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

#nav-overlay.active {
    transform: translateX(0);
}

#nav-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#nav-close:hover {
    opacity: 1;
}

#nav-list {
    list-style: none;
    text-align: center;
}

#nav-list li {
    margin: 2rem 0;
}

#nav-list a {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--cream);
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
}

#nav-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--coral);
    transition: width 0.3s ease-out;
}

#nav-list a:hover::after {
    width: 100%;
}

/* ============================================
   Main Herbarium Container
   ============================================ */

#herbarium {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#herbarium::-webkit-scrollbar {
    display: none;
}

/* ============================================
   Plate Base Styles
   ============================================ */

.plate {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    transition: background-color 300ms ease;
}

.plate-inner {
    max-width: 1440px;
    margin: 0 auto;
    height: 100%;
    position: relative;
    padding: 4rem 3rem;
    display: flex;
    align-items: center;
}

/* ============================================
   Angular Decorative Lines
   ============================================ */

.angle-line {
    position: absolute;
    background-color: var(--lavender);
    pointer-events: none;
    opacity: 0.25;
}

.angle-line-1 {
    width: 200px;
    height: 1px;
    top: 25%;
    left: 10%;
    transform: rotate(15deg);
}

.angle-line-2 {
    width: 160px;
    height: 1px;
    bottom: 30%;
    right: 15%;
    transform: rotate(-30deg);
}

.angle-line-3 {
    width: 280px;
    height: 1px;
    top: 20%;
    right: 5%;
    transform: rotate(30deg);
}

.angle-line-4 {
    width: 180px;
    height: 1px;
    bottom: 15%;
    left: 20%;
    transform: rotate(-15deg);
}

.angle-line-5 {
    width: 240px;
    height: 1px;
    top: 30%;
    left: 8%;
    transform: rotate(45deg);
}

.angle-line-6 {
    width: 200px;
    height: 1px;
    bottom: 25%;
    right: 10%;
    transform: rotate(-60deg);
}

.angle-line-7 {
    width: 300px;
    height: 1px;
    top: 15%;
    left: 5%;
    transform: rotate(15deg);
}

.angle-line-8 {
    width: 220px;
    height: 1px;
    bottom: 20%;
    right: 8%;
    transform: rotate(-45deg);
}

.angle-line-9 {
    width: 260px;
    height: 1px;
    top: 25%;
    right: 12%;
    transform: rotate(60deg);
}

.angle-line-10 {
    width: 190px;
    height: 1px;
    bottom: 18%;
    left: 15%;
    transform: rotate(-30deg);
}

.angle-line-11 {
    width: 320px;
    height: 1px;
    top: 35%;
    left: 50%;
    transform: translateX(-50%) rotate(15deg);
}

/* ============================================
   Plate 1: Title
   ============================================ */

.plate-title {
    background-color: var(--cream);
}

.plate-title .plate-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.title-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 0.01ms;
}

.title-text.visible {
    opacity: 1;
}

.title-line {
    width: 0;
    height: 1px;
    background-color: var(--coral);
    margin: 1.5rem 0;
    transition: width 0.6s ease-out;
}

.title-line.expanded {
    width: 40vw;
}

.subtitle-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--charcoal);
    opacity: 0;
    transition: opacity 0.8s ease;
}

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

.scroll-chevron {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-chevron 2s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

@keyframes pulse-chevron {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ============================================
   Specimen Plates Layout
   ============================================ */

.plate-specimen {
    /* Background set per plate via data-bg */
}

.plate-layout-left {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2.4rem;
    align-items: center;
}

.plate-layout-left .specimen-illustration {
    grid-column: 1 / 8;
    position: relative;
}

.plate-layout-left .specimen-text {
    grid-column: 8 / 12;
}

.plate-layout-right {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2.4rem;
    align-items: center;
}

.plate-layout-right .specimen-text {
    grid-column: 2 / 6;
}

.plate-layout-right .specimen-illustration {
    grid-column: 6 / 13;
    position: relative;
}

/* ============================================
   Botanical Illustrations
   ============================================ */

.specimen-illustration {
    position: relative;
    clip-path: polygon(0 0, 100% 5%, 95% 100%, 0 98%);
}

.botanical-svg {
    width: 100%;
    height: auto;
    max-height: 75vh;
    display: block;
    transform: scale(0.85);
    opacity: 0.7;
    filter: blur(1px);
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.specimen-illustration.in-focus .botanical-svg {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
}

/* ============================================
   Annotations
   ============================================ */

.annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.annotation {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.annotation.visible {
    opacity: 1;
    transform: translateY(0);
}

.annotation-line {
    display: block;
    width: 24px;
    height: 1px;
    background-color: var(--forest);
}

.annotation-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.875rem, 1.4vw, 1.1rem);
    color: var(--forest);
    white-space: nowrap;
}

/* ============================================
   Specimen Text
   ============================================ */

.specimen-text {
    position: relative;
    z-index: 2;
}

.specimen-label {
    font-family: 'Caveat', cursive;
    font-size: clamp(0.875rem, 1.4vw, 1.1rem);
    color: var(--forest);
    display: block;
    margin-bottom: 0.5rem;
    transform: rotate(-3deg);
    transform-origin: left center;
}

.specimen-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
}

.specimen-description {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: var(--charcoal);
    max-width: 38ch;
}

/* ============================================
   Plate 6: Closing
   ============================================ */

.plate-closing {
    background-color: var(--cream);
}

.plate-closing .plate-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.closing-content {
    position: relative;
}

.closing-quote {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.9;
    color: var(--charcoal);
    margin-bottom: 3rem;
    max-width: 50ch;
}

.closing-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.closing-year {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--forest);
    display: inline-block;
    transform: rotate(-5deg);
}

/* ============================================
   Plate Background Colors
   ============================================ */

#plate-1 { background-color: var(--cream); }
#plate-2 { background-color: var(--ivory); }
#plate-3 { background-color: var(--sage-wash); }
#plate-4 { background-color: var(--cream); }
#plate-5 { background-color: var(--lavender-wash); }
#plate-6 { background-color: var(--cream); }

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 1024px) {
    .plate-inner {
        padding: 3rem 2rem;
    }

    .plate-layout-left .specimen-illustration {
        grid-column: 1 / 7;
    }

    .plate-layout-left .specimen-text {
        grid-column: 7 / 12;
    }

    .plate-layout-right .specimen-text {
        grid-column: 1 / 6;
    }

    .plate-layout-right .specimen-illustration {
        grid-column: 6 / 13;
    }
}

@media (max-width: 768px) {
    .plate-layout-left,
    .plate-layout-right {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        justify-content: center;
    }

    .plate-layout-right {
        flex-direction: column-reverse;
    }

    .specimen-illustration {
        width: 80%;
        max-width: 400px;
        clip-path: polygon(0 0, 100% 3%, 97% 100%, 0 97%);
    }

    .specimen-text {
        text-align: center;
    }

    .specimen-description {
        max-width: 50ch;
        margin: 0 auto;
    }

    .specimen-label {
        transform-origin: center center;
    }

    .plate-inner {
        padding: 2rem 1.5rem;
    }

    #nav-trigger {
        top: 1rem;
        left: 1rem;
    }

    .angle-line {
        display: none;
    }
}

@media (max-width: 480px) {
    .specimen-illustration {
        width: 90%;
    }

    .specimen-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}
