@font-face {
  font-family: Atkinson;
  src: url(fonts/atkinson-regular.woff) format("woff");
  font-display: swap;
}
@font-face {
  font-family: Atkinson;
  font-weight: 700;
  src: url(fonts/atkinson-bold.woff) format("woff");
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --ink: #141414;
  --paper: #fff;
  --quiet: #6b6b6b;
  --tint: #f1efea;
  --edge: clamp(1.25rem, 6vw, 6rem);
  --m: clamp(1.5rem, 4vw, 3rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ecebe6;
    --paper: #121212;
    --quiet: #a09e98;
    --tint: #1e1e1d;
  }
}
/* the button's choice wins over the system setting */
:root[data-theme="light"] { color-scheme: light; --ink: #141414; --paper: #fff; --quiet: #6b6b6b; --tint: #f1efea; }
:root[data-theme="dark"] { color-scheme: dark; --ink: #ecebe6; --paper: #121212; --quiet: #a09e98; --tint: #1e1e1d; }
#theme { position: relative; width: 1.5rem; height: 0.86rem; margin-left: 0.35rem; padding: 0; border: 0; background: none; color: inherit; vertical-align: baseline; cursor: pointer; }
#theme::after { content: ""; position: absolute; inset: -0.5rem; }
#theme svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="light"] #theme svg { transform: scaleY(-1); }

* { box-sizing: border-box; }
html {
  font: 112.5%/1.6 Atkinson, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
body { margin: 0; overflow-wrap: break-word; }
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-size: 1rem; line-height: 1.25; margin: 0; }
time { color: var(--quiet); font-size: 0.85rem; }

.name { font-size: 1.25rem; line-height: 1.2; font-weight: 700; margin: 0 0 2.5rem; }
.name a { text-decoration: none; }
.site-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 1.5rem; margin: 0 0 2.5rem; }
.site-head .name { margin: 0; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.85rem; color: var(--quiet); }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .site-nav [aria-current] { color: var(--ink); }
.site-nav [aria-current] { font-weight: 700; }

body:has(.home) { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; }
.home {
  display: flex;
  flex-direction: column;
  width: min(100%, 40rem);
  max-height: 100vh;
  max-height: 100dvh;
  padding: var(--m);
  overflow: hidden;
}
.page { width: min(100%, calc(46rem + 2 * var(--m))); margin: 0 auto; padding: var(--m) var(--m) 6rem; }
.home main { flex: none; min-width: 0; }
.home .name { font-size: 1rem; line-height: 1; margin: 0 0 1.6rem; text-box: trim-both cap alphabetic; }
.intro { margin: 0; font-size: 1rem; line-height: 1.5; text-wrap: pretty; }

.latest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 1.6rem;
}
.latest .block, .latest .block > a { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.latest .block > a { flex: 0 1 auto; text-decoration: none; }
.latest .block img, .latest .block p { display: block; flex: 0 1 clamp(4.5rem, 16vh, 7.5rem); min-height: 0; width: 100%; height: auto; margin: 0; }
.latest .block img { object-fit: cover; }
.latest .block p {
  padding: 0.7rem 0.8rem;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--tint);
}
.latest .block h2 {
  flex: none;
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.latest .block > a:hover h2 { text-decoration: underline 1px; text-underline-offset: 0.2em; }
.latest .block time { display: block; flex: none; font-size: 0.85rem; line-height: 1.25; text-box: trim-end alphabetic; }

.machine { order: -1; flex: 0 1 15rem; min-height: 5rem; margin-bottom: 1.6rem; }
.machine img { display: block; height: 100%; width: auto; }
.machine p { margin: 0; color: var(--quiet); }

.page main > * { max-width: 36rem; }
.page h1 { font-size: 1.35rem; line-height: 1.2; margin-bottom: 0.3rem; }
.page .body { max-width: none; }
.page img { width: auto; max-width: 100%; max-height: min(70vh, 26rem); }
img.photo { margin: 2rem 0; }
.zoom.hero { display: block; width: 100%; max-width: 46rem; margin: 1.75rem 0 0; }
.zoom.hero img { width: 100%; max-height: min(65vh, 30rem); object-fit: cover; }

.list-sub { margin: 0.35rem 0 0; color: var(--quiet); font-size: 0.9rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 1.5rem; max-width: none; margin-top: 2rem; }
.page main > .photo-grid { max-width: none; }
.page .block > a { display: block; text-decoration: none; }
.page .block img { width: 100%; max-width: none; aspect-ratio: 3 / 2; object-fit: cover; }
.page .block h2 { margin: 0.6rem 0 0; font-size: 0.9rem; }
.page .block time { display: block; font-size: 0.82rem; line-height: 1.3; margin-top: 0.15rem; }

.rich-list { list-style: none; max-width: 42rem; margin: 0.5rem 0 0; padding: 0; }
.page main > .rich-list { max-width: 42rem; }
.rich-list li { border-top: 1px solid color-mix(in srgb, var(--quiet) 22%, transparent); }
.rich-list li:first-child { border-top: 0; }
.rich-list a { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; padding: 1.1rem 0; text-decoration: none; }
.rich-list a:hover .rl-title { text-decoration: underline 1px; text-underline-offset: 0.2em; }
.rl-body { flex: 1; min-width: 0; }
.rl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.rl-title { font-weight: 700; font-size: 0.98rem; line-height: 1.35; }
.rl-top time { flex: none; font-size: 0.82rem; }
.rl-excerpt { margin: 0.35rem 0 0; color: var(--quiet); font-size: 0.88rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.page .rl-thumb { flex: none; width: 5.5rem; height: 3.75rem; max-width: none; max-height: none; object-fit: cover; margin-top: 0.15rem; border-radius: 3px; background: var(--tint); }

.list-meta { display: inline-flex; align-items: baseline; gap: 0.75rem; flex: none; }
.list-kind { color: var(--quiet); font-size: 0.78rem; }

.cols { display: grid; grid-template-columns: minmax(0, 31rem) minmax(0, 13rem); column-gap: 2rem; align-items: start; max-width: none; margin-top: 2.25rem; }
.cols.solo { grid-template-columns: minmax(0, 38rem); }
.page main > .cols { max-width: none; }
.main > :first-child { margin-top: 0; }
.main > .body > :first-child { margin-top: 0; }
.meta { font-size: 0.85rem; line-height: 1.5; color: var(--quiet); }
.meta h2 { margin: 1.2rem 0 0.2rem; font-size: 0.85rem; color: var(--ink); }
.meta h2:first-child { margin-top: 0; line-height: 1.6rem; }
.meta p:empty::before { content: "–"; }
.meta p { margin: 0; }
.meta p + p { margin-top: 0.6rem; }
.meta a { color: inherit; }
.row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.5rem; }
.body:empty + .row { margin-top: 0; }
.zoom { display: block; width: fit-content; max-width: 100%; cursor: zoom-in; }
.row .zoom { width: auto; }
.zoom input { position: absolute; opacity: 0; pointer-events: none; }
.zoom:has(:focus-visible) img { outline: 2px solid var(--ink); }
.page .row img { display: block; width: 100%; max-width: none; aspect-ratio: 1; object-fit: cover; margin: 0; }
.zoom:has(:checked) { cursor: zoom-out; }
.zoom:has(:checked) img, .page .row .zoom:has(:checked) img { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; max-width: none; max-height: none; aspect-ratio: auto; margin: 0; padding: var(--m); background: var(--paper); object-fit: contain; }

.kinds { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 1.5rem 0 0; }
.kinds + .kinds { margin-top: 0.5rem; }
.kinds [aria-current] { font-weight: 700; text-decoration: none; }
.year { margin: 3.5rem 0 0.5rem; color: var(--quiet); font-weight: 400; }
.list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.year + .list { margin-top: 0; }
.list li { display: flex; align-items: baseline; justify-content: space-between; gap: 1.5rem; padding: 0.45rem 0; }
.list time { flex: none; }

.poem { font-size: 0.85rem; line-height: 1.55; white-space: pre-line; font-style: italic; color: var(--ink); }
.caption { margin: 0.85rem 0 0; }
.caption p { margin: 0; }
.caption .piece-title { font-size: 0.9rem; font-weight: 700; line-height: 1.35; color: var(--ink); }
.caption .piece-medium { margin-top: 0.15rem; font-size: 0.85rem; font-style: italic; line-height: 1.4; color: var(--quiet); }
.caption .piece-note { margin-top: 0.35rem; font-size: 0.85rem; line-height: 1.5; color: var(--ink); }
.machine .caption { margin: 0.8rem 0 0; }
.machine .caption .piece-title { font-size: 0.85rem; }
.machine .caption .piece-note { margin-top: 0.25rem; color: var(--quiet); }
.machine-intro { margin: 1rem 0 0; color: var(--quiet); font-size: 0.9rem; }
.machine-intro p { margin: 0 0 0.75rem; }
.past-works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; max-width: none; margin-top: 1.5rem; }
.page main > .past-works { max-width: none; }
.past-work img { width: 100%; max-height: none; margin: 0; }
.piece-meta { margin: 0.85rem 0 0; padding-top: 0.75rem; border-top: 1px solid color-mix(in srgb, var(--quiet) 30%, transparent); font-size: 0.85rem; line-height: 1.5; color: var(--quiet); }
.piece-meta dt { margin: 0.55rem 0 0.1rem; font-weight: 700; color: var(--ink); }
.piece-meta dt:first-child { margin-top: 0; }
.piece-meta dd { margin: 0; }
.piece-meta a { color: inherit; }

