:root {
  color-scheme: light;
  --background: #fffdf8;
  --foreground: #1c1917;
  --muted: #78716c;
  --border: #e7e5e4;
  --accent: #b45309;
  --accent-strong: #92400e;
  --accent-soft: #fef3c7;
  --panel: #ffffff;
  --code-background: #1c1917;
  --code-foreground: #fafaf9;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--foreground);
  background: var(--background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
}

a {
  color: var(--accent-strong);
  text-underline-offset: 0.18em;
}

.site-header,
.site-footer,
.site-main {
  width: min(100% - 3rem, 1024px);
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--foreground);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.035em;
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.site-header nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--foreground);
}

.site-header nav .button {
  padding: 0.625rem 1rem;
  border-radius: 999px;
  color: white;
  background: var(--accent);
}

.site-main {
  padding-block: 4.5rem 6rem;
}

.blog-intro {
  max-width: 760px;
  margin-bottom: 4rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.blog-intro h1,
.article-header h1 {
  margin: 0.75rem 0 0;
  max-width: 900px;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.blog-intro > p:last-child,
.dek {
  max-width: 760px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.75;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.post-card {
  padding: 2rem 2rem 2.25rem 0;
  border-bottom: 1px solid var(--border);
}

.post-card:nth-child(even) {
  padding-right: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--border);
}

.post-card h2 {
  margin: 0.65rem 0 0;
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.post-card h2 a {
  color: var(--foreground);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent-strong);
}

.post-card > p:not(.eyebrow, .post-meta) {
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.article {
  max-width: 800px;
  margin-inline: auto;
}

.article-header {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: clamp(2.4rem, 6vw, 4.25rem);
}

.article-body {
  padding-top: 2.5rem;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.82;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: -0.025em;
  line-height: 1.2;
  scroll-margin-top: 2rem;
}

.article-body h2 {
  margin: 3.4rem 0 1rem;
  padding-top: 0.75rem;
  font-size: 2rem;
}

.article-body h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.4rem;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 1.2rem 0;
}

.article-body li + li {
  margin-top: 0.55rem;
}

.article-body strong {
  color: var(--foreground);
}

.article-body blockquote {
  margin: 2rem 0;
  padding: 0.1rem 0 0.1rem 1.5rem;
  border-left: 3px solid var(--accent);
  color: #57534e;
  font-size: 1.15rem;
}

.article-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 2.25rem 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: 0 24px 70px rgb(28 25 23 / 0.1);
}

.article-body pre {
  overflow-x: auto;
  margin: 1.8rem 0;
  padding: 1.25rem;
  border-radius: 0.85rem;
  color: var(--code-foreground);
  background: var(--code-background);
  font-size: 0.86rem;
  line-height: 1.65;
}

.article-body :not(pre) > code {
  padding: 0.16rem 0.35rem;
  border-radius: 0.3rem;
  color: var(--foreground);
  background: #f5f5f4;
  font-size: 0.88em;
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border-collapse: collapse;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

.article-body th,
.article-body td {
  min-width: 10rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: #fafaf9;
}

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

.related {
  max-width: 1024px;
  margin: 6rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  margin: 0.5rem 0 1.5rem;
  font-size: 1.8rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-grid a {
  display: flex;
  min-height: 10rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  color: var(--foreground);
  background: var(--panel);
  text-decoration: none;
}

.related-grid a:hover {
  border-color: var(--accent);
}

.related-grid span {
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.related-grid strong {
  line-height: 1.35;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .site-main {
    width: min(100% - 2rem, 1024px);
  }

  .site-header {
    align-items: flex-start;
    padding-block: 1rem;
  }

  .site-header nav {
    gap: 0.9rem;
  }

  .site-header nav a:not([aria-current="page"], .button) {
    display: none;
  }

  .site-main {
    padding-block: 3rem 4.5rem;
  }

  .post-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-card,
  .post-card:nth-child(even) {
    padding: 1.75rem 0;
    border-left: 0;
  }

  .article-body {
    font-size: 1rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.5rem;
  }
}
