:root {
  --blog-reading: 56rem;
  --blog-line: 1.85;
  --blog-title-tracking: -0.015em;
  --blog-shadow: 0 12px 36px var(--accent-a10);
  --blog-terminal-shadow: 0 10px 24px var(--brown-shadow);
  --blog-promo-surface: linear-gradient(125deg, var(--accent-dark), var(--accent));
  --blog-terminal-surface: linear-gradient(150deg, var(--pill-dark), var(--text));
  --blog-warning-surface: color-mix(in srgb, var(--warn) 11%, var(--panel));
  --blog-success-surface: color-mix(in srgb, var(--success) 10%, var(--panel));
  --blog-rule-width: 3.5em;
}

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

.blog-index main,
.blog-article main {
  min-width: 0;
}

.blog-index [hidden],
.blog-article [hidden],
#related-posts[hidden],
#post-nav[hidden] {
  display: none !important;
}

.reading-wrap,
.article-hero,
.breadcrumbs,
.breadcrumb,
#related-posts,
#post-nav {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--blog-reading) + var(--gutter) + var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-width: 0;
}

.reading-wrap {
  width: 100%;
  max-width: calc(var(--blog-reading) + var(--gutter) + var(--gutter));
  padding-inline: var(--gutter);
  margin-inline: auto;
}

.reading-wrap .article-hero,
.reading-wrap .breadcrumbs,
.reading-wrap .breadcrumb,
.reading-wrap #related-posts,
.reading-wrap #post-nav {
  max-width: 100%;
  padding-inline: 0;
}

.blog-index h1,
.blog-index h2,
.blog-index h3,
.article-hero h1,
.prose h1,
.prose h2,
.prose h3,
.article-body h1,
.article-body h2,
.article-body h3,
[data-article-body] h1,
[data-article-body] h2,
[data-article-body] h3,
#related-posts h2,
#related-posts h3 {
  display: block;
  text-wrap: pretty;
  letter-spacing: var(--blog-title-tracking);
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-display);
}

.blog-list-hero {
  padding-block: clamp(3rem, 7vw, 5rem) 2rem;
  text-align: center;
}

.blog-kicker,
.article-kicker,
.article-hero .kicker {
  margin: 0 0 1.25rem;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-kicker .led {
  margin-inline-end: 0.5rem;
  vertical-align: middle;
}

.blog-list-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.3;
}

.blog-list-hero h1::after,
.article-hero h1::after {
  content: "";
  display: block;
  width: var(--blog-rule-width);
  height: 3px;
  margin: 1.4rem auto;
  background: var(--accent);
  border-radius: var(--r-pill);
}

.blog-intro {
  max-width: 42rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: var(--blog-line);
}

.blog-list-section {
  padding-block: 0 2.5rem;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-block: 0.5rem 1rem;
}

.blog-filters button {
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.blog-filters button:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.blog-filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.blog-status {
  min-height: 1.8em;
  margin: 1rem 0 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

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

.article-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--blog-shadow);
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}

.article-meta time {
  font-family: var(--font-mono);
}

.article-card .tag {
  max-width: 100%;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-family: var(--font-body);
  font-weight: 600;
}

.article-card h2.article-card-title,
.article-card h3.article-card-title {
  margin: 0 0 0.8rem;
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.65;
}

.article-card-title a {
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.article-card-title a:hover {
  color: var(--accent-dark);
}

.article-summary {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: var(--blog-line);
}

.article-card .article-link {
  align-self: flex-start;
  margin-top: auto;
  padding-block: 0.3rem;
  color: var(--accent-dark);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.article-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-card);
  background: var(--panel-2);
  color: var(--muted);
  line-height: var(--blog-line);
  text-align: center;
}

