/* The landing page's peer-to-peer part (docs/site.md, src/mesh.ts): computers on a stage, a dotted line between every
   two, and messages going along the lines as dots. A computer is a button: pressed it closes or opens, dragged it
   moves. Its second line always stands, so it is the same size open, closed or holding what waits. */

.mesh-wrap {
  margin-top: var(--after-head);
}
.mesh {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  aspect-ratio: 16 / 8;
  touch-action: pan-y;
  user-select: none;
  overflow: hidden;
}
.mesh > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mesh > svg path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 0.1 7;
  vector-effect: non-scaling-stroke;
  opacity: 0.5;
  transition: opacity 200ms var(--arrive);
}
.mesh > svg path.cut {
  opacity: 0.12;
}
.device {
  position: absolute;
  translate: -50% -50%;
  display: grid;
  justify-items: center;
  gap: 0.125rem;
  padding: 0.875rem 1rem 0.625rem;
  border-radius: 20px;
  background: var(--soft);
  color: var(--ink);
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  z-index: 1;
}
.device.held {
  cursor: grabbing;
  z-index: 3;
}
.device:active {
  transform: scale(0.97);
}
.device span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
  transition: opacity 200ms var(--arrive);
}
.device :is(i, b) {
  display: grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
}
.device i {
  border-radius: 50%;
  background: var(--mute);
  color: var(--page);
  font-style: normal;
  font-weight: 600;
  font-size: 0.875rem;
}
.device strong {
  font-size: 0.875rem;
  line-height: 1.125rem;
  font-weight: 500;
}
.device small {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.device.off span {
  opacity: 0.45;
}
.device.holds small {
  color: light-dark(#a86a00, #ffb740);
}
@media (hover: hover) {
  .device:hover {
    background: var(--softer);
  }
}
.sent {
  position: absolute;
  width: 0.625rem;
  height: 0.625rem;
  margin: -0.3125rem;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .mesh > svg path {
    animation: flow 1.2s linear infinite;
  }
}
@keyframes flow {
  to {
    stroke-dashoffset: -7.1;
  }
}

.mesh-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: 1.25rem;
}
.mesh-foot p {
  font-size: 1rem;
  line-height: 1.5rem;
}
.button:disabled {
  opacity: 0.4;
  cursor: default;
}
.list.across {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .list.across {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 40rem) {
  .mesh {
    aspect-ratio: 1 / 1.4;
  }
  .device {
    padding: 0.625rem 0.75rem 0.5rem;
  }
  .device :is(i, b) {
    width: 1.75rem;
    height: 1.75rem;
  }
  .device span {
    gap: 0.375rem;
  }
  .device strong {
    font-size: 0.75rem;
  }
}
