:root {
  --blog-reading-width: 56rem;
  --blog-gutter: 1.5rem;
  --blog-body-size: 1rem;
  --blog-list-title: clamp(2rem, 4vw, 3rem);
  --blog-article-title: clamp(1.8rem, 3.6vw, 2.6rem);
  --blog-heading-size: clamp(1.3rem, 2.4vw, 1.6rem);
  --blog-subheading-size: clamp(1.1rem, 2vw, 1.3rem);
  --blog-line-height: 1.9;
  --blog-heading-spacing: -0.015em;
  --blog-rule-width: 4px;
}

.blog-list-wrap,
.reading-wrap,
.article-hero,
.article-header,
.article-breadcrumbs {
  box-sizing: border-box;
}

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

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

.breadcrumbs {
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--size-small);
  overflow-wrap: anywhere;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.breadcrumbs a,
.prose a,
[data-article-body] a,
.article-link {
  color: var(--indigo);
  text-underline-offset: 0.2em;
}

.blog-hero {
  position: relative;
  padding-block: 1.25rem 2rem;
  border-top: var(--blog-rule-width) solid var(--border);
  border-bottom: 1px solid var(--border);
}

.blog-kicker {
  margin: 0 0 0.8rem;
  font-family: var(--font-mono);
  font-size: var(--size-small);
  color: var(--muted);
}

.blog-hero h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-list-title);
  font-weight: var(--weight-bold);
  line-height: 1.3;
  letter-spacing: var(--blog-heading-spacing);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

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

.blog-catalogue {
  padding-block: 1.5rem 2rem;
}

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

.blog-filter {
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color var(--duration-ui), background-color var(--duration-ui);
}

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

.blog-filter[aria-pressed="true"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

.blog-status {
  margin: 1rem 0;
  color: var(--muted);
  font-size: var(--size-small);
  line-height: 1.8;
}

.blog-post-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 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(--shadow-soft);
  color: var(--text);
  opacity: 1;
  visibility: visible;
  transition: transform var(--duration-ui), border-color var(--duration-ui);
}

.article-card:hover,
.article-card:focus-within {
  border-top-color: var(--indigo);
  transform: translateY(-3px);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem 0.75rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--size-caption);
  line-height: 1.7;
}

.article-meta .tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-pill);
  background: var(--indigo);
  color: var(--panel);
  font-size: inherit;
}

.article-card h3 {
  display: block;
  margin: 1rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: var(--blog-subheading-size);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  letter-spacing: var(--blog-heading-spacing);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

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

.article-card h3 a:hover {
  color: var(--indigo);
}

.article-card p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: var(--blog-body-size);
  line-height: 1.8;
}

.article-link {
  align-self: flex-start;
  margin-top: auto;
  padding-block: 0.35rem;
  font-size: var(--size-small);
  font-weight: var(--weight-semibold);
}

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

.blog-empty p {
  margin: 0;
}

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

.article-hero {
  padding-block: 0.75rem 1.5rem;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.article-header {
  position: relative;
  padding: 1.25rem 0 1.5rem;
  border-top: var(--blog-rule-width) solid var(--border);
  border-bottom: 1px solid var(--border);
  background: none;
  border-radius: 0;
  box-shadow: none;
}

.article-header h1,
.article-hero h1 {
  display: block;
  margin: 1rem 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-article-title);
  font-weight: var(--weight-bold);
  line-height: 1.45;
  letter-spacing: var(--blog-heading-spacing);
  text-align: left;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.article-header .article-meta time,
.article-header .read-time,
.article-header .reading-time,
.article-hero .read-time,
.article-hero .reading-time {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
}

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

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

.prose h2,
[data-article-body] h2 {
  display: block;
  margin: 2rem 0 0.8rem;
  font-family: var(--font-display);
  font-size: var(--blog-heading-size);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  letter-spacing: var(--blog-heading-spacing);
  text-wrap: pretty;
  counter-increment: blog-chapter;
}

.prose h2::before,
[data-article-body] h2::before {
  content: counter(blog-chapter, decimal-leading-zero);
  display: inline-block;
  margin-inline-end: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-tab);
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  font-weight: var(--weight-medium);
  vertical-align: 0.1em;
}

.prose h3,
[data-article-body] h3 {
  display: block;
  margin: 1.5rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: var(--blog-subheading-size);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
  letter-spacing: var(--blog-heading-spacing);
  text-wrap: pretty;
}

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

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

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

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

.prose :is(h2, h3, section),
[data-article-body] :is(h2, h3, section) {
  scroll-margin-top: var(--anchor-offset);
}

.prose blockquote,
[data-article-body] blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
}

.prose blockquote p:last-child,
[data-article-body] blockquote p:last-child {
  margin-bottom: 0;
}

.prose .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);
}

.prose table,
[data-article-body] table {
  width: 100%;
  margin-block: 1.5rem;
  border-collapse: collapse;
  font-size: var(--blog-body-size);
  line-height: 1.8;
}

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

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

.prose th,
[data-article-body] th {
  background: var(--text);
  color: var(--panel);
  font-weight: var(--weight-semibold);
}

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

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

