:root {
  --bg: #f4f1eb;
  --ink: #221f1c;        /* headings, active */
  --text: #4a453f;       /* body */
  --muted: #9a938a;
  --faint: #c4bdb2;
  --rule: #e3ded5;
  --wash: #ebe7df;

  --cradle-bar: #2a2724;
  --cradle-string: #b3ab9f;
  --cradle-shadow: rgba(70, 62, 52, 0.12);
  --ball-1: #f7f4ef; --ball-2: #d4cdc3; --ball-3: #a49c91; --ball-4: #6d665e;

  --font: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --ink: #eeeae3;
    --text: #bab3a9;
    --muted: #7c766e;
    --faint: #4d4944;
    --rule: #2a2826;
    --wash: #1f1d1b;
    --cradle-bar: #d9d3ca;
    --cradle-string: #57524b;
    --cradle-shadow: rgba(0, 0, 0, 0.35);
    --ball-1: #f2eee8; --ball-2: #b9b1a6; --ball-3: #7d766d; --ball-4: #3f3a35;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
html, body { margin: 0; background: var(--bg); }
body {
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--ink); color: var(--bg); }

.page { max-width: 560px; margin: 0 auto; padding: 64px 28px 40px; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { color: var(--ink); font-weight: 500; letter-spacing: -0.015em; margin: 0; }

/* nav */
.site-nav { display: flex; align-items: baseline; gap: 22px; margin: 0 0 56px; font-size: 13px; }
.site-nav .home { color: var(--ink); font-weight: 500; text-decoration: none; margin-right: auto; }
.site-nav nav { display: flex; gap: 22px; }
.site-nav nav a { color: var(--muted); text-decoration: none; }
.site-nav nav a:hover, .site-nav nav a[aria-current] { color: var(--ink); }

/* home */
.intro h1 { font-size: 17px; margin-bottom: 6px; }
.intro p { margin: 0; }
.intro p + p { margin-top: 10px; color: var(--muted); }

.cradle { margin: 36px 0 0; }
.cradle canvas { display: block; width: 100%; height: 157px; -webkit-tap-highlight-color: transparent; }
.cradle canvas.grab { cursor: grab; }
.cradle canvas.grabbing { cursor: grabbing; }
.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: 13px; user-select: none; -webkit-user-select: none; }
.controls .group { display: flex; align-items: center; gap: 4px; }
.controls button { font: inherit; color: var(--muted); background: transparent; border: 0; padding: 4px 6px; margin: -4px 0; cursor: pointer; border-radius: 4px; }
.controls button:hover, .controls button.on { color: var(--ink); }
.controls .count { color: var(--text); font-variant-numeric: tabular-nums; min-width: 1ch; text-align: center; }
.speeds, .speeds-inner { display: flex; align-items: center; gap: 6px; }
.speeds { margin-right: -6px; }
.speeds .sep { width: 1px; height: 12px; background: var(--rule); margin: 0 6px; }

.section { margin-top: 56px; }
.section h2, .year h2 { font-size: 13px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin: 0 0 8px; }
.section h2 a { color: inherit; text-decoration: none; }
.section h2 a:hover { color: var(--ink); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li > a { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 7px 0; text-decoration: none; color: var(--text); }
.list li > a:hover .t { color: var(--ink); }
.list .t { transition: color .15s; }
.list time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.arrow { color: var(--muted); font-size: 12px; margin-left: 4px; }
.draft { font-size: 11px; color: var(--bg); background: var(--muted); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; font-weight: 500; letter-spacing: .02em; }

.head { margin-bottom: 40px; }
.head h1 { font-size: 17px; margin-bottom: 6px; }
.head p { margin: 0; }
.year { margin-top: 32px; }
.year:first-of-type { margin-top: 0; }

/* posts */
.post-head { margin-bottom: 36px; }
.post-head h1 { font-size: 22px; line-height: 1.3; letter-spacing: -0.02em; }
.post-head .sub { margin: 6px 0 0; color: var(--text); }
.meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 0 14px; }
.meta a { color: inherit; }

.prose { font-size: 16px; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 1.15em; }
.prose h2 { font-size: 17px; margin: 2.2em 0 .6em; }
.prose h3, .prose h4 { font-size: 16px; margin: 1.8em 0 .5em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: .3em 0; padding-left: .15em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 1.5px solid var(--faint); color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font: 13.5px ui-monospace, "SF Mono", Menlo, monospace; background: var(--wash); padding: 2px 5px; border-radius: 4px; }
.prose pre { background: var(--wash); padding: 14px 16px; border-radius: 6px; overflow-x: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; height: 1px; background: var(--rule); margin: 2.4em 0; }

