:root {
  color-scheme: light dark;

  --hf-bg: #ffffff;
  --hf-bg-secondary: #eaeaea;
  --hf-header-bg: #fafafa;
  --hf-text: #222222;
  --hf-text-strong: #111111;
  --hf-text-secondary: #777777;
  --hf-border: #dcdcdc;
  --hf-accent: #3eb0ef;
  --hf-code-bg: #f2f2f2;
  --hf-selection: rgba(62, 176, 239, 0.25);

  --hf-content-width: 800px;
  --hf-radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hf-bg: #232425;
    --hf-bg-secondary: #3b3d42;
    --hf-header-bg: #1b1c1d;
    --hf-text: #a9a9b3;
    --hf-text-strong: #f2f2f2;
    --hf-text-secondary: #8f8f98;
    --hf-border: #4e4e57;
    --hf-code-bg: #2d2f33;
    --hf-selection: rgba(62, 176, 239, 0.32);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--hf-bg);
  color: var(--hf-text);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.54;
  letter-spacing: 0.035em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--hf-selection);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--hf-accent);
  outline-offset: 3px;
}

body > header {
  width: 100%;
  background: var(--hf-header-bg);
  border-bottom: 1px solid var(--hf-border);
  padding: 28px 20px 24px;
}

body > header > * {
  width: min(100%, var(--hf-content-width));
  margin-left: auto;
  margin-right: auto;
}

body > header h1 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  color: var(--hf-text-strong);
  font-size: 2.2rem;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

#post > header h1 {
  font-size: 2.625rem;
}

body > header p,
body > header span {
  color: var(--hf-text-secondary);
}

body > header p {
  margin-top: 0.35rem;
  margin-bottom: 0;
  font-weight: 400;
}

body > header nav {
  width: min(100%, var(--hf-content-width));
  margin: 1rem auto 0;
  color: var(--hf-text-secondary);
}

body > header nav a {
  color: var(--hf-text);
  text-decoration: none;
}

body > header nav a:hover {
  color: var(--hf-text-strong);
  text-decoration: underline;
}

body > header hr {
  display: none;
}

#blog > header {
  text-align: center;
  padding-top: 42px;
  padding-bottom: 34px;
}

#blog > header h1 {
  font-size: 2.35rem;
}

body > main {
  width: min(100%, calc(var(--hf-content-width) + 40px));
  margin: 0 auto;
  padding: 38px 20px 56px;
  flex: 1 0 auto;
}

.md {
  overflow-wrap: anywhere;
}

.md > :first-child {
  margin-top: 0;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--hf-text-strong);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.025em;
  margin: 2.2rem 0 0.85rem;
}

article.md h1 {
  font-size: 2rem;
}

article.md h2 {
  font-size: 1.625rem;
}

article.md h3 {
  font-size: 1.3rem;
}

article.md h4 {
  font-size: 1.1rem;
}

article.md h5,
article.md h6 {
  font-size: 1rem;
}

p {
  margin: 0 0 1.35rem;
}

strong,
b {
  color: var(--hf-text-strong);
}

ul,
ol {
  margin: 0 0 1.4rem;
  padding-left: 1.65rem;
}

li {
  margin: 0.3rem 0;
}

li::marker {
  color: var(--hf-text-secondary);
}

article.md a {
  text-decoration-color: color-mix(in srgb, var(--hf-accent) 75%, transparent);
}

article.md a:hover {
  text-decoration-color: var(--hf-accent);
}

blockquote {
  margin: 1.8rem 0;
  padding: 0.35rem 0 0.35rem 1.25rem;
  border-left: 3px solid var(--hf-accent);
  color: var(--hf-text-secondary);
}

main article.md blockquote {
  position: relative;
}

main article.md blockquote::before {
  content: "”";
  position: absolute;
  left: 0.28rem;
  top: -0.08rem;
  color: var(--hf-accent);
  font-size: 1.65rem;
  line-height: 1;
  opacity: 0.85;
}

main article.md blockquote > :last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  height: 1px;
  background: var(--hf-border);
  margin: 2rem 0;
}

code,
kbd,
samp {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    Menlo,
    monospace;
  font-size: 0.9em;
}

:not(pre) > code {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--hf-code-bg);
}

pre {
  margin: 1.6rem 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--hf-border);
  border-radius: var(--hf-radius);
  background: var(--hf-code-bg) !important;
  line-height: 1.45;
  tab-size: 2;
}

pre code {
  padding: 0;
  background: transparent !important;
  border: 0;
  font-size: 0.9rem;
}

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

article.md img {
  display: block;
  margin: 1.7rem auto;
  border-radius: var(--hf-radius);
}

figure {
  margin: 1.8rem 0;
}

figcaption {
  margin-top: 0.65rem;
  color: var(--hf-text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.7rem 0;
  font-size: 0.94rem;
}

th,
td {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hf-border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--hf-text-strong);
  background: var(--hf-bg-secondary);
  font-weight: 600;
}

.posts {
  margin-top: 0;
}

.posts > article {
  margin: 0;
  border-bottom: 1px dashed var(--hf-border);
}

.posts > article > div {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 0;
}

.posts .post-date {
  flex: 0 0 7.5rem;
  color: var(--hf-text-secondary);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.posts article a {
  color: var(--hf-text);
  text-decoration: none;
}

.posts article a:hover {
  color: var(--hf-text-strong);
  text-decoration: underline;
  text-decoration-color: var(--hf-accent);
}

.tags {
  margin-top: 2.25rem;
}

.tags code.tag {
  display: inline-block;
  margin: 0 0.45rem 0.45rem 0;
  padding: 0;
  background: transparent;
  color: var(--hf-text-secondary);
}

.tags code.tag a {
  color: inherit;
  text-decoration: none;
}

.tags code.tag a:hover {
  color: var(--hf-text);
}

#last-updated {
  margin-top: 1.15rem;
  color: var(--hf-text-secondary);
  font-size: 0.82rem;
}

#post-footer {
  margin-top: 2.5rem;
  color: var(--hf-text-secondary);
}

[role="list"] {
  margin: 1.5rem 0;
}

[role="listitem"] {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.45rem 0;
}

.listitem-bullet {
  flex: 0 0 auto;
  color: var(--hf-text-secondary);
}

.listitem-text {
  min-width: 0;
}

body > footer {
  width: 100%;
  padding: 28px 20px 38px;
  color: var(--hf-text-secondary);
  text-align: center;
  font-size: 0.86rem;
}

body > footer > * {
  width: min(100%, var(--hf-content-width));
  margin-left: auto;
  margin-right: auto;
}

body > footer hr {
  margin-bottom: 1.4rem;
}

body > footer a {
  color: var(--hf-text);
}

body > footer {
  display: none;
}

@media (max-width: 684px) {
  body {
    letter-spacing: 0.02em;
  }

  body > header {
    padding: 24px 18px 20px;
  }

  #blog > header {
    padding-top: 30px;
    padding-bottom: 26px;
  }

  body > main {
    padding: 30px 18px 44px;
  }

  #post > header h1,
  #blog > header h1 {
    font-size: 2rem;
  }

  article.md h1 {
    font-size: 1.75rem;
  }

  article.md h2 {
    font-size: 1.45rem;
  }

  .posts > article > div {
    display: block;
    padding: 0.85rem 0;
  }

  .posts .post-date {
    display: block;
    margin-bottom: 0.15rem;
  }

  pre {
    margin-left: -6px;
    margin-right: -6px;
    border-radius: 6px;
  }
}

