:root {
  --bg: #f7f6f2;
  --code-bg: #efede6;
  --text: #1f1e1b;
  --text-soft: #4a4842;
  --muted: #6b6860;
  --rule: #d8d5cc;
  --accent: #2f6b47;
  --selection: #d9e6dc;
  --serif: 'Source Serif 4', Georgia, serif;
  --mono: 'IBM Plex Mono', monospace;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
::selection { background: var(--selection); }

.page { max-width: 1104px; margin: 0 auto; padding: 0 32px; }

/* Header and footer */
.site-header, .site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
}
.site-header {
  align-items: baseline;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--text);
  font-size: 12px;
}
.site-name { font-weight: 500; letter-spacing: 0.02em; }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a, .site-footer a { color: var(--muted); }
.site-header nav a:hover, .site-footer a:hover { color: var(--text); }
.site-footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--text);
  font-size: 11px;
  color: var(--muted);
}

/* Home */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 48px 64px;
  padding: 72px 0 80px;
  border-bottom: 1px solid var(--rule);
}
.hero-text { display: flex; flex-direction: column; gap: 28px; }
.hero h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(48px, 7vw, 76px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.targets { font-family: var(--mono); font-size: 12px; line-height: 1.7; color: var(--muted); }
.hero p { margin: 0; max-width: 32em; font-size: 19px; line-height: 1.55; text-wrap: pretty; }
.aims { display: flex; flex-direction: column; gap: 10px; }
.aims div { font-size: 17px; font-style: italic; color: var(--text-soft); }
.aims ol { display: flex; flex-wrap: wrap; gap: 28px; font-size: 19px; }
.aims li { display: flex; gap: 8px; align-items: baseline; }
.aims li span { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.hero figure {
  display: flex;
  align-self: center;
  justify-self: center;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 0;
}
.hero img { width: 100%; height: 100%; object-fit: contain; }
.aims ol, .posts ol { margin: 0; padding: 0; list-style: none; }

.posts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 24px 64px;
  padding: 56px 0 96px;
}
.posts h2 { margin: 0; font-weight: 400; font-size: 15px; font-variant: small-caps; letter-spacing: 0.06em; }
.posts ol { border-top: 1px solid var(--rule); }
.posts li { border-bottom: 1px solid var(--rule); font-size: 19px; }
.posts li a, .posts .empty { display: block; padding: 14px 0; }
.posts li a { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 24px; align-items: baseline; }
.posts .empty { font-style: italic; color: var(--text-soft); }
.posts time, .post-header time { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Posts */
.post { padding: 72px 0 96px; }
.post-header { display: flex; flex-direction: column; gap: 20px; max-width: 640px; padding-bottom: 40px; }
.post-header h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.post-body { max-width: 640px; font-size: 19px; line-height: 1.6; }
.post-body > * { margin: 24px 0 0; }
.post-body > :first-child { margin-top: 0; }
.post-body p { text-wrap: pretty; }
.post-body a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.post-body h2 { margin-top: 48px; font-weight: 600; font-size: 21px; }
.post-body h3 { margin-top: 36px; font-weight: 600; font-size: 19px; }
.post-body img { max-width: 100%; height: auto; }
.post-body blockquote { padding-left: 20px; border-left: 1px solid var(--text); color: var(--text-soft); }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.post-body th, .post-body td { padding: 8px 16px 8px 0; border-bottom: 1px solid var(--rule); text-align: left; }
.post-body code { font-family: var(--mono); font-size: 0.79em; overflow-wrap: break-word; }
.post-body pre {
  margin: 32px 0;
  padding: 20px 22px;
  background: var(--code-bg);
  border-top: 1px solid var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  overflow-x: auto;
}
.post-body pre code { font-size: inherit; }
.highlight :is(.k, .kd, .kn, .kr, .kt, .kc, .cp) { color: var(--accent); }
.highlight :is(.c, .c1, .cm, .cs) { color: var(--muted); }

.footnotes {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}
.footnotes ol { margin: 0; padding-left: 20px; }
.footnotes li + li { margin-top: 10px; }
.footnotes p { margin: 0; }
.footnotes ::marker, sup .footnote { font-family: var(--mono); font-size: 11px; color: var(--accent); }
sup:has(.footnote) { line-height: 0; }

@media (max-width: 760px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .page { padding: 0 20px; }
  .posts li a { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
