:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --soft: #f6f6f4;
  --link: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --text: #e8e8e6;
    --muted: #9a9a96;
    --line: #2c2c2c;
    --soft: #1d1d1d;
    --link: #e8e8e6;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 660px;
  margin: 0 auto;
  padding: 72px 20px 96px;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--text);
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 34px;
  margin: 0 0 8px;
}

h2 {
  font-size: 25px;
  margin: 56px 0 12px;
}

h3 {
  font-size: 20px;
  margin: 36px 0 8px;
}

p,
ul,
ol,
table,
blockquote {
  margin: 0 0 20px;
}

ul,
ol {
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

.back {
  display: inline-block;
  font-size: 16px;
  margin-bottom: 40px;
  color: var(--muted);
  text-decoration: none;
}

.back:hover {
  color: var(--text);
}

.date {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 36px;
}

/* Home */

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

.essays li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

.essays li:last-child {
  border-bottom: 1px solid var(--line);
}

.essays time {
  color: var(--muted);
  font-size: 16px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .essays li {
    flex-direction: column;
    gap: 2px;
  }
}

/* Essay */

.toc {
  font-size: 17px;
  background: var(--soft);
  border-radius: 8px;
  padding: 18px 22px 8px;
  margin-bottom: 36px;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
}

.toc ol {
  padding-left: 20px;
}

.toc li {
  margin-bottom: 4px;
}

blockquote {
  border-left: 3px solid var(--line);
  padding-left: 18px;
  margin-left: 0;
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: var(--soft);
  padding: 2px 5px;
  border-radius: 4px;
}

.flow {
  background: var(--soft);
  border-radius: 8px;
  padding: 16px 20px;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 17px;
  margin: 0;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 700;
  border-bottom: 1px solid var(--muted);
}

footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--muted);
}
