/* loaf — a quiet hexo theme with a cat in it */

@font-face { font-family: Iosevka; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/iosevka-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Iosevka; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/iosevka-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Iosevka; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/iosevka-latin-400-italic.woff2) format("woff2"); }

/* ---------- colors ----------
   Black cat, blue hour. Everything on the site is one of these. */

:root {
  --bg: #fbfaf7;
  --fg: #1f1d1c;
  --muted: #726c67;
  --faint: #b5aea7;
  --line: #e7e3dd;
  --surface: #f3f0eb;
  --accent: #2f62c9;
  --tint: #d3e2fb;
  --green: #4c7a34;
  --amber: #96580f;
  --violet: #8a4fa8;
  --dim: #655f5a;
  --ear: #1f1d1c;
  --pupil: .26;
  color-scheme: light;

  /* grows with the window, leaving room for the contents list beside a post */
  --col: clamp(46rem, 100vw - 27rem, 60rem);
  --measure: 100%;
  --mono: Iosevka, ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131214;
    --fg: #e9e4de;
    --muted: #9b948e;
    --faint: #5f5a56;
    --line: #2c2a2d;
    --surface: #1c1b1e;
    --accent: #8fb8f6;
    --tint: #26406c;
    --green: #a8cc8c;
    --amber: #e2b272;
    --violet: #cfa8ee;
    --dim: #a59e98;
    --ear: #4d4946;
    --pupil: 1;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #131214;
  --fg: #e9e4de;
  --muted: #9b948e;
  --faint: #5f5a56;
  --line: #2c2a2d;
  --surface: #1c1b1e;
  --accent: #8fb8f6;
  --tint: #26406c;
  --green: #a8cc8c;
  --amber: #e2b272;
  --violet: #cfa8ee;
  --dim: #a59e98;
  --ear: #4d4946;
  --pupil: 1;
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.7 var(--mono);
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

main { flex: 1; }

.wrap {
  width: 100%;
  max-width: calc(var(--col) + 2.5rem);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--tint); }

img, svg { max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; text-wrap: balance; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 5; background: var(--bg); padding: .25rem .5rem; }

.meta { display: flex; flex-wrap: wrap; column-gap: .6em; color: var(--muted); font-size: .875rem; }
.meta > * + *::before { content: "·"; margin-right: .6em; color: var(--faint); display: inline-block; }
.meta a { text-decoration: none; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.25rem;
  padding-block: 1.25rem .75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-right: auto;
  font-weight: 700;
  text-decoration: none;
}
.brand svg { width: 1.4rem; height: 1.4rem; transition: transform .2s; }
.brand:hover { color: inherit; }
.brand:hover svg { transform: rotate(-10deg); }

.nav { display: flex; gap: 1.15rem; font-size: .9375rem; }
.nav a { color: var(--muted); text-decoration: none; padding-block: .25rem; }
.nav a:hover { color: var(--fg); }
.nav a[aria-current] { color: var(--fg); box-shadow: 0 2px 0 var(--accent); }

.tools { display: flex; margin-right: -.45rem; }
.icon-btn {
  display: grid;
  place-items: center;
  padding: .45rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--fg); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; display: block; }

/* the light switch is a cat's eye: slit in the light, wide in the dark */
.pupil {
  transform: scaleX(var(--pupil));
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
}

@media (max-width: 34rem) {
  .nav { order: 3; flex-basis: 100%; }
}

/* ---------- home ---------- */

.hello {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 2rem 2.25rem;
}
.avatar { width: 3.5rem; height: 3.5rem; flex: none; border-radius: 50%; object-fit: cover; background: var(--surface); }
.hello h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.hello p { margin: .15rem 0 0; color: var(--muted); }
.social { font-size: .875rem; display: flex; flex-wrap: wrap; gap: 0 1rem; }