.prose tbody tr:hover,
[data-article-body] tbody tr:hover {
  background: color-mix(in srgb, var(--indigo) 12%, var(--panel));
}

.prose code,
[data-article-body] code {
  padding: 0.1rem 0.3rem;
  border-radius: var(--r-tab);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  overflow-wrap: anywhere;
}

.prose pre,
[data-article-body] pre {
  position: relative;
  max-width: 100%;
  margin: 1.5rem 0;
  padding: 2.75rem 1.25rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--ink-teal);
  border-radius: var(--r-card);
  background: var(--text);
  color: var(--panel);
  font-family: var(--font-mono);
  line-height: 1.8;
}

.prose pre::before,
[data-article-body] pre::before {
  content: "VPNNT / NOTES";
  position: absolute;
  top: 0.75rem;
  left: 1.25rem;
  color: var(--panel-2);
  font-size: var(--size-micro);
  letter-spacing: 0.08em;
}

.prose pre code,
[data-article-body] pre code {
  padding: 0;
  border-radius: 0;
  background: var(--transparent);
  color: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

.callout {
  position: relative;
  margin-block: 1.5rem;
  padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  border-inline-start: 4px solid var(--indigo);
  border-radius: var(--r-row);
  background: color-mix(in srgb, var(--indigo) 8%, var(--panel));
  color: var(--text);
}

.callout::before {
  content: "i";
  position: absolute;
  top: 1.25rem;
  left: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--indigo);
  border-radius: var(--r-round);
  color: var(--indigo);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  line-height: 1.5rem;
  text-align: center;
}

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

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

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

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

.callout p:last-child {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 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(--border);
  border-radius: var(--r-card);
  background: var(--panel-2);
  color: var(--text);
}

.stat-card:nth-child(even) {
  background: var(--apricot);
  border-top-color: var(--apricot-edge);
}

.stat-num {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--blog-heading-size);
  font-weight: var(--weight-bold);
  line-height: 1.5;
}

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

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

.check-list li {
  margin-block: 0.65rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-row);
  background: var(--panel);
}

.verdict {
  margin-block: 1.5rem;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--r-row);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  color: var(--text);
}

.verdict strong:first-child {
  font-weight: var(--weight-bold);
}

.verdict p:last-child {
  margin-bottom: 0;
}

.promo-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-block: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-top: var(--blog-rule-width) solid var(--ink-teal);
  border-radius: var(--r-card);
  background: linear-gradient(125deg, var(--panel-2), var(--bg-top));
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

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

.promo-copy strong {
  font-family: var(--font-display);
  font-size: var(--blog-subheading-size);
  font-weight: var(--weight-bold);
}

.promo-copy p {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: var(--blog-body-size);
  line-height: 1.8;
}

.promo-block .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

.promo-block :is(.btn-main, .btn-primary):hover {
  background: var(--text);
  color: var(--panel);
}

.promo-block :is(.btn-line, .btn-secondary) {
  border-color: var(--text);
  background: var(--transparent);
  color: var(--text);
}

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

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

#related-posts > h2 {
  display: block;
  margin: 0 0 1rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--blog-heading-size);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  letter-spacing: var(--blog-heading-spacing);
  text-wrap: pretty;
}

#related-posts > h2::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 3px;
  margin-inline-end: 0.65rem;
  background: var(--border);
  vertical-align: middle;
}

.related-card {
  padding: 1.25rem;
}

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

.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(--duration-ui), transform var(--duration-ui);
}

.post-nav-card:hover,
.post-nav-card:focus-visible {
  border-top-color: var(--indigo);
  transform: translateY(-3px);
}

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

.post-nav-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: var(--size-small);
}

.post-nav-card strong {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: var(--blog-body-size);
  font-weight: var(--weight-semibold);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.float-cta {
  position: fixed;
  right: var(--blog-gutter);
  bottom: var(--blog-gutter);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: calc(100vw - var(--blog-gutter) * 2);
  min-height: 2.75rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: var(--shadow-accent);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-button);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

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

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

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

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

.blog-filter:focus-visible,
.article-card a:focus-visible,
.post-nav-card:focus-visible,
.promo-block a:focus-visible,
.float-cta:focus-visible,
.breadcrumbs a:focus-visible,
.prose a:focus-visible,
[data-article-body] a:focus-visible,
.table-scroll:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 4px;
}

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

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

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

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

@media (max-width: 640px) {
  :root {
    --blog-gutter: 1rem;
  }

  .no-break {
    white-space: normal;
  }

  .blog-post-grid,
  .stat-grid,
  #post-nav {
    grid-template-columns: 1fr;
  }

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

  .article-card,
  .promo-block {
    padding: 1.25rem;
  }

  .article-header h1,
  .article-hero h1 {
    font-size: var(--blog-article-title);
  }

  .promo-block .button-row {
    width: 100%;
  }

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

  .float-cta {
    position: static;
    display: flex;
    width: fit-content;
    margin: 1rem var(--blog-gutter) 1.5rem auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .post-nav-card,
  .blog-filter {
    transition: none;
  }

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