:root {
  --blog-reading: 56rem;
  --blog-edge: var(--gutter, 1.5rem);
  --blog-line: color-mix(in srgb, var(--accent) 12%, var(--border));
  --blog-tint: color-mix(in srgb, var(--accent) 9%, var(--panel));
  --blog-ink: color-mix(in srgb, var(--text) 92%, var(--accent-dark));
}

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

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

.blog-breadcrumb {
  margin-top: 1.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.blog-breadcrumb a {
  color: var(--accent-dark);
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-breadcrumb span[aria-hidden] {
  margin-inline: 0.6rem;
  color: var(--faint);
}

.blog-list-hero,
.article-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--blog-line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}

.blog-list-hero::before,
.article-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 1.2rem;
  right: 1rem;
  width: 42%;
  height: calc(100% - 2.4rem);
  border-radius: var(--r-card);
  background:
    linear-gradient(135deg, var(--blog-tint), color-mix(in srgb, var(--rose) 17%, var(--panel))),
    repeating-linear-gradient(0deg, transparent 0 1.45rem, var(--blog-line) 1.45rem calc(1.45rem + 1px));
}

.blog-list-hero::after,
.article-hero::after {
  content: "NX";
  position: absolute;
  z-index: -1;
  right: 2rem;
  bottom: -0.35em;
  color: color-mix(in srgb, var(--accent) 15%, var(--panel));
  font-family: var(--font-display);
  font-size: clamp(6rem, 17vw, 12rem);
  line-height: 1;
  pointer-events: none;
}

.blog-list-hero {
  margin-top: 0.5rem;
  padding: clamp(2rem, 5vw, 3.7rem) max(1.5rem, var(--blog-edge));
}

.blog-list-hero-content {
  position: relative;
  max-width: 43rem;
}

.blog-eyebrow {
  margin: 0 0 0.85rem;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.blog-list-hero h1 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: pretty;
}

.blog-list-hero-content > p:last-child {
  max-width: 36rem;
  margin: 1rem 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-directory {
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.blog-directory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.blog-directory-heading h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.blog-price-link,
.article-read {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.blog-price-link:hover,
.article-read:hover {
  text-decoration: underline;
}

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

.blog-filter {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  padding: 0.55rem 0.95rem;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

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

.blog-filter.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-dark);
}

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

.article-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-card);
  background: var(--panel);
  box-shadow: var(--shadow-chip);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

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

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

.article-meta time,
.article-meta .read-time {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel);
  padding: 0.3rem 0.55rem;
}

.article-meta .tag,
.article-card .tag,
.related-card .tag {
  display: inline-block;
  border-radius: var(--r-sm);
  background: var(--accent-dark);
  padding: 0.35rem 0.55rem;
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.article-card h3 {
  margin: 1.25rem 0 0.7rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.article-card > p {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.article-card .article-read {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.9rem;
}

.article-read::after {
  content: " ↗";
}

.blog-loading,
.blog-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--panel);
  color: var(--muted);
}

.blog-list-note {
  padding-top: 2.2rem;
  padding-bottom: 4rem;
  color: var(--muted);
  line-height: 1.8;
}

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

/* The article hero and the reading column use the same width and inset. */
.article-hero {
  margin-top: 0.5rem;
  padding: clamp(2rem, 5vw, 3.25rem) max(1.5rem, var(--blog-edge));
}

.article-hero .article-meta {
  position: relative;
  margin-bottom: 1.3rem;
}

.article-hero h1 {
  position: relative;
  max-width: 43rem;
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.36;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.article-hero > p,
.article-hero .article-summary {
  position: relative;
  max-width: 39rem;
  margin: 1.25rem 0 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.reading-wrap {
  margin-top: 2rem;
  margin-bottom: 0;
}

.article-body,
.prose {
  counter-reset: blog-section;
  min-width: 0;
  color: var(--blog-ink);
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

.article-body > :first-child,
.prose > :first-child {
  margin-top: 0;
}

.article-body p,
.prose p {
  margin: 0 0 1.35rem;
}

.article-body h2,
.prose h2 {
  counter-increment: blog-section;
  margin: 2.6rem 0 1rem;
  color: var(--text);
  font-size: clamp(1.3rem, 2.7vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.45;
  text-wrap: pretty;
}

.article-body h2::before,
.prose h2::before {
  content: counter(blog-section, decimal-leading-zero);
  display: inline-block;
  margin-right: 0.75rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.73em;
  vertical-align: 0.08em;
}

.article-body h3,
.prose h3 {
  margin: 2rem 0 0.85rem;
  color: var(--text);
  font-size: clamp(1.1rem, 2.3vw, 1.3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.5;
  text-wrap: pretty;
}

.article-body ul,
.article-body ol,
.prose ul,
.prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.5rem;
}

.article-body li,
.prose li {
  padding-left: 0.15rem;
  margin-bottom: 0.5rem;
}

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

.article-body blockquote,
.prose blockquote {
  margin: 1.75rem 0;
  padding: 1.15rem 1.5rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--blog-tint);
  color: var(--text);
}

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

.article-body .table-scroll,
.prose .table-scroll {
  max-width: 100%;
  margin: 1.8rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.article-body table,
.prose table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.65;
}

.article-body th,
.prose th {
  background: var(--accent-dark);
  color: var(--on-dark);
  font-weight: 600;
  text-align: left;
}

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

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

.article-body tbody tr:hover,
.prose tbody tr:hover {
  background: var(--blog-tint);
}

.article-body pre,
.prose pre {
  position: relative;
  max-width: 100%;
  margin: 1.8rem 0;
  padding: 2.5rem 1.25rem 1.3rem;
  overflow-x: auto;
  border-radius: var(--r-card);
  background: var(--text);
  color: var(--on-dark);
  font-family: var(--font-mono);
  font-size: 0.87rem;
  line-height: 1.75;
}

.article-body pre::before,
.prose pre::before {
  content: "●  ●  ●";
  position: absolute;
  top: 0.65rem;
  left: 1.25rem;
  color: var(--rose);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
}

.article-body pre code,
.prose pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.article-body :not(pre) > code,
.prose :not(pre) > code {
  border-radius: var(--r-sm);
  background: var(--panel-2);
  padding: 0.14em 0.3em;
  font-family: var(--font-mono);
  font-size: 0.87em;
}

.article-body .callout,
.prose .callout {
  position: relative;
  margin: 1.8rem 0;
  padding: 1.25rem 1.4rem 1.25rem 3.4rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-card) var(--r-card) 0;
  background: var(--blog-tint);
}

.article-body .callout::before,
.prose .callout::before {
  content: "i";
  position: absolute;
  top: 1.2rem;
  left: 1rem;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid currentColor;
  border-radius: var(--r-sm);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

.article-body .callout.warning,
.prose .callout.warning {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
}

.article-body .callout.warning::before,
.prose .callout.warning::before {
  color: var(--warn);
}

.article-body .callout.success,
.prose .callout.success {
  border-left-color: var(--success);
  background: color-mix(in srgb, var(--success) 11%, var(--panel));
}

.article-body .callout.success::before,
.prose .callout.success::before {
  color: var(--success);
}

.article-body .stat-grid,
.prose .stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.8rem;
  margin: 1.8rem 0;
}

.article-body .stat-card,
.prose .stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 1.2rem;
  border: 1px solid var(--blog-line);
  border-radius: var(--r-card);
  background: var(--blog-tint);
}

.article-body .stat-card::before,
.prose .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}

.article-body .stat-card:nth-child(even),
.prose .stat-card:nth-child(even) {
  border-color: color-mix(in srgb, var(--success) 20%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--panel));
}