.types { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: 1.75rem; font-size: .9375rem; }
.types button { padding: .15rem 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.types button:hover { color: var(--fg); }
.types button[aria-pressed="true"] { color: var(--fg); box-shadow: 0 2px 0 var(--accent); }
.types sup { margin-left: .25em; color: var(--muted); font-size: .7em; }

.year-group + .year-group { margin-top: 1.25rem; }
.year-group .year { margin: 0 0 .5rem; }

.posts { list-style: none; margin: 0; padding: 0; }

.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.post-row:hover { color: inherit; }
.post-row-text { min-width: 0; }
.post-row h3 { margin: .2rem 0 0; font-size: 1.125rem; line-height: 1.35; transition: color .15s; }
.post-row:hover h3 { color: var(--accent); }
.post-row p {
  margin: .3rem 0 0;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* covers grow ears when you point at them */
.thumb { position: relative; isolation: isolate; flex: none; width: 10rem; }
.thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; background: var(--surface); }
.thumb::before, .thumb::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: calc(100% - 9px);
  width: 1.9rem;
  height: 1.55rem;
  border-radius: 3px 3px 0 0;
  background: var(--ear);
  transform: translateY(100%);
  transition: transform .22s cubic-bezier(.3, 1.5, .5, 1);
}
.thumb::before { left: .45rem; clip-path: polygon(0 100%, 8% 0, 100% 100%); }
.thumb::after { right: .45rem; clip-path: polygon(0 100%, 92% 0, 100% 100%); }
.post-row:hover .thumb::before, .post-row:hover .thumb::after,
.post-row:focus-visible .thumb::before, .post-row:focus-visible .thumb::after { transform: none; }

@media (max-width: 34rem) {
  .post-row { align-items: flex-start; gap: 1rem; }
  .thumb { width: 5.75rem; margin-top: .3rem; }
  .thumb::before, .thumb::after { width: 1.3rem; height: 1.1rem; bottom: calc(100% - 7px); }
  .thumb img { border-radius: 5px; }
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  padding-block: 1.35rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9375rem;
}
.pager a { text-decoration: none; color: var(--fg); }
.pager a:hover { color: var(--accent); }
.pager > :last-child { text-align: right; }

/* ---------- lists: archives, categories, tags ---------- */

.page-title { margin: 2.25rem 0 1.5rem; font-size: 1.5rem; }
.page-title span { color: var(--muted); font-weight: 400; }
.page-title span::after { content: "/"; margin-left: .35em; color: var(--faint); }

.year { margin: 2.25rem 0 .4rem; font-size: 1.125rem; font-weight: 400; color: var(--muted); }
.page-title + .year { margin-top: 0; }

.list { list-style: none; margin: 0 0 2rem; padding: 0; }
.list li { display: flex; align-items: baseline; gap: 1.25rem; padding-block: .5rem; border-top: 1px solid var(--line); }
.list time, .list span { flex: none; color: var(--muted); font-size: .875rem; }
.list a { text-decoration: none; }
.list i { flex: 1; }

.terms { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 2rem; font-size: 1.125rem; }
.terms a { text-decoration: none; }
.terms sup { margin-left: .25em; color: var(--muted); font-size: .7em; }

/* ---------- post ---------- */

.post-head { padding-block: 2.25rem 1.75rem; }
.post-head h1 { margin: .35rem 0 0; font-size: clamp(1.55rem, 1.2rem + 1.8vw, 2.05rem); line-height: 1.2; letter-spacing: -.01em; }
.lede { margin: .7rem 0 0; max-width: var(--measure); color: var(--muted); }
.facts { margin-top: .8rem; }
.facts a:hover { color: var(--accent); }
.post-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 2rem; border-radius: 10px; background: var(--surface); }

.post-body { position: relative; }

