:root {
    --bg: #F0EEE6;
    --ink: #1F1E1D;
    --code-bg: rgba(31, 30, 29, 0.06);
    --rule: rgba(31, 30, 29, 0.25);
}

:root[data-theme="dark"] {
    --bg: #1F1E1D;
    --ink: #F0EEE6;
    --code-bg: rgba(240, 238, 230, 0.08);
    --rule: rgba(240, 238, 230, 0.3);
}

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

html {
    background-color: var(--bg);
}

body {
    font-family: 'Newsreader', 'Times New Roman', serif;
    font-optical-sizing: none;
    font-variation-settings: "opsz" 24;
    font-size: 20px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--bg);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 10px;
    margin-bottom: 40px;
}

.site-name {
    font-size: 28.8px;
    font-weight: 600;
    line-height: 1.2;
}

.site-name a {
    color: inherit;
    text-decoration: none;
}

/* Theme toggle */
.theme-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 20px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    position: relative;
    padding: 0;
}

.toggle-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--ink);
    transition: transform 0.2s ease;
}

:root[data-theme="dark"] .toggle-dot {
    transform: translateX(19px);
}

/* Typography */
p {
    margin-bottom: 20px;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 16px;
}

section:first-of-type h2 {
    margin-top: 48px;
}

ul {
    list-style: disc;
    padding-left: 22px;
}

li {
    margin-bottom: 20px;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1.6px;
    text-underline-offset: 2px;
}

a:hover {
    opacity: 0.65;
}

em {
    font-style: italic;
}

.pub-meta {
    display: inline-block;
    margin-top: 2px;
}

.contact-line {
    margin-bottom: 8px;
}

/* Meditations (rendered markdown) */
.post-title,
.meditation h1 {
    font-size: 28.8px;
    font-weight: 600;
    line-height: 1.25;
    margin: 8px 0 24px;
}

.meditation h3 {
    font-size: 21px;
    font-weight: 600;
    margin: 32px 0 12px;
}

.meditation li {
    margin-bottom: 10px;
}

.meditation ol {
    padding-left: 22px;
}

.meditation blockquote {
    margin: 24px 0;
    padding-left: 20px;
    border-left: 2px solid var(--ink);
    font-style: italic;
}

.meditation blockquote p:last-child {
    margin-bottom: 0;
}

.meditation code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.78em;
    background: var(--code-bg);
    padding: 2px 5px;
    border-radius: 3px;
}

.meditation pre {
    background: var(--code-bg);
    padding: 16px;
    border-radius: 3px;
    overflow-x: auto;
    margin: 24px 0;
    line-height: 1.5;
}

.meditation pre code {
    background: none;
    padding: 0;
    font-size: 15px;
}

.meditation img {
    max-width: 100%;
    height: auto;
    margin: 24px 0;
}

.meditation hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 40px 0;
}

.meditation table {
    border-collapse: collapse;
    margin: 24px 0;
    width: 100%;
    display: block;
    overflow-x: auto;
}

.meditation th,
.meditation td {
    border: 1px solid var(--rule);
    padding: 6px 12px;
    text-align: left;
}

/* Mobile */
@media (max-width: 480px) {
    body {
        font-size: 18px;
    }

    .site-name {
        font-size: 24px;
    }

    h2 {
        font-size: 22px;
    }
}
