:root {
    --paper: #f6f4ef;
    --surface: #fffdf9;
    --ink: #182b3a;
    --muted: #68747a;
    --accent: #c55b43;
    --accent-dark: #9d402d;
    --accent-soft: #f1ddd4;
    --line: #dedfd9;
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --shadow: 0 8px 24px rgba(24, 43, 58, .06);
    --shadow-hover: 0 16px 34px rgba(24, 43, 58, .13);
}

html[data-theme="dark"] {
    --paper: #111b24;
    --surface: #192733;
    --ink: #edf2f1;
    --muted: #aab8bb;
    --accent: #e17a5d;
    --accent-dark: #f19a7e;
    --accent-soft: #3a2d2d;
    --line: #30404a;
    --shadow: 0 8px 24px rgba(0, 0, 0, .2);
    --shadow-hover: 0 16px 34px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.65; }
img { max-width: 100%; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.skip-link { position: absolute; left: 12px; top: -100px; z-index: 20; background: var(--ink); color: white; padding: 8px 14px; border-radius: 0 0 8px 8px; }
.skip-link:focus { top: 0; color: white; }
.site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.site-header__inner { min-height: 72px; display: flex; align-items: center; gap: 28px; position: relative; }
.site-title { color: var(--ink); font: 700 1.35rem/1 var(--serif); letter-spacing: -.02em; white-space: nowrap; }
.site-title:hover { color: var(--accent); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-size: .9rem; padding: 24px 0 20px; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.is-current { color: var(--ink); text-decoration: none; }
.site-nav a.is-current { border-bottom-color: var(--accent); }
.lang-switch { margin-left: auto; }
.lang-switch a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .8rem; background: var(--surface); }
.lang-switch a:hover { border-color: var(--accent); text-decoration: none; }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme-toggle { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font: 1.1rem/1 var(--sans); cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.page-home { padding-bottom: 36px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(200px, .7fr); gap: 48px; align-items: end; padding: clamp(72px, 13vw, 150px) 0 76px; }
.hero::after { content: ""; display: block; height: 180px; border-radius: 55% 45% 48% 52%; background: var(--accent-soft); transform: rotate(-8deg); grid-column: 2; grid-row: 1; }
.hero > * { grid-column: 1; }
.hero::after { grid-column: 2; }
.eyebrow { margin: 0 0 12px; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .35em; font-size: .75rem; font-weight: 700; }
.hero-title { max-width: 10ch; margin: 0 0 18px; font: 700 clamp(3rem, 8vw, 6.4rem)/.98 var(--serif); letter-spacing: -.055em; }
.hero-sub { max-width: 45ch; margin: 0; color: var(--muted); font-size: 1.15rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 0 0 74px; }
.card { display: block; overflow: hidden; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { color: var(--ink); transform: translateY(-5px); box-shadow: var(--shadow-hover); text-decoration: none; }
.card img { display: block; width: 100%; height: 185px; object-fit: cover; }
.card-body { padding: 18px 20px 20px; }
.card h2, .card h3 { margin: 0 0 3px; font: 700 1.35rem/1.2 var(--serif); }
.card p { margin: 0; color: var(--muted); font-size: .9rem; }

.page-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-top: 70px; }
.page-heading { margin: 0 0 8px; font: 700 clamp(2.4rem, 6vw, 4rem)/1 var(--serif); letter-spacing: -.04em; }
.page-heading-row .eyebrow { margin-bottom: 10px; }
.page-intro { max-width: 68ch; margin: 0 0 32px; color: var(--muted); font-size: 1.08rem; }
.feature-panel { max-width: 760px; margin: 42px 0 80px; padding: 34px; border-radius: 18px; background: var(--accent-soft); }
.feature-panel h2 { margin: 0 0 8px; font: 700 2rem/1.1 var(--serif); }
.feature-panel p:last-child { max-width: 55ch; margin: 0; color: var(--muted); }
.page-count { padding-bottom: 10px; color: var(--muted); font-size: .85rem; }
.blog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.blog-filters button { padding: 8px 17px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: .86rem; cursor: pointer; }
.blog-filters button:hover, .blog-filters button.active { border-color: var(--ink); }
.blog-filters button.active { background: var(--ink); color: white; }
html[data-theme="dark"] .blog-filters button.active { background: var(--accent); border-color: var(--accent); color: #111b24; }
.post-list { max-width: 850px; margin-bottom: 80px; }
.post-card { display: flex; align-items: center; gap: 22px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.post-card img { flex: 0 0 190px; width: 190px; height: 125px; object-fit: cover; border-radius: 9px; }
.card-info { min-width: 0; }
.post-card time { color: var(--muted); font-size: .78rem; }
.post-language { display: inline-block; margin-left: 8px; color: var(--accent-dark); font-size: .7rem; font-weight: 700; letter-spacing: .1em; }
.post-card h2 { margin: 4px 0 4px; font: 700 1.45rem/1.2 var(--serif); }
.excerpt { margin: 0; color: var(--muted); font-size: .9rem; }
.empty-state { margin: 24px 0 80px; padding: 26px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

.post { max-width: 760px; margin: 0 auto; padding: 72px 0 96px; }
.post-header { margin-bottom: 32px; }
.post-meta { margin: 0 0 12px; color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; margin-left: 10px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .7rem; letter-spacing: .1em; }
.post-title { margin: 0; font: 700 clamp(2.5rem, 7vw, 4.6rem)/1 var(--serif); letter-spacing: -.05em; }
.post-subtitle { margin: 12px 0 0; color: var(--muted); font-size: 1.1rem; }
.post-figure { margin: 0 0 38px; }
.post-figure img { display: block; width: 100%; max-height: 560px; object-fit: cover; border-radius: 14px; }
.post-figure figcaption { margin-top: 8px; color: var(--muted); text-align: center; font-size: .82rem; }
.post-content { font-size: 1.08rem; }
.post-content p { margin: 0 0 1.25em; }
pre.poem { overflow-x: auto; margin: 0; padding: 4px 0 4px 26px; border-left: 3px solid var(--accent-soft); background: transparent; color: var(--ink); font: 1.25rem/2 var(--serif); white-space: pre-line; }
.post-nav { margin-top: 58px; }
.back-link { color: var(--muted); font-size: .9rem; }
.back-link:hover { color: var(--accent-dark); text-decoration: none; }
.site-footer { margin-top: 36px; padding: 28px 0 44px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .82rem; }
.error { padding: 120px 0; text-align: center; }
.error h1 { margin: 0 0 12px; font: 700 5rem/1 var(--serif); }
.error p { margin: 0 0 26px; color: var(--muted); }

@media (max-width: 760px) {
    .container { width: min(100% - 28px, 620px); }
    .site-header__inner { gap: 16px; padding: 14px 0; }
    .site-nav { order: 3; width: 100%; justify-content: space-between; gap: 8px; }
    .site-nav a { padding: 4px 0; font-size: .82rem; }
    .hero { display: block; padding: 74px 0 58px; }
    .hero::after { display: none; }
    .hero-title { font-size: clamp(3.3rem, 16vw, 5rem); }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .card img { height: 145px; }
    .card-body { padding: 14px; }
    .card h2 { font-size: 1.15rem; }
    .page-heading-row { margin-top: 48px; }
    .post-card { align-items: flex-start; }
    .post-card img { flex-basis: 120px; width: 120px; height: 100px; }
}
@media (max-width: 440px) {
    .grid { grid-template-columns: 1fr; }
    .site-nav { justify-content: flex-start; flex-wrap: wrap; column-gap: 14px; }
    .header-tools { margin-left: 0; }
    .post-card { display: block; }
    .post-card img { width: 100%; height: 170px; margin-bottom: 12px; }
    .post-title { font-size: 2.8rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
