:root {
  --article-bg: var(--color-background-8);
  --article-surface: var(--color-background-6);
  --article-surface-raised: var(--color-background-7);
  --article-line: var(--color-stroke-6);
  --article-text: var(--color-accent);
  --article-muted: rgba(252, 252, 252, 0.74);
  --article-subtle: rgba(252, 252, 252, 0.54);
  --article-accent: var(--color-primary-500);
  --article-good: #34d399;
  --article-warning: #fbbf24;
}

body.articles-page {
  min-height: 100vh;
  margin: 0;
  color: var(--article-text);
  background: var(--article-bg);
}

.articles-main {
  padding-top: 144px;
}

.articles-shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.articles-reading-shell {
  width: min(820px, calc(100% - 40px));
  margin-inline: auto;
}

.articles-hero {
  padding: 72px 0 66px;
}

.articles-hero h1 {
  max-width: 940px;
  margin: 0;
  color: var(--article-text);
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.articles-hero h1 strong {
  color: var(--article-accent);
  font-weight: 400;
}

.articles-lead {
  max-width: 790px;
  margin: 28px 0 0;
  color: var(--article-muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.68;
}

.articles-eyebrow {
  display: inline-flex;
  margin-bottom: 22px;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--article-accent);
  background: rgba(252, 252, 252, 0.09);
  font-size: 0.9rem;
}

.articles-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--article-subtle);
  font-size: 0.9rem;
}

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

.articles-breadcrumb a:hover,
.articles-breadcrumb a:focus-visible {
  color: var(--article-accent);
}

.articles-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 25px;
  color: var(--article-subtle);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.articles-section {
  padding: 68px 0 94px;
  border-top: 1px solid var(--article-line);
  background: var(--article-surface);
}

.articles-section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.articles-section-heading h2 {
  margin: 0 0 12px;
  color: var(--article-text);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.articles-section-heading p {
  margin: 0;
  color: var(--article-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

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

.articles-card {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--article-line);
  border-radius: 24px;
  color: var(--article-text);
  background: var(--article-bg);
  text-decoration: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.articles-card:hover,
.articles-card:focus-visible {
  border-color: rgba(229, 168, 32, 0.68);
  outline: none;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
  transform: translateY(-3px);
}

.articles-card-tag {
  color: var(--article-accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.articles-card h2 {
  margin: 34px 0 14px;
  color: var(--article-text);
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.articles-card p {
  margin: 0;
  color: var(--article-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.articles-card-cta {
  margin-top: auto;
  padding-top: 28px;
  color: var(--article-accent);
  font-weight: 600;
}

.article-content {
  padding: 18px 0 100px;
}

.article-content h2 {
  margin: 62px 0 18px;
  color: var(--article-text);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.article-content h3 {
  margin: 36px 0 12px;
  color: var(--article-text);
  font-size: 1.32rem;
  font-weight: 600;
  line-height: 1.25;
}

.article-content p,
.article-content li {
  color: var(--article-muted);
  font-size: 1.05rem;
  line-height: 1.82;
}

.article-content p {
  margin: 0 0 20px;
}

.article-content ul,
.article-content ol {
  margin: 18px 0 24px;
  padding-left: 24px;
}

.article-content li + li {
  margin-top: 10px;
}

.article-content a {
  color: var(--article-accent);
  text-underline-offset: 3px;
}

.article-content code:not(pre code) {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--article-accent);
  background: rgba(229, 168, 32, 0.09);
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.article-summary {
  margin: 4px 0 48px;
  padding: 24px 26px;
  border: 1px solid rgba(229, 168, 32, 0.4);
  border-radius: 18px;
  background: rgba(229, 168, 32, 0.07);
}

.article-summary strong {
  color: var(--article-text);
}

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

.article-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 38px;
}

.article-stat {
  padding: 22px 18px;
  border: 1px solid var(--article-line);
  border-radius: 16px;
  background: var(--article-surface);
}

.article-stat-value {
  display: block;
  color: var(--article-accent);
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.article-stat-label {
  display: block;
  margin-top: 7px;
  color: var(--article-subtle);
  font-size: 0.85rem;
  line-height: 1.35;
}

.article-table-wrap {
  max-width: 100%;
  margin: 28px 0 38px;
  overflow-x: auto;
  border: 1px solid var(--article-line);
  border-radius: 16px;
  background: var(--article-surface);
  -webkit-overflow-scrolling: touch;
}

.article-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.article-table th,
.article-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--article-line);
  text-align: right;
  white-space: nowrap;
}

.article-table th:first-child,
.article-table td:first-child {
  text-align: left;
}

.article-table th {
  color: var(--article-subtle);
  background: var(--article-surface-raised);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-table td {
  color: var(--article-muted);
}

.article-table tr:last-child td {
  border-bottom: 0;
}

.article-table .article-score {
  color: var(--article-accent);
  font-weight: 700;
}

.article-formula {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid var(--article-line);
  border-radius: 16px;
  color: var(--article-text);
  background: var(--article-surface-raised);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.25rem);
  text-align: center;
}

.article-evidence,
.article-caveat {
  margin: 30px 0;
  padding: 22px 24px;
  border-radius: 16px;
  color: var(--article-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.article-evidence {
  border: 1px solid rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.06);
}

.article-caveat {
  border: 1px solid rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.06);
}

.article-evidence strong,
.article-caveat strong {
  color: var(--article-text);
}

.article-code {
  margin: 24px 0 38px;
  overflow: hidden;
  border: 1px solid var(--article-line);
  border-radius: 16px;
  background: #090d12;
}

.article-code-label {
  padding: 11px 16px;
  border-bottom: 1px solid var(--article-line);
  color: var(--article-subtle);
  background: var(--article-surface-raised);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.article-code pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  color: rgba(252, 252, 252, 0.9);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

.article-cta {
  margin-top: 64px;
  padding: 34px;
  border: 1px solid var(--article-line);
  border-radius: 22px;
  background: var(--article-surface);
}

.article-cta h2 {
  margin-top: 0;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.article-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 1px solid var(--article-line);
  border-radius: 999px;
  color: var(--article-text) !important;
  background: transparent;
  font-weight: 600;
  text-decoration: none;
}

.article-button-primary {
  border-color: var(--article-accent);
  color: var(--color-secondary) !important;
  background: var(--article-accent);
}

.article-source-note {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--article-line);
  color: var(--article-subtle) !important;
  font-size: 0.9rem !important;
}

@media (max-width: 900px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .articles-card {
    min-height: 280px;
  }

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

@media (max-width: 560px) {
  .articles-main {
    padding-top: 112px;
  }

  .articles-hero {
    padding: 48px 0 50px;
  }

  .articles-shell,
  .articles-reading-shell {
    width: min(100% - 28px, 820px);
  }

  .article-content {
    padding-bottom: 72px;
  }

  .article-stats {
    grid-template-columns: 1fr 1fr;
  }

  .article-stat {
    padding: 18px 15px;
  }

  .article-cta {
    padding: 25px 22px;
  }
}
