:root {
  --bg-deep:        #07090b;
  --bg-base:        #07090b;
  --surface-1:      #14181c;
  --surface-2:      #1a1f24;
  --surface-3:      #1f262c;
  --text-primary:   #f3f6f8;
  --text-secondary: #a6acb3;
  --text-muted:     #8A8F98;
  --steel-bright:   #d7dbdf;
  --border-subtle:  rgba(166, 172, 179, 0.14);
  --border-strong:  rgba(166, 172, 179, 0.28);
  --accent:         #00d4ff;
  --accent-hover:   #33ddff;
  --accent-active:  #00b0d8;
  --on-accent:      #07090b;
  --warning:        #ffa51f;
  --font-display: 'Rajdhani', 'Rajdhani Fallback', system-ui, 'Segoe UI', sans-serif;
  --font-body:    'Rajdhani', 'Rajdhani Fallback', system-ui, 'Segoe UI', sans-serif;
  --font-mono:    'Rajdhani', 'Rajdhani Fallback', system-ui, sans-serif;
}
@font-face {
  font-family: 'Rajdhani Fallback';
  src: local('Arial'), local('Helvetica Neue');
  size-adjust: 94%;
  ascent-override: 98.94%;
  descent-override: 36.81%;
  line-gap-override: 0%;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Circuit backdrop (same as homepage) ---- */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  transform: translateZ(0); backface-visibility: hidden;
  background:
    radial-gradient(820px 460px at 80% -6%, rgba(0,123,255,0.13), transparent 60%),
    radial-gradient(640px 420px at 8% 4%, rgba(0,212,255,0.06), transparent 55%),
    linear-gradient(180deg, #0b0e11, #07090b 44%);
}
.bd-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(166,172,179,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(166,172,179,0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(125% 95% at 50% 18%, #000 40%, transparent 90%);
  mask-image: radial-gradient(125% 95% at 50% 18%, #000 40%, transparent 90%);
}
.bd-circuit { position: absolute; inset: 0; width: 100%; height: 100%; }
.bd-circuit .trace { stroke: rgba(166,172,179,0.1); stroke-width: 1.1; }
.bd-circuit .pulse {
  stroke: #00d4ff; stroke-width: 1.5; stroke-linecap: round;
  stroke-dasharray: 6 240; filter: drop-shadow(0 0 5px rgba(0,212,255,0.7));
}
.bd-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(125% 100% at 50% 40%, transparent 60%, rgba(0,0,0,0.55) 100%);
}

/* ---- Wordmark ---- */
.wordmark {
  position: absolute;
  top: clamp(20px, 4vw, 32px);
  left: clamp(20px, 4vw, 40px);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
}
.wordmark:hover { color: var(--text-secondary); }
.wordmark .dot { color: var(--accent); }
.wordmark:focus-visible { outline: none; color: var(--text-primary); box-shadow: 0 0 0 3px rgba(0,212,255,0.4); border-radius: 3px; }

/* ---- Shared chips ---- */
.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 4px 10px; border-radius: 4px; border: 1px solid;
}
.chip-problem { color: var(--warning); border-color: rgba(255,165,31,0.35); background: rgba(255,165,31,0.08); }
.chip-service { color: var(--accent);  border-color: rgba(0,212,255,0.35);  background: rgba(0,212,255,0.08); }
.chip-trade   { color: var(--steel-bright); border-color: rgba(166,172,179,0.32); background: rgba(166,172,179,0.07); }

/* ===================== LISTING ===================== */
.blog-main {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto;
  padding: clamp(88px, 12vw, 128px) 24px 8px;
}
.blog-hero { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.blog-hero .eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0 0 16px; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent);
}
.blog-hero .eyebrow::before,
.blog-hero .eyebrow::after {
  content: ""; width: 28px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.6));
}
.blog-hero .eyebrow::after { transform: scaleX(-1); }
.blog-hero h1 {
  margin: 0 0 16px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.25rem, 1.6rem + 2.6vw, 3.4rem); line-height: 1.05;
  letter-spacing: -0.02em; color: var(--text-primary); text-wrap: balance;
}
.blog-hero .subhead {
  margin: 0; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.2rem);
  color: var(--text-secondary); line-height: 1.55; text-wrap: pretty;
}
.blog-meta {
  margin: 18px 0 0; font-family: var(--font-mono); font-size: 0.8125rem;
  letter-spacing: 0.04em; color: var(--text-muted);
}
.blog-meta .dot-sep { color: var(--accent); margin: 0 4px; }

