/* ============================================================
   Interactive demo — embedded extension demo + "view source" CTA.
   Scoped under .demo-section to avoid touching the rest of the site.
   ============================================================ */

.demo-section {
  padding: 56px 0 12px;
}

.demo-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
}

.demo-head .cs-section-tag {
  display: inline-block;
  margin-bottom: 12px;
}

.demo-head h2 { margin: 0 0 10px; }

.demo-head p {
  color: var(--text-muted, #64748b);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Stage layout: framed demo + side caption */
.demo-stage {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 32px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .demo-stage {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

.demo-frame-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #eef2ff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 60px -24px rgba(30, 41, 59, 0.45);
  min-height: 560px;
}

.demo-frame {
  display: block;
  width: 100%;
  height: 580px;
  border: 0;
  background: #eef2ff;
}

.demo-frame-wrap.is-loading::after {
  content: "Loading demo…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: #94a3b8;
  pointer-events: none;
}

/* "Live demo" badge */
.demo-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.82);
  color: #e2e8f0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}

.demo-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: demoPulse 1.6s infinite;
}

@keyframes demoPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Side caption */
.demo-caption { padding-top: 6px; }

.demo-caption h3 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: var(--text, #1e293b);
}

.demo-caption ol {
  margin: 0 0 18px;
  padding-left: 18px;
  display: grid;
  gap: 9px;
}

.demo-caption ol li {
  font-size: 0.88rem;
  color: var(--text-muted, #475569);
  line-height: 1.5;
}

.demo-caption ol li strong { color: var(--text, #1e293b); }

.demo-cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* View-source button */
.demo-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--accent, #6366f1);
  color: #fff;
  transition: all 0.2s ease;
}

.demo-source-btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -10px rgba(99, 102, 241, 0.7);
}

.demo-source-note {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  margin: 12px 0 0;
  line-height: 1.5;
}
