:root {
  color-scheme: light;
  --bg: #faf8f2;
  --text: #201d17;
  --muted: #6e685b;
  --faint: #a09a89;
  --line: #e6dfd0;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #eddfb8;
  color: #201d17;
}
::-moz-selection {
  background: #eddfb8;
  color: #201d17;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 96px 24px 120px;
}

/* ---------- header ---------- */
.logo {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--text);
  margin: 0 0 24px;
}

h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

.bio {
  margin: 0 0 6px;
}

.socials {
  margin: 14px 0 0;
  font-size: 15px;
}
.socials a {
  color: var(--muted);
}
.socials a:hover {
  color: var(--text);
}
.socials .sep {
  color: var(--faint);
  margin: 0 10px;
  user-select: none;
}

/* ---------- sections ---------- */
section {
  margin-top: 64px;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 14px;
}

/* writing index */
.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}
.posts li {
  display: flex;
  gap: 22px;
  padding: 7px 0;
}
.posts .date {
  flex: 0 0 96px;
  color: var(--faint);
  font-size: 14px;
  padding-top: 2px;
  white-space: nowrap;
}
.posts .title {
  min-width: 0;
}

/* projects + open source */
.items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.items li {
  padding: 7px 0;
}
.items .p {
  font-weight: 600;
}
.items .d {
  color: var(--muted);
}

/* ---------- links ---------- */
a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover {
  border-bottom-color: var(--text);
}
a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 1px;
}

/* ---------- post pages ---------- */
.back {
  display: inline-block;
  font-size: 14.5px;
  color: var(--muted);
  border-bottom-color: transparent;
  margin: 0 0 40px;
}
.back:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.post-head h1 {
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 10px;
}
.post-head .date {
  color: var(--faint);
  font-size: 14.5px;
  margin: 0 0 44px;
}

article {
  font-size: 16.5px;
}
article p {
  margin: 0 0 24px;
}
article h2 {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 44px 0 14px;
}
article h3 {
  font-size: 16.5px;
  font-weight: 650;
  margin: 36px 0 12px;
}
article ul,
article ol {
  margin: 0 0 24px;
  padding-left: 24px;
}
article li {
  margin: 6px 0;
}
article blockquote {
  margin: 0 0 24px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}
article blockquote p:last-child {
  margin-bottom: 0;
}
article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: #f1ecdf;
  border-radius: 4px;
  padding: 2px 5px;
}
article pre {
  background: #f1ecdf;
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 24px;
}
article pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}
article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* photo collage */
.collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 24px;
}
.collage img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.collage img:nth-child(4) {
  object-position: 50% 20%;
}
.collage figcaption {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--faint);
  margin-top: 2px;
}
article hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

/* footnotes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

article sup {
  line-height: 0;
  font-size: 0.72em;
}
article sup a {
  border-bottom: none;
  color: var(--faint);
}
article sup a::before {
  content: "[";
}
article sup a::after {
  content: "]";
}
article sup a:hover {
  color: var(--text);
}

.footnotes {
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
.footnotes ol {
  margin: 0;
  padding-left: 20px;
}
.footnotes li {
  margin: 4px 0;
}
.footnotes li p {
  margin: 0;
}
.footnotes a {
  color: var(--muted);
}
.footnotes a:hover {
  color: var(--text);
}
.footnotes [data-footnote-backref] {
  border-bottom: none;
  margin-left: 4px;
  color: var(--faint);
}

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  main {
    padding: 64px 22px 96px;
  }
  .posts li {
    flex-direction: column;
    gap: 0;
  }
  .posts .date {
    flex: none;
    padding-top: 0;
  }
}
