:root {
    --bg: #0a0908;
    --frame: #2c2218;
    --frame-highlight: #3a2e22;
    --text-body: #b8a898;
    --text-label: #8a7e6e;
    --gold: #c4a54a;
    --specimen-border: #4a3f35;
    --parchment-wash: #f5ede0;
    --tear: #2a2520;
    --seal-bg: #080706;
}

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

body {
    background-color: var(--bg);
    color: var(--text-body);
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 2.0;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

/* Cabinet Frame */
.cabinet-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    border-top: 32px solid var(--frame);
    border-bottom: 32px solid var(--frame);
    border-left: 24px solid var(--frame);
    border-right: 24px solid var(--frame);
    background: transparent;
    border-image: repeating-linear-gradient(
        2deg,
        #2c2218 0px,
        #2c2218 3px,
        #3a2e22 3px,
        #3a2e22 5px,
        #2c2218 5px,
        #2c2218 9px,
        #3a2e22 9px,
        #3a2e22 10px
    ) 32 24;
}

/* Drawers */
.drawer {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: 32px 24px;
}

.drawer-content {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.33, 0, 0.2, 1), transform 1.2s cubic-bezier(0.33, 0, 0.2, 1);
}

.drawer-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Drawer Labels */
.drawer-label {
    display: block;
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--text-label);
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* Drawer 1: The Epitaph */
.drawer-1 {
    background-color: var(--bg);
}

.drawer-1 .drawer-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 15%;
}

.domain-name {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(42px, 6vw, 72px);
    letter-spacing: 0.14em;
    color: var(--text-body);
    text-transform: lowercase;
    line-height: 1.2;
}

.epitaph {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.22em;
    color: var(--text-label);
    margin-top: 20px;
}

.pressed-flower-accent {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

/* Drawer 2: The Collection */
.drawer-2 {
    background-color: var(--bg);
}

.collection-layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.collection-text {
    width: 55%;
    padding-right: 40px;
}

.collection-divider {
    width: 1px;
    min-height: 400px;
    background-color: rgba(58, 53, 48, 0.5);
    flex-shrink: 0;
}

.collection-specimens {
    width: 35%;
    margin-left: 10%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.body-text {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 2.0;
    letter-spacing: 0.02em;
    color: var(--text-body);
}

/* Specimen Cards */
.specimen-card {
    border: 1px solid var(--specimen-border);
    padding: 20px 16px;
    box-shadow: inset 0 0 12px rgba(10, 9, 8, 0.6);
    background: transparent;
    text-align: center;
}

.specimen-icon {
    display: block;
    margin: 0 auto 12px;
}

.specimen-label {
    display: block;
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--text-label);
    margin-bottom: 8px;
}

.specimen-desc {
    font-family: 'EB Garamond', serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-body);
}

/* Drawer 3: The Herbarium */
.drawer-3 {
    background-color: var(--bg);
}

.herbarium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 2px;
    background-color: var(--frame);
}

.herbarium-panel {
    background: rgba(245, 237, 224, 0.06);
    padding: 30px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.botanical-drawing {
    display: block;
    margin-bottom: 16px;
}

.herbarium-caption {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 14px;
    color: #6a5e50;
    text-align: center;
    line-height: 1.4;
}

/* Drawer 4: The Weeping Room */
.drawer-4 {
    background-color: var(--bg);
}

.weeping-layout {
    position: relative;
    width: 100%;
}

.weeping-text {
    width: 45%;
    margin-left: 20%;
}

.weeping-body {
    line-height: 2.4;
    margin-bottom: 40px;
}

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

.tear-line {
    position: absolute;
    left: var(--x);
    top: 0;
    width: 0.5px;
    height: var(--h);
    background-color: rgba(42, 37, 32, var(--opacity));
}

/* Drawer 5: The Seal */
.drawer-5 {
    background-color: var(--seal-bg);
}

.seal-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10vh;
}

.mourning-seal {
    width: 80px;
    height: 80px;
    margin-bottom: 30px;
}

.seal-wreath {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.seal-wreath.animate {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2.5s ease;
}

.seal-letter {
    transition: opacity 1s ease;
}

.seal-domain {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--text-label);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.seal-finis {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--text-label);
    text-transform: uppercase;
}

/* Mobile */
@media (max-width: 768px) {
    .cabinet-frame {
        border-width: 16px;
        border-image: repeating-linear-gradient(
            2deg,
            #2c2218 0px,
            #2c2218 3px,
            #3a2e22 3px,
            #3a2e22 5px,
            #2c2218 5px,
            #2c2218 9px,
            #3a2e22 9px,
            #3a2e22 10px
        ) 16;
    }

    .drawer {
        padding: 16px;
    }

    .drawer-1 .drawer-content {
        padding-left: 5%;
    }

    .pressed-flower-accent {
        display: none;
    }

    .collection-layout {
        flex-direction: column;
    }

    .collection-text {
        width: 100%;
        padding-right: 0;
        margin-bottom: 30px;
    }

    .collection-divider {
        display: none;
    }

    .collection-specimens {
        width: 100%;
        margin-left: 0;
    }

    .herbarium-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .weeping-text {
        width: 80%;
        margin-left: 5%;
    }

    .tear-line {
        display: none;
    }
}