.breadcrumbs,
.breadcrumb {
  padding-top: 1.5rem;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.breadcrumbs ol,
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs a,
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumb a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.article-hero {
  position: relative;
  padding-block: 2.5rem 1.75rem;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: center;
}

.article-hero h1 {
  max-width: 100%;
  margin: 0;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 900;
  line-height: 1.5;
}

.article-hero .article-summary,
.article-hero .lede,
.article-hero .article-deck {
  max-width: 46rem;
  margin: 0 auto 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: var(--blog-line);
}

.article-hero .article-meta {
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  text-align: center;
}

.article-hero .article-meta > * {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  max-width: 100%;
}

.article-hero .article-meta > * + *::before {
  content: "·";
  display: inline;
  margin-inline-end: 0.5rem;
  color: var(--muted);
}

.prose,
.article-body,
[data-article-body] {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: var(--blog-line);
  overflow-wrap: anywhere;
}

.prose p,
.article-body p,
[data-article-body] p {
  margin-block: 0 1.25rem;
}

.prose h2,
.article-body h2,
[data-article-body] h2 {
  position: relative;
  margin-block: 2.5rem 1.1rem;
  padding-top: 0.9rem;
  font-size: 1.6rem;
  line-height: 1.6;
  font-weight: 800;
  scroll-margin-top: var(--anchor-offset);
}

.prose h2::before,
.article-body h2::before,
[data-article-body] h2::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 2rem;
  height: 3px;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.prose > h2:first-child,
.article-body > h2:first-child,
[data-article-body] > h2:first-child,
.prose > section:first-child > h2:first-child,
.article-body > section:first-child > h2:first-child,
[data-article-body] > section:first-child > h2:first-child {
  margin-top: 0.75rem;
}

.prose h3,
.article-body h3,
[data-article-body] h3 {
  margin-block: 1.8rem 0.8rem;
  font-size: 1.3rem;
  line-height: 1.65;
  font-weight: 750;
}

.prose a,
.article-body a,
[data-article-body] a {
  color: var(--accent-dark);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.prose ul,
.prose ol,
.article-body ul,
.article-body ol,
[data-article-body] ul,
[data-article-body] ol {
  margin-block: 0 1.5rem;
  padding-inline-start: 1.5rem;
}

.prose li,
.article-body li,
[data-article-body] li {
  margin-block: 0.45rem;
}

.prose img,
.article-body img,
[data-article-body] img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-small);
}

.prose hr,
.article-body hr,
[data-article-body] hr {
  margin-block: 2rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose :not(pre) > code,
.article-body :not(pre) > code,
[data-article-body] :not(pre) > code {
  padding: 0.15em 0.4em;
  border-radius: var(--r-small);
  background: var(--panel-2);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.prose pre,
.article-body pre,
[data-article-body] pre {
  position: relative;
  max-width: 100%;
  margin-block: 1.5rem;
  padding: 3rem 1.25rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--pill-dark-2);
  border-radius: var(--r-card);
  background: var(--blog-terminal-surface);
  color: var(--white);
  box-shadow: var(--blog-terminal-shadow);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  tab-size: 2;
}

.prose pre::before,
.article-body pre::before,
[data-article-body] pre::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  left: 1.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--r-circle);
  background: var(--error);
  box-shadow: 1rem 0 0 var(--warn), 2rem 0 0 var(--success);
}

.prose pre code,
.article-body pre code,
[data-article-body] pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-family: var(--font-mono);
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

.prose .table-scroll,
.article-body .table-scroll,
[data-article-body] .table-scroll {
  max-width: 100%;
  margin-block: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-row);
  overscroll-behavior-inline: contain;
}

.prose table,
.article-body table,
[data-article-body] table {
  width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.8;
  text-align: start;
}

.prose .table-scroll table,
.article-body .table-scroll table,
[data-article-body] .table-scroll table {
  min-width: 38rem;
  margin: 0;
}

.prose th,
.prose td,
.article-body th,
.article-body td,
[data-article-body] th,
[data-article-body] td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: start;
}

.prose thead th,
.article-body thead th,
[data-article-body] thead th {
  background: var(--accent-dark);
  color: var(--white);
  font-weight: 650;
}

.prose tbody tr,
.article-body tbody tr,
[data-article-body] tbody tr {
  background: var(--panel);
}

.prose tbody tr:nth-child(even),
.article-body tbody tr:nth-child(even),
[data-article-body] tbody tr:nth-child(even) {
  background: var(--panel-2);
}

.prose tbody tr:hover,
.article-body tbody tr:hover,
[data-article-body] tbody tr:hover {
  background: var(--accent-tint);
}

.prose caption,
.article-body caption,
[data-article-body] caption {
  padding-block: 0 0.75rem;
  color: var(--muted);
  text-align: start;
}

.callout,
.verdict {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.2rem 1.25rem 1.2rem 3.25rem;
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--r-row);
  background: var(--accent-tint);
  color: var(--text);
  line-height: var(--blog-line);
}

.callout::before {
  content: "i";
  position: absolute;
  top: 1.3rem;
  left: 1rem;
  width: 1.3rem;
  height: 1.3rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-circle);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
}

.callout.warning,
.callout--warning {
  border-inline-start-color: var(--warn);
  background: var(--blog-warning-surface);
}

.callout.warning::before,
.callout--warning::before {
  content: "!";
  border-color: var(--warn);
  color: var(--text);
}

.callout.success,
.callout--success {
  border-inline-start-color: var(--success);
  background: var(--blog-success-surface);
}

.callout.success::before,
.callout--success::before {
  border-color: var(--success);
  color: var(--success);
}

.callout > :last-child,
.verdict > :last-child {
  margin-bottom: 0;
}

.verdict {
  padding-inline-start: 1.25rem;
  background: var(--panel-2);
}

.verdict strong:first-child {
  color: var(--accent-dark);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.stat-card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-card);
  background: var(--accent-tint);
}