.blog-controls {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto 12px;
}
.search-wrap { flex: 1 1 260px; max-width: 360px; }
#blogSearch {
  width: 100%; height: 46px; padding: 0 14px;
  font-family: var(--font-body); font-size: 16px; color: var(--text-primary);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  -webkit-appearance: none; appearance: none;
  transition: border-color 150ms, box-shadow 150ms;
}
#blogSearch::placeholder { color: var(--text-muted); }
#blogSearch:focus-visible { outline: none; border-color: var(--accent); box-shadow: inset 0 1px 2px rgba(0,0,0,0.4), 0 0 0 3px rgba(0,212,255,0.35); }

/* Segmented bar: one connected control, calm cyan-tint active segment (no fill) */
.filters {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-1); overflow: hidden;
}
.filter {
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 16px; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease;
}
.filter + .filter { border-left: 1px solid var(--border-subtle); }
.filter .cnt { color: var(--text-muted); font-weight: 500; }
.filter:hover { color: var(--text-primary); background: rgba(255,255,255,0.025); }
.filter.is-active { color: var(--accent); background: rgba(0,212,255,0.10); }
.filter.is-active .cnt { color: var(--accent); opacity: 0.75; }
.filter:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgba(0,212,255,0.6); }

.result-count { max-width: 1080px; margin: 0 auto 20px; font-size: 0.8125rem; color: var(--text-muted); min-height: 1em; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
/* Calm card concept ported from the old site (bcai2bweb): monochrome gunmetal,
   muted label, bright title, dim blurb, cyan "Learn more", one restrained hover. */
.post-card {
  display: flex; flex-direction: column; gap: 12px; height: 100%;
  padding: clamp(22px, 2.6vw, 28px); border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, #14181c, #0f1114);
  color: var(--steel-bright); text-decoration: none;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.3s;
}
.post-card .kind {
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted);
}
.post-card h2 {
  margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  line-height: 1.2; color: var(--text-primary);
}
.post-card .excerpt {
  margin: 0; flex: 1; font-size: 0.95rem; line-height: 1.6; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .more {
  margin-top: 4px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
  transition: gap 0.2s;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,212,255,0.45);
  box-shadow: inset 0 1px 0 rgba(0,212,255,0.35), 0 18px 40px rgba(0,0,0,0.45), 0 0 22px rgba(0,212,255,0.28);
}
.post-card:hover .more { gap: 12px; }
.post-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.4); }
.post-card[hidden] { display: none; }
.no-results { max-width: 1080px; margin: 24px auto; text-align: center; color: var(--text-muted); }

/* ===================== ARTICLE ===================== */
.article-wrap {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto;
  padding: clamp(84px, 11vw, 116px) 24px 8px;
}
.breadcrumb { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 28px; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb a:focus-visible { outline: none; color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.4); border-radius: 3px; }
.breadcrumb .sep { margin: 0 8px; color: var(--border-strong); }

.article-head { margin-bottom: 40px; }
.article-head h1 {
  margin: 16px 0 18px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 1.5rem + 2.3vw, 3rem); line-height: 1.06;
  letter-spacing: -0.02em; color: var(--text-primary); text-wrap: balance;
}
.article-head .lead {
  margin: 0; font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.55; color: var(--steel-bright);
}

