/* MCP section: capability cards beside a terminal mock of an agent calling TonyProxy tools. */

.tp-mcp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 2rem;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}
.tp-mcp-cards { display: grid; gap: 1rem; }

.tp-mcp-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 1.1rem;
  padding: 1.4rem 1.5rem;
}
.tp-mcp-card h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--tp-text); }
.tp-mcp-card p { margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.6; color: var(--tp-text-secondary); }

.tp-mcp-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.85rem 0 0; padding: 0; list-style: none; }
.tp-mcp-tools code {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font: 500 0.72rem/1 var(--tp-font-mono);
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 24%, transparent);
  direction: ltr;
  unicode-bidi: isolate;
}
.tp-mcp-tools .tp-mcp-res { color: var(--tp-text-secondary); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }

/* Terminal mock: lines fade in one by one once the reveal observer marks it visible. */
.tp-mcp-term {
  position: sticky;
  top: 96px;
  margin: 0;
  overflow: hidden;
  border-radius: var(--tp-radius-lg);
  background: #0a0b10;
  box-shadow: var(--tp-glass-edge), 0 30px 70px -20px rgba(100, 210, 255, 0.25);
}
.tp-mcp-term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.tp-mcp-term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3f; }
.tp-mcp-term-bar span { margin-left: 8px; font: 500 0.75rem/1 var(--tp-font-mono); color: var(--tp-text-tertiary); }

.tp-mcp-term-body { padding: 1.2rem 1.3rem 1.4rem; font: 0.8rem/1.75 var(--tp-font-mono); color: var(--tp-text-secondary); }
.tp-mcp-line { margin: 0; overflow-wrap: anywhere; }
/* Code stays left-to-right on RTL pages; prose lines follow their own script direction. */
.tp-mcp-term-body { direction: ltr; }
.tp-mcp-ask, .tp-mcp-out, .tp-mcp-answer { unicode-bidi: plaintext; }
.tp-mcp-term.is-visible .tp-mcp-line { animation: tp-mcp-line 0.45s var(--tp-ease) both; animation-delay: calc(var(--i) * 0.42s + 0.2s); }
.tp-mcp-term:not(.is-visible) .tp-mcp-line { opacity: 0; }
@keyframes tp-mcp-line { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.tp-mcp-ask { color: var(--tp-text); }
.tp-mcp-ask b { color: var(--tp-cyan); }
.tp-mcp-call { margin-top: 0.6rem; color: var(--tp-green); }
.tp-mcp-call code { font: inherit; color: var(--tp-text); }
.tp-mcp-call span { color: var(--tp-text-tertiary); }
.tp-mcp-out { padding-left: 1rem; color: var(--tp-text-tertiary); }
.tp-mcp-row { display: flex; gap: 0.8rem; padding-left: 2rem; white-space: pre; }
.tp-mcp-row em { font-style: normal; font-weight: 600; }
.tp-mcp-row em.is-5xx { color: var(--tp-pink); }
.tp-mcp-row span { margin-left: auto; color: var(--tp-text-tertiary); }
.tp-mcp-answer {
  margin-top: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  font: 0.88rem/1.6 var(--tp-font-text);
  color: var(--tp-text);
  background: rgba(100, 210, 255, 0.07);
  box-shadow: inset 2px 0 0 var(--tp-cyan);
}

/* Safety strip + clients line. */
.tp-mcp-safety {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1120px;
  margin: 2.5rem auto 0;
  padding: 0;
  list-style: none;
}
.tp-mcp-safe-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-radius: var(--tp-radius-md);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--tp-text-secondary);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.tp-mcp-safe-item svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  fill: none;
  stroke: var(--tp-green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tp-mcp-foot { margin-top: 2rem; text-align: center; }
.tp-mcp-clients { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; margin: 0; }
.tp-mcp-clients span { margin-right: 0.3rem; font-size: 0.85rem; color: var(--tp-text-tertiary); }
.tp-mcp-clients b {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--tp-text);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.tp-mcp-platforms { margin: 0.9rem 0 0; font-size: 0.86rem; color: var(--tp-text-tertiary); }

@media (max-width: 1000px) {
  .tp-mcp-safety { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tp-mcp-grid { grid-template-columns: 1fr; }
  .tp-mcp-term { position: static; }
}
@media (max-width: 560px) {
  .tp-mcp-safety { grid-template-columns: 1fr; }
  .tp-mcp-card { grid-template-columns: 1fr; row-gap: 0.9rem; padding: 1.25rem; }
  .tp-mcp-term-body { font-size: 0.74rem; padding: 1rem; }
  .tp-mcp-row { padding-left: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-mcp-term .tp-mcp-line, .tp-mcp-term:not(.is-visible) .tp-mcp-line { animation: none; opacity: 1; }
}
