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

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #1a1a1a;
  background: #fafaf8;
  margin: 0;
  padding: 2rem 1rem;
}

article,
main,
.prose {
  max-width: 65ch;
  margin: 0 auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.5em;
  color: #111;
}

h1 {
  font-size: 2.25rem;
  margin-top: 0;
}
h2 {
  font-size: 1.75rem;
}
h3 {
  font-size: 1.375rem;
}
h4 {
  font-size: 1.125rem;
}

p,
figure {
  margin-top: 0;
  margin-bottom: 1.25em;
}

a {
  color: #2563eb;
  text-decoration: underline;
}

a:hover {
  color: #1d4ed8;
}

ul,
ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

li {
  margin-bottom: 0.375em;
}

blockquote {
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  border-left: 4px solid #d1d5db;
  color: #4b5563;
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.875em;
  background: #f3f4f6;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: #f3f4f6;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25em;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2.5em 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25em;
  font-size: 0.95em;
}

th,
td {
  text-align: left;
  padding: 0.5em 0.75em;
  border-bottom: 1px solid #e5e7eb;
}

th {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-weight: 600;
  background: #f9fafb;
}

figure {
  margin-left: 0;
  margin-right: 0;
}

@media (prefers-color-scheme: dark) {
  body {
    color: #e5e7eb;
    background: #0b0f14;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #f3f4f6;
  }

  a {
    color: #93c5fd;
  }

  a:hover {
    color: #bfdbfe;
  }

  blockquote {
    border-left-color: #374151;
    color: #9ca3af;
  }

  code,
  pre,
  th {
    background: #111827;
  }

  hr,
  th,
  td {
    border-color: #374151;
  }

  img {
    filter: invert(1) hue-rotate(180deg);
  }
}
