/* Local system fonts and a single small stylesheet keep the reading path light. */
:root {
  color-scheme: light;
  --paper: #faf8f2;
  --surface: #fffdf8;
  --ink: #202d28;
  --muted: #58655e;
  --green: #245840;
  --green-hover: #153d2b;
  --orange: #9d431e;
  --line: #d8ddd3;
  --soft: #edf1e8;
  --danger: #982f2a;
  --radius: .35rem;
}
* { box-sizing: border-box; }
html { font-size: 100%; scroll-padding-top: 2rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-wrap: break-word; }
::selection { background: #d5e3c7; color: #14271c; }
a { color: var(--green); text-decoration-thickness: .075em; text-underline-offset: .2em; }
a:hover { color: var(--green-hover); text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, .button { touch-action: manipulation; }
img, video, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.18; text-wrap: balance; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.035em; }
h1 { font-size: clamp(2.35rem, 6vw, 4rem); margin: 0 0 1.3rem; }
h2 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.35rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.6rem 0; }
.wrap { width: min(100% - 3rem, 740px); margin-inline: auto; }
.narrow { max-width: 520px; }
.site-header { width: min(100% - 3rem, 1120px); margin: 0 auto; padding: 1.9rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-size: 1.1rem; font-weight: 750; text-decoration: none; letter-spacing: -.025em; }
.brand::before { content: ""; display: inline-block; width: .65rem; height: .65rem; margin-right: .7rem; background: var(--green); border-radius: 50%; }
.site-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; font-size: .9rem; }
.site-nav a { color: var(--muted); padding-block: .4rem; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
main { min-height: 50vh; padding-block: clamp(2.5rem, 7vw, 5.5rem); }
.intro { padding-bottom: 2.4rem; border-bottom: 1px solid var(--line); margin-bottom: .7rem; }
.intro p { max-width: 36rem; color: var(--muted); font-size: 1.15rem; }
.intro p:last-child { margin-bottom: 0; }
.eyebrow, .intro .eyebrow { display: block; font-size: .75rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); margin-bottom: 1rem; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-card { padding: 2rem 0; border-bottom: 1px solid var(--line); }
.post-card h2 { font-size: clamp(1.6rem, 3.8vw, 2rem); margin: .55rem 0 .7rem; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.post-card p { color: var(--muted); margin-bottom: .6rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; color: var(--muted); font-size: .825rem; font-variant-numeric: tabular-nums; }
.prose { font-family: Georgia, "Times New Roman", serif; font-size: 1.1875rem; line-height: 1.8; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin-top: 2.7rem; }
.prose h3, .prose h4 { margin-top: 2.2rem; }
.prose ul, .prose ol { padding-left: 1.4em; margin-block: 1.4rem; }
.prose li + li { margin-top: .45rem; }
.prose img { display: block; margin: 2rem auto; border-radius: var(--radius); }
.prose figure { margin: 2rem 0; }
.prose figcaption { color: var(--muted); font: .875rem/1.6 system-ui, sans-serif; margin-top: .6rem; }
blockquote { border-left: 3px solid var(--green); margin: 2rem 0; padding: .25rem 0 .25rem 1.4rem; color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .85em; }
code { background: var(--soft); padding: .12em .3em; border-radius: .2rem; overflow-wrap: anywhere; }
pre { overflow: auto; max-width: 100%; padding: 1.2rem; background: #eaf0e6; border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.7; tab-size: 4; }
pre code { padding: 0; background: none; font-size: 1em; overflow-wrap: normal; }
table { border-collapse: collapse; width: 100%; margin: 1.8rem 0; font-size: .9em; }
th, td { border-bottom: 1px solid var(--line); padding: .7rem .6rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { font-weight: 700; background: var(--soft); }
details { margin: 1.2rem 0; border: 1px solid var(--line); padding: .85rem 1rem; border-radius: var(--radius); }
summary { cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: .8rem; }
.site-footer { width: min(100% - 3rem, 1120px); margin: 0 auto; border-top: 1px solid var(--line); padding: 1.6rem 0 2rem; color: var(--muted); font-size: .825rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; }
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.back-link { display: inline-block; font-size: .875rem; margin-bottom: 2rem; }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; font-size: .9rem; }
.empty { padding: 2.5rem 0; color: var(--muted); }
.admin-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.admin-header h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
.admin-header form, .actions form { margin: 0; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-card { padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.admin-card h2, .admin-card h3 { margin: 0 0 .5rem; font-size: 1.4rem; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > * { flex: 1 1 14rem; min-width: 0; }
form { margin: 0; }
label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: .4rem; }
input:not([type="checkbox"]):not([type="radio"]), textarea, select { display: block; width: 100%; max-width: 100%; border: 1px solid #8e9b90; border-radius: var(--radius); padding: .7rem .8rem; background: var(--surface); color: var(--ink); min-height: 2.9rem; }
input[type="checkbox"], input[type="radio"] { width: 1.2rem; height: 1.2rem; vertical-align: middle; accent-color: var(--green); margin-right: .4rem; }
input:disabled, textarea:disabled, select:disabled { opacity: .65; cursor: not-allowed; }
textarea { min-height: 8rem; resize: vertical; }
textarea.editor { min-height: 26rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; line-height: 1.65; tab-size: 4; }
form small, .form-row small { display: block; color: var(--muted); font-size: .8rem; margin-top: .35rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.button, button { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; border: 1px solid var(--green); border-radius: var(--radius); background: var(--green); color: #fff; font-size: .9rem; font-weight: 650; line-height: 1.4; min-height: 2.8rem; padding: .65rem 1.1rem; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }
.button.secondary { background: transparent; color: var(--green); border-color: #879b88; }
.button.secondary:hover { background: var(--soft); }
.button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: #f9e8e3; }
.notice, .error { margin-bottom: 1.5rem; padding: 1rem 1.15rem; border: 1px solid #90ad83; border-left-width: 4px; border-radius: var(--radius); background: #edf4e8; }
.error { border-color: #b2695b; background: #fff0e9; color: #782620; }
.notice p:last-child, .error p:last-child { margin-bottom: 0; }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 1rem; padding: .08rem .55rem; font-size: .72rem; font-weight: 650; line-height: 1.7; color: var(--green); background: var(--soft); vertical-align: middle; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 100; padding: .6rem 1rem; background: var(--ink); color: white; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); color: white; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 540px) {
  body { font-size: 1rem; }
  .wrap, .site-header, .site-footer { width: calc(100% - 2rem); }
  .site-header { padding-block: 1.2rem; align-items: flex-start; flex-direction: column; gap: .6rem; }
  .site-nav { gap: .5rem 1.2rem; }
  .intro { padding-bottom: 1.8rem; }
  .post-card { padding-block: 1.6rem; }
  .prose { font-size: 1.125rem; }
  pre { padding: .85rem; }
  th, td { padding: .55rem .35rem; }
  textarea.editor { min-height: 22rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  :root { --ink: #000; --muted: #333; --paper: #fff; --line: #bbb; }
  body { font-size: 11pt; }
  .wrap, .site-header, .site-footer { width: 100%; max-width: none; }
  main { padding-block: 1rem; }
  .site-nav, .skip-link, .actions, .pagination, .back-link, .admin-header form { display: none; }
  .site-header, .site-footer { padding-block: .7rem; }
  .prose { font-size: 11pt; }
  h1 { font-size: 28pt; }
  h2, h3, h4 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  pre, blockquote, figure { break-inside: avoid; }
  pre { white-space: pre-wrap; }
  a { color: inherit; }
  .prose a[href^="https://"]::after { content: " (" attr(href) ")"; font-size: .8em; overflow-wrap: anywhere; }
}

/* Markdown controls are loaded only on editor pages. */
.markdown-tools { display: flex; flex-wrap: wrap; gap: .35rem; padding: .7rem; border: 1px solid #8e9b90; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--soft); }
.markdown-tools[hidden] { display: none; }
.markdown-tools button { min-height: 2.5rem; padding: .45rem .65rem; border-color: transparent; background: transparent; color: var(--green); font-size: .8rem; }
.markdown-tools button:hover { background: var(--green); color: white; }
.markdown-editor textarea.markdown { min-height: 28rem; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; line-height: 1.7; tab-size: 4; font-weight: 400; }
.markdown-tools:not([hidden]) + textarea.markdown { border-top-left-radius: 0; border-top-right-radius: 0; }
@media (max-width: 540px) { .markdown-tools { gap: .2rem; padding: .4rem; } .markdown-tools button { min-height: 2.75rem; } }
@media print { .markdown-tools { display: none; } }

.slug-reset { align-self: flex-start; margin-top: -.8rem; font-size: .8rem; }
.slug-reset[hidden] { display: none; }
.image-upload { margin: 0; }
.image-upload p { color: var(--muted); font-size: .875rem; }
.image-upload input[type="file"] { white-space: normal; }
.prose img { height: auto; max-width: 100%; }
