.blog-index,
.blog-article {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.blog-skip {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: var(--gutter);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-small);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-180%);
}

.blog-skip:focus {
  transform: translateY(0);
}

.blog-list-main {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.blog-list-hero {
  padding-block: 1.5rem 2.5rem;
}

.blog-eyebrow {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

.blog-list-hero h1 {
  max-width: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.2rem + 2.5vw, 3rem);
  font-weight: var(--weight-regular);
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.blog-list-intro {
  max-width: 48rem;
  margin: 1.25rem 0 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.blog-filter {
  min-height: 44px;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: var(--weight-regular);
  line-height: 1.5;
  cursor: pointer;
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease);
}

.blog-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.blog-filter[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--bg-panel-2);
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.4em;
  text-decoration-thickness: 2px;
}

.blog-filter:active {
  background: var(--bg-panel);
  color: var(--text);
}

.blog-filter:disabled {
  border-color: var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}

.blog-filter:focus-visible,
.blog-skip:focus-visible,
.post-card a:focus-visible,
.post-nav-card:focus-visible,
.blog-download-close:focus-visible,
.blog-breadcrumb a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.blog-status {
  min-height: 1.5em;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.blog-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.blog-post-grid > *,
#related-posts > *,
#post-nav > * {
  min-width: 0;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg-panel);
  color: var(--text);
}

.post-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.post-meta time,
.article-meta time {
  font-variant-numeric: tabular-nums;
}

.post-meta .tag,
.article-meta .tag {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-tag);
  background: var(--bg-panel-2);
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.post-card h2,
.post-card h3 {
  max-width: 100%;
  margin: 1rem 0 0.875rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem);
  font-weight: var(--weight-regular);
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

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

.post-card p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.post-card .post-link {
  align-self: flex-start;
  margin-top: auto;
  padding-block: 0.25rem;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.7;
  text-decoration: none;
}

.post-card .post-link:hover {
  color: var(--accent);
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-small);
  background: var(--bg-panel);
  color: var(--text-muted);
  line-height: 1.8;
}

.blog-empty a {
  color: var(--text);
  text-underline-offset: 0.2em;
}

.blog-empty a:hover {
  color: var(--accent);
}

