/* ============================================================
   NBQ Engineering — blog.css
   Styles for /blog/ landing and blog article pages.
   Built entirely on the existing NBQ design tokens in style.css:
   --nbq-void, --nbq-cyan, --nbq-teal, --color-bg, DM Mono, etc.
   ============================================================ */

/* ------------------------------------------------------------
   1. BLOG LANDING — page hero (light, matches faq/careers pattern)
   ------------------------------------------------------------ */
.blog-hero {
  position: relative;
  padding-top: calc(var(--nav-h) + 5rem);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  background:
    radial-gradient(circle at 88% 18%, rgba(61, 207, 234, 0.12), transparent 28%),
    radial-gradient(circle at 12% 78%, rgba(0, 212, 170, 0.10), transparent 30%),
    var(--color-bg);
  overflow: hidden;
  isolation: isolate;
}

.blog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(0, 212, 170, 0.14) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(61, 207, 234, 0.10) 1px, transparent 1.5px);
  background-size: 72px 72px, 132px 132px;
  background-position: 0 0, 42px 56px;
  opacity: 0.28;
  pointer-events: none;
  z-index: -1;
}

.blog-hero__headline {
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.blog-hero__intro {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-muted);
  max-width: 58ch;
}

/* ------------------------------------------------------------
   2. FEATURED ARTICLE CARD (dark terminal panel on light bg)
   ------------------------------------------------------------ */
.blog-list {
  padding: var(--space-xl) 0;
  background: var(--color-bg);
}

.featured-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  background: var(--nbq-void, #060709);
  border: 1px solid rgba(61, 207, 234, 0.18);
  overflow: hidden;
  color: var(--color-text-light);
  transition: border-color var(--duration-mid) var(--ease),
              transform var(--duration-mid) var(--ease);
}

.featured-card:hover,
.featured-card:focus-within {
  border-color: rgba(61, 207, 234, 0.45);
  transform: translateY(-3px);
}

.featured-card__badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #06110f;
  background: var(--nbq-teal, #00d4aa);
  padding: 0.45rem 0.9rem;
}

.featured-card__badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #06110f;
}

.featured-card__content {
  padding: calc(var(--space-lg) + 1rem) var(--space-lg) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.featured-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}

.chip--accent {
  color: var(--nbq-cyan, #3dcfea);
  border-color: rgba(61, 207, 234, 0.4);
}

.featured-card__title {
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-top: 0.25rem;
}

.featured-card__title a {
  color: inherit;
}

.featured-card__title a:hover {
  color: var(--nbq-cyan, #3dcfea);
}

.featured-card__title a:focus-visible {
  outline: 2px solid var(--nbq-cyan, #3dcfea);
  outline-offset: 4px;
}

.featured-card__excerpt {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.62);
  max-width: 56ch;
}

.featured-card__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: auto;
  padding-top: var(--space-sm);
}

.featured-card__read {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nbq-teal, #00d4aa);
  margin-top: var(--space-sm);
}

.featured-card__read::after {
  content: "→";
  transition: transform var(--duration-fast) var(--ease);
}

.featured-card:hover .featured-card__read::after {
  transform: translateX(5px);
}

.featured-card__visual {
  position: relative;
  min-height: 320px;
  border-left: 1px solid rgba(61, 207, 234, 0.14);
  background: var(--nbq-void-2, #070d10);
}

.featured-card__visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------
   3. SHARED CTA BLOCK (blog landing + article end)
   ------------------------------------------------------------ */
.blog-cta {
  padding: var(--space-xl) 0;
  background: var(--color-bg);
}

.blog-cta__panel {
  position: relative;
  background: var(--nbq-void, #060709);
  border: 1px solid rgba(0, 212, 170, 0.2);
  padding: var(--space-lg);
  color: var(--color-text-light);
  overflow: hidden;
}

.blog-cta__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 207, 234, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 207, 234, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

.blog-cta__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.blog-cta__title {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.blog-cta__text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.6);
  max-width: 52ch;
}

.btn--quantum {
  background: var(--nbq-teal, #00d4aa);
  color: #06110f;
  border: 1px solid var(--nbq-teal, #00d4aa);
}

.btn--quantum:hover {
  background: var(--nbq-cyan, #3dcfea);
  border-color: var(--nbq-cyan, #3dcfea);
  color: #06110f;
}

/* ------------------------------------------------------------
   4. ARTICLE HERO (dark, matches index hero language)
   ------------------------------------------------------------ */
.article-hero {
  position: relative;
  background:
    radial-gradient(ellipse at 70% -10%, rgba(61, 207, 234, 0.10), transparent 45%),
    radial-gradient(ellipse at 15% 110%, rgba(0, 212, 170, 0.08), transparent 45%),
    var(--nbq-void, #060709);
  color: var(--color-text-light);
  padding-top: calc(var(--nav-h) + 4.5rem);
  padding-bottom: var(--space-lg);
  overflow: hidden;
  isolation: isolate;
}

.article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 207, 234, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 207, 234, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
  pointer-events: none;
  z-index: -1;
}

.article-hero__path {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: var(--space-md);
  overflow-wrap: anywhere;
}

.article-hero__path a {
  color: rgba(255, 255, 255, 0.55);
}

.article-hero__path a:hover {
  color: var(--nbq-cyan, #3dcfea);
}

.article-hero__path .prompt {
  color: var(--nbq-teal, #00d4aa);
}

.article-hero__title {
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 21ch;
  margin-bottom: var(--space-md);
}

.article-hero__sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.62);
  max-width: 62ch;
  margin-bottom: var(--space-md);
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.article-hero__meta .meta-sep {
  color: rgba(61, 207, 234, 0.5);
}

.article-hero__figure {
  margin: 0;
}

.article-hero__figure svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(61, 207, 234, 0.16);
}

.article-hero__figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.38);
  padding-top: 0.7rem;
}

/* ------------------------------------------------------------
   5. ARTICLE BODY (light paper for long-form readability)
   ------------------------------------------------------------ */
.article-body {
  background: var(--color-bg);
  padding: var(--space-xl) 0;
}

.article-body__inner {
  max-width: 760px;
  margin: 0 auto;
}

.article-body p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #2a2a2a;
  margin-bottom: 1.4rem;
}

.article-body p.lead {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--color-text);
}

.article-body h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: var(--space-lg) 0 var(--space-sm);
}

.article-body h2 .square-marker {
  transform: translateY(-3px);
  background: var(--nbq-teal, #00d4aa);
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: var(--space-md) 0 0.75rem;
}

.article-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0, 212, 170, 0.6);
  text-underline-offset: 3px;
}

