:root {
  --bg: #F7F5F0;
  --text: #1F1E1C;
  --muted: #5F5B54;
  --rule: #E3DFD6;
  --accent: #3D5A6C;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --text: #E9E6E0;
    --muted: #A6A198;
    --rule: #2E2D2A;
    --accent: #9EADB6;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* Layout */

.column {
  max-width: calc(640px + 48px);
  margin: 0 auto;
  padding: 96px 24px 64px;
}

/* Home */

.name {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.intro .prose p { margin: 0 0 1em; }
.intro { margin-bottom: 72px; }

.block { margin-bottom: 64px; }

.label {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

/* Rows */

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }

.row {
  display: grid;
  column-gap: 20px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.row--post { grid-template-columns: 2.25em 1fr auto; grid-template-areas: "num main aside"; }
.row--labeled { grid-template-columns: 8.5em 1fr; grid-template-areas: "label main"; }

.row__num { grid-area: num; font-size: 13px; color: var(--muted); }
.row__label { grid-area: label; font-size: 13px; color: var(--muted); }
.row__main { grid-area: main; }
.row__aside { grid-area: aside; font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }

/* Top bar */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 72px;
}
.topbar .back { color: var(--accent); text-decoration: none; }
.topbar .back:hover { text-decoration: underline; }

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 13px;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Mobile */

@media (max-width: 560px) {
  body { font-size: 17px; }
  .column { padding: 56px 16px 48px; }
  .intro { margin-bottom: 56px; }

  .row--post {
    grid-template-columns: 2.25em 1fr;
    grid-template-areas: "num main" ". aside";
    row-gap: 2px;
  }
  .row__aside { text-align: left; }

  .row--labeled { grid-template-columns: 1fr; grid-template-areas: "label" "main"; row-gap: 2px; }

  .topbar { flex-direction: column; gap: 4px; margin-bottom: 48px; }
}
