/* ============================================================
   CORBINSOFT — BLOG STYLES
   ============================================================ */

/* ── Hero ── */
.blog-hero {
  padding: 140px 0 72px;
  background: var(--clr-bg2);
  border-bottom: 1px solid var(--clr-border);
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(29,159,213,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, black 20%, transparent 100%);
  pointer-events: none;
}
.blog-hero__inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}
.blog-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.blog-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(29,159,213,0.1);
  color: var(--clr-blue-dark);
  border: 1px solid rgba(29,159,213,0.22);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.blog-tag--teal { background: rgba(0,168,152,0.1); color: #007d74; border-color: rgba(0,168,152,0.25); }
.blog-tag--slate { background: rgba(74,110,138,0.1); color: var(--clr-slate); border-color: rgba(74,110,138,0.2); }
.blog-meta-sep { color: var(--clr-text-muted); font-size: 13px; }
.blog-date, .blog-read-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--clr-text-muted);
  letter-spacing: 0.03em;
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1.12;
  margin-bottom: 20px;
  font-variation-settings: 'opsz' 60, 'WONK' 1;
}
.blog-hero h1 em {
  font-style: italic;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-hero__sub {
  font-size: 18px;
  color: var(--clr-text-mid);
  line-height: 1.7;
  max-width: 640px;
}

/* ── Layout ── */
.blog-layout {
  max-width: 1160px;
  margin: 0 auto;
  padding: 64px 32px 80px;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 72px;
  align-items: start;
}

/* ── TOC ── */
.blog-toc {
  position: sticky;
  top: 100px;
}
.blog-toc__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
  margin-bottom: 14px;
}
.blog-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--clr-border);
}
.blog-toc__list li { margin: 0; }
.blog-toc__list a {
  display: block;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--clr-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.5;
}
.blog-toc__list a:hover,
.blog-toc__list a.active {
  color: var(--clr-blue);
  border-left-color: var(--clr-blue);
}

/* ── Article Typography ── */
.blog-article {
  min-width: 0;
}
.blog-article p {
  font-size: 16px;
  line-height: 1.85;
  color: var(--clr-text-mid);
  margin-bottom: 20px;
}
.blog-article p:last-child { margin-bottom: 0; }

.blog-section { margin-bottom: 64px; }

.blog-section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-blue);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.blog-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
  max-width: 48px;
}

.blog-h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 20px;
  line-height: 1.2;
  font-variation-settings: 'opsz' 32, 'WONK' 1;
}
.blog-h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--clr-text);
  margin: 28px 0 12px;
  font-variation-settings: 'opsz' 20, 'WONK' 1;
}

.blog-article ul, .blog-article ol {
  padding-left: 0;
  margin: 16px 0 24px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.blog-article ul li, .blog-article ol li {
  font-size: 15.5px;
  color: var(--clr-text-mid);
  padding-left: 22px;
  position: relative;
  line-height: 1.7;
}
.blog-article ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--clr-blue);
  font-size: 12px;
  top: 3px;
}
.blog-article ol { counter-reset: ol-counter; }
.blog-article ol li::before {
  counter-increment: ol-counter;
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  color: var(--clr-blue);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  top: 4px;
}

/* Pull quote */
.blog-quote {
  border-left: 3px solid var(--clr-blue);
  background: var(--clr-bg2);
  padding: 20px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 32px 0;
}
.blog-quote p {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  color: var(--clr-text);
  margin: 0;
  line-height: 1.5;
  font-variation-settings: 'opsz' 20, 'WONK' 0;
}
.blog-quote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clr-text-muted);
  font-style: normal;
  letter-spacing: 0.04em;
}

/* Stat callout */
.blog-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}
.blog-stat {
  background: var(--clr-bg2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.blog-stat__num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--clr-blue);
  line-height: 1;
  display: block;
  font-variation-settings: 'opsz' 48, 'WONK' 0;
}
.blog-stat__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
  display: block;
}

/* Source citation */
.blog-source {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: -12px;
  margin-bottom: 20px;
}
.blog-source a { color: var(--clr-blue); text-decoration: underline; }

/* ── Infographic containers ── */
.infographic {
  background: var(--clr-bg2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 36px 24px;
  margin: 36px 0;
  position: relative;
}
.infographic__label {
  position: absolute;
  top: -1px; left: 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 0 0 6px 6px;
  border: 1px solid var(--clr-border);
  border-top: none;
  background: var(--clr-surface);
  color: var(--clr-text-muted);
}
.infographic__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--clr-text);
  text-align: center;
  margin-bottom: 28px;
  font-variation-settings: 'opsz' 18, 'WONK' 1;
}

