:root {
  --blog-column: 56rem;
  --blog-gutter: max(1.5rem, var(--gutter));
  --blog-h1: clamp(1.85rem, 4vw, 2.6rem);
  --blog-index-h1: clamp(2rem, 4.5vw, 3rem);
  --blog-h2: clamp(1.3rem, 2.5vw, 1.6rem);
  --blog-h3: 1.3rem;
  --blog-body-size: 1rem;
  --blog-leading: 1.9;
  --blog-tracking: -0.015em;
  --blog-stamp-size: 4.5rem;
  --blog-stamp-angle: -11deg;
  --blog-focus-width: 3px;
  --blog-rule-width: 4px;
  --blog-button-min: 2.75rem;
}

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

.blog-index-wrap {
  padding-bottom: 3rem;
}

.blog-skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border-radius: var(--r-sm);
  background: var(--accent-dark);
  color: var(--on-dark);
  transform: translateY(-200%);
}

.blog-skip-link:focus {
  transform: none;
}

.blog-list-page :focus-visible,
.blog-article-page :focus-visible,
.article-body :focus-visible,
#related-posts :focus-visible,
#post-nav :focus-visible,
.float-cta:focus-visible {
  outline: var(--blog-focus-width) solid var(--accent);
  outline-offset: 4px;
}

.breadcrumbs {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.breadcrumbs li + li::before {
  content: "›";
  margin-inline-end: 0.7rem;
  color: var(--muted);
}

.breadcrumbs a {
  color: var(--accent-dark);
  text-underline-offset: 0.2em;
}

.blog-index-hero {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--accent-soft), var(--panel));
  box-shadow: var(--shadow-1);
}

.blog-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.blog-index-hero h1 {
  margin: 0 0 1rem;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: var(--blog-index-h1);
  font-weight: var(--weight-display);
  line-height: 1.25;
}

.blog-index-hero > p:not(.blog-kicker) {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.blog-fact-row,
.article-meta,
.blog-hero .article-meta,
.article-hero .article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.6rem;
}

.blog-fact-row {
  margin-top: 1.5rem;
}

.blog-catalog {
  padding-block: 2.5rem;
}

.blog-catalog-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.blog-catalog-heading h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: var(--blog-h2);
}

.blog-results-status {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.blog-filter {
  min-height: var(--blog-button-min);
  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: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  cursor: pointer;
}

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

.blog-filter.is-active,
.blog-filter[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-dark);
}

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

.blog-card-grid > *,
.related-grid > * {
  min-width: 0;
}

.blog-card-grid .article-card,
#related-posts .article-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent-line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  opacity: 1;
  visibility: visible;
}

.blog-card-grid .article-card:hover,
#related-posts .article-card:hover,
.blog-card-grid .article-card:focus-within,
#related-posts .article-card:focus-within {
  border-color: var(--accent);
}

.article-meta {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.article-meta .tag {
  padding: 0.25rem 0.65rem;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: var(--weight-semibold);
}

.blog-card-grid .article-card h2,
#related-posts .article-card h3 {
  margin: 0;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: var(--blog-h3);
  font-weight: var(--weight-bold);
  line-height: 1.6;
}

.article-card h2 a,
.article-card h3 a {
  color: inherit;
  text-decoration: none;
}

.article-card h2 a:hover,
.article-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.blog-card-grid .article-card > p,
#related-posts .article-card > p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.9;
}

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

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

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

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

/* Shared outer box and identical gutters keep the article's left edge aligned. */
.reading-wrap,
.article-hero,
.blog-hero,
.article-breadcrumbs,
.blog-article-page > .breadcrumbs {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--blog-column) + var(--blog-gutter) + var(--blog-gutter));
  margin-inline: auto;
  padding-inline: var(--blog-gutter);
}

.reading-wrap .reading-wrap,
.reading-wrap > .article-hero,
.reading-wrap > .blog-hero,
.reading-wrap > .breadcrumbs,
.reading-wrap > .article-breadcrumbs {
  width: 100%;
  max-width: none;
  padding-inline: 0;
}

.reading-wrap .article-hero,
.reading-wrap .blog-hero {
  width: calc(100% + var(--blog-gutter) + var(--blog-gutter));
  max-width: none;
  margin-inline: calc(-1 * var(--blog-gutter));
  padding-inline: var(--blog-gutter);
}

