:root {
  --bg: #fbfaf7;
  --text: #222;
  --muted: #5c5c5c;
  --link: #3b5b7a;
  --link-visited: #2f4862;
  --link-hover: #24384d;
  --rule: #e2dfd8;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header and nav */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 2.5rem 0 1rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.site-title:visited {
  color: var(--text);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:visited {
  color: var(--link);
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
}

/* Text */

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  margin: 2em 0 0.5em;
}

h1 {
  font-size: 1.6rem;
  margin-top: 1.5em;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1.1rem;
}

p,
ul,
ol {
  margin: 0 0 1.1em;
}

ul,
ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.3em;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: var(--link-hover);
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 0.75rem 0;
}

/* Images */

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 2px;
}

/* Headshot sits left with the About text wrapping around it. */
img.headshot {
  float: left;
  max-width: 13rem;
  margin: 0.35rem 1.5rem 1rem 0;
  border: 0.3rem solid var(--link);
}

article::after {
  content: "";
  display: table;
  clear: both;
}

/* On narrow screens there is not enough room to wrap, so stack instead. */
@media (max-width: 36rem) {
  img.headshot {
    float: none;
    max-width: 13rem;
    margin: 1.5rem 0;
  }
}

/* Figures and video */

figure {
  margin: 1.5rem 0;
}

figure img,
figure video {
  margin: 0;
}

video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Musings and Projects lists, and single entries */

.entry-list {
  list-style: none;
  padding-left: 0;
}

.entry-list li {
  margin-bottom: 1.1em;
}

.entry-list time,
.entry-meta,
.post-date {
  font-size: 0.95rem;
  color: var(--muted);
}

.post-date {
  margin-top: -0.25em;
}

.post-back {
  margin-top: 3rem;
}

/* Footer */

.site-footer {
  margin: 4rem 0 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--muted);
}

/* Small screens */

@media (max-width: 30rem) {
  body {
    font-size: 1.0625rem;
  }

  .site-header {
    padding-top: 1.5rem;
  }
}
