/* "How it works" hub: apps on top, servers below, every lane routed through TonyProxy. */

.tp-hub { position: relative; }
.tp-hub::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(900px, 100%);
  height: 600px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(10, 132, 255, 0.16), transparent 70%);
  filter: blur(20px);
}

.tp-hub-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 2rem;
  max-width: 1120px;
  margin: 0 auto;
  text-align: left;
}
.tp-hub-label {
  grid-column: 1 / -1;
  margin: 0 0 0.9rem;
  font: 600 0.72rem/1 var(--tp-font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tp-text-tertiary);
}
.tp-hub-label--bottom { margin: 0.9rem 0 0; }

.tp-hub-card { padding: 1.5rem 1.6rem; }
.tp-hub-card h3 { margin-top: 1.1rem; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; color: var(--tp-text); }
.tp-hub-card p { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.6; color: var(--tp-text-secondary); }
.tp-hub-tag {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  font: 600 0.7rem/1 var(--tp-font-mono);
  letter-spacing: 0.04em;
  color: var(--tp-text-tertiary);
}

/* Bridge: SVG lanes stretched to the grid width; strokes stay 1.5px via non-scaling-stroke. */
.tp-hub-bridge { grid-column: 1 / -1; position: relative; height: 220px; }
.tp-hub-paths { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; }
.tp-hub-paths .tp-hub-rail {
  stroke: rgba(100, 160, 255, 0.35);
  stroke-width: 1.5;
  stroke-dasharray: 6 7;
  vector-effect: non-scaling-stroke;
  animation: tp-hub-rail 1.35s linear infinite;
}
.tp-hub-paths .tp-hub-packet {
  stroke: url(#tp-hub-packet-grad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 26 1000;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px var(--tp-cyan));
  animation: tp-hub-packet 2.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.tp-hub-paths .tp-hub-packet--resp {
  stroke: var(--tp-green);
  filter: drop-shadow(0 0 4px var(--tp-green));
  animation-direction: reverse;
  animation-duration: 3.1s;
}
@keyframes tp-hub-rail { to { stroke-dashoffset: -26; } }
@keyframes tp-hub-packet { from { stroke-dashoffset: 26; } to { stroke-dashoffset: -330; } }

.tp-hub-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #111318;
  box-shadow: 0 0 0 14px rgba(10, 132, 255, 0.1), 0 0 0 15px rgba(10, 132, 255, 0.18),
    var(--tp-glass-edge), 0 20px 50px -10px rgba(10, 132, 255, 0.45);
}
.tp-hub-core::before,
.tp-hub-core::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(100, 180, 255, 0.75);
  opacity: 0;
  pointer-events: none;
  animation: tp-hub-pulse 2.4s ease-out infinite;
}
.tp-hub-core::after { animation-delay: 1.2s; }
@keyframes tp-hub-pulse {
  0% { transform: scale(0.4); opacity: 0; }
  18% { opacity: 0.75; }
  100% { transform: scale(2); opacity: 0; }
}
.tp-hub-core img { position: relative; z-index: 1; width: 60px; height: 60px; border-radius: 14px; }

.tp-hub-caption {
  position: absolute;
  left: 50%;
  top: calc(50% + 62px);
  z-index: 2;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 10px;
  border-radius: 99px;
  white-space: nowrap;
  font: 600 0.72rem/1 var(--tp-font-mono);
  color: var(--tp-text-secondary);
  background: var(--tp-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.tp-hub-caption b { color: var(--tp-text); }

@media (max-width: 820px) {
  .tp-hub-grid { grid-template-columns: 1fr; row-gap: 0.9rem; }
  .tp-hub-label, .tp-hub-label--bottom { margin: 0; }
  .tp-hub-bridge { height: 200px; }
  .tp-hub-paths { display: none; }
  .tp-hub-bridge::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1.5px dashed rgba(100, 160, 255, 0.4);
  }
  .tp-hub-caption { font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-hub-paths .tp-hub-rail, .tp-hub-core::before, .tp-hub-core::after { animation: none; }
  .tp-hub-paths .tp-hub-packet { display: none; }
}