/* ── Cycle Diagrams ── */
.cycle-svg { width: 100%; max-width: 460px; display: block; margin: 0 auto; overflow: visible; }

.cycle-track { fill: none; stroke-dasharray: 6 5; }

/* Vicious cycle — red */
.vicious .cycle-track { stroke: rgba(239,68,68,0.18); }
.vicious .cycle-node-bg { fill: rgba(239,68,68,0.08); stroke: #ef4444; stroke-width: 1.5; }
.vicious .cycle-arrow { stroke: #ef4444; fill: none; stroke-width: 1.8; opacity: 0.65; }
.vicious .cycle-arrowhead { fill: #ef4444; }
.vicious .cycle-node-label { fill: #7f1d1d; }
.vicious .cycle-node-sub { fill: #991b1b; }
.vicious .cycle-center-text { fill: #ef4444; }

/* Virtuous cycle — teal */
.virtuous .cycle-track { stroke: rgba(0,168,152,0.2); }
.virtuous .cycle-node-bg { fill: rgba(0,168,152,0.08); stroke: #00a898; stroke-width: 1.5; }
.virtuous .cycle-arrow { stroke: #00a898; fill: none; stroke-width: 1.8; opacity: 0.65; }
.virtuous .cycle-arrowhead { fill: #00a898; }
.virtuous .cycle-node-label { fill: #064e3b; }
.virtuous .cycle-node-sub { fill: #065f46; }
.virtuous .cycle-center-text { fill: #00a898; }

/* Node pulse animation */
@keyframes nodePulse {
  0%, 60%, 100% { opacity: 0.85; r: 48; }
  30% { opacity: 1; r: 52; }
}
.cycle-node-bg { transform-box: fill-box; transform-origin: center; }
.vicious .cycle-node-bg:nth-child(1)  { animation: nodePulse 5s ease-in-out 0s infinite; }
.vicious .cycle-node-bg:nth-child(2)  { animation: nodePulse 5s ease-in-out 1s infinite; }
.vicious .cycle-node-bg:nth-child(3)  { animation: nodePulse 5s ease-in-out 2s infinite; }
.vicious .cycle-node-bg:nth-child(4)  { animation: nodePulse 5s ease-in-out 3s infinite; }
.vicious .cycle-node-bg:nth-child(5)  { animation: nodePulse 5s ease-in-out 4s infinite; }
.virtuous .cycle-node-bg:nth-child(1) { animation: nodePulse 5s ease-in-out 0s infinite; }
.virtuous .cycle-node-bg:nth-child(2) { animation: nodePulse 5s ease-in-out 1s infinite; }
.virtuous .cycle-node-bg:nth-child(3) { animation: nodePulse 5s ease-in-out 2s infinite; }
.virtuous .cycle-node-bg:nth-child(4) { animation: nodePulse 5s ease-in-out 3s infinite; }
.virtuous .cycle-node-bg:nth-child(5) { animation: nodePulse 5s ease-in-out 4s infinite; }

/* ── Defect Cost Chart ── */
.cost-chart-svg { width: 100%; display: block; overflow: visible; }

.cost-area {
  fill: url(#costGrad);
  opacity: 0;
  transition: opacity 1s 0.3s;
}
.cost-area.visible { opacity: 1; }

.cost-line {
  fill: none;
  stroke: var(--clr-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.cost-line.visible { stroke-dashoffset: 0; }

.cost-dot {
  opacity: 0;
  transition: opacity 0.3s;
}
.cost-dot.visible { opacity: 1; }

.cost-axis { stroke: var(--clr-border); stroke-width: 1; }
.cost-grid { stroke: var(--clr-border); stroke-width: 1; stroke-dasharray: 3 4; }
.cost-label { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: #7a9ab2; }
.cost-stage-label { font-family: 'Manrope', sans-serif; font-size: 11px; fill: #4a6778; font-weight: 500; }
.cost-annotation { font-family: 'JetBrains Mono', monospace; font-size: 10px; fill: var(--clr-blue-dark); font-weight: 600; }

/* ── Traceability Chain ── */
.trace-chain {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.trace-node {
  flex: 1;
  min-width: 120px;
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  cursor: default;
}
.trace-node:hover {
  border-color: var(--clr-blue);
  box-shadow: 0 4px 20px rgba(29,159,213,0.15);
  transform: translateY(-3px);
  z-index: 2;
}
.trace-node--req:hover { border-color: var(--clr-blue); }
.trace-node--risk:hover { border-color: #f59e0b; }
.trace-node--test:hover { border-color: var(--clr-teal); }
.trace-node--defect:hover { border-color: #ef4444; }

.trace-node__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.trace-node--req .trace-node__icon  { background: rgba(29,159,213,0.1); color: var(--clr-blue); }
.trace-node--risk .trace-node__icon { background: rgba(245,158,11,0.1); color: #d97706; }
.trace-node--test .trace-node__icon { background: rgba(0,168,152,0.1); color: var(--clr-teal); }
.trace-node--defect .trace-node__icon { background: rgba(239,68,68,0.1); color: #ef4444; }

.trace-node__title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--clr-text-muted);
  margin-bottom: 6px;
  display: block;
}
.trace-node__name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-text);
  display: block;
  font-variation-settings: 'opsz' 14, 'WONK' 1;
}
.trace-node__desc {
  font-size: 11.5px;
  color: var(--clr-text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.trace-arrow {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--clr-text-muted);
  flex-shrink: 0;
}
.trace-arrow svg { width: 28px; }

/* ── Three Pillars ── */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 28px 0;
}
.pillar-card {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.pillar-card:hover {
  border-color: var(--clr-blue);
  box-shadow: 0 6px 24px rgba(29,159,213,0.12);
  transform: translateY(-4px);
}
.pillar-card__num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--clr-text-muted);
  margin-bottom: 14px;
}
.pillar-card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(29,159,213,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-blue);
  margin-bottom: 14px;
}
.pillar-card:nth-child(2) .pillar-card__icon { background: rgba(0,168,152,0.08); color: var(--clr-teal); }
.pillar-card:nth-child(3) .pillar-card__icon { background: rgba(74,110,138,0.1); color: var(--clr-slate); }
.pillar-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 8px;
  font-variation-settings: 'opsz' 16, 'WONK' 1;
}
.pillar-card p {
  font-size: 13px;
  color: var(--clr-text-muted);
  line-height: 1.65;
  margin: 0;
}
.pillar-card__tag {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(29,159,213,0.08);
  color: var(--clr-blue-dark);
  border: 1px solid rgba(29,159,213,0.18);
}
.pillar-card:nth-child(2) .pillar-card__tag { background: rgba(0,168,152,0.08); color: #007d74; border-color: rgba(0,168,152,0.2); }
.pillar-card:nth-child(3) .pillar-card__tag { background: rgba(74,110,138,0.08); color: var(--clr-slate); border-color: rgba(74,110,138,0.2); }

/* ── Author Card ── */
.blog-author {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: var(--clr-bg2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin-top: 56px;
}
.blog-author__avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.blog-author__name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--clr-text);
  display: block;
  font-variation-settings: 'opsz' 16, 'WONK' 1;
}
.blog-author__role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clr-text-muted);
  display: block;
  margin-top: 2px;
}
.blog-author__bio {
  font-size: 13.5px;
  color: var(--clr-text-mid);
  margin-top: 8px;
  line-height: 1.65;
}

/* ── Blog CTA ── */
.blog-cta-section {
  background: var(--clr-bg2);
  border-top: 1px solid var(--clr-border);
  padding: 72px 0;
  text-align: center;
}
.blog-cta-section .section-label { margin-bottom: 12px; display: inline-block; }
.blog-cta-section h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 16px;
  font-variation-settings: 'opsz' 40, 'WONK' 1;
}
.blog-cta-section p {
  font-size: 16px;
  color: var(--clr-text-mid);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.7;
}
.blog-cta-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .blog-layout { grid-template-columns: 1fr; gap: 0; }
  .blog-toc { display: none; }
  .pillars-grid { grid-template-columns: 1fr; }
  .blog-stat-row { grid-template-columns: repeat(3, 1fr); }
  .blog-layout { order: 1; }
}
@media (max-width: 600px) {
  .blog-stat-row { grid-template-columns: 1fr; }
  .blog-author { flex-direction: column; text-align: center; }
  .pillars-grid { grid-template-columns: 1fr; }
  .trace-chain { flex-direction: column; }
  .trace-arrow { transform: rotate(90deg); justify-content: center; }
  .blog-layout { padding: 40px 20px 60px; }
  .blog-hero__inner { padding: 0 20px; }
}
