/* SVG network and one ordinary HTML reading layer share a camera. */
.network-loop {
  --network-surface: #fff4ec;
  --network-card: #fffdfb;
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1200 / 650;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: var(--network-surface);
  scroll-margin-top: 82px;
}
.network-loop > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.loop-reading-layer {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  width: 1200px;
  height: 650px;
  pointer-events: none;
  font-family: inherit;
}
.loop-intent {
  position: absolute;
  left: 70px;
  top: 70px;
  width: 360px;
  pointer-events: none;
}
.loop-person {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}
.loop-person > img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--network-card);
}
.loop-intent > p {
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.16;
  text-wrap: balance;
  color: var(--ink);
}
.loop-dialogue {
  position: absolute;
  left: 672px;
  top: 74px;
  width: 432px;
  height: 507px;
  pointer-events: none;
}
.loop-message {
  position: absolute;
  left: 0;
  max-width: 94%;
  width: fit-content;
  padding: 13px 17px;
  border-radius: 17px;
  background: var(--network-card);
  border: 1px solid var(--line);
  opacity: 0;
  box-shadow: 0 4px 15px -10px color-mix(in srgb, var(--ink) 15%, transparent);
}
.loop-message:nth-child(1) {
  top: 0;
}
.loop-message:nth-child(2) {
  top: 28%;
  left: auto;
  right: 0;
}
.loop-message:nth-child(3) {
  top: 56%;
}
.loop-message-outgoing {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.loop-speaker {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 5px;
}
.loop-message > p {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.32;
  letter-spacing: -0.025em;
}
.loop-outcome {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  max-width: 100%;
}
.loop-outcome > span {
  display: grid;
  place-items: center;
  flex: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
}
.loop-outcome > p {
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
/* Phone typography is kept in screen pixels, in the HTML layer, synchronized with the moving world. */
.loop-reading-portrait {
  width: 600px;
  --loop-text-unit: 1.8;
}
.loop-reading-portrait .loop-intent {
  left: calc(22px * var(--loop-text-unit));
  top: calc(20px * var(--loop-text-unit));
  width: calc(600px - 44px * var(--loop-text-unit));
}
.loop-reading-portrait .loop-person {
  font-size: calc(14px * var(--loop-text-unit));
  gap: calc(8px * var(--loop-text-unit));
  margin-bottom: calc(10px * var(--loop-text-unit));
}
.loop-reading-portrait .loop-person > img {
  width: calc(25px * var(--loop-text-unit));
  height: calc(25px * var(--loop-text-unit));
  border-width: calc(2px * var(--loop-text-unit));
}
.loop-reading-portrait .loop-intent > p {
  font-size: calc(26px * var(--loop-text-unit));
  line-height: 1.14;
}
.loop-reading-portrait .loop-dialogue {
  display: flex;
  flex-direction: column;
  gap: calc(10px * var(--loop-text-unit));
  left: calc(22px * var(--loop-text-unit));
  top: var(--loop-dialogue-top);
  width: calc(600px - 44px * var(--loop-text-unit));
  height: auto;
}
.loop-reading-portrait .loop-message {
  position: relative;
  align-self: flex-start;
  flex: none;
  top: auto;
  left: auto;
  right: auto;
  max-width: 94%;
  padding: calc(10px * var(--loop-text-unit)) calc(13px * var(--loop-text-unit));
  border-radius: calc(15px * var(--loop-text-unit));
}
.loop-reading-portrait .loop-message:nth-child(2) {
  align-self: flex-end;
  top: auto;
  left: auto;
  right: auto;
}
.loop-reading-portrait .loop-message:nth-child(3) {
  top: auto;
}
.loop-reading-portrait .loop-speaker {
  font-size: calc(14px * var(--loop-text-unit));
  margin-bottom: calc(4px * var(--loop-text-unit));
  line-height: 1.3;
}
.loop-reading-portrait .loop-message > p {
  font-size: calc(16px * var(--loop-text-unit));
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.loop-reading-portrait .loop-outcome {
  position: relative;
  left: auto;
  bottom: auto;
  gap: calc(8px * var(--loop-text-unit));
  margin-top: calc(4px * var(--loop-text-unit));
  min-height: calc(30px * var(--loop-text-unit));
}
.loop-reading-portrait .loop-outcome > span {
  width: calc(22px * var(--loop-text-unit));
  height: calc(22px * var(--loop-text-unit));
  font-size: calc(13px * var(--loop-text-unit));
}
.loop-reading-portrait .loop-outcome > p {
  font-size: calc(16px * var(--loop-text-unit));
  line-height: 1.4;
}
.loop-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 30px;
  background: var(--network-surface);
  font-size: 25px;
  line-height: 1.5;
  text-align: center;
}
@media (max-width: 700px) {
  .network-loop {
    aspect-ratio: auto;
    height: calc(518px + (100vw - 34px) * 0.54);
    border-radius: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .network-loop * {
    animation: none !important;
    transition: none !important;
  }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .network-loop {
    aspect-ratio: 1200 / 750;
    border-radius: 24px;
  }
  .loop-reading-layer {
    height: 750px;
  }
  .loop-person {
    font-size: 26px;
  }
  .loop-person > img {
    width: 40px;
    height: 40px;
  }
  .loop-intent > p {
    font-size: 46px;
  }
  .loop-dialogue {
    top: 40px;
    height: 650px;
  }
  .loop-message > p {
    font-size: 30px;
  }
  .loop-speaker {
    font-size: 26px;
  }
  .loop-outcome > p {
    font-size: 30px;
  }
}
