:root {
    --paper: #F1ECE1;
    --ink: #211D19;
    --oxblood: #7A2A2A;
    --muted: #8A8072;
    --line: #D7CFBE;
    --paper-raised: #E8E1D2;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #1B1815;
        --ink: #EDE7DA;
        --oxblood: #C4645A;
        --muted: #948B7C;
        --line: #3A342C;
        --paper-raised: #24211C;
    }
}

:root[data-theme="dark"] {
    --paper: #1B1815;
    --ink: #EDE7DA;
    --oxblood: #C4645A;
    --muted: #948B7C;
    --line: #3A342C;
    --paper-raised: #24211C;
}

html {
    scroll-padding-top: env(safe-area-inset-top, 0px);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

header.masthead {
    border-bottom: 2px solid var(--ink);
    padding-bottom: 22px;
    margin-bottom: 36px;
}

.byline-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 10px;
}

h1.name {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: clamp(2.3rem, 7vw, 3.4rem);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.role {
    font-size: 1.02rem;
    color: var(--muted);
    max-width: 46ch;
}

    .role strong {
        color: var(--ink);
        font-weight: 500;
    }

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.section-label {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--muted);
}

button {
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 3px;
}

.btn-primary {
    background: var(--oxblood);
    color: var(--paper);
    border: none;
    padding: 9px 16px;
}

    .btn-primary:hover {
        opacity: 0.9;
    }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 8px 14px;
}

    .btn-ghost:hover {
        border-color: var(--muted);
    }

.btn-text {
    background: none;
    border: none;
    color: var(--oxblood);
    padding: 0;
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#composer {
    display: none;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 34px;
}

    #composer.open {
        display: block;
    }

    #composer label {
        display: block;
        font-size: 0.78rem;
        color: var(--muted);
        margin: 14px 0 5px;
    }

        #composer label:first-child {
            margin-top: 0;
        }

    #composer input, #composer textarea, #composer select {
        width: 100%;
        font-family: inherit;
        font-size: 0.95rem;
        padding: 9px 10px;
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: 4px;
        color: var(--ink);
    }

    #composer textarea {
        resize: vertical;
        min-height: 130px;
        line-height: 1.55;
    }

.composer-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

ul.feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post {
    border-bottom: 1px solid var(--line);
    padding: 22px 0;
}

    .post:first-child {
        padding-top: 0;
    }

.post-meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.tag {
    color: var(--oxblood);
    font-weight: 600;
}

.post h2 {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.45rem;
    margin: 0 0 6px;
    cursor: pointer;
}

.dek {
    color: var(--muted);
    font-size: 0.96rem;
    margin: 0 0 10px;
}

.body-text {
    display: none;
    font-size: 0.98rem;
    line-height: 1.7;
    white-space: pre-wrap;
    margin: 12px 0 10px;
    max-width: 62ch;
}

    .body-text.open {
        display: block;
    }

.post-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.empty {
    color: var(--muted);
    font-style: italic;
    font-family: 'Fraunces', serif;
    padding: 30px 0;
}

footer {
    margin-top: 50px;
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}