main.wrap:has(> article),
.article-shell {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(820px + var(--gutter) + var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: 3rem;
}

main.wrap:has(> article) {
  padding-top: 24px;
}

main.wrap:has(> article) > nav {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
}

main.wrap:has(> article) > nav p {
  margin: 0;
}

main.wrap > article > header {
  margin: 0;
  padding-block: 8px 12px;
}

main.wrap > article > header > p:last-child {
  margin-bottom: 0;
}

main.wrap > article > .prose,
main.wrap > article.prose > section:first-of-type {
  padding-top: 8px;
}

main.wrap > article > .prose > h2:first-child,
main.wrap > article > .prose > section:first-child > h2:first-child,
main.wrap > article.prose > section:first-of-type > h2:first-child {
  margin-top: 0;
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
}

.blog-breadcrumb a,
nav.breadcrumb a,
nav.breadcrumbs a {
  flex: 0 0 auto;
  color: var(--text-muted);
  text-decoration: none;
}

.blog-breadcrumb a:hover,
nav.breadcrumb a:hover,
nav.breadcrumbs a:hover {
  color: var(--accent);
}

.blog-breadcrumb [aria-hidden="true"],
nav.breadcrumb [aria-hidden="true"],
nav.breadcrumbs [aria-hidden="true"] {
  flex: 0 0 auto;
  color: var(--text-muted);
  opacity: 0.55;
}

.blog-breadcrumb [aria-current="page"],
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.blog-article main.section,
.blog-article .article-shell.section,
.blog-article .section:has(> .blog-breadcrumb),
.blog-article .section:has(> nav.breadcrumb),
.blog-article .section:has(> nav.breadcrumbs) {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.article-hero,
.blog-article .article-hero.section {
  margin: 0;
  padding-block: 0.5rem 1.75rem;
  background: var(--bg);
  color: var(--text);
}

.article-hero .article-meta,
.article-hero .post-meta {
  margin: 0 0 1rem;
}

.article-hero h1 {
  max-width: 100%;
  margin: 1rem 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: var(--weight-regular);
  line-height: 1.32;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.article-lead,
.article-hero .article-summary {
  max-width: 100%;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

.article-body,
.article-content,
.blog-article .prose {
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

:is(.article-body, .article-content, .blog-article .prose) > :first-child,
:is(.article-body, .article-content, .blog-article .prose) > section:first-child > :first-child {
  margin-top: 0;
}

:is(.article-body, .article-content, .blog-article .prose) section,
:is(.article-body, .article-content, .blog-article .prose) section.section {
  margin-block: 0 1.5rem;
  padding-block: 0;
}

:is(.article-body, .article-content, .blog-article .prose) h2 {
  max-width: 100%;
  margin: 2rem 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
  font-weight: var(--weight-regular);
  line-height: 1.5;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

:is(.article-body, .article-content, .blog-article .prose) section > h2:first-child,
:is(.article-body, .article-content, .blog-article .prose) > h2:first-child {
  margin-top: 0;
}

:is(.article-body, .article-content, .blog-article .prose) h3 {
  max-width: 100%;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-weight: var(--weight-medium);
  line-height: 1.6;
}

:is(.article-body, .article-content, .blog-article .prose) p,
:is(.article-body, .article-content, .blog-article .prose) ul,
:is(.article-body, .article-content, .blog-article .prose) ol {
  margin-block: 0 1.125rem;
}

:is(.article-body, .article-content, .blog-article .prose) ul,
:is(.article-body, .article-content, .blog-article .prose) ol {
  padding-inline-start: 1.5rem;
}

:is(.article-body, .article-content, .blog-article .prose) li + li {
  margin-top: 0.375rem;
}

:is(.article-body, .article-content, .blog-article .prose) a:not([class*="btn"]):not([class*="button"]) {
  color: var(--text);
  text-decoration-color: var(--text-muted);
  text-underline-offset: 0.2em;
}

:is(.article-body, .article-content, .blog-article .prose) a:not([class*="btn"]):not([class*="button"]):hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

:is(.article-body, .article-content, .blog-article .prose) code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

:is(.article-body, .article-content, .blog-article .prose) :not(pre) > code {
  padding: 0.125em 0.35em;
  border-radius: var(--r-tag);
  background: var(--bg-panel-2);
  color: var(--text);
}

:is(.article-body, .article-content, .blog-article .prose) pre {
  box-sizing: border-box;
  max-width: 100%;
  margin: 1.25rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-small);
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  white-space: pre;
  tab-size: 2;
}

:is(.article-body, .article-content, .blog-article .prose) pre code {
  padding: 0;
  background: var(--bg-panel);
  color: var(--text);
  font-size: inherit;
  white-space: inherit;
  overflow-wrap: normal;
  word-break: normal;
}

:is(.article-body, .article-content, .blog-article .prose) blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 2px solid var(--border);
  border-radius: var(--r-tag);
  background: var(--bg-panel);
  color: var(--text);
}

:is(.article-body, .article-content, .blog-article .prose) blockquote > :last-child {
  margin-bottom: 0;
}

:is(.article-body, .article-content, .blog-article .prose) .table-scroll {
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
}

:is(.article-body, .article-content, .blog-article .prose) table {
  display: block;
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.9375rem;
}

:is(.article-body, .article-content, .blog-article .prose) .table-scroll table {
  display: table;
  width: 100%;
  margin: 0;
}

:is(.article-body, .article-content, .blog-article .prose) th,
:is(.article-body, .article-content, .blog-article .prose) td {
  min-width: 7em;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

:is(.article-body, .article-content, .blog-article .prose) th {
  background: var(--bg-panel-2);
  color: var(--text);
  font-weight: var(--weight-medium);
}

:is(.article-body, .article-content, .blog-article .prose) img {
  max-width: 100%;
  height: auto;
}

.dl-card {
  box-sizing: border-box;
  margin-block: 2rem 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg-panel);
  color: var(--text);
}

.dl-card h2 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

.dl-card p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.dl-card .article-download-actions,
.dl-card .download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.article-related {
  margin-block: 2rem;
  padding-block: 0;
  background: var(--bg);
  color: var(--text);
}

.article-related > h2 {
  margin: 0 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

#related-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 820px;
}

#related-posts:empty,
#post-nav:empty {
  display: none;
}

#related-posts .related-card {
  padding: 1.25rem;
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 2rem;
}

.post-nav-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--r-small);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
}

.post-nav-card:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.post-nav-label {
  display: block;
  margin-bottom: 0.625rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.post-nav-card strong {
  color: inherit;
  font-size: 1rem;
  font-weight: var(--weight-regular);
  line-height: 1.7;
  overflow-wrap: break-word;
}

.post-nav-next {
  grid-column: 2;
}

.blog-download-dialog {
  box-sizing: border-box;
  width: calc(100% - 2rem);
  max-width: 30rem;
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  background: var(--bg-panel);
  color: var(--text);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.blog-download-dialog.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.blog-download-dialog::backdrop {
  background: var(--shade-deep);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.blog-download-dialog.is-visible::backdrop {
  opacity: 1;
}

.blog-download-panel {
  position: relative;
  padding: 3.75rem 2rem 2rem;
  background: var(--bg-panel);
  color: var(--text);
}

.blog-download-panel h2 {
  max-width: 100%;
  margin: 0 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-regular);
  line-height: 1.5;
}

.blog-download-panel p {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
}

.blog-download-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-round);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.blog-download-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.blog-download-close:active {
  background: var(--bg);
  color: var(--text);
}

@media (max-width: 680px) {
  .blog-list-main {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
  }

  .blog-list-hero {
    padding-block: 1rem 2rem;
  }

  .blog-list-hero h1 {
    font-size: clamp(1.5rem, 5vw, 1.875rem);
  }

  .blog-post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-hero h1 {
    font-size: 1.5rem;
  }

  #post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-nav-next {
    grid-column: auto;
  }

  .blog-download-panel {
    padding-inline: 1.25rem;
  }

  .blog-breadcrumb,
  nav.breadcrumb,
  nav.breadcrumbs {
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-filter,
  .blog-download-dialog,
  .blog-download-dialog::backdrop {
    transition: none;
  }

  .blog-download-dialog {
    transform: none;
  }
}