.blog-hero,
.article-hero {
  position: relative;
  isolation: isolate;
  margin-block: 0 1.75rem;
  padding-block: 1.75rem 2rem;
  border-radius: var(--r-xl);
  background: var(--panel-2);
  box-shadow: var(--shadow-1);
}

.blog-hero::after,
.article-hero::after {
  content: "VB";
  position: absolute;
  top: 1.5rem;
  right: var(--blog-gutter);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--blog-stamp-size);
  height: var(--blog-stamp-size);
  border: 4px double var(--accent);
  border-radius: var(--r-round);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  transform: rotate(var(--blog-stamp-angle));
  pointer-events: none;
}

.blog-hero .article-meta,
.article-hero .article-meta {
  min-height: 4.5rem;
  margin: 0 0 1.25rem;
  padding-inline-end: 5.5rem;
}

.blog-hero .article-meta > *,
.article-hero .article-meta > * {
  max-width: 100%;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.blog-hero .article-meta .tag,
.article-hero .article-meta .tag {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: var(--on-dark);
}

.blog-hero h1,
.article-hero h1 {
  margin: 0 0 1rem;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: var(--blog-h1);
  font-weight: var(--weight-display);
  line-height: 1.4;
}

.blog-hero > p,
.article-hero > p,
.article-summary {
  margin: 0;
  color: var(--muted);
  font-size: var(--blog-body-size);
  line-height: var(--blog-leading);
}

.blog-index-hero h1,
.blog-catalog h2,
.article-card h2,
.article-card h3,
.blog-hero h1,
.article-hero h1,
.article-body h2,
.article-body h3,
[data-article-body] h2,
[data-article-body] h3,
#related-posts h2,
.promo-block h2 {
  display: block;
  text-align: start;
  text-wrap: pretty;
  letter-spacing: var(--blog-tracking);
  overflow-wrap: anywhere;
  word-break: normal;
}

.article-body.prose,
[data-article-body] {
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--blog-body-size);
  line-height: var(--blog-leading);
  counter-reset: blog-section;
  overflow-wrap: anywhere;
}

.article-body.prose:not(.reading-wrap),
[data-article-body]:not(.reading-wrap) {
  width: 100%;
  max-width: var(--blog-column);
  margin-inline: auto;
}

.article-body :is(p, ul, ol, blockquote, pre, figure),
[data-article-body] :is(p, ul, ol, blockquote, pre, figure) {
  margin-block: 0 1.4rem;
}

.article-body :is(ul, ol),
[data-article-body] :is(ul, ol) {
  padding-inline-start: 1.6rem;
}

.article-body li + li,
[data-article-body] li + li {
  margin-top: 0.55rem;
}

.article-body h2,
[data-article-body] h2 {
  clear: both;
  margin: 2.5rem 0 1.1rem;
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: var(--blog-h2);
  font-weight: var(--weight-bold);
  line-height: 1.65;
  counter-increment: blog-section;
  scroll-margin-top: var(--section-anchor);
}

.article-body h2::before,
[data-article-body] h2::before {
  content: counter(blog-section, decimal-leading-zero);
  display: inline-block;
  margin-inline-end: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  vertical-align: 0.12em;
}

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

.article-body h3,
[data-article-body] h3 {
  margin: 1.8rem 0 0.8rem;
  color: var(--accent-dark);
  font-size: var(--blog-h3);
  font-weight: var(--weight-semibold);
  line-height: 1.65;
}

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

.article-body img,
[data-article-body] img,
.article-body svg,
[data-article-body] svg {
  max-width: 100%;
  height: auto;
}

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

.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-md);
  overscroll-behavior-inline: contain;
}

.article-body table,
[data-article-body] table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: 1.8;
  text-align: start;
}

.article-body caption,
[data-article-body] caption {
  padding: 0.85rem 1rem;
  background: var(--panel);
  color: var(--muted);
  text-align: start;
}

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

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

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

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

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

.article-body pre,
[data-article-body] pre {
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
  padding: 3rem 1.4rem 1.4rem;
  overflow-x: auto;
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-md);
  background: var(--accent-dark);
  color: var(--on-dark);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.85;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
}

.article-body pre::before,
[data-article-body] pre::before {
  content: "BASIC / TERMINAL";
  position: absolute;
  top: 0.7rem;
  left: 1.4rem;
  color: var(--on-dark);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
}

