/* Interactive network orchestration demo (homepage) */

.orch-demo {
  position: relative;
  width: 100%;
  padding: 2.75rem clamp(1rem, 4vw, 3rem) 2.5rem;
  border-top: 1px solid rgba(255, 107, 53, 0.22);
  border-bottom: 1px solid rgba(255, 107, 53, 0.22);
  background:
    radial-gradient(ellipse at top,
      rgba(255, 140, 66, 0.08) 0%,
      rgba(255, 107, 53, 0.03) 35%,
      rgba(47, 26, 23, 0.02) 70%,
      transparent 100%);
}

.orch-demo-inner {
  max-width: 960px;
  margin: 0 auto;
}

.orch-demo-title {
  color: #2f1a17;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  margin-bottom: 0.65rem;
}

.orch-demo-lead {
  color: #5a433c;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  max-width: 38rem;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
}

.orch-panel {
  background: #12171d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(24, 12, 8, 0.18);
  color: #e8edf2;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.orch-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: #1a2129;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.orch-panel-title {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.orch-panel-count {
  color: #9aa7b5;
  font-weight: 500;
}

.orch-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.orch-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.orch-btn:focus-visible {
  outline: 2px solid rgba(232, 93, 44, 0.7);
  outline-offset: 2px;
}

.orch-btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
  color: #c5d0db;
}

.orch-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.orch-btn-create {
  background: #e85d2c;
  color: #fff;
}

.orch-btn-create:hover {
  background: #f06a3a;
}

.orch-btn-create:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.orch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.18);
}

.orch-toolbar-tools {
  display: flex;
  gap: 0.4rem;
}

.orch-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #c5d0db;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.orch-tool:focus-visible {
  outline: 2px solid rgba(232, 93, 44, 0.7);
  outline-offset: 2px;
}

.orch-tool.is-active {
  background: rgba(232, 93, 44, 0.18);
  border-color: rgba(232, 93, 44, 0.55);
  color: #ffb08a;
}

.orch-mode-pill {
  font-size: 0.72rem;
  color: #9aa7b5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: rgba(255, 255, 255, 0.03);
}

.orch-stats {
  display: flex;
  gap: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9aa7b5;
}

.orch-stats [data-orch-online] {
  color: #5fd38d;
}

.orch-canvas-wrap {
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(56, 120, 200, 0.08) 0%, transparent 55%),
    #0f1419;
}

.orch-canvas {
  display: block;
  width: 100%;
  height: auto;
  min-height: 320px;
  max-height: 520px;
}

.orch-hint {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 20, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b7c3d0;
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.95;
}

.orch-hint.is-faded {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.orch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
  padding: 0.65rem 1rem 0.85rem;
  font-size: 0.75rem;
  color: #9aa7b5;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.orch-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.orch-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}

.orch-dot-online { background: #3ecf7a; }
.orch-dot-idle { background: #e6c14a; }
.orch-dot-offline { background: #e25b5b; }
.orch-dot-link { background: #e85d2c; }

/* SVG nodes / links */
.orch-hub-spoke {
  stroke: rgba(180, 198, 214, 0.35);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  fill: none;
}

.orch-client-link {
  stroke: #e85d2c;
  stroke-width: 3.5;
  fill: none;
  cursor: pointer;
  stroke-linecap: round;
}

.orch-client-link:hover,
.orch-client-link.is-hot {
  stroke: #ff7a4d;
  stroke-width: 4.5;
}

.orch-rubber {
  stroke: #e85d2c;
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  fill: none;
  pointer-events: none;
}

.orch-node {
  cursor: pointer;
}

.orch-node-circle {
  stroke-width: 3;
}

.orch-node-circle.status-online {
  fill: #1d3d2c;
  stroke: #3ecf7a;
}

.orch-node-circle.status-idle {
  fill: #3d3620;
  stroke: #e6c14a;
}

.orch-node-circle.status-offline {
  fill: #3a2222;
  stroke: #e25b5b;
}

.orch-node-circle.status-hub {
  fill: #1e3a5f;
  stroke: #4f8fd9;
}

.orch-node.is-source .orch-node-circle,
.orch-node.is-target .orch-node-circle {
  filter: drop-shadow(0 0 6px rgba(232, 93, 44, 0.65));
}

.orch-node-label {
  fill: #e8edf2;
  font-size: 12px;
  font-weight: 600;
  font-family: "Source Sans Pro", system-ui, sans-serif;
  text-anchor: middle;
  pointer-events: none;
}

.orch-node-ip {
  fill: #8a98a8;
  font-size: 10px;
  font-family: "Source Sans Pro", system-ui, sans-serif;
  text-anchor: middle;
  pointer-events: none;
}

.orch-demo-cta-wrap {
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .orch-panel-header,
  .orch-toolbar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .orch-mode-pill {
    display: none;
  }

  .orch-hint {
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 1.5rem);
    font-size: 0.68rem;
  }

  .orch-canvas {
    min-height: 280px;
  }

  .orch-tool {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }
}