.body { font-size: 1rem; line-height: 1.6; }
.body > * { max-width: 36rem; }
.body > p:has(img), .body > figure { max-width: none; }
.body p, .body ul, .body ol { margin: 0 0 1.25rem; }
.body img { margin: 2rem 0; }
.body figure { margin: 2.5rem 0; }
.body figure img { margin: 0 0 0.6rem; }
.body figcaption { color: var(--quiet); font-size: 0.85rem; }
.body h1, .body h2, .body h3 { font-size: 1rem; margin: 2.5rem 0 0.75rem; }
.body blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 1px solid var(--quiet); }
.body pre, .body code { font: inherit; }
.body pre { overflow-x: auto; padding: 1rem; background: var(--tint); }
.body table { display: block; overflow-x: auto; border-collapse: collapse; }
.body td, .body th { padding: 0.3rem 1.25rem 0.3rem 0; text-align: left; vertical-align: top; }
.body hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--quiet); }

/* home: the same two columns as a post, text and posts in the main one, the machine in the margin */
.home { display: grid; grid-template-columns: minmax(0, 31rem) minmax(0, 13rem); column-gap: 2rem; align-items: stretch; width: auto; max-width: 100%; max-height: none; overflow: visible; }
.home main { display: flex; flex-direction: column; }
.home .name { font-size: 1.25rem; line-height: 1.2; margin: 0 0 1rem; text-box: none; }
.label { margin: auto 0 0; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, var(--quiet) 40%, transparent); font-size: 0.85rem; font-weight: 400; color: var(--quiet); }
.latest { gap: 1rem; padding-top: 0.8rem; }
.latest .block img, .latest .block p { flex: none; height: 7rem; }
.machine { order: 0; flex: none; min-height: 0; margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--quiet); }
.machine img { display: block; width: 100%; height: auto; }
.machine p { margin: 0.8rem 0 0; color: var(--quiet); }
.machine p:last-child { text-box: trim-end alphabetic; }
.intro + .intro { margin-top: 1rem; padding-bottom: 2rem; }
.machine .poem { font-size: 0.85rem; color: var(--ink); }

@media (max-width: 760px) {
  .home, .home main { display: block; }
  .label { margin-top: 0; }
  .latest { grid-template-columns: 1fr; }
  .latest .block img, .latest .block p { height: auto; aspect-ratio: 3 / 2; }
  .machine { margin: 2rem 0 0; }
  .page main:has(> .block) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
  .page .rl-thumb { width: 4.5rem; height: 3.1rem; }
  .cols, .cols.solo { grid-template-columns: 1fr; row-gap: 2rem; }
  .past-works { grid-template-columns: 1fr; }
}
