:root {
  --color-bg: #fff;
  --color-rule: #ddd;
  --color-text-muted: #767676;
  --color-text: #333;
  --h1: 1.5rem;
  --h2: 1rem;
  --h3: 0.75rem;
  --post-width: 36rem;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
  --rule-width: 0.0625rem;
}

/* @media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #000;
    --color-rule: #444;
    --color-text-muted: #999;
    --color-text: #ddd;
  }
} */

html {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--h2);
  line-height: 1.333;
  margin: 0;
  min-height: 100vh;
  padding: 0 1rem;
}

@media (min-width: 80em) {
  body {
    padding: 0 2rem;
  }
}

img,
video {
  display: inline-block;
  height: auto;
  margin-bottom: 2em;
  margin-top: 2em;
  max-width: 100%;
  vertical-align: top;
}

figure {
  margin: 2rem 0;
}

figure *:not(figcaption) {
  margin-bottom: 0;
  margin-top: 0;
}

figcaption {
  color: var(--color-text-muted);
  font-size: var(--h3);
  margin-bottom: 3rem;
  margin-top: 0.5rem;
  max-width: var(--post-width);
}

p {
  margin-bottom: 1em;
  margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text);
  font-weight: 400;
  margin-bottom: 1em;
  margin-top: 3em;
}

h1 {
  font-size: var(--h1);
}

h2 {
  font-size: inherit;
}

h3,
h4,
h5,
h6 {
  font-size: var(--h3);
}

hr {
  border: 0;
  border-top: var(--rule-width) solid var(--color-rule);
  height: 0;
  margin: 3em 0;
}

ul {
  list-style: circle;
  padding-left: 1.125em;
}

ul ul,
ol ul {
  list-style: disc;
}

ol ol ul,
ol ul ul,
ul ol ul,
ul ul ul {
  list-style: square;
}

code,
kbd,
samp {
  color: var(--color-text);
  font-family: var(--font-mono);
}

a {
  color: inherit;
  transition: color 300ms;
  text-decoration-thickness: 0.0625rem;
  text-underline-offset: 0.1em;
}

a:focus,
a:hover {
  color: var(--color-text-muted);
  text-decoration: none;
  transition-duration: 100ms;
}

iframe {
  background-color: #fff;
  border: var(--rule-width) solid var(--color-text-muted);
  display: block;
  margin-bottom: 2rem;
  margin-top: 2rem;
  max-width: 100%;
}

blockquote {
  border-left: 0.25rem currentColor solid;
  margin-left: 0;
  margin-right: 0;
  padding-left: 1rem;
}

small {
  font-size: 87.5%;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2em;
  margin-top: 2em;
  text-align: left;
}

th,
td {
  padding: 0.25em 0;
  vertical-align: baseline;
}

tr > *:not(:last-child) {
  padding-right: 2rem;
}

tr td {
  border-top: var(--rule-width) solid var(--color-rule);
}

.site-header {
  border-bottom: var(--rule-width) solid var(--color-rule);
  padding: 1rem 0;
  margin-bottom: 3rem;
}

.site-header__title {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

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

.site-main {
  flex: 1;
}

.site-footer {
  border-top: var(--rule-width) solid var(--color-rule);
  margin-top: 3rem;
  padding: 1rem 0;
}

.site-footer > * {
  margin: 0;
}

.post:not(:last-child) {
  margin-bottom: 4rem;
}

.post__header,
.post__body > *:not(figure):not(img):not(iframe):not(table):not(video):not(hr) {
  max-width: var(--post-width);
}

.post__date {
  display: block;
  font-size: var(--h3);
  margin-bottom: 0.5rem;
}

.post__title {
  font-size: var(--h1);
  font-weight: 400;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.post__image {
  max-width: 16rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.post__link {
  text-decoration: none;
}

.post__body {
  color: var(--color-text-muted);
}

.post__body
  > *:first-child:not(figure):not(img):not(:matches(h1, h2, h3, h4, h5, h6)) {
  margin-top: 0;
}

.post__body > *:last-child {
  margin-bottom: 0;
}

.anchor-link {
  color: transparent;
  text-decoration: none;
}

:hover > .anchor-link {
  color: var(--color-text-muted);
}

.btn {
  background-color: var(--color-rule);
  color: var(--color-text);
  display: inline-block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background-color 100ms;
}

.btn:focus,
.btn:hover {
  background-color: var(--color-text);
  color: var(--color-bg);
  transition-duration: 100ms;
}

:target {
  scroll-margin-block-start: 1rem;
}
