:root {
  --size-300: 0.75rem;
  --size-400: 1rem;
  --size-500: 1.33rem;
  --size-600: 1.77rem;
  --size-700: 2.36rem;
  --size-800: 3.15rem;
  --size-900: 4.2rem;
  --bg-color: #fafafa;
  --text-color: #333;
  --font-sans-serif: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
  --font-serif: Charter, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --code-token-comment: #6b655a;
  --code-token-function: #756341;
  --code-token-entity: #728fcb;
  --code-background: #efefef;
  --code-token-selector: #2d2006;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #333;
    --text-color: #fafafa;
    --code-token-comment: #d7d2ca;
    --code-token-function: #dbd7ce;
    --code-token-entity: #dde6f9;
    --code-background: #eeeeee36;
    --code-token-selector: #dcd8d0;
  }
}

html {
  font-size: 100%;
  font-family: var(--font-sans-serif);
  scrollbar-color: var(--text-color) var(--bg-color);
  color-scheme: light dark;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  display: grid;
  row-gap: clamp(1rem, 1vw, 4rem);
  grid-template-columns: 1fr min(90vw, 100%) 1fr;
  grid-template-rows: auto 1fr auto;
  padding: var(--size-400);
  margin: 0;
}

header,
main,
footer {
  grid-column: 2;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

header ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  display: flex;
  justify-content: flex-end;
  gap: clamp(0.5rem, 1vw, 2rem);
}

footer {
  border-top: 2px solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  --padding: 1.5rem 0;
  gap: 0.5rem;
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

time {
  white-space: pre;
  font-variant-numeric: tabular-nums;
}

code {
  font-family: var(--font-mono);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
  background-color: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--text-color);
}

a:not([class]) {
  color: currentColor;
}

:focus {
  outline: 2px solid;
  outline-offset: 0.25rem;
}

[href]:hover {
  text-decoration: none;
}

::selection {
  color: var(--bg-color, #fff);
  background: var(--text-color, rgba(0, 0, 0, 0.99));
}

article a {
  text-decoration: underline;
}

article {
  font-family: var(--font-serif);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans-serif);
  line-height: 1.3;
}

h1,
h2 {
  font-weight: 900;
}

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

h2 {
  font-size: var(--size-600);
}

h3 {
  font-size: var(--size-600);
}

figcaption {
  font-size: var(--size-300);
  font-style: italic;
  margin-top: 1rem;
}

blockquote {
  padding-left: var(--size-600);
  border-left: 5px solid;
  font-style: italic;
}

h1 {
  max-width: 15ch;
}

h2,
h3 {
  max-width: 25ch;
}

p {
  max-width: 65ch;
}

pre,
iframe {
  max-width: 100ch;
}

@media (min-width: 45em) {
  h1 {
    font-size: var(--size-900);
  }

  h2 {
    font-size: var(--size-700);
  }

  p,
  label,
  strong,
  li,
  th,
  td,
  time,
  pre {
    font-size: var(--size-500);
  }

  figcaption {
    font-size: var(--size-400);
  }

  blockquote p {
    font-size: var(--size-600);
    max-width: 40ch;
  }

  .post time {
    font-size: var(--size-600);
  }
}
