@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: #fafafa;
  --text: #333333;
  --heading: #3f3f3f;
  --muted: #777777;
  --border: #e8e8e8;
  --link: #333333;
  --hover: #f3f3f2;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    "Geist",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 96px 24px 64px;
}

/* Typography */

h1,
h2 {
  color: var(--heading);
  letter-spacing: -0.025em;
}

h1 {
  margin: 0 0 16px;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
}

h2 {
  margin: 72px 0 24px;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

p {
  margin: 0 0 20px;
}

a {
  color: var(--link);
  text-decoration-color: #bbbbbb;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--text);
}

/* Writing */

.writing {
  margin-top: 72px;
}

.writing h2 {
  margin-top: 0;
}

.post-item {
  display: block;
  margin: 0 -16px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  border-radius: 7px;
  transition: background-color 120ms ease;
}

.post-item + .post-item {
  margin-top: 6px;
}

.post-item:hover {
  background: var(--hover);
  text-decoration: none;
}

.post-title {
  margin-bottom: 4px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.post-item:hover .post-title {
  text-decoration: none;
}

.post-description {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-item time {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Article */

.post-header {
  margin-bottom: 56px;
}

.back-link {
  display: inline-block;
  margin-bottom: 48px;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.post-header h1 {
  margin-bottom: 12px;
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.post-intro {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 1.05rem;
}

.post-header time {
  color: var(--muted);
  font-size: 0.8rem;
}

.post-content {
  font-size: 1rem;
  line-height: 1.75;
}

.post-content h2 {
  margin: 56px 0 16px;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-content p {
  margin: 0 0 24px;
}

/* Article links */

.post-content a {
  text-decoration: underline;
  text-decoration-color: #c7c7c7;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-content a:hover {
  text-decoration-color: var(--text);
}

/* Code */

.post-content .highlight {
  margin: 32px 0;
  overflow: hidden;
  background: #f5f5f4;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.post-content .highlight pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  background: transparent;
  border: 0;
}

.post-content pre,
.post-content code {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
}

.post-content pre {
  color: #242424;
  font-size: 0.875rem;
  line-height: 1.65;
}

.post-content p code {
  padding: 2px 5px;
  color: #242424;
  background: #f1f1f0;
  border-radius: 4px;
  font-size: 0.875em;
}

/* Images */

.post-content img {
  display: block;
  width: 100%;
  height: auto;
  margin: 32px 0;
  border-radius: 10px;
}

.post-content figure {
  margin: 40px 0;
}

.post-content figure img {
  margin: 0;
}

.post-content figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
}

/* Video */

.video {
  position: relative;
  width: 100%;
  margin: 40px 0;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Callout */

.callout {
  margin: 32px 0;
  padding: 16px 18px;
  color: #555555;
  background: #f7f7f6;
  border: 1px solid #eeeeec;
  border-radius: 6px;
}

.callout strong {
  color: #484848;
  font-weight: 500;
}

.callout p {
  margin-top: 6px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Footer */

.site-footer {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: #c7c7c7;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* Mobile */

@media (max-width: 640px) {
  main {
    padding: 56px 20px 40px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    margin-top: 56px;
  }

  .post-item {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .post-header h1 {
    font-size: 2rem;
  }

  .post-header {
    margin-bottom: 44px;
  }

  .back-link {
    margin-bottom: 36px;
  }

  .site-footer {
    margin-top: 72px;
  }
}

/* Homepage sections */

.homepage-section {
  padding-bottom: 32px;
}

.about {
  border-bottom: 1px solid #eeeeec;
}

.homepage-section + .homepage-section {
  margin-top: 48px;
}

.homepage-section h2 {
  margin-top: 0;
}

.writing {
  margin-top: 0;
}