.prose figure { margin: 2em 0; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 6px; background: var(--wash); cursor: zoom-in; }
.prose figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.prose .grid { display: grid; gap: 8px; }
.prose .grid.g2 { grid-template-columns: 1fr 1fr; }
.prose .grid.g3 { grid-template-columns: 1fr 1fr 1fr; }
.prose .grid img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
@media (min-width: 700px) {
  .prose .grid { margin-left: -40px; margin-right: -40px; }
}

.pager { display: flex; justify-content: space-between; gap: 24px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; }
.pager a { text-decoration: none; max-width: 48%; color: var(--ink); }
.pager a span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.pager .next { text-align: right; margin-left: auto; }
.back { margin-top: 48px; font-size: 14px; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--ink); }

/* footer */
.site-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 96px; font-size: 12px; color: var(--muted); }
.site-footer .links { display: flex; gap: 16px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* image zoom */
.zoom { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 94%, transparent); cursor: zoom-out; opacity: 0; transition: opacity .2s; }
.zoom.open { opacity: 1; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.18); }

@media (max-width: 520px) {
  .page { padding: 40px 20px 32px; }
  .site-nav { gap: 16px; margin-bottom: 44px; }
  .site-nav nav { gap: 16px; }
  .site-footer { margin-top: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.head .intro-text { font-size: 15px; line-height: 1.55; margin-top: 6px; }
.head .intro-text blockquote { margin: 20px 0 0; font-size: 14px; }
.head .intro-text blockquote p { margin: 0 0 8px; }
.prose .video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; background: var(--wash); }
.prose audio { width: 100%; }
.prose video { display: block; width: 100%; border-radius: 6px; }
@media (max-width: 520px) { .prose .grid.g3 { grid-template-columns: 1fr 1fr; } }

/* work in progress */
.wip { margin: 24px 0 0; }
.wip svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; overflow: visible; }
.wip svg * { stroke: var(--ink); stroke-width: 1.5; }
.wip .chair *, .wip .desk * { stroke: var(--muted); }
.wip .head { fill: var(--bg); }
.wip text { stroke: none; fill: var(--muted); font: 500 9px var(--font); opacity: 0; animation: word 2.4s ease-out infinite; }
.wip text:nth-child(2) { animation-delay: .6s; }
.wip text:nth-child(3) { animation-delay: 1.2s; }
.wip text:nth-child(4) { animation-delay: 1.8s; }
@keyframes word { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-6px, -26px); } }

.wip .forearm { transform-box: fill-box; animation: type .28s ease-in-out infinite alternate; }
.wip .arm-back .forearm { transform-origin: left center; animation-delay: .14s; stroke: var(--muted); }
.wip .arm-back > path:first-child { stroke: var(--muted); }
.wip .arm-front .forearm { transform-origin: left center; }
@keyframes type { from { transform: rotate(-5deg); } to { transform: rotate(4deg); } }

.wip .head { transform-box: fill-box; transform-origin: center bottom; animation: nod 3.2s ease-in-out infinite; }
@keyframes nod { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(6deg); } 86% { transform: rotate(-2deg); } }

.wip .steam { stroke: var(--muted); opacity: 0; animation: steam 2.6s ease-in-out infinite; }
.wip .s2 { animation-delay: 1.3s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-8px); } }


@media (prefers-reduced-motion: reduce) {
  .wip *, .wip *::before { animation: none !important; }
  .wip text, .wip .steam { opacity: 0; }
}

/* rss */
.feed-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px; margin: 0 0 24px; }
.feed-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 14px ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); }
.copy { font: inherit; font-size: 13px; color: var(--ink); background: var(--wash); border: 1px solid var(--rule); border-radius: 6px; padding: 5px 12px; cursor: pointer; flex: none; }
.copy:hover { border-color: var(--faint); }

.prose { overflow-wrap: break-word; }
.prose .tweet { margin: 1.4em 0; }
.prose .xlink { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 99px; font-size: 14px; text-decoration: none; color: var(--ink); }
.prose .xlink:hover { border-color: var(--faint); }
.prose figcaption .xlink { padding: 0; border: 0; font-size: inherit; color: var(--muted); text-decoration: underline; text-decoration-color: var(--faint); }