.contents { margin-bottom: 1.75rem; font-size: .875rem; }
.contents details { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .9rem; }
.contents summary { color: var(--muted); cursor: pointer; }
.contents ol { list-style: none; margin: 0; padding: 0; }
.contents details > ol { margin-top: .4rem; }
.contents ol ol { padding-left: 1.1rem; }
.contents a { display: block; padding-block: .15rem; color: var(--muted); text-decoration: none; }
.contents a:hover { color: var(--fg); }
.contents a[aria-current] { color: var(--accent); }

@media (min-width: 80rem) {
  .contents { position: absolute; top: 0; bottom: 0; left: 100%; width: 11.5rem; margin: 0 0 0 1.25rem; }
  .contents details { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; border: 0; padding: 0; scrollbar-width: thin; }
  .contents summary { list-style: none; pointer-events: none; margin-bottom: .3rem; }
  .contents summary::-webkit-details-marker { display: none; }
}
@media (min-width: 100rem) {
  .contents { width: 13rem; margin-left: 1.75rem; }
}

.section-filter { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.section-filter:focus-within { border-bottom-color: var(--accent); }
.section-filter input { flex: 1; min-width: 0; padding: .5rem 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; }
.section-filter input::placeholder { color: var(--faint); }
.section-filter input::-webkit-search-cancel-button { display: none; }
.section-filter span { flex: none; color: var(--muted); font-size: .8125rem; }

/* ---------- prose: whatever markdown throws at it ---------- */

.prose [hidden] { display: none !important; }

.prose > * { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose > figure, .prose > pre, .prose > table, .prose > p:has(img), .prose > hr, .prose > iframe, .prose > video { max-width: none; }

.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose dl { margin-block: 0 1.15rem; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { position: relative; margin-block: 2.4rem .8rem; }
.prose h1 { font-size: 1.45rem; margin-top: 3rem; }
.prose h2 { font-size: 1.22rem; }
.prose h3 { font-size: 1.06rem; }
.prose h4, .prose h5, .prose h6 { font-size: 1rem; }
.prose h1 + h2, .prose h2 + h3, .prose h1 + h3 { margin-top: 1.25rem; }

.prose a { color: var(--accent); text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }

.headerlink { text-decoration: none !important; }
.headerlink::before { content: "#"; position: absolute; right: 100%; padding-right: .4em; color: var(--faint); opacity: 0; transition: opacity .15s; }
:is(h1, h2, h3, h4, h5, h6):hover > .headerlink::before, .headerlink:focus-visible::before { opacity: 1; }
.headerlink:hover::before { color: var(--accent); }

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-block: .25rem; }
.prose li > ul, .prose li > ol { margin-block: .25rem 0; }
.prose li::marker { color: var(--muted); }

.prose blockquote { margin-inline: 0; padding-left: 1rem; border-left: 2px solid var(--accent); color: var(--muted); }
.prose blockquote > :last-child { margin-bottom: 0; }

.prose img { display: block; border-radius: 8px; cursor: zoom-in; }
.prose a img { cursor: pointer; }
.prose p > img:not(:first-child) { margin-top: .9rem; }

.prose strong { font-weight: 700; }
.prose kbd { padding: .05em .4em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: inherit; font-size: .9em; }
.prose mark, mark { background: var(--tint); color: inherit; padding-inline: .1em; border-radius: 2px; }

/* <hr> is a paw print */
.prose hr {
  height: 1.15rem;
  margin: 2.75rem auto;
  border: 0;
  background: var(--faint);
  -webkit-mask: var(--paw) center / contain no-repeat;
  mask: var(--paw) center / contain no-repeat;
  --paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 11.500c-3.300 0-6.200 2.800-6.200 5.700 0 2 1.500 3.100 3.300 3.100 1.100 0 1.900-.5 2.900-.5s1.800.5 2.900.5c1.800 0 3.300-1.100 3.300-3.100 0-2.900-2.900-5.700-6.200-5.700Z'/%3E%3Cellipse cx='4.300' cy='10.200' rx='1.900' ry='2.500'/%3E%3Cellipse cx='9' cy='5.800' rx='2' ry='2.700'/%3E%3Cellipse cx='15' cy='5.800' rx='2' ry='2.700'/%3E%3Cellipse cx='19.700' cy='10.200' rx='1.900' ry='2.500'/%3E%3C/svg%3E");
}

.prose > table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .9375rem; }
.prose > table th, .prose > table td { padding: .45rem .9rem .45rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose > table th { font-weight: 700; border-bottom-color: var(--faint); }

/* ---------- code ---------- */

code, pre, kbd, samp { font-family: var(--mono); }

:not(pre) > code {
  padding: .1em .35em;
  border-radius: 4px;
  background: var(--surface);
  font-size: .92em;
  overflow-wrap: anywhere;
}

.prose pre, .prose figure.highlight {
  position: relative;
  margin: 0 0 1.25rem;
  border-radius: 8px;
  background: var(--surface);
  font-size: .875rem;
  line-height: 1.6;
  tab-size: 4;
}
.prose pre { padding: .8rem 1rem; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.prose pre code { font-size: inherit; }

/* hexo's highlighter: figure > table > (gutter | code) */
.prose figure.highlight table {
  display: block;
  width: auto;
  margin: 0;
  overflow-x: auto;
  border-collapse: collapse;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: var(--faint) transparent;
}
.prose figure.highlight td { padding: 0; border: 0; vertical-align: top; }
.prose figure.highlight pre { margin: 0; overflow: visible; border-radius: 0; background: none; font-size: inherit; }
.prose figure.highlight .gutter { display: none; }
.prose figure.highlight figcaption { padding: .5rem 1rem 0; color: var(--muted); font-size: .8125rem; }
.prose figure.highlight figcaption a { float: right; }

@media (max-width: 34rem) {
  /* on phones, code runs edge to edge: terminal output needs every pixel */
  .prose pre, .prose figure.highlight { margin-inline: -1.25rem; border-radius: 0; font-size: .8125rem; }
  .prose figure.highlight pre { margin-inline: 0; }
  .prose pre, .prose figure.highlight .code pre { padding-inline: 1.25rem; }
}

/* terminal blocks: commands stay sharp, output steps back */
.prose .highlight .out { color: var(--dim); }
.prompt { color: var(--accent); user-select: none; -webkit-user-select: none; }
.var { color: var(--amber); }

.copy {
  position: absolute;
  top: .4rem;
  right: .4rem;
  padding: .1rem .5rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
}
:hover > .copy, .copy:focus-visible, .copy.done { opacity: 1; }
.copy:hover { color: var(--fg); }
.copy.done { color: var(--green); }
@media (hover: none) { .copy { opacity: .85; } }

/* syntax: highlight.js and prism share five colors */
.hljs-comment, .hljs-quote, .hljs-meta, .token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--muted); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-doctag, .hljs-name, .hljs-tag,
.highlight .keyword, .highlight .literal, .highlight .section, .highlight .name, .highlight .selector-tag,
.token.keyword, .token.tag, .token.boolean, .token.important, .token.atrule { color: var(--accent); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-template-string,
.highlight .string, .highlight .regexp, .highlight .addition,
.token.string, .token.char, .token.attr-value, .token.regex, .token.inserted { color: var(--green); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-variable, .hljs-template-variable, .hljs-attr, .hljs-params,
.highlight .number, .highlight .symbol, .highlight .variable, .highlight .attr, .highlight .template-variable,
.token.number, .token.constant, .token.symbol, .token.variable, .token.attr-name, .token.property { color: var(--amber); }
.hljs-built_in, .hljs-title, .hljs-type, .hljs-class, .hljs-function, .hljs-selector-id, .hljs-selector-class,
.highlight .built_in, .highlight .title, .highlight .type, .highlight .function, .highlight .class,
.token.function, .token.class-name, .token.builtin, .token.selector { color: var(--violet); }
.hljs-deletion, .highlight .deletion, .token.deleted { color: var(--accent); }
.highlight .comment, .highlight .quote, .highlight .meta { color: var(--muted); font-style: italic; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ---------- post footer ---------- */

.post-foot { margin-top: 3.5rem; }
.related .year { margin: 0 0 .4rem; font-size: .875rem; }
.related .list { margin-bottom: 2.5rem; }

.neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding-top: 1.35rem; border-top: 1px solid var(--line); }
.neighbors a { text-decoration: none; line-height: 1.45; }
.neighbors small { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .8125rem; }
.neighbors .newer { grid-column: 2; text-align: right; }

/* ---------- footer, with resident ---------- */

.site-footer { margin-top: 6rem; }
.site-footer-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding-block: 1.1rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
}

.perch { position: absolute; right: 1.25rem; bottom: 100%; width: 4.25rem; color: var(--fg); line-height: 0; }
.perch:hover { color: var(--fg); }
.cat { display: block; width: 100%; height: auto; overflow: visible; }
.cat-awake { opacity: 0; }
.cat-tail { transform-origin: 11px 32px; transition: transform .3s; }
.perch:hover .cat-awake, .perch:focus-visible .cat-awake, .lost .cat-awake { opacity: 1; }
.perch:hover .cat-asleep, .perch:focus-visible .cat-asleep, .lost .cat-asleep { opacity: 0; }
.perch:hover .cat-tail { transform: rotate(14deg); }

/* ---------- search ---------- */

dialog { color: var(--fg); }
dialog::backdrop { background: rgb(10 9 10 / .45); }

.search {
  width: min(40rem, calc(100vw - 1.5rem));
  max-height: min(34rem, 80vh);
  margin-top: 12vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
}
.search[open] { display: flex; flex-direction: column; }
.search input {
  width: 100%;
  padding: 1rem 1.15rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  background: none;
  color: inherit;
  font: inherit;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; scrollbar-width: thin; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: .55rem .75rem; border-radius: 7px; text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--surface); color: inherit; outline: 0; }
.search-results small { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.5; overflow-wrap: anywhere; }
.search-note { margin: 0; padding: .7rem 1.15rem; color: var(--muted); font-size: .8125rem; }

/* ---------- image zoom ---------- */

.zoom { max-width: 100vw; max-height: 100vh; padding: 0; border: 0; background: none; cursor: zoom-out; }
.zoom img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 6px; }
.zoom::backdrop { background: rgb(10 9 10 / .85); }

/* ---------- 404 ---------- */

.lost { padding-block: 4rem 2rem; }
.lost h1 { margin: 5.5rem 0 .5rem; font-size: 1.5rem; }
.lost p { margin: 0; color: var(--muted); }
.shelf { position: relative; width: min(19rem, 72%); border-bottom: 2px solid var(--fg); }
.shelf .cat { width: 6.5rem; margin-left: auto; margin-right: 2.5rem; }
.knocked {
  position: absolute;
  right: -.35rem;
  bottom: .1rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  transform-origin: 100% 100%;
  animation: knocked 1.1s .5s cubic-bezier(.5, 0, .9, .6) forwards;
}
@keyframes knocked {
  25% { transform: translateX(1.1rem); }
  45% { transform: translateX(2.2rem) rotate(18deg); }
  100% { transform: translate(3.6rem, 3.6rem) rotate(100deg); }
}

/* ---------- small courtesies ---------- */

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .knocked { animation-duration: .01s; animation-delay: 0s; }
  @view-transition { navigation: none; }
}

@media (min-width: 40rem) {
  body { font-size: 1.0625rem; }
}

/* desktop: everything a size up */
@media (min-width: 64rem) {
  html { font-size: 110%; }
}

@media print {
  .nav, .tools, .site-footer, .contents, .copy, .neighbors { display: none; }
  body { font-size: 11pt; }
  .prose pre, .prose figure.highlight table { white-space: pre-wrap; overflow: visible; }
}
