/* ============================================================
   Shared styles across /demos/*.html — hero, problema/solución,
   architecture flow, metrics, stack row, demo switcher and a
   couple of small reusable pieces (mono, check, replay button).
   Each demoN.html links this file + its own demoN.css. Nothing
   here touches the site's existing css files.
   ============================================================ */

.demo1-mono { font-family: 'JetBrains Mono', monospace; }

/* DEMO SWITCHER */
.demo-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  max-width: 100%;
}
.demo-switcher__item {
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease, background 0.2s ease;
}
.demo-switcher__item:hover { color: var(--text-primary); }
.demo-switcher__item.is-active { background: var(--accent); color: #131313; }

/* HERO */
.demo1-hero { padding-block: 56px 24px; }
.demo1-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
  transition: color 0.2s ease, gap 0.2s ease;
}
.demo1-back:hover { color: var(--accent); gap: 9px; }

.demo1-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.demo1-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
  animation: demo1-pulse-ring 1.8s ease-out infinite;
}
@keyframes demo1-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6); }
  100% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
}

/* PROBLEMA / SOLUCION */
.demo1-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-block: 24px 64px;
}
.demo1-split__card h3 { font-size: 20px; margin: 18px 0 10px; }
.demo1-split__card p { color: var(--text-secondary); font-size: 14px; }

/* Reusable "reiniciar demo" ghost button */
.demo1-replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  transition: color 0.2s ease;
}
.demo1-replay:hover { color: var(--accent); }

/* Reusable check-circle (animated draw-in via .is-visible/.is-done on an ancestor) */
.demo1-check {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(62, 207, 142, 0.15);
  color: #3ecf8e;
  display: flex; align-items: center; justify-content: center;
}
.demo1-check svg {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.5s ease 0.15s;
}

/* Reusable fade/slide-in used by bubbles, chips, list items across demos */
@keyframes demo1-bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Reusable blinking caret for typewriter effects */
@keyframes demo1-caret-blink { 50% { opacity: 0; } }

/* Step progress dots — used by the click-through "Continuar" flow */
.demo1-progress { display: flex; align-items: center; gap: 5px; }
.demo1-progress__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.3s ease, transform 0.3s ease;
}
.demo1-progress__dot.is-current { background: rgba(var(--accent-rgb), 0.5); transform: scale(1.3); }
.demo1-progress__dot.is-done { background: var(--accent); }

/* "Continuar" nudge — a pulsing CTA that gates each interaction so it's
   obvious a demo is waiting for a click, not autoplaying. Each demoN.css
   positions this within its own layout (overlay, inline block, etc). */
.demo1-continue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.demo1-continue.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.demo1-continue__hint {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.demo1-continue__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #131313;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.35);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.demo1-continue__btn:hover { background: var(--accent-dark); transform: translateY(-2px); }
.demo1-continue__btn:active { transform: translateY(0) scale(0.96); }
.demo1-continue__btn:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.9); outline-offset: 3px; }
.demo1-continue__btn:disabled { opacity: 0; pointer-events: none; }
.demo1-continue__ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55);
  animation: demo1-pulse-ring-lg 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes demo1-pulse-ring-lg {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
}
.demo1-continue__arrow { transition: transform 0.2s ease; }
.demo1-continue__btn:hover .demo1-continue__arrow { transform: translateX(3px); }

/* Reusable agent "reasoning" trace chip — simulated tool-call step */
.demo1-trace {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px dashed rgba(var(--accent-rgb), 0.4);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.01em;
  animation: demo1-bubble-in 0.28s ease;
}

/* ARCHITECTURE FLOW */
.demo1-arch { padding-block: 40px 80px; }
.demo1-flow {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 44px;
}
.demo1-flow__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  width: 140px;
  flex-shrink: 0;
}
.demo1-flow__node p { font-size: 13px; color: var(--text-secondary); }
.demo1-flow__node p span { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.demo1-flow__node--accent .icon-badge {
  background: var(--accent);
  color: #131313;
  box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.14);
}
.demo1-flow__node--accent p { color: var(--text-primary); font-weight: 600; }

.demo1-flow__connector {
  position: relative;
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-rgb), 0.1));
  margin: 0 -4px 28px;
  min-width: 24px;
}
.demo1-flow__dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.8);
  animation: demo1-travel 2.6s ease-in-out infinite;
}
.demo1-flow__connector:nth-child(4) .demo1-flow__dot { animation-delay: 0.65s; }
.demo1-flow__connector:nth-child(6) .demo1-flow__dot { animation-delay: 1.3s; }
.demo1-flow__connector:nth-child(8) .demo1-flow__dot { animation-delay: 1.95s; }
@keyframes demo1-travel {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* METRICS */
.demo1-metrics { padding-block: 40px 80px; }
.demo1-metrics__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.demo1-metric {
  text-align: center;
  padding: 36px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.demo1-metric__value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.demo1-metric__label { color: var(--text-secondary); font-size: 14px; }

/* STACK */
.demo1-stack { padding-block: 0 96px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .demo1-live-dot,
  .demo1-flow__dot,
  .demo1-continue__ring { animation: none; }
  .demo1-check svg,
  .demo1-continue,
  .demo1-continue__btn,
  .demo1-progress__dot { transition: none; }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .demo1-split { grid-template-columns: 1fr; }
  .demo1-flow { flex-direction: column; align-items: flex-start; gap: 20px; }
  .demo1-flow__node { width: 100%; flex-direction: row; text-align: left; }
  .demo1-flow__connector { display: none; }
  .demo1-metrics__grid { grid-template-columns: 1fr; }
}