.article-body { display: flex; flex-direction: column; gap: 44px; }
.sec-num {
  display: inline-block; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.1em; color: var(--accent); margin-bottom: 10px;
}
.sec h2 {
  margin: 0 0 14px; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.4rem, 1.2rem + 0.7vw, 1.75rem); line-height: 1.2; color: var(--text-primary);
}
.sec p { margin: 0; font-size: 1.05rem; line-height: 1.75; color: var(--text-secondary); }
.points { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.points li { display: flex; gap: 11px; align-items: flex-start; font-size: 1rem; line-height: 1.55; color: var(--text-primary); }
.bolt { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 4px; color: var(--accent); fill: currentColor; }

/* Panel (signs / scan checks) */
.panel {
  margin-top: 48px; padding: 28px;
  background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: 12px;
}
.panel-eyebrow {
  margin: 0 0 6px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent);
}
.panel-h { margin: 0 0 18px; font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; color: var(--text-primary); }
.panel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.panel-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 1rem; line-height: 1.55; color: var(--text-secondary); }

/* FAQ */
.faq { margin-top: 48px; }
.block-eyebrow {
  margin: 0 0 6px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent);
}
.block-h { margin: 0 0 20px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.9rem); color: var(--text-primary); }
.faq details { border-top: 1px solid var(--border-subtle); }
.faq details:last-of-type { border-bottom: 1px solid var(--border-subtle); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--text-primary);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--accent); transition: transform 180ms;
}
.faq details[open] summary::after { content: "\2013"; }
.faq summary:hover { color: var(--accent); }
.faq summary:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,212,255,0.4); border-radius: 4px; }
.faq-a { padding: 0 0 20px; font-size: 1rem; line-height: 1.7; color: var(--text-secondary); }

/* Related */
.related { margin-top: 56px; display: flex; flex-direction: column; gap: 28px; }
.rel-group .rel-h {
  margin: 0 0 14px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted);
}
.rel-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.rel-card {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  color: var(--text-primary); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: border-color 150ms, background 150ms, transform 150ms;
}
.rel-card .rel-arrow { color: var(--accent); transition: transform 150ms; }
.rel-card:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }
.rel-card:hover .rel-arrow { transform: translateX(3px); }
.rel-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.4); }

/* CTA */
.cta {
  margin: 64px 0 8px; padding: 40px 28px; text-align: center;
  background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: 14px;
}
.cta-eyebrow {
  margin: 0 0 8px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent);
}
.cta-h { margin: 0 0 10px; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); color: var(--text-primary); }
.cta-p { margin: 0 auto 22px; max-width: 460px; color: var(--text-secondary); }
.cta-btn {
  display: inline-block; padding: 0 28px; height: 52px; line-height: 52px;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  color: var(--on-accent); background: var(--accent); border-radius: 6px; text-decoration: none;
  transition: background 160ms ease-out, transform 150ms ease-out;
}
.cta-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.cta-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg-base), 0 0 0 6px rgba(0,212,255,0.55); }

/* ---- Footer (same as homepage) ---- */
.site-footer {
  position: relative; z-index: 1; margin-top: 72px;
  background: var(--bg-deep); border-top: 1px solid var(--border-subtle);
  padding: 48px 24px 28px;
}
.footer-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand { margin: 0 0 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text-primary); }
.footer-brand .dot { color: var(--accent); }
.footer-about { margin: 0; max-width: 40ch; font-size: 0.9rem; line-height: 1.6; color: var(--text-muted); }
.footer-h { margin: 0 0 14px; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-secondary); }
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--text-muted); }
.footer-list a { display: inline-block; padding: 5px 0; color: var(--text-secondary); text-decoration: none; transition: color 150ms ease-out; }
.footer-list a:hover { color: var(--accent); }
.footer-list a:focus-visible { outline: none; color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.4); border-radius: 3px; }
.footer-bottom { max-width: 1000px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--border-subtle); text-align: center; font-size: 0.8125rem; color: var(--text-muted); }

/* ---- Responsive (card grid auto-fills via minmax) ---- */
@media (max-width: 640px) {
  .blog-controls { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; }
  .filters { display: flex; width: 100%; }
  .filter { flex: 1; justify-content: center; padding: 0 8px; font-size: 0.7rem; letter-spacing: 0.05em; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 460px) {
  .filter .cnt { display: none; }
}

/* ---- Motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .bd-circuit .pulse { animation: bcai-dash 8s linear infinite; }
  .bd-circuit .pulse.p2 { animation-duration: 9s; animation-delay: 1.6s; }
  @keyframes bcai-dash { to { stroke-dashoffset: -240; } }
}
