/* Interactive product demos on index page */

.mockup-body--demo {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  min-height: 280px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
}

[data-demo="universal"] .mockup-body--demo,
[data-demo="legal"] .mockup-body--demo {
  min-height: 340px;
}

[data-demo="universal"] .mockup-window,
[data-demo="legal"] .mockup-window {
  min-width: min(100%, 480px);
}

.mockup-header .mockup-title {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-family: 'Geist Mono', monospace;
}

.mockup-dot.red { background: #ff5f56; }
.mockup-dot.yellow { background: #ffbd2e; }
.mockup-dot.green { background: #27c93f; }

/* Protocol Universal — chat demo */
.demo-universal {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 20px;
  gap: 14px;
  text-align: left;
}

.demo-universal-msgs {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
}

.demo-chat-line {
  padding: 12px 16px;
  border-radius: 10px;
  max-width: 88%;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.demo-chat-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-chat-line.user {
  align-self: flex-end;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

.demo-chat-line.agent {
  align-self: flex-start;
  max-width: 98%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.demo-chat-line.agent .done {
  color: #22c55e;
  margin-right: 2px;
}

.demo-chat-line.agent .step {
  display: block;
  margin-bottom: 8px;
}

.demo-chat-line.agent .step:last-child {
  margin-bottom: 0;
}

.demo-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-self: flex-start;
}

.demo-typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: demoTyping 1.2s infinite;
}

.demo-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.demo-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes demoTyping {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Protocol Legal — mini terminal */
.demo-legal {
  padding: 18px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.demo-legal-query {
  display: flex;
  gap: 8px;
  color: var(--text-primary);
  min-height: 20px;
  line-height: 1.55;
  font-size: 0.82rem;
}

.demo-legal-query .prompt {
  color: var(--accent);
}

.demo-legal-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--text-primary);
  animation: demoBlink 1s step-end infinite;
}

@keyframes demoBlink {
  50% { opacity: 0; }
}

.demo-legal-loader {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: demoSpin 0.8s linear infinite;
  opacity: 0;
}

.demo-legal-loader.visible { opacity: 1; }

@keyframes demoSpin {
  to { transform: rotate(360deg); }
}

.demo-legal-result {
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.82rem;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
}

.demo-legal-result.visible { opacity: 1; }

.demo-legal-result .stat {
  color: #22c55e;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 10px;
}

.demo-legal-result .insight {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.demo-legal-result .highlight {
  display: block;
  color: #eab308;
  background: rgba(234, 179, 8, 0.1);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.demo-legal-result .strategy {
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Factor tree — mini graph */
.demo-graph {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 260px;
  padding: 20px;
}

.demo-graph svg {
  width: 100%;
  height: 100%;
}

.demo-graph .graph-node {
  fill: #12141a;
  stroke: var(--border);
  stroke-width: 1.5;
  transition: fill 0.3s ease, stroke 0.3s ease;
}

.demo-graph .graph-node.active {
  fill: #1a2744;
  stroke: var(--accent);
}

.demo-graph .graph-edge {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  transition: stroke 0.3s ease;
}

.demo-graph .graph-edge.active {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.demo-graph .graph-label {
  fill: var(--text-secondary);
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  text-anchor: middle;
}

.demo-graph .graph-label.active {
  fill: var(--text-primary);
}

.demo-graph-caption {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}
