@font-face {
  font-family: "Fenix Inter";
  src: url("/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: hsl(220 25% 97%);
  --surface-1: hsl(0 0% 100%);
  --surface-2: hsl(220 18% 95%);
  --surface-3: hsl(220 14% 91%);
  --border: hsl(220 14% 88%);
  --border-strong: hsl(220 11% 76%);
  --text-1: hsl(220 18% 12%);
  --text-2: hsl(220 9% 32%);
  --text-3: hsl(220 7% 44%);
  --primary: hsl(142 72% 28%);
  --primary-dim: hsl(142 55% 92%);
  --code-bg: hsl(220 18% 95%);
  --radius: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(220 10% 5%);
    --surface-1: hsl(220 8% 8%);
    --surface-2: hsl(220 7% 11%);
    --surface-3: hsl(220 7% 14%);
    --border: hsl(220 8% 16%);
    --border-strong: hsl(220 8% 24%);
    --text-1: hsl(0 0% 95%);
    --text-2: hsl(220 6% 68%);
    --text-3: hsl(220 5% 52%);
    --primary: hsl(142 70% 45%);
    --primary-dim: hsl(142 45% 16%);
    --code-bg: hsl(220 7% 11%);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font: 400 16px/1.7 "Fenix Inter", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.masthead {
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}

.wordmark {
  display: flex;
  align-items: center;
  width: min(100%, 72rem);
  min-height: 3.5rem;
  margin: 0 auto;
  color: var(--text-1);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark::before {
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.65rem;
  border-radius: 50%;
  background: var(--primary);
  content: "";
}

.wordmark:hover,
a {
  color: var(--primary);
}

main {
  width: min(100%, 48rem);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2rem;
}

.entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.entry-title {
  display: block;
  color: var(--text-1);
  font-size: 20px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.entry-title:hover {
  color: var(--primary);
}

.entry.empty,
.entry-summary {
  color: var(--text-2);
}

.entry-summary {
  margin: 0.65rem 0 0;
}

time {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.post h1,
.post h2,
.post h3,
.post h4 {
  color: var(--text-1);
  font-weight: 650;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
}

.back-link::before {
  content: "← ";
}

.back-link:hover {
  color: var(--primary);
}

.post h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.post h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.post h3 {
  margin: 2.25rem 0 0.65rem;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.post h4 {
  margin: 2rem 0 0.5rem;
  font-size: 14px;
  line-height: 1.4;
}

.post > time {
  margin-bottom: 1rem;
}

.post p,
.post ul,
.post ol {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.post li {
  margin-bottom: 0.4rem;
}

.post strong {
  color: var(--text-1);
  font-weight: 650;
}

.post figure {
  margin: 2rem 0;
}

.post img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.post figcaption {
  margin-top: 0.6rem;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
}

.post iframe {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.post blockquote {
  margin: 1.75rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  color: var(--text-2);
}

.post blockquote > :last-child {
  margin-bottom: 0;
}

.post pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.post code {
  font: 0.87em/1.5 ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
}

.post pre code {
  font-size: 13px;
}

.post table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 14px;
}

.post th,
.post td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.post th {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post hr {
  margin: 2.75rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-nav a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1);
  text-decoration: none;
}

.article-nav a:last-child {
  text-align: right;
}

.article-nav a:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.article-nav span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-nav strong {
  overflow: hidden;
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 2rem;
  padding: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  list-style: none;
}

.tags li {
  padding: 0.4rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: 999px;
  background: var(--primary-dim);
}

.footer {
  width: min(calc(100% - 3rem), 48rem);
  margin: 2rem auto 0;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.footer a {
  color: var(--text-3);
  text-decoration: none;
}

.footer a:hover {
  color: var(--primary);
}

@media (max-width: 40rem) {
  .masthead,
  main {
    padding-inline: 1rem;
  }

  main {
    padding-top: 2.25rem;
  }

  .footer {
    width: calc(100% - 2rem);
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav > span {
    display: none;
  }

  .article-nav a:last-child {
    text-align: left;
  }
}
