:root {
  --bg1: #060a14;
  --bg2: #091022;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --accent3: #10b981;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --article-scale: 1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #e6eef8;
  background:
    radial-gradient(950px 580px at 14% 12%, rgba(88, 28, 135, 0.16), transparent 62%),
    radial-gradient(900px 520px at 86% 24%, rgba(6, 182, 212, 0.11), transparent 60%),
    linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 55%, #050811 100%);
  -webkit-font-smoothing: antialiased;
  line-height: 1.72;
  padding: 24px 20px 68px;
}

/* Neon Reading Progress Bar */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 1000;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.7);
  transition: width 0.08s linear;
}

.blog-shell {
  max-width: 940px;
  margin: 0 auto;
}

.article-shell {
  max-width: 790px;
  margin: 0 auto;
}

/* Top Nav */
.blog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, color 0.2s ease;
}

.blog-back:hover {
  transform: translateX(-3px);
  color: #fff;
}

.blog-nav-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.blog-lang-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.7);
  color: var(--accent2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-lang-btn:hover {
  border-color: var(--accent2);
  background: rgba(6, 182, 212, 0.16);
  color: #fff;
}

.post-status-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.status-badge.read {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
}

.status-badge.saved {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.reader-btn.saved {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.blog-brand {
  font-weight: 700;
  font-size: 15px;
  color: #f8fafc;
  text-decoration: none;
}

.blog-brand span {
  background: linear-gradient(125deg, #8b5cf6, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Blog Hero */
.blog-hero {
  margin-bottom: 26px;
}

.blog-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent2);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.blog-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.18;
  margin-bottom: 10px;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.blog-hero p {
  color: rgba(230, 238, 248, 0.76);
  font-size: 15px;
  max-width: 640px;
}

.read-counter-bar {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(230, 238, 248, 0.8);
}

.read-counter-track {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.read-counter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.35s ease;
}

/* Filter + Search Toolbar */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-pill {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 238, 248, 0.78);
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: rgba(6, 182, 212, 0.5);
  color: #fff;
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.65), rgba(6, 182, 212, 0.55));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

.blog-search {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 15px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 13px;
  width: 230px;
  outline: none;
  transition: border-color 0.2s ease;
}

.blog-search:focus {
  border-color: var(--accent2);
}

/* Bento Post Grid with Spotlight */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.post-card {
  --mx: 50%;
  --my: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.24s ease, box-shadow 0.24s ease;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(6, 182, 212, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.post-card:hover::before {
  opacity: 1;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
}

/* Featured Full-Width Lab Dossier */
.post-card.featured {
  grid-column: 1 / -1;
  padding: 28px 30px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(11, 16, 32, 0.78) 55%, rgba(6, 182, 212, 0.12));
  border-color: rgba(6, 182, 212, 0.28);
}

.post-card.featured h2 {
  font-size: clamp(21px, 3vw, 27px);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(230, 238, 248, 0.56);
}

.post-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dossier-code {
  color: rgba(167, 139, 250, 0.9);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.post-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent2);
  font-weight: 600;
}

.post-tag.featured-tag {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
}

.post-card h2 {
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #f8fafc;
  margin-bottom: 8px;
}

.post-card p {
  font-size: 13.5px;
  color: rgba(230, 238, 248, 0.76);
  line-height: 1.62;
}

.post-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.post-highlights span {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(230, 238, 248, 0.75);
}

.post-readmore {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
}

/* Article Page */
.article-card {
  background: rgba(11, 16, 32, 0.74);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  padding: 34px 34px 30px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

.reader-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reader-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(230, 238, 248, 0.82);
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reader-btn:hover {
  border-color: var(--accent2);
  color: #fff;
  background: rgba(6, 182, 212, 0.16);
}

.article-card h1 {
  font-size: clamp(24px, 4.2vw, 35px);
  line-height: 1.24;
  color: #f8fafc;
  margin: 10px 0 14px;
  letter-spacing: -0.015em;
}

.article-lead {
  font-size: calc(15.5px * var(--article-scale));
  color: rgba(230, 238, 248, 0.88);
  margin-bottom: 22px;
}

/* 30-Second TL;DR Summary Box */
.tldr-box {
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(124, 58, 237, 0.34);
  margin-bottom: 24px;
}

.tldr-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #c4b5fd;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.tldr-box ul {
  margin: 0;
  padding-left: 18px;
}

.tldr-box li {
  font-size: 13.5px;
  margin-bottom: 5px;
  color: #f1f5f9;
}

.tldr-box li:last-child {
  margin-bottom: 0;
}

/* Visual Metric Bars & Parameter Cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.metric-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
}

.metric-head span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent2);
}

.metric-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 6px;
}

.metric-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.metric-sub {
  font-size: 12px;
  color: rgba(230, 238, 248, 0.68);
  margin: 0 !important;
}

.param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 22px;
}

.param-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.22);
  text-align: center;
}

.param-val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 4px;
}

.param-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 2px;
}

.param-note {
  font-size: 11.5px;
  color: rgba(230, 238, 248, 0.64);
  margin: 0 !important;
}

.article-card h2 {
  font-size: calc(20px * var(--article-scale));
  color: #f8fafc;
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent2);
}

.article-card p {
  font-size: calc(15px * var(--article-scale));
  color: rgba(230, 238, 248, 0.86);
  margin-bottom: 15px;
}

.article-card ul {
  padding-left: 20px;
  margin-bottom: 18px;
}

.article-card li {
  margin-bottom: 8px;
  font-size: calc(14.5px * var(--article-scale));
  color: rgba(230, 238, 248, 0.88);
}

.article-callout {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.28);
  margin: 22px 0;
  font-size: 14px;
}

.article-callout strong {
  color: var(--accent2);
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin: 22px 0;
  background: #020617;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.4);
}

.cta-pill.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e6eef8;
}

.cta-pill.secondary:hover {
  border-color: var(--accent2);
  box-shadow: none;
}

/* Next Lab Note Flow Card */
.next-post-card {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(6, 182, 212, 0.09));
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.next-post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.5);
}

.next-post-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--accent2);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.next-post-title {
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
}

.next-post-arrow {
  font-size: 20px;
  color: var(--accent2);
  flex-shrink: 0;
}

/* Toast */
.blog-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: rgba(11, 16, 32, 0.94);
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #f8fafc;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1200;
}

.blog-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.blog-footer {
  margin-top: 44px;
  text-align: center;
  font-size: 13px;
  color: rgba(230, 238, 248, 0.45);
}

.blog-footer a {
  color: rgba(230, 238, 248, 0.62);
  text-decoration: none;
}

.blog-footer a:hover {
  color: var(--accent2);
}

@media (max-width: 720px) {
  body {
    padding: 18px 14px 56px;
    touch-action: manipulation;
  }

  .posts-grid,
  .metric-grid,
  .param-grid {
    grid-template-columns: 1fr;
  }

  .blog-search {
    width: 100%;
    font-size: 16px;
  }

  .article-card {
    padding: 22px 16px;
  }

  .post-card.featured {
    padding: 22px 18px;
  }

  .reader-tools {
    flex-wrap: wrap;
  }

  .next-post-card {
    padding: 16px 18px;
  }
}

@media (max-width: 440px) {
  .blog-nav {
    margin-bottom: 24px;
    gap: 8px;
  }

  .blog-back,
  .blog-brand {
    font-size: 13px;
  }

  .post-card {
    padding: 18px 16px;
  }
}
