:root {
  --bg: #faf7f0;
  --surface: #ffffff;
  --raised: #f5f1e7;
  --ink: #232019;
  --muted: #6b6459;
  --faint: #a79e8d;
  --line: #e7e0d3;
  --accent: #1c6b64;
  --accent-soft: #e3efec;
  --code-bg: #232b2a;
  --code-fg: #d7e3e0;
}

body[data-theme="dark"] {
  --bg: #16140f;
  --surface: #1e1b15;
  --raised: #211d16;
  --ink: #f0ebe0;
  --muted: #a8a091;
  --faint: #6f685b;
  --line: #2c281f;
  --accent-soft: #1d2b29;
  --code-bg: #100e0a;
  --code-fg: #d7e3e0;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell-motion main > * {
  animation: fadeup 0.35s ease both;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-nav__inner,
.section-inner,
.hero-section__inner,
.site-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.site-nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-brand {
  margin-right: auto;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav__link {
  font-size: 15px;
  color: var(--muted);
}

.site-nav__link.is-active,
.site-nav__link:hover,
.section-link,
.back-link {
  color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
}

.hero-section {
  padding: 96px 0 88px;
}

.hero-section__inner {
  max-width: 780px;
}

.eyebrow,
.section-label,
.post-stack__meta,
.site-footer__copy,
.site-footer__links,
.article-meta,
.hero-note,
.series-nav__label {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow,
.section-label {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-section h1,
.page-header h1,
.article-shell h1 {
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0 0 24px;
}

.hero-section h1 {
  font-size: clamp(2.75rem, 7vw, 3.9rem);
}

.hero-copy,
.page-header p,
.about-teaser__body {
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 14px 24px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}

.button-primary {
  background: var(--accent);
  color: var(--bg);
}

.button-secondary {
  border: 1px solid var(--line);
}

.listing-section {
  border-top: 1px solid var(--line);
}

.listing-section-raised,
.site-footer {
  background: var(--raised);
}

.section-inner {
  padding-top: 56px;
  padding-bottom: 72px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.post-list__item,
.post-stack__item {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-bottom: 24px;
}

.post-list__item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 28px;
  align-items: baseline;
}

.post-list__title,
.post-stack__title {
  display: block;
  color: var(--ink);
}

.post-list__title {
  font-size: 1.7rem;
  margin-bottom: 8px;
}

.post-list__dek,
.post-stack__dek,
.post-list__meta,
.post-list__aside,
.article-meta {
  color: var(--muted);
}

.post-stack__title {
  font-size: 2rem;
  line-height: 1.16;
  margin-bottom: 8px;
}

.compact-width {
  max-width: 820px;
  margin: 0 auto;
}

.page-header {
  padding: 80px 0 28px;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.tag-row-article {
  margin-top: 0;
  margin-bottom: 28px;
}

.tag-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.about-teaser__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
}

.about-teaser__title {
  font-size: 1.6rem;
  line-height: 1.45;
  margin-bottom: 18px;
}

.article-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 40px 88px;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  font-family: "IBM Plex Mono", monospace;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 34px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.article-meta__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
}

.prose {
  font-size: 1.25rem;
  line-height: 1.72;
  color: var(--muted);
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--ink);
  line-height: 1.2;
  margin-top: 44px;
  margin-bottom: 16px;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose blockquote {
  margin-top: 0;
  margin-bottom: 24px;
}

.prose code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
}

.prose pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 26px;
  overflow-x: auto;
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.prose a {
  color: var(--accent);
}

.series-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.series-nav__card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.series-nav__card-right {
  text-align: right;
}

.series-nav__title {
  font-size: 1.1rem;
  color: var(--ink);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 40px;
  padding-bottom: 40px;
}

.site-footer__name {
  margin-right: auto;
  font-size: 1.05rem;
}

.site-footer__links {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer__copy {
  width: 100%;
  font-size: 12px;
  color: var(--faint);
}

@keyframes fadeup {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 760px) {
  .site-nav__inner,
  .section-inner,
  .hero-section__inner,
  .site-footer__inner,
  .article-shell {
    padding-left: 20px;
    padding-right: 20px;
  }

  .site-nav__inner {
    flex-wrap: wrap;
  }

  .site-brand {
    margin-right: 0;
    width: 100%;
  }

  .post-list__item,
  .about-teaser__grid,
  .series-nav {
    grid-template-columns: 1fr;
  }

  .post-list__meta,
  .post-list__aside {
    width: auto;
  }

  .hero-copy,
  .page-header p,
  .about-teaser__body,
  .prose {
    font-size: 1.15rem;
  }
}