:root {
    --parchment: #f4f0e8;
    --ink: #1a1a1a;
    --rust: #8b3a2a;
    --faded-ink: #4a4a42;
    --border: #2a2a2a;
    --link: #6b2a1a;
    --link-hover: #8b3a2a;
    --sidebar-bg: rgba(0,0,0,0.02);
}

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

body {
    background-color: var(--parchment);
    color: var(--ink);
    font-family: 'IM Fell English', serif;
    min-height: 100vh;
    position: relative;
}

/* Paper texture */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 100;
}

/* ---- Layout ---- */
.site-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-body {
    display: flex;
    gap: 3rem;
    flex: 1;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ---- Header ---- */
.site-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.top-rule {
    margin-bottom: 1.5rem;
}

.top-rule svg {
    width: 280px;
    height: 24px;
}

.site-title {
    font-family: 'Uncial Antiqua', cursive;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.1;
}

.site-title a {
    color: var(--ink);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--rust);
}

.site-tagline {
    font-style: italic;
    font-size: 1.05rem;
    color: var(--faded-ink);
    margin-top: 0.5rem;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    padding-top: 0.5rem;
}

.sidebar-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-heading {
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rust);
    margin-bottom: 0.8rem;
}

.sidebar-link {
    display: block;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--faded-ink);
    text-decoration: none;
    padding: 0.25rem 0;
}

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

/* ---- Dividers ---- */
.divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 2rem 0;
    position: relative;
}

.divider::after {
    content: '\25C6';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--parchment);
    padding: 0 1rem;
    color: var(--rust);
    font-size: 0.7rem;
}

.post-divider {
    width: 40%;
    height: 1px;
    background: var(--border);
    margin: 2rem auto;
    opacity: 0.4;
}

/* ---- Content ---- */
.intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--faded-ink);
}

/* ---- Posts list ---- */
.posts {
    margin-top: 1rem;
}

.post-preview {
    margin-bottom: 0.5rem;
}

.post-title {
    font-family: 'IM Fell English', serif;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.3;
}

.post-title a {
    color: var(--ink);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--rust);
}

.post-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faded-ink);
    display: block;
    margin-top: 0.3rem;
}

.post-tags {
    margin-top: 0.5rem;
}

.tag {
    font-family: 'Courier Prime', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rust);
    border: 1px solid var(--rust);
    padding: 0.1rem 0.4rem;
    margin-right: 0.3rem;
    display: inline-block;
}

.post-excerpt {
    margin-top: 0.8rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--faded-ink);
}

.empty-state {
    font-style: italic;
    color: var(--faded-ink);
    margin: 2rem 0;
}

/* ---- Single post ---- */
.post-header .post-title {
    font-size: 1.8rem;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--ink);
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content h2 {
    font-family: 'IM Fell English', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-content h3 {
    font-family: 'IM Fell English', serif;
    font-size: 1.15rem;
    font-weight: 400;
    font-style: italic;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.post-content a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--rust);
    text-underline-offset: 3px;
}

.post-content a:hover {
    color: var(--link-hover);
}

.post-content blockquote {
    border-left: 3px solid var(--rust);
    margin: 1.5rem 0;
    padding: 0.5rem 1.5rem;
    font-style: italic;
    color: var(--faded-ink);
}

.post-content ul, .post-content ol {
    margin: 1rem 0 1.2rem 1.5rem;
}

.post-content li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.post-content code {
    font-family: 'Courier Prime', monospace;
    font-size: 0.9em;
    background: rgba(0,0,0,0.05);
    padding: 0.15rem 0.4rem;
}

.post-content pre {
    background: rgba(0,0,0,0.05);
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-left: 3px solid var(--border);
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.post-content th, .post-content td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.post-content th {
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(0,0,0,0.04);
}

/* ---- Post navigation ---- */
.post-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.post-nav-link {
    font-family: 'Courier Prime', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--faded-ink);
    text-decoration: none;
}

.post-nav-link:hover {
    color: var(--rust);
}

/* ---- Page ---- */
.page-title {
    font-family: 'Uncial Antiqua', cursive;
    font-size: 2rem;
    font-weight: 400;
}

.page-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--ink);
}

.page-content p {
    margin-bottom: 1.2rem;
}

.page-content a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--rust);
    text-underline-offset: 3px;
}

/* ---- Archive page ---- */
.archive-year {
    font-family: 'Courier Prime', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--rust);
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-list li {
    padding: 0.35rem 0;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.archive-list .archive-date {
    font-family: 'Courier Prime', monospace;
    font-size: 0.75rem;
    color: var(--faded-ink);
    flex-shrink: 0;
    width: 5.5rem;
}

.archive-list a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
}

.archive-list a:hover {
    color: var(--rust);
}

/* ---- Footer ---- */
.site-footer {
    margin-top: 3rem;
    text-align: center;
    padding-top: 0;
}

.bottom-rule {
    width: 100%;
    height: 2px;
    background: var(--border);
    margin-bottom: 1.2rem;
    position: relative;
}

.bottom-rule::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0; right: 0;
    height: 1px;
    background: var(--border);
}

.site-footer p {
    font-family: 'Courier Prime', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--faded-ink);
    opacity: 0.6;
}

/* ---- Mobile: sidebar collapses below content ---- */
@media (max-width: 720px) {
    .site-wrapper {
        padding: 1.5rem 1.25rem 1rem;
    }

    .site-body {
        flex-direction: column;
        gap: 2rem;
    }

    .sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0 3rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border);
    }

    .sidebar-section {
        border-bottom: none;
        padding-bottom: 0.5rem;
        margin-bottom: 1rem;
    }

    .site-title {
        font-size: 2.2rem;
    }

    .post-header .post-title {
        font-size: 1.5rem;
    }
}