.article-body code,
[data-article-body] code {
  padding: 0.15em 0.35em;
  border-radius: var(--r-sm);
  background: var(--panel-2);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.article-body pre code,
[data-article-body] pre code {
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  white-space: inherit;
  overflow-wrap: normal;
}

.article-body blockquote,
[data-article-body] blockquote,
.callout,
.verdict {
  position: relative;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-inline-start: var(--blog-rule-width) solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--text);
}

.callout {
  padding-inline-start: 3.6rem;
}

.callout::before {
  content: "i";
  position: absolute;
  top: 1.3rem;
  left: 1.1rem;
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-round);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.35rem;
  text-align: center;
}

.callout.warning,
.callout-warning {
  border-inline-start-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
}

.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: color-mix(in srgb, var(--success) 10%, var(--panel));
}

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

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

.verdict {
  margin-block: 1.5rem;
  background: var(--panel);
  box-shadow: var(--shadow-1);
}

.verdict > strong:first-child,
.verdict > p:first-child > strong:first-child {
  color: var(--accent-dark);
  font-weight: var(--weight-bold);
}

.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(--accent-line);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}

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

.stat-num {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: var(--weight-bold);
  line-height: 1.4;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.article-body .check-list,
[data-article-body] .check-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.check-list li {
  margin: 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  list-style: none;
}

.article-body .check-list li + li,
[data-article-body] .check-list li + li {
  margin-top: 0;
}

.promo-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-block: 2rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, var(--accent-dark), var(--accent));
  color: var(--on-dark);
  box-shadow: var(--shadow-2);
}

.promo-block .promo-copy {
  flex: 1 1 18rem;
  min-width: 0;
}

.promo-block h2 {
  margin: 0 0 0.5rem;
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: var(--blog-h2);
  font-weight: var(--weight-display);
  line-height: 1.4;
}

.promo-block h2::before {
  content: none;
}

.promo-block p {
  margin: 0;
  color: var(--on-dark);
  line-height: 1.9;
}

.promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.promo-block .btn-primary {
  border: 1px solid var(--panel);
  background: var(--panel);
  color: var(--accent-dark);
}

.promo-block .btn-secondary,
.promo-block .btn-outline {
  border: 1px solid var(--on-dark);
  background: none;
  color: var(--on-dark);
}

.promo-block .btn:focus-visible {
  outline-color: var(--on-dark);
}

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

#related-posts > h2 {
  margin: 0 0 1.25rem;
  color: var(--accent-dark);
  font-size: var(--blog-h2);
  line-height: 1.6;
}

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

.post-nav-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent-line);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

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

.post-nav-label,
.post-nav-card time {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.post-nav-card strong {
  color: var(--accent-dark);
  font-size: var(--blog-body-size);
  font-weight: var(--weight-semibold);
  line-height: 1.8;
}

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

#post-nav[hidden],
#related-posts[hidden] {
  display: none;
}

.float-cta {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: calc(100% - 2.5rem);
  min-height: var(--blog-button-min);
  box-sizing: border-box;
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-dark);
  box-shadow: var(--shadow-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
  text-decoration: none;
}

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

@media (max-width: 1000px) {
  .blog-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .article-body .table-scroll table,
  [data-article-body] .table-scroll table {
    display: table;
    width: 100%;
    min-width: 36rem;
    max-width: none;
  }
}

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

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

  .blog-catalog {
    padding-block: 2rem;
  }

  .blog-index-hero {
    padding: 1.5rem;
  }

  .blog-hero,
  .article-hero {
    padding-block: 1.5rem;
  }

  .article-body h2,
  [data-article-body] h2 {
    margin-top: 2rem;
  }

  .promo-block {
    align-items: stretch;
  }

  .promo-actions {
    width: 100%;
  }

  .promo-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }

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

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

  .float-cta {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    max-width: calc(100% - 2rem);
    padding: 0.75rem 1rem;
  }

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

  body:has(.float-cta) #site-footer {
    padding-bottom: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-list-page *,
  .blog-list-page *::before,
  .blog-list-page *::after,
  .blog-article-page *,
  .blog-article-page *::before,
  .blog-article-page *::after,
  .article-card,
  .post-nav-card,
  .float-cta {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}