@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Source+Serif+4:ital,wght@0,400;0,600;1,400;1,600&display=swap');

:root {
  color-scheme: light dark;
  --paper: #f6f1e7;
  --ink: #1f1d1a;
  --muted: #6b655b;
  --rule: #d6cdbb;
  --grid: rgba(31, 29, 26, 0.07);
  --accent: #b8432f;
  --wash: #ede6d6;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171614;
    --ink: #e8e2d6;
    --muted: #a39c8f;
    --rule: #3a3732;
    --grid: rgba(232, 226, 214, 0.06);
    --accent: #ee8d76;
    --wash: #211f1c;
  }
}

body {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  /* graph paper at the top of the page, fading into plain paper */
  background-image:
    linear-gradient(to bottom, transparent 0, var(--paper) 17rem),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, 1.5rem 1.5rem, 1.5rem 1.5rem;
  background-repeat: no-repeat, repeat, repeat;
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top strip */
.strip {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 1rem;
}
.strip a { color: var(--ink); }
.strip a:hover { color: var(--accent); }

/* masthead */
.masthead, main, .colophon { max-width: 39rem; }
.masthead {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  align-items: center;
  padding-top: 2.75rem;
  padding-bottom: 1.5rem;
}
.avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0;
}
.blog-title {
  grid-column: 2;
  align-self: end;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.blog-title a { color: var(--ink); }
.blog-title a:hover { color: var(--accent); }
.tagline {
  grid-column: 2;
  align-self: start;
  margin: 0.3rem 0 0;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--muted);
}

/* smaller masthead on post pages */
.post .masthead { padding-top: 1.75rem; padding-bottom: 0.5rem; }
.post .avatar { width: 2.75rem; height: 2.75rem; }
.post .blog-title { font-size: 1.15rem; letter-spacing: 0; }
.post .tagline { font-size: 0.85rem; margin-top: 0.1rem; }

/* headings */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; }
h1 { font-size: 1.7rem; font-size: clamp(1.6rem, 5.5vw, 2.2rem); line-height: 1.2; letter-spacing: -0.01em; margin: 2rem 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 0.5rem; }
h3 { font-size: 1.125rem; margin: 1.8rem 0 0.4rem; }
h4 { font-size: 1rem; font-style: italic; margin: 1.5rem 0 0.4rem; }

time {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* front page */
.about {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.about::before,
.posts > h2 {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.about::before { content: "About"; margin-bottom: 0.6rem; }
.about p { margin: 0 0 1rem; }
.about ul, .about ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.about li { margin-bottom: 0.4rem; }
.about li::marker { color: var(--accent); }

.posts { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.posts > h2 { margin: 0 0 0.4rem; }
.post-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.post-link { font-size: 1.2rem; line-height: 1.35; font-weight: 600; text-decoration: none; }
.post-link:hover { text-decoration: underline; }
.empty { color: var(--muted); font-style: italic; }

/* post page */
.post-header { margin: 1.5rem 0 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.post-header h1 { margin-top: 1rem; }
.post-header time { display: block; margin-top: 0.5rem; }

.post-body p { margin: 0 0 1.15rem; }
.post-body ul, .post-body ol { margin: 0 0 1.15rem; padding-left: 1.4rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body li::marker { color: var(--accent); }

blockquote {
  margin: 1.4rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--wash);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  margin: 1.4rem 0;
  overflow-x: auto;
}
pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }

hr { border: 0; border-top: 2px solid var(--accent); width: 4rem; margin: 2.5rem 0; }

.notice {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px dashed var(--accent);
  padding: 0.6rem 0.8rem;
  margin-top: 2rem;
}
.receipt, .colophon {
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--muted);
}
.receipt { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.receipt a { color: var(--ink); }
.receipt a:hover { color: var(--accent); }
.colophon { border-top: 1px solid var(--rule); padding-top: 1rem; padding-bottom: 3rem; }

@media (max-width: 30rem) {
  body { font-size: 1.05rem; }
  .masthead { padding-top: 2rem; column-gap: 0.8rem; }
  .avatar { width: 3.4rem; height: 3.4rem; }
  .post-link { font-size: 1.1rem; }
}