.stat-card:nth-child(even) {
  border-top-color: var(--text);
  background: var(--panel-2);
}

.stat-num {
  display: block;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.stat-card:nth-child(even) .stat-num {
  color: var(--text);
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.prose .check-list,
.article-body .check-list,
[data-article-body] .check-list,
.check-list {
  display: grid;
  gap: 0.7rem;
  margin-block: 1.5rem;
  padding: 0;
  list-style: none;
}

.check-list > li {
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-row);
  background: var(--panel);
  line-height: var(--blog-line);
}

.check-list > li::before,
.check-list > li::after {
  content: none;
}

.check-list > li::marker {
  content: "";
}

.promo-block {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-sizing: border-box;
  margin-block: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-card);
  background: var(--blog-promo-surface);
  color: var(--white);
  box-shadow: var(--blog-shadow);
}

.promo-block.reading-wrap {
  width: calc(100% - var(--gutter) - var(--gutter));
  max-width: var(--blog-reading);
  padding-inline: 1.75rem;
}

.reading-wrap .promo-block.reading-wrap {
  width: 100%;
}

.promo-copy {
  min-width: 0;
}

.promo-copy strong {
  display: block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.6;
}

.promo-copy p {
  margin: 0.5rem 0 0;
  color: var(--white);
  font-size: 0.9375rem;
  line-height: var(--blog-line);
}

.promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex-shrink: 0;
}

.promo-block .btn {
  min-height: 44px;
  border-radius: var(--r-pill);
  text-decoration: none;
}

.promo-block .btn-main,
.promo-block .btn-primary {
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--accent-dark);
  box-shadow: none;
}

.promo-block .btn-soft,
.promo-block .btn-secondary {
  border: 1px solid var(--white);
  background: var(--clear);
  color: var(--white);
  box-shadow: none;
}

.promo-block .btn-main:hover,
.promo-block .btn-primary:hover {
  background: var(--accent-tint);
}

.promo-block .btn-soft:hover,
.promo-block .btn-secondary:hover {
  background: var(--accent-dark);
}

#related-posts {
  padding-block: 1.5rem 2rem;
}

#related-posts .related-heading {
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 1.6rem;
  line-height: 1.6;
}

#related-posts .related-heading::before {
  content: none;
}

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

.related-grid .article-card {
  padding: 1.2rem;
}

.related-grid .article-card-title {
  font-size: 1.1rem;
}

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

.post-nav-card {
  display: block;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: var(--r-card);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

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

.post-nav-label,
.post-nav-date {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.8;
}

.post-nav-label {
  margin-bottom: 0.6rem;
  color: var(--accent-dark);
  font-weight: 650;
}

.post-nav-title {
  display: block;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.post-nav-date {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
}

.float-cta {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-sizing: border-box;
  max-width: calc(100vw - 2rem);
  min-height: 48px;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-pill);
  background: var(--blog-promo-surface);
  color: var(--white);
  box-shadow: var(--blog-shadow);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.float-cta svg {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
}

.float-cta:hover {
  background: var(--accent-dark);
  color: var(--white);
}

@media (hover: hover) and (pointer: fine) {
  .article-card:hover,
  .post-nav-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
  }
}

@media (max-width: 860px) {
  .prose table,
  .article-body table,
  [data-article-body] table {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

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

  .promo-block {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .no-break {
    white-space: normal;
  }

  .reading-wrap,
  .article-hero,
  .breadcrumbs,
  .breadcrumb,
  #related-posts,
  #post-nav {
    padding-inline: max(1rem, var(--gutter));
  }

  .reading-wrap .article-hero,
  .reading-wrap .breadcrumbs,
  .reading-wrap .breadcrumb,
  .reading-wrap #related-posts,
  .reading-wrap #post-nav {
    padding-inline: 0;
  }

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

  .blog-card-grid {
    grid-template-columns: 1fr;
  }

  .blog-filters {
    gap: 0.5rem;
  }

  .blog-filters button {
    padding-inline: 0.85rem;
  }

  .article-card {
    padding: 1.25rem;
  }

  .article-hero {
    padding-block: 2rem 1.25rem;
  }

  .article-hero h1 {
    font-size: clamp(1.65rem, 6.8vw, 2.1rem);
  }

  .prose h2,
  .article-body h2,
  [data-article-body] h2 {
    font-size: 1.4rem;
  }

  .promo-block,
  .promo-block.reading-wrap {
    padding: 1.5rem;
  }

  .promo-actions {
    width: 100%;
  }

  #post-nav {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

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

  .float-cta {
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    right: 1rem;
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
  }

  body:has(.float-cta) {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .post-nav-card,
  .blog-filters button,
  .float-cta {
    transition: none;
    animation: none;
  }

  .article-card:hover,
  .post-nav-card:hover {
    transform: none;
  }
}