.article-body a:hover {
  text-decoration-color: var(--nbq-teal, #00d4aa);
}

.article-body strong {
  font-weight: 700;
  color: var(--color-text);
}

/* Figures with dark SVG panels inside the light article */
.article-figure {
  margin: var(--space-lg) 0;
}

.article-figure__panel {
  background: var(--nbq-void, #060709);
  border: 1px solid rgba(17, 17, 17, 0.85);
  overflow-x: auto;
}

.article-figure__panel svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 560px;
}

.article-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding-top: 0.7rem;
}

/* Pull-quote divider card */
.article-quote {
  margin: var(--space-lg) 0;
  background: var(--nbq-void, #060709);
  border-left: 3px solid var(--nbq-teal, #00d4aa);
  padding: var(--space-md) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.article-quote::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(61, 207, 234, 0.12) 1px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: 0.5;
  pointer-events: none;
}

.article-quote blockquote {
  position: relative;
  margin: 0;
}

.article-quote p {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.45;
  color: var(--color-white);
  margin: 0;
}

.article-quote footer {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nbq-cyan, #3dcfea);
  margin-top: 0.9rem;
}

/* Action steps (ordered — the sequence carries meaning) */
.action-steps {
  counter-reset: step;
  margin: var(--space-md) 0 var(--space-lg);
  border-top: 1px solid rgba(17, 17, 17, 0.14);
}

.action-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.14);
}

.action-steps li::before {
  content: "0" counter(step);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--nbq-teal, #009f80);
  padding-top: 0.2rem;
}

.action-steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.action-steps p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* References */
.article-refs {
  margin-top: var(--space-lg);
  border-top: 1px solid rgba(17, 17, 17, 0.14);
  padding-top: var(--space-md);
}

.article-refs h2 {
  font-size: 1rem;
  margin: 0 0 var(--space-sm);
}

.article-refs ul {
  display: grid;
  gap: 0.55rem;
}

.article-refs li {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------
   6. NBQ PERSPECTIVE / ARTICLE CTA (dark closing section)
   ------------------------------------------------------------ */
.article-perspective {
  background: var(--nbq-void, #060709);
  color: var(--color-text-light);
  padding: var(--space-xl) 0;
  border-top: 1px solid rgba(61, 207, 234, 0.14);
}

.article-perspective__inner {
  max-width: 760px;
  margin: 0 auto;
}

.article-perspective h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.article-perspective p {
  font-size: 1rem;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 1.3rem;
}

.article-perspective__closing {
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-white);
  border-left: 3px solid var(--nbq-cyan, #3dcfea);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
}

/* ------------------------------------------------------------
   7. SVG shared bits
   ------------------------------------------------------------ */
.svg-stream {
  stroke-dasharray: 6 7;
  animation: nbq-stream 2.6s linear infinite;
}

@keyframes nbq-stream {
  to { stroke-dashoffset: -26; }
}

@media (prefers-reduced-motion: reduce) {
  .svg-stream { animation: none; }
  .featured-card,
  .featured-card:hover { transform: none; }
}

/* ------------------------------------------------------------
   8. Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-card__visual {
    min-height: 260px;
    border-left: none;
    border-top: 1px solid rgba(61, 207, 234, 0.14);
    order: -1;
  }
  .featured-card__content {
    padding: var(--space-md);
    padding-top: var(--space-md);
  }
  .featured-card__badge {
    position: absolute;
  }
}

@media (max-width: 640px) {
  .article-hero__meta {
    gap: 0.35rem 0.9rem;
  }
  .article-quote {
    padding: var(--space-md);
  }
  .action-steps li {
    grid-template-columns: 2.6rem 1fr;
  }
  .blog-cta__panel {
    padding: var(--space-md);
  }
}
