:root {
  color-scheme: light dark;
  --bg: #fcfcfa;
  --fg: #252724;
  --muted: #62665f;
  --rule: #d8dbd3;
  --code: #eeefe9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #191b19; --fg: #dedfd8; --muted: #a2a79d; --rule: #3b4038; --code: #252923; }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191b19; --fg: #dedfd8; --muted: #a2a79d; --rule: #3b4038; --code: #252923;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); }
body {
  max-width: 76ch;
  margin: 3rem auto 3rem max(1.5rem, calc((100vw - 1040px) / 2));
  padding: 0 1.5rem;
  font: 16px/1.75 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  overflow-wrap: anywhere;
}
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, select:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.site-header { display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: baseline; padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule); }
.site-title { font-weight: 700; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .875rem; }
nav [aria-current="page"] { text-decoration-thickness: 2px; }
.appearance-control { margin-left: auto; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.appearance-control select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--rule); border-radius: 2px; padding: .2rem; }
main { margin-top: 2.5rem; }
h1, h2, h3, h4 { line-height: 1.4; font-size: 1rem; margin: 2rem 0 .75rem; }
h1 { font-size: 1.25rem; margin-top: 0; }
p { margin: 1rem 0; }
.intro { margin-bottom: 2.5rem; }
.intro h1 { font-size: 1.125rem; }
section + section { margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--rule); }
.post-list { list-style: none; margin: 1rem 0; padding: 0; }
.post-list li { display: grid; grid-template-columns: 10ch 1fr; gap: 1rem; margin: .65rem 0; align-items: baseline; }
.post-list time, .meta, .muted, .section-links, .site-footer { color: var(--muted); }
.post-list time { font-size: .8125rem; white-space: nowrap; }
.section-links, .meta, .site-footer { font-size: .8125rem; }
dl { margin: 1rem 0; }
dt { font-weight: 700; margin-top: 1.5rem; }
dd { margin: .35rem 0 0; color: var(--muted); font-size: .875rem; }
.article-header { margin-bottom: 2rem; }
.article-header h1 { margin-bottom: .6rem; }
.article-header .meta { margin: .15rem 0; }
article ul, article ol { padding-left: 1.5rem; }
article li { margin: 1rem 0; }
img { max-width: 100%; height: auto; }
pre { overflow-x: auto; padding: 1rem; background: var(--code); }
code { font-family: inherit; }
blockquote { border-left: 2px solid var(--rule); margin: 1.5rem 0; padding-left: 1rem; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
table { display: block; overflow-x: auto; border-collapse: collapse; }
th, td { padding: .5rem; border-bottom: 1px solid var(--rule); text-align: left; }
.image-row { display: flex; gap: .75rem; }
.image-row img { flex: 1; min-width: 0; object-fit: cover; }
.back-link { margin-top: 2.5rem; font-size: .875rem; }
.site-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.skip-link { position: absolute; left: -10000px; }
.skip-link:focus { position: static; display: block; margin-bottom: 1rem; }
@media (max-width: 700px) {
  body { margin: 1.5rem auto; padding: 0 1.25rem; }
  main { margin-top: 2rem; }
  .post-list li { grid-template-columns: 1fr; gap: .1rem; margin: 1rem 0; }
  .image-row { flex-wrap: wrap; }
}

.activity-summary { display: block; color: var(--muted); font-size: .8125rem; }

/* Photos preserve their proportions; only the enlarged view needs JavaScript. */
.photo { margin: 1.5rem 0; }
.photo-link { display: block; }
.photo-link img { display: block; width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: .8125rem; margin-top: .4rem; }
.photo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.photo-gallery .photo { margin: .5rem 0; }
#photo-viewer { width: min(96vw, 1500px); max-width: 96vw; max-height: 96dvh; padding: 1rem; background: var(--bg); color: var(--fg); border: 1px solid var(--rule); }
#photo-viewer::backdrop { background: rgb(0 0 0 / .85); }
#photo-viewer figure { margin: .75rem 0 0; }
#photo-viewer img { display: block; width: 100%; height: auto; max-height: 72dvh; object-fit: contain; }
.photo-controls { display: flex; gap: .75rem; flex-wrap: wrap; }
.photo-controls button { font: inherit; color: inherit; background: var(--code); border: 1px solid var(--rule); padding: .35rem .6rem; cursor: pointer; }
.photo-controls button:disabled { opacity: .4; cursor: default; }
.photo-controls button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.photo-source { display: block; overflow-wrap: anywhere; }
@media (max-width: 700px) { .photo-gallery { grid-template-columns: 1fr; } }

.photo-width-50 { width: 50%; margin-left: auto; margin-right: auto; }
.photo-width-75 { width: 75%; margin-left: auto; margin-right: auto; }
@media (max-width: 700px) {
  .photo-width-50, .photo-width-75 { width: 100%; }
}
