@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/JetBrainsMono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/JetBrainsMono-600.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --text-primary: #000000dd;
    --background: #fefefe;
    --background-code: #effefe;
    --link: #1f5fff;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #ffffffdd;
    --background: #263340;
    --background-code: #00000060;
    --link: #a3bacb;
  }
}

body {
  background-color: var(--background);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 1rem;
  line-height: 1.5;
  width: min(90%, 75ch);
  margin: 2em auto;
}

h1, h2, h3 {
  font-weight: 600;
  padding-top: 1em;
}

h1 { font-size: 1.5em; }
h2 { font-size: 1.25em; }
h3 { font-size: 1.1em; }

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

a:hover {
  text-decoration: underline;
}

code, pre {
  font-family: inherit;
  background-color: var(--background-code);
}

code {
  padding: 0.1em 0.3em;
}

pre {
  font-size: smaller;
  padding: 0.9em;
  overflow-x: auto;
}

img {
  max-width: 50%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

figure {
  margin: 1.5em auto;
  text-align: center;
}

figcaption {
  font-style: italic;
  font-size: small;
  opacity: 80%;
  padding-top: 0.5em;
}

ul {
  padding-left: 1.2em;
}

li {
  margin-bottom: 0.6em;
}

footer {
  font-size: small;
  margin-top: 3em;
}

.muted {
  opacity: 50%;
  font-size: smaller;
}

.entry {
  margin-bottom: 1.5em;
}

.entry-head {
  font-weight: 600;
}

.entry-meta {
  opacity: 60%;
  font-size: smaller;
}

.tech {
  font-style: italic;
  opacity: 70%;
}

figure.left,
figure.right {
  width: 45%;
  margin-top: 0.4em;
  margin-bottom: 0.5em;
}

figure.left {
  float: left;
  margin-right: 1.5em;
  margin-left: 0;
}

figure.right {
  float: right;
  margin-left: 1.5em;
  margin-right: 0;
}

figure.left img,
figure.right img {
  max-width: 100%;
}

h1 {
  clear: both;
}

@media (max-width: 600px) {
  figure.left,
  figure.right {
    float: none;
    width: auto;
    margin: 1.5em auto;
  }
}

/* about section: tall portrait photo stays narrow; right float waits for the left one */
figure.portrait {
  width: 32%;
}

figure.right {
  clear: left;
}
