/* leewenjie.com: plain essay theme. No JS, no trackers, no webfonts. */
:root {
  --paper: #ffffff;
  --ink: #1b1917;
  --muted: #57534e;
  --faint: #a8a29e;
  --rule: #e7e5e4;
  --accent: #334155;
  --max: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --ink: #e7e5e4;
    --muted: #a8a29e;
    --faint: #57534e;
    --rule: #292524;
    --accent: #cbd5e1;
  }
}

* { box-sizing: border-box; }

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

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Masthead */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.masthead .name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.masthead nav {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  display: flex;
  gap: 1.25rem;
}

.masthead nav a {
  color: var(--muted);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Article */
main { padding: 2.5rem 0 3rem; }

h1, h2, h3 {
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.25rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }

p { margin: 0 0 1.25rem; }

.meta {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

a { color: var(--accent); }
a:hover { color: var(--ink); }

main a {
  text-decoration: underline;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

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

ul, ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--muted); }

blockquote {
  margin: 0 0 1.25rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.6;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem auto;
  max-width: 12rem;
}

/* Index list */
.lede { color: var(--muted); }

.more { margin-top: 1.5rem; }

.postlist {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.postlist li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.postlist a.title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.postlist a.title:hover { text-decoration: underline; text-underline-offset: 3px; }

.postlist .desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.postlist time {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: var(--faint);
}

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 3rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 480px) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.6rem; }
  main { padding-top: 2rem; }
}