.article-body .stat-card:nth-child(even)::before,
.prose .stat-card:nth-child(even)::before {
  background: var(--success);
}

.article-body .stat-num,
.prose .stat-num {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  line-height: 1.4;
}

.article-body .stat-label,
.prose .stat-label {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-body .check-list,
.prose .check-list {
  display: grid;
  gap: 0.55rem;
  margin: 1.6rem 0;
  padding: 0;
  list-style: none;
}

.article-body .check-list li,
.prose .check-list li {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: var(--panel);
  list-style: none;
}

.article-body .verdict,
.prose .verdict {
  margin: 1.8rem 0;
  padding: 1.15rem 1.4rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--blog-tint);
  color: var(--text);
}

.article-body .verdict strong,
.prose .verdict strong {
  color: var(--accent-dark);
}

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

.promo-block {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  overflow: hidden;
  margin: 2.5rem 0 0;
  padding: 1.65rem;
  border-radius: var(--r-card);
  background: linear-gradient(120deg, var(--accent-dark), var(--accent), var(--rose));
  box-shadow: var(--shadow-card);
  color: var(--on-dark);
}

.promo-block::before {
  content: "NX";
  position: absolute;
  right: 17%;
  bottom: -0.4em;
  color: color-mix(in srgb, var(--on-dark) 16%, transparent);
  font-family: var(--font-display);
  font-size: 9rem;
  line-height: 1;
  pointer-events: none;
}

.promo-block > * {
  position: relative;
}

.promo-block strong {
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: 1.55rem;
}

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

.promo-block .btn,
.promo-block .btn-primary {
  flex: none;
  border: 1px solid var(--panel);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--accent-dark);
  box-shadow: none;
}

.promo-block .btn:hover,
.promo-block .btn:focus-visible {
  background: var(--panel-2);
  color: var(--accent-dark);
}

.promo-block .btn-ghost {
  border-color: var(--on-dark);
  background: transparent;
  color: var(--on-dark);
}

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

.post-nav-card,
.related-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--panel);
  text-decoration: none;
  box-shadow: var(--shadow-chip);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.post-nav-card {
  display: block;
  padding: 1.15rem 1.25rem;
  color: var(--text);
}

.post-nav-direction {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.post-nav-card strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.post-nav-card:hover,
.post-nav-card:focus-visible,
.related-card:hover,
.related-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}

#related-posts {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

#related-posts > h2 {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

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

.related-card {
  padding: 1.1rem;
}

.related-card .article-meta {
  gap: 0.4rem;
  font-size: 0.7rem;
}

.related-card h3 {
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

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

.related-card h3 a:hover {
  color: var(--accent-dark);
}

/* Article search-entry CTA; the blog index does not render this component. */
.float-cta {
  position: fixed;
  z-index: 30;
  right: max(1.25rem, var(--blog-edge));
  bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: calc(100vw - 2.5rem);
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--accent-dark);
  border-radius: var(--r-xl);
  background: var(--accent);
  box-shadow: var(--shadow-card);
  color: var(--on-dark);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms ease, transform 180ms ease;
}

.float-cta:hover,
.float-cta:focus-visible {
  transform: translateY(-2px);
  background: var(--accent-dark);
  color: var(--on-dark);
}

.float-cta svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

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

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

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

  .blog-list-hero::before,
  .article-hero::before {
    width: 56%;
  }

  .blog-list-hero::after,
  .article-hero::after {
    right: 0.5rem;
    font-size: 6rem;
  }

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

  .blog-directory-heading {
    align-items: start;
  }

  .article-hero > p,
  .article-hero .article-summary,
  .blog-list-hero-content > p:last-child {
    margin-left: 0;
  }

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

  .float-cta {
    right: 1rem;
    bottom: max(0.8rem, env(safe-area-inset-bottom));
    padding: 0.7rem 0.95rem;
  }
}

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

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