* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  color: #333;
  background-color: #fff;
  font-family: "Libre Baskerville", serif;
  font-feature-settings: "calt" 1, "liga" 1;
  line-height: 1.6;
}

main {
  width: min(80vw, 760px);
  margin: 4rem auto;
  opacity: 0;
  animation: fade 1s forwards;
}

body.center {
  position: relative;
}

body.center main {
  position: absolute;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

/* for 404 */
main > h1,
main > h1 ~ * {
  text-align: center;
}

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

main > article:last-of-type {
  margin-bottom: 0;
}

footer {
  text-align: center;
}

h1 {
  font-size: 2.25rem;
}

h2,
h3 {
  font-size: 1.25rem;
}

h2 {
  margin-bottom: 1rem;
}

p,
li {
  font-size: 1.125rem;
}

p {
  margin-bottom: 0.75rem;
}

ul {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

li {
  margin-bottom: 0.1rem;
}

a {
  color: #111;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  text-decoration: underline;
}

h1 + p,
header > a,
time,
article > p,
footer {
  color: #666;
}

/* the line under a page or post title */
h1 + p {
  margin-top: 0.15rem;
}

/* small back-link at the top of a page */
header > a {
  display: inline-block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

/* blog shiz */
.post-list {
  list-style: none;
  padding-left: 0;
}

.post-list li {
  margin-bottom: 1.5rem;
}

.post-list article {
  margin-bottom: 0;
}

.post-list time {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.post-list h3 {
  margin-bottom: 0.75rem;
}

.post-list article > p {
  margin-bottom: 0.75rem;
}

article > header {
  margin-bottom: 1.5rem;
}

article > header h1 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

article > header p {
  margin-bottom: 0;
}

code,
pre {
  background: #f3f3f3;
}

code {
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

pre {
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 4px;
  margin: 0 0 1.25rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.comments {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e5e5;
}

.comments h3 {
  margin-bottom: 1rem;
}

#comment-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.25rem;
}

#comment-list li {
  margin-bottom: 0.5rem;
}

#comment-list li::before {
  content: "> ";
  color: #999;
}

#comment-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1.125rem;
  line-height: 1.6;
  color: inherit;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  resize: vertical;
}

#comment-form textarea:focus {
  outline: none;
  border-color: #999;
}

.comment-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

#comment-form button {
  font-family: inherit;
  font-size: 0.95rem;
  color: #333;
  background: #f3f3f3;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

#comment-form button:hover:not(:disabled) {
  background: #e9e9e9;
}

#comment-form button:disabled {
  opacity: 0.5;
  cursor: default;
}

#comment-counter {
  color: #999;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

#comment-status {
  color: #666;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  min-height: 1.5rem;
}

#comment-status:empty {
  min-height: 0;
}

@keyframes fade {
  0% {
    opacity: 0;
  }

  60% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1.5rem;
  }

  main {
    width: 100%;
    margin: 2rem auto;
  }

  body.center main {
    position: static;
    inset: auto;
    transform: none;
  }

  h1 {
    font-size: 1.875rem;
  }
}

@media (prefers-color-scheme: dark) {
  html {
    filter: invert(1) hue-rotate(180deg);
  }
}
