/* 16 · read — modelled on Medium. Sans for titles and furniture, serif for
   prose. One column, no rules except where they separate things. */

:root {
  --text:  #242424;   /* body copy */
  --title: #111113;   /* headings */
  --meta:  #6b6b6b;   /* dates, captions, bylines */
  --rule:  #e8e8e8;
  --wash:  #f7f7f8;   /* code blocks */
  --measure: 50rem;   /* text column — the one number to tune */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Iowan Old Style", "Source Serif Pro", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 400 22px/1.6 var(--serif);
  letter-spacing: -0.003em;
}

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

/* ---------- site header ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
  padding: 1.6rem 0;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.masthead a { color: inherit; text-decoration: none; }
.sitename {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tagline {
  margin: 0;
  color: var(--meta);
  font-size: 0.85rem;
  letter-spacing: 0;
}

/* ---------- index ---------- */

.year {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--meta);
  margin: 3rem 0 0.5rem;
}
.year:first-of-type { margin-top: 0; }

.entries { list-style: none; margin: 0; padding: 0; }
.entries li { padding: 1.6rem 0; border-bottom: 1px solid var(--rule); }
.entries time {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--meta);
  margin-bottom: 0.4rem;
}
.entries a {
  font-family: var(--sans);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--title);
  text-decoration: none;
}
.entries a:hover { text-decoration: underline; text-underline-offset: 3px; }
.entries p {
  margin: 0.4rem 0 0;
  color: var(--meta);
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- article ---------- */

article header { margin-bottom: 2.4rem; }

h1 {
  font-family: var(--sans);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--title);
  margin: 0 0 0.9rem;
}

.dateline {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--meta);
  margin: 0;
}

h2 {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--title);
  margin: 2.6em 0 0.6em;
}

article p { margin: 0 0 1.4em; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: #b9b9b9;
}
a:hover { text-decoration-color: currentColor; }

ul, ol { margin: 0 0 1.4em; padding-left: 1.4em; }
li { margin-bottom: 0.5em; }

blockquote {
  margin: 1.8em 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--text);
  font-style: italic;
  color: #3d3d3d;
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8em;
  background: var(--wash);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
pre {
  background: var(--wash);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  margin: 1.8em 0;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.6;
}
pre code { background: none; padding: 0; font-size: inherit; }

figure { margin: 2.4em 0; }
figure img { display: block; width: 100%; height: auto; }
figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--meta);
  text-align: center;
  margin-top: 0.7rem;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.8em 0; }

.footnotes {
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--meta);
}
.footnotes ol { padding-left: 1.2em; }
sup a { text-decoration: none; }

footer.post {
  font-family: var(--sans);
  font-size: 0.9rem;
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
footer.post a { color: var(--meta); text-decoration: none; }
footer.post a:hover { color: var(--text); }

.sitefooter {
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--meta);
  margin: 3rem 0 0;
}

@media (max-width: 40rem) {
  body { font-size: 19px; }
  .wrap { padding-left: 1.25rem; padding-right: 1.25rem; }
  .masthead { padding: 1.3rem 0; margin-bottom: 2.2rem; }
}
