:root {
  /* Atom One Light theme colors. Source:
     schemes/Atom One Light.itermcolors from mbadolato/iTerm2-Color-Schemes. */
  color-scheme: light dark;
  --background: #f9f9f9;
  --text: #2a2c33;
  --muted: #2a2c33;
  --brand: #2f5af3;
  --nav: #2a2c33;
  --link: #2f5af3;
  --border: #bbbbbb;
  --footer-border: #ededed;
  --code-background: #ededed;
  --code-text: #2a2c33;
  --syntax-comment: #bbbbbb;
  --syntax-keyword: #a00095;
  --syntax-string: #3f953a;
  --syntax-name: #2f5af3;
  --syntax-number: #d2b67c;
  --syntax-error: #de3e35;
  --font-body: "Source Serif 4", "Iowan Old Style", Palatino, Georgia, serif;
  --font-heading: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Snazzy Soft theme colors. Source:
       schemes/Snazzy Soft.itermcolors from mbadolato/iTerm2-Color-Schemes. */
    --background: #282a36;
    --text: #eff0eb;
    --muted: #f1f1f0;
    --brand: #57c7ff;
    --nav: #eff0eb;
    --link: #4babdb;
    --border: #686868;
    --footer-border: #686868;
    --code-background: color-mix(in srgb, #000000 50%, #282a36);
    --code-text: #eff0eb;
    --syntax-comment: #686868;
    --syntax-keyword: #ff6ac1;
    --syntax-string: #5af78e;
    --syntax-name: #57c7ff;
    --syntax-number: #f3f99d;
    --syntax-error: #ff5c57;
  }
}

html[data-theme="light"] {
  /* Atom One Light theme colors. */
  color-scheme: light;
  --background: #f9f9f9;
  --text: #2a2c33;
  --muted: #2a2c33;
  --brand: #2f5af3;
  --nav: #2a2c33;
  --link: #2f5af3;
  --border: #bbbbbb;
  --footer-border: #ededed;
  --code-background: #ededed;
  --code-text: #2a2c33;
  --syntax-comment: #bbbbbb;
  --syntax-keyword: #a00095;
  --syntax-string: #3f953a;
  --syntax-name: #2f5af3;
  --syntax-number: #d2b67c;
  --syntax-error: #de3e35;
}

html[data-theme="dark"] {
  /* Snazzy Soft theme colors. */
  color-scheme: dark;
  --background: #282a36;
  --text: #eff0eb;
  --muted: #f1f1f0;
  --brand: #57c7ff;
  --nav: #eff0eb;
  --link: #4babdb;
  --border: #686868;
  --footer-border: #686868;
  --code-background: color-mix(in srgb, #000000 50%, #282a36);
  --code-text: #eff0eb;
  --syntax-comment: #686868;
  --syntax-keyword: #ff6ac1;
  --syntax-string: #5af78e;
  --syntax-name: #57c7ff;
  --syntax-number: #f3f99d;
  --syntax-error: #ff5c57;
}

html {
  background: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 1.5rem;
}

a {
  color: var(--link);
  text-decoration: none;
}

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

a:focus,
button:focus {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

img,
svg {
  height: auto;
  max-width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
}

pre {
  background: var(--code-background);
  border: 1px solid var(--border);
  color: var(--code-text);
  overflow-x: auto;
  padding: 1rem;
}

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

:not(pre) > code {
  background: var(--code-background);
  padding: 0.1em 0.25em;
}

.chroma {
  background: var(--code-background);
  color: var(--code-text);
}

.chroma .c,
.chroma .c1,
.chroma .cm,
.chroma .cp,
.chroma .cs {
  color: var(--syntax-comment);
}

.chroma .k,
.chroma .kc,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kt {
  color: var(--syntax-keyword);
}

.chroma .s,
.chroma .s1,
.chroma .s2,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .sd,
.chroma .se,
.chroma .sh,
.chroma .si,
.chroma .sr,
.chroma .ss {
  color: var(--syntax-string);
}

.chroma .n,
.chroma .na,
.chroma .nb,
.chroma .nc,
.chroma .nd,
.chroma .ne,
.chroma .nf,
.chroma .ni,
.chroma .nl,
.chroma .nn,
.chroma .no,
.chroma .nt,
.chroma .nv,
.chroma .nx {
  color: var(--syntax-name);
}

.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .mo {
  color: var(--syntax-number);
}

.chroma .err {
  color: var(--syntax-error);
}

blockquote {
  border-left: 4px solid var(--border);
  color: var(--muted);
  margin-left: 0;
  padding-left: 1rem;
}

table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
}

figcaption,
time,
.site-footer {
  color: var(--muted);
}

.skip-link {
  background: var(--background);
  left: 1rem;
  padding: 0.5rem;
  position: absolute;
  top: -4rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header,
.site-footer {
  margin: 2rem 0;
}

.site-footer {
  align-items: center;
  border-top: 1px solid var(--footer-border);
  display: flex;
  font-size: 0.75rem;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1rem;
}

.site-footer p {
  margin: 0;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  flex-direction: column;
}

.site-title {
  color: var(--brand);
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.1;
}

h1,
h2,
h3,
h4,
h5,
h6,
nav {
  font-family: var(--font-heading);
}

nav {
  display: flex;
  gap: 1.25rem;
}

nav a {
  color: var(--nav);
  font-size: 1.35rem;
  font-weight: 700;
}

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

.theme-toggle {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  line-height: 1;
  padding: 0;
}

.theme-toggle:focus {
  outline: 0;
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

.theme-toggle-track {
  align-items: center;
  background: var(--code-background);
  border: 1px solid var(--border);
  border-radius: 999px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 1.55rem;
  overflow: hidden;
  position: relative;
  width: 3rem;
}

.theme-toggle-thumb {
  background: var(--brand);
  border-radius: 999px;
  height: 1.15rem;
  left: 0.18rem;
  position: absolute;
  top: 0.18rem;
  transition: transform 200ms ease;
  width: 1.15rem;
}

.theme-toggle[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(1.45rem);
}

.theme-toggle-sun,
.theme-toggle-moon {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.theme-toggle-sun::before,
.theme-toggle-moon::before {
  background: var(--text);
  content: "";
  height: 0.85rem;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  width: 0.85rem;
}

.theme-toggle-sun::before {
  mask-image: url("/icons/heroicons/sun-solid.svg");
}

.theme-toggle-moon::before {
  mask-image: url("/icons/heroicons/moon-solid.svg");
}

@media (min-width: 44rem) {
  .site-header {
    align-items: baseline;
    flex-direction: row;
    justify-content: space-between;
  }

  .site-title {
    font-size: 2.5rem;
  }
}

.post-list {
  list-style: none;
  margin-top: 0.25rem;
  padding-left: 0;
}

.post-list li {
  align-items: baseline;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 7rem 1fr;
  margin: 0.25rem 0;
}

.post-list time {
  font-size: 0.9rem;
  line-height: inherit;
}

h2 + .post-list {
  margin-top: -0.25rem;
}

article + section {
  margin-top: 3rem;
}
