:root {
    --parchment: #F5ECD7;
    --umber: #2B2520;
    --tobacco: #5C4A3A;
    --walnut: #3A322A;
    --bronze: #8B7355;
    --foxed-gold: #C8B89A;
    --saddle: #8B4513;
    --seal-crimson: #7A2E2E;
    --ivory: #FAF6EE;
    --ink: #1A1714;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--parchment);
    color: var(--walnut);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    background-image:
        radial-gradient(circle, #C8B89A 1px, transparent 1px),
        radial-gradient(circle, #8B7355 1.5px, transparent 1.5px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 3px 3px;
    background-blend-mode: normal;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, #C8B89A 1px, transparent 1px),
        radial-gradient(circle, #8B7355 1.5px, transparent 1.5px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 3px 3px;
    opacity: 0.003;
    pointer-events: none;
    z-index: 9999;
}

/* ============================================
   COLOPHON / HERO
   ============================================ */

.colophon {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--parchment);
}

.colophon-inner {
    text-align: center;
    padding: 2rem;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-variant: small-caps;
    color: var(--umber);
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.title-rule {
    width: 40vw;
    height: 1px;
    background-color: var(--tobacco);
    margin: 0 auto 2rem;
}

.epigraph {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--tobacco);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

.epigraph-attribution {
    font-style: normal;
    font-size: 0.85em;
    color: var(--bronze);
    display: block;
    margin-top: 0.5rem;
}

.scroll-sentinel {
    position: absolute;
    top: 20vh;
    width: 1px;
    height: 1px;
}

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

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.chevron {
    display: block;
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--tobacco);
    border-bottom: 2px solid var(--tobacco);
    transform: rotate(45deg);
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--umber);
    padding: 2rem 1.25rem;
    z-index: 100;
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.sidebar.visible {
    opacity: 1;
    pointer-events: all;
}

.sidebar-nav {
    list-style: none;
    width: 100%;
}

.sidebar-nav li {
    margin-bottom: 1rem;
}

.sidebar-link {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--bronze);
    padding: 0.4rem 0;
    border-left: 3px solid transparent;
    padding-left: 0.75rem;
    transition: color 0.15s ease, border-color 0.2s ease;
}

.sidebar-link:hover {
    color: var(--foxed-gold);
}

.sidebar-link.active {
    color: var(--parchment);
    border-left-color: var(--saddle);
}

.sidebar-label {
    flex-shrink: 0;
    white-space: nowrap;
}

.leader-dots {
    flex: 1;
    overflow: hidden;
    margin-left: 0.5rem;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--bronze);
    opacity: 0.4;
}

.leader-dots::before {
    content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ";
    letter-spacing: 0.15em;
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--umber);
    z-index: 100;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-nav.visible {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    text-decoration: none;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    color: var(--bronze);
    padding: 0.3rem 0.6rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.2s ease;
}

.mobile-link:hover {
    color: var(--foxed-gold);
}

.mobile-link.active {
    color: var(--parchment);
    border-bottom-color: var(--saddle);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    margin-left: 0;
    transition: margin-left 0.4s ease;
}

.main-content.with-sidebar {
    margin-left: 240px;
}

.content-section {
    max-width: 780px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.08em;
    color: var(--tobacco);
    line-height: 1.25;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--foxed-gold);
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-text {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.about-text p {
    margin-bottom: 1.25rem;
}

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

.marginal-note {
    border-left: 1px solid var(--foxed-gold);
    padding-left: 0.75rem;
    margin-top: 1.5rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--bronze);
}

.marginal-date {
    display: block;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.marginal-text {
    display: block;
    font-style: italic;
}

/* ============================================
   LEXICON SECTION
   ============================================ */

.lexicon-entry {
    margin-bottom: 2.5rem;
}

.entry-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--tobacco);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.entry-body.two-column {
    columns: 2;
    column-gap: 2.5rem;
    column-rule: 1px solid #D4C4A8;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.entry-body p {
    margin-bottom: 1rem;
    break-inside: avoid;
}

.seal-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.seal-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background-color: var(--foxed-gold);
    opacity: 0.5;
}

.seal-ornament {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--bronze);
    border-radius: 50%;
    position: relative;
    background-color: var(--parchment);
    z-index: 1;
}

.seal-ornament::before,
.seal-ornament::after {
    content: '';
    position: absolute;
    background-color: var(--tobacco);
}

.seal-ornament::before {
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 6px;
}

.seal-ornament::after {
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    width: 6px;
    height: 1px;
}

/* ============================================
   TREATIES SECTION / TIMELINE
   ============================================ */

.treaties-intro {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--bronze);
    margin-bottom: 3rem;
    letter-spacing: 0.02em;
}

.timeline {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.timeline-entry {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
}

.timeline-entry.entry-left {
    justify-content: flex-start;
    padding-right: 50%;
}

.timeline-entry.entry-right {
    justify-content: flex-end;
    padding-left: 50%;
}

.timeline-entry.entry-left + .entry-right::before,
.timeline-entry.entry-right + .entry-left::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    width: 40%;
    height: 1px;
    background-color: var(--foxed-gold);
    opacity: 0.5;
}

.timeline-entry.entry-left + .entry-right::before {
    left: 20%;
    transform: rotate(8deg);
}

.timeline-entry.entry-right + .entry-left::before {
    right: 20%;
    left: auto;
    transform: rotate(-8deg);
}

.timeline-card {
    max-width: 380px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--bronze);
    box-shadow: 2px 2px 0 #D4C4A8;
    background-color: var(--ivory);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 var(--foxed-gold);
}

.timeline-date {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--saddle);
    display: block;
    margin-bottom: 0.4rem;
}

.timeline-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--tobacco);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.timeline-summary {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--walnut);
}

/* ============================================
   READING ROOM / FOOTER
   ============================================ */

.reading-room-section {
    background-color: var(--umber);
    max-width: 100%;
    padding: 4rem 2rem;
}

.reading-room-inner {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2.5rem;
}

.footer-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--foxed-gold);
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--tobacco);
}

.footer-column p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--foxed-gold);
    opacity: 0.85;
}

.bibliography-list {
    list-style: none;
    padding: 0;
}

.bibliography-list li {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--foxed-gold);
    opacity: 0.85;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    text-indent: -1rem;
}

.footer-domain {
    margin-top: 1rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    color: var(--foxed-gold);
    text-transform: uppercase;
}

.finis-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3rem;
    gap: 0.75rem;
}

.finis-bracket {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--foxed-gold);
    opacity: 0.6;
    line-height: 1;
}

.finis-diamond {
    width: 8px;
    height: 8px;
    background-color: var(--foxed-gold);
    transform: rotate(45deg);
    opacity: 0.6;
}

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

@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .mobile-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content.with-sidebar {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-section {
        padding: 3rem 1.25rem;
    }

    .entry-body.two-column {
        columns: 1;
    }

    .timeline-entry.entry-left,
    .timeline-entry.entry-right {
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
    }

    .reading-room-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .mobile-nav.visible + .main-content .content-section:first-child {
        padding-top: 5rem;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none !important;
    }
}
