:root {
  --ink: #2b2d42;
  --accent: #dc143c;
  --page: #f6f6f6;
  --surface: #f0f1f2;
  --muted: #5b5e70;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.7;
}

.page-content {
  max-width: 80ch;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 3vw, 2rem) 2.5rem;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

a:focus-visible {
  outline: 0.2rem solid var(--accent);
  outline-offset: 0.2rem;
  text-decoration: none;
}

.site-header {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.banner {
  margin: 0;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: var(--surface);
  font-weight: 500;
  text-align: center;
}

.site-title {
  display: block;
  margin-bottom: 1rem;
  font-family: Fredoka, system-ui, sans-serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

nav a {
  text-decoration: none;
}

main > header,
article > header {
  margin-bottom: 1.75rem;
}

h1,
h2,
h3,
h4 {
  margin: 2.5rem 0 0.75rem;
  font-family: Fredoka, system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.1;
}

h1 {
  margin-top: 0;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

.post h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.post > header {
  margin-bottom: 2rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
}

h3 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}

p,
ul,
blockquote,
pre,
form {
  margin: 0 0 1.5rem;
}

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

time,
figcaption {
  color: var(--muted);
  font-size: 0.825em;
}

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

.post-summary {
  margin: 0;
  padding: 1.5rem 0;
}

.post-summary h3 {
  margin: 0 0 0.4rem;
}

.post-summary h3 a {
  position: relative;
  text-decoration: none;
}

.post-summary h3 a::after {
  position: absolute;
  right: 0;
  bottom: -0.1em;
  left: 0;
  height: 0.1em;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.post-summary p {
  margin: 0.25rem 0 0;
}

blockquote {
  margin-inline: 1rem;
  padding-left: 1rem;
  border-left: 0.125rem solid var(--muted);
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 0.1em 0.3em;
  background: var(--surface);
}

pre {
  overflow-x: auto;
  padding: 1.25rem;
  background: var(--surface);
  font-size: 0.95em;
  line-height: 1.5;
}

pre code {
  padding: 0;
  background: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

figure {
  margin: 2.5rem 0;
}

figcaption {
  margin-top: 0.65rem;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 500;
}

input,
textarea,
button {
  margin-top: 0.35rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.65rem;
}

textarea {
  min-height: 10rem;
  resize: vertical;
}

button {
  width: auto;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--page);
  cursor: pointer;
}

button:hover {
  background: var(--accent);
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 0.2rem solid var(--accent);
  outline-offset: 0.15rem;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: center;
  margin-top: 5rem;
  font-size: 0.875rem;
}

footer a {
  text-decoration: none;
}

@media (max-width: 32rem) {
  body {
    min-height: auto;
  }

  .site-header {
    margin-bottom: 3rem;
  }

  .post-summary {
    padding: 1.25rem 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 120ms ease;
  }
}
