html {
  margin: 0 auto;
  max-width: 62rem;
  padding: 1.5rem 1.25rem 4rem;
}

:root {
  --site-font: Helvetica, Arial, sans-serif;
  --mono-font: monaco, monospace;
  --text: #171717;
  --muted: #666;
  --line: #d8d8d8;
  --soft: #f4f4f2;
  --link: #174ea6;
  --link-hover: #0f766e;
  --visited: #5a3f8c;
  --section-width: 52rem;
  --subheading-indent: 0.5rem;
  --content-indent: 1rem;
  --body-indent: 1.5rem;
}

body {
  color: var(--text);
  font-family: var(--site-font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  margin: 1.5rem 0 1rem;
}

h2 {
  background-color: var(--soft);
  border-top: 1px solid var(--line);
  box-sizing: border-box;
  display: block;
  font-size: 1.2rem;
  margin: 2.5rem 0 0.8rem;
  max-width: var(--section-width);
  padding: 0.55rem 0.65rem;
  width: 100%;
}

h3 {
  font-size: 1.05rem;
  margin: 2rem 0 0.5rem var(--subheading-indent);
  max-width: calc(var(--section-width) - var(--subheading-indent));
}

h4 {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 1.5rem 0 0.25rem var(--content-indent);
  max-width: calc(var(--section-width) - var(--content-indent));
}

p {
  margin: 1rem 0 0 var(--body-indent);
  max-width: calc(46rem - var(--body-indent));
}

ul,
ol {
  box-sizing: border-box;
  margin: 0.75rem 0 0 var(--body-indent);
  max-width: calc(var(--section-width) - var(--body-indent));
  padding-left: 1.35rem;
  width: calc(100% - var(--body-indent));
}

li {
  padding: 0.2rem 0;
}

p img,
table {
  max-width: 100%;
}

p img {
  height: auto;
}

img[alt="concept-drawing-1"] {
  width: min(100%, 22rem);
}

img[alt="dig-design"] {
  width: min(100%, 28rem);
}

.gradesov-traffic {
  text-align: center;
}

.gradesov-traffic img {
  width: min(100%, 26rem);
}

pre {
  border: 1px solid var(--line);
  box-sizing: border-box;
  margin-left: var(--body-indent);
  max-width: calc(var(--section-width) - var(--body-indent));
  overflow-x: auto;
  padding: 1rem;
  width: calc(100% - var(--body-indent));
}

code,
pre {
  background-color: var(--soft);
  font-family: var(--mono-font);
  font-size: 0.9rem;
  text-transform: none;
}

code {
  overflow-wrap: anywhere;
  padding: 0.15em 0.3em;
}

pre code {
  overflow-wrap: normal;
}

pre i {
  font-style: normal;
}

pre b {
  color: #000;
}

pre u {
  background-color: #c0e0ee;
  color: #333;
  text-decoration: none;
}

pre i::before {
  color: #aaa;
  content: "> ";
}

pre strong {
  background-color: #0000cc;
  color: #fff;
}

pre em {
  background-color: #fda;
  font-style: normal;
  padding: 0.25em;
}

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

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

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0 0;
}

.avatar {
  border-radius: 100%;
  width: 60px;
}

.button {
  border: #00f solid 1px;
  display: inline-block;
  padding: 0.5em 1em;
  text-decoration: none;
}

.logo {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 2rem;
  max-width: var(--section-width);
  padding-bottom: 0.75rem;
}

.logo,
h1 + h4,
h1 + h4 + ul {
  margin-left: 0;
}

h1 + h4 + ul {
  max-width: var(--section-width);
  width: 100%;
}

.logo a,
.small,
.small a {
  color: var(--muted);
}

.logo a,
.small a {
  text-decoration-color: #aaa;
}

.logo + h1 {
  margin-top: 0;
}

.logo + h1 + p,
.logo + h4 {
  font-size: 1.05rem;
  line-height: 1.65;
}

#eric + p,
#eric + h4 {
  max-width: 42rem;
}

#works + ul,
#interests + ul {
  list-style: none;
  padding-left: 0;
  padding-right: var(--body-indent);
}

#works + ul li,
#interests + ul li {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  /* Row gap stays 0 so a wrapped nested list sits directly under its parent;
     the 1.5rem is column spacing between the link and its description. */
  gap: 0 1.5rem;
  justify-content: space-between;
  max-width: var(--section-width);
  padding: 0.35rem 0;
}

#works + ul li a,
#interests + ul li a {
  flex: 0 0 auto;
}

/* A nested list is a flex item of its parent li, so without a full-width
   basis it lands beside the link instead of below it. */
#works + ul ul,
#interests + ul ul {
  flex: 0 0 100%;
  list-style: none;
  margin: 0;
  max-width: none;
  padding-left: var(--body-indent);
  padding-right: 0;
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #d6d6d6;
    --muted: #999;
    --line: #333;
    --soft: #181818;
    --link: #31beb0;
    --link-hover: #8ee8dd;
    --visited: #b7a7e8;
  }

  html {
    background-color: #0a0a0a;
  }

  pre b {
    color: #fff;
  }

  pre i::before {
    color: #555;
  }

  pre strong {
    background-color: #0000cc;
    color: #fff;
  }

  pre em {
    color: #000;
  }

  .button {
    border-color: #fda;
  }
}

@media (max-width: 640px) {
  html {
    padding: 1rem 1rem 3rem;
  }

  h1 {
    font-size: 2rem;
  }

  #works + ul li,
  #interests + ul li {
    align-items: flex-start;
    display: block;
  }
}
