:root {
  --bg: #f2f0ed;
  --ink: #1a1a1a;
  --frame: #0d0d0d;
  --muted: #5c5a57;
  --font-sys: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--frame);
}

body {
  width: min(calc(100% - 2rem), 58rem);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sys);
  line-height: 1.7;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--ink);
  font-size: 0.78rem;
}

.wordmark {
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem 1rem;
}

main {
  padding: clamp(2rem, 8vw, 6rem) clamp(1rem, 8vw, 6rem);
}

.document-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

article {
  min-width: 0;
  max-width: 72ch;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  margin: 0 0 2rem;
  font-size: clamp(2rem, 8vw, 4.75rem);
}

h2 {
  margin: 3.5rem 0 1rem;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.15rem;
}

p,
li {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

li + li {
  margin-top: 0.65rem;
}

blockquote {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid var(--ink);
}

hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--ink);
}

footer {
  border-top: 1px solid var(--ink);
  border-bottom: 0;
}

@media (max-width: 42rem) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  main {
    overflow-x: hidden;
  }

  ul,
  ol {
    padding-inline-start: 1.5rem;
  }

  .document-meta {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
