:root {
    --limestone: #F5F0E8;
    --parchment-shadow: #EDE8DF;
    --carbon-ink: #1B1B1B;
    --graphite-dust: #8C8172;
    --aged-linen: #C4BBA8;
    --oxblood: #6B1D1D;
    --reserve-gold: #A67C2E;
    --vault-steel: #3A3D42;
    --body-ink: #2C2820;
    --intaglio-stripe: #E8E3DA;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--aged-linen) var(--parchment-shadow);
}

body {
    background-color: var(--limestone);
    color: var(--body-ink);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.9;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--parchment-shadow);
}

::-webkit-scrollbar-thumb {
    background: var(--aged-linen);
}

/* ============================================
   THE INSCRIPTION
   ============================================ */

.inscription {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 15%;
    padding-right: 15%;
}

.inscription-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.25em;
    color: var(--carbon-ink);
    line-height: 1.1;
    text-shadow: 1px 1px 0 rgba(27, 27, 27, 0.08);
}

.inscription-rule {
    width: 0%;
    height: 0.5px;
    background-color: var(--graphite-dust);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    transition: width 1.8s ease-out;
}

.inscription-rule.extended {
    width: 40%;
}

.inscription-date {
    font-family: 'Spectral SC', serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: var(--graphite-dust);
}

/* ============================================
   COMPARTMENTS
   ============================================ */

.compartment {
    position: relative;
    background-color: var(--parchment-shadow);
    box-shadow: inset 0 2px 6px rgba(27, 27, 27, 0.12);
    padding: 2.5rem 2rem;
    margin-bottom: 8vh;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
}

.section-numeral {
    position: absolute;
    left: -2.5rem;
    top: 0.5rem;
    font-family: 'Spectral SC', serif;
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--graphite-dust);
    letter-spacing: 0.1em;
}

.section-header {
    font-family: 'Spectral', serif;
    font-variant: small-caps;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.12em;
    color: var(--carbon-ink);
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--body-ink);
    margin-bottom: 1.4em;
}

.drop-cap {
    float: left;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 3.2rem;
    line-height: 0.85;
    margin-right: 0.1em;
    color: var(--oxblood);
}

/* ============================================
   MARGINAL ANNOTATIONS
   ============================================ */

.marginal-annotation {
    position: absolute;
    width: 160px;
}

.marginal-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--graphite-dust);
    border-left: 2px solid var(--oxblood);
    padding-left: 0.75rem;
}

/* ============================================
   HAIRLINE DIVIDERS
   ============================================ */

.hairline {
    height: 0.5px;
    background-color: var(--aged-linen);
    position: relative;
    margin-bottom: 6vh;
}

.line-numeral {
    position: absolute;
    right: -2rem;
    top: -0.5rem;
    font-family: 'Spectral', serif;
    font-size: 0.65rem;
    color: var(--graphite-dust);
}

/* ============================================
   COUNTER COLUMN
   ============================================ */

.counter-column {
    position: relative;
    width: 18%;
    padding: 1.5rem;
    margin-bottom: 6vh;
    text-align: right;
    float: right;
    clear: right;
}

.counter-column:nth-of-type(even) {
    float: left;
    text-align: left;
}

.figure-number {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(3rem, 6vw, 5rem);
    color: var(--reserve-gold);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.figure-caption {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--graphite-dust);
    line-height: 1.4;
}

.figure-compartment {
    text-align: center;
    padding: 3rem 2rem;
}

.figure-compartment .figure-number {
    margin-bottom: 0.75rem;
}

/* ============================================
   INTAGLIO TEXTURE
   ============================================ */

.intaglio-bg {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        var(--intaglio-stripe) 3px,
        var(--intaglio-stripe) 4px
    );
    background-color: var(--parchment-shadow);
}

/* ============================================
   ARCHIVE FLOOR
   ============================================ */

.archive-floor {
    background-color: var(--vault-steel);
    padding: 6rem 15%;
    margin-top: 10vh;
    clear: both;
}

.archive-axiom {
    font-family: 'Spectral', serif;
    font-variant: small-caps;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.08em;
    color: var(--limestone);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 3rem;
}

.colophon-block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.colophon-item {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--aged-linen);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ============================================
   ENGRAVED LINE-WORK SVG
   ============================================ */

.engraved-ornament {
    stroke: var(--aged-linen);
    stroke-width: 1;
    fill: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .inscription {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .compartment {
        width: 90% !important;
        margin-left: 5% !important;
    }

    .hairline {
        width: 60% !important;
        margin-left: 5% !important;
    }

    .section-numeral {
        position: static;
        display: block;
        margin-bottom: 0.5rem;
    }

    .marginal-annotation {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }

    .counter-column {
        float: none;
        width: 90%;
        margin: 4vh auto;
        text-align: left;
    }

    .archive-floor {
        padding: 3rem 1.5rem;
    }

    .colophon-block {
        gap: 1rem;
    }
}
