:root {
  color-scheme: light;
  --ink: #1c1814;
  --paper: #f3eee6;
  --mute: #6d655c;
  --rule: color-mix(in srgb, var(--ink) 14%, transparent);
  --wash: color-mix(in srgb, var(--ink) 6%, transparent);
  --screen: #0b0d14;
  --measure: 40rem;
  --wide: 62rem;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.1875rem;
  line-height: 1.65;
}

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.6rem 1.25rem;
}

.site-header a {
  color: var(--ink);
  text-decoration: none;
}

.site-header .name {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.site-header nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.95rem;
}

.site-header nav a {
  color: var(--mute);
}

.site-header nav a[aria-current="page"],
.site-header nav a:hover {
  color: var(--ink);
}

main {
  padding: 0 1.25rem 5rem;
}

.page-title {
  max-width: var(--measure);
  margin: 3.5rem auto 0.5rem;
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.page-lede {
  max-width: var(--measure);
  margin: 0 auto 2.5rem;
  color: var(--mute);
}

.post-list {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 1fr 9.5rem;
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}

.post-list .title {
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.post-list .title:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.post-list p {
  margin: 0.55rem 0 0.5rem;
  color: var(--mute);
  font-size: 1.05rem;
  line-height: 1.55;
}

.post-list .thumb {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--screen);
}

.post-list .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta {
  font-size: 0.88rem;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.post-header {
  max-width: var(--measure);
  margin: 3.5rem auto 2.25rem;
}

.post-header h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 5.2vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.post-header .lede {
  margin: 0 0 1.25rem;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--mute);
}

.post-header .demo {
  display: inline-block;
  margin-left: 0.6rem;
  color: var(--ink);
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.15rem;
}

.prose li {
  margin: 0.35rem 0;
}

.prose a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose strong {
  font-weight: 600;
}

.prose figure {
  margin: 2.5rem 0;
}

.prose figure.wide {
  width: min(var(--wide), calc(100vw - 2.5rem));
  margin-left: 50%;
  transform: translateX(-50%);
}

.prose figure img,
.prose figure video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--screen);
  box-shadow: 0 1px 2px rgba(28, 24, 20, 0.08), 0 16px 44px rgba(28, 24, 20, 0.16);
}

.prose figcaption {
  max-width: var(--measure);
  margin: 0.8rem auto 0;
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--mute);
}

.prose table {
  width: 100%;
  margin: 1.75rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.prose th,
.prose td {
  padding: 0.55rem 0.6rem 0.55rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.prose th {
  font-weight: 600;
  border-bottom-color: var(--ink);
}

.prose th[align="right"],
.prose td[align="right"] {
  text-align: right;
}

.prose code {
  padding: 0.1em 0.35em;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8em;
  background: var(--wash);
  border-radius: 4px;
}

.prose pre {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  color: var(--paper);
  background: var(--ink);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.prose pre code {
  padding: 0;
  font-size: inherit;
  background: none;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--ink);
  color: var(--mute);
}

.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--measure);
  margin: 4rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.post-footer a {
  color: var(--ink);
}

.not-found {
  max-width: var(--measure);
  margin: 6rem auto;
  text-align: center;
}

@media (max-width: 640px) {
  body {
    font-size: 1.08rem;
  }

  .post-list li {
    grid-template-columns: 1fr;
  }

  .post-list .thumb {
    grid-row: 1;
  }

  .prose figure.wide {
    width: calc(100vw - 1.5rem);
  }
}
