.chapter--share { overflow-x: clip; }

.share-layout {
  width: min(100%, 96rem);
  margin-inline: auto;
  display: grid;
  gap: clamp(1.3rem, 3.5svh, 2.75rem);
}

.share-heading {
  position: relative;
  display: grid;
  justify-items: center;
  align-items: center;
  text-align: center;
}

.share-heading h2 {
  font-size: clamp(2.5rem, 5.1vw, 5.4rem);
  letter-spacing: -.065em;
  line-height: .98;
  text-wrap: balance;
}

.share-heading h2 span { transition: color 750ms ease; }
.share-layout[data-team-complete] .share-heading h2 span { color: #bcebd6; }

.share-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.team-stage {
  position: relative;
  grid-template-columns: minmax(0, .97fr) minmax(0, 1fr);
  gap: clamp(2.55rem, 6.3vw, 7.35rem);
  align-items: center;
}

.team-sender, .team-recipient {
  width: 100%;
  min-width: 0;
  display: grid;
  justify-items: center;
  margin: 0;
}

.team-sender .device--laptop { width: min(100%, 49rem); }
.team-screen { position: relative; }
.team-screen img { display: block; width: 100%; height: auto; }

.team-recipients {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-areas: "phone tablet" "phone office";
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.11fr);
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem) clamp(1.45rem, 3vw, 3.25rem);
}

.team-recipient--phone { grid-area: phone; }
.team-recipient--tablet { grid-area: tablet; }
.team-recipient--office { grid-area: office; }

.team-recipient .device { margin: 0; }
.team-recipient .device--tablet { width: min(100%, 19rem, max(8rem, (100svh - 23rem) * .63)); }
.team-recipient .device--phone {
  width: min(100%, 15.35rem, max(8.2rem, (100svh - 14rem) * .41));
  transform: scale(.91);
  transition: transform 800ms var(--ease), box-shadow 800ms var(--ease);
}

.team-recipient--phone[data-state="open"] .device--phone {
  transform: scale(1.06);
  box-shadow: 0 1.8rem 3.2rem #0008, 0 0 0 1px #8aa8bb6e;
}

.team-recipient--phone .team-role { margin-top: 1rem; }

.team-screen .team-cover { border-radius: inherit; }

.device--monitor {
  width: min(100%, 19rem, max(8rem, (100svh - 23rem) * .74));
  padding: clamp(.24rem, .68vw, .52rem);
  border-radius: clamp(.35rem, .92vw, .75rem);
}

.device--monitor .device-screen { border-radius: .25rem; }

.device--monitor::before, .device--monitor::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  content: "";
  background: linear-gradient(90deg, #656c7a, #424953 68%, #353844);
}

.device--monitor::before { bottom: -.5rem; width: 12%; height: .5rem; }
.device--monitor::after { bottom: -.59rem; width: 27%; height: .12rem; border-radius: 1rem; }

.team-role {
  display: inline-flex;
  align-items: center;
  gap: clamp(.25rem, .7vw, .58rem);
  margin-top: .7rem;
  font-size: clamp(.75rem, 1.15vw, 1.035rem);
  font-weight: 700;
  color: #f1f2f5;
  white-space: nowrap;
}

.team-avatar {
  display: grid;
  place-items: center;
  width: clamp(1.55rem, 2.5vw, 2.3rem);
  aspect-ratio: 1;
  border: 1px solid #5a6783;
  border-radius: 50%;
  background: #253044;
  color: #dce9ff;
  transition: background-color 350ms ease, border-color 350ms ease, color 350ms ease;
}

.team-avatar svg { width: 62%; }

.team-recipient[data-state="arrived"] .team-avatar, .team-recipient[data-state="tap"] .team-avatar {
  color: #eaf1ff;
  background: #395788;
  border-color: #88a9df;
}

.team-recipient[data-state="open"] .team-avatar { color: #bcebd6; background: #253b39; border-color: #718f84; }

.team-copy {
  position: absolute;
  z-index: 1;
  top: 4.75%;
  left: 97%;
  width: clamp(1.75rem, 3vw, 2.65rem);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.share-layout[data-sender-tap] .team-copy::after {
  position: absolute;
  content: "";
  inset: .2rem;
  border: 2px solid #d5e4ff;
  border-radius: 50%;
  box-shadow: 0 0 .9rem #88aefb;
  animation: source-press 680ms ease-out both;
}

@keyframes source-press {
  from { transform: scale(.57); opacity: 1; }
  to { transform: scale(1.95); opacity: .13; }
}

.team-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 42%, #334465, #151a26 73%);
  transition: opacity 360ms ease, transform 430ms var(--ease), visibility 360ms;
}

.team-wait {
  width: clamp(1.15rem, 2.1vw, 1.8rem);
  color: #aebfdc;
  transition: opacity 180ms ease;
}

.team-open {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  min-height: 2.75rem;
  padding: .36rem clamp(.44rem, 1.35vw, .85rem);
  transform: translate(-50%, -37%) scale(.87);
  border: 1px solid #f0f5ff;
  border-radius: clamp(.42rem, .82vw, .72rem);
  color: #182d50;
  background: #dceafe;
  box-shadow: 0 .55rem 1.45rem #02091390;
  font-size: clamp(.7rem, 1.13vw, 1rem);
  font-weight: 700;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  cursor: pointer;
  transition: opacity 270ms ease, transform 505ms var(--ease);
}

.team-open:hover { background: #f1f7ff; }
.team-recipient[data-state="arrived"] .team-wait, .team-recipient[data-state="tap"] .team-wait { opacity: 0; }
.team-recipient[data-state="arrived"] .team-open, .team-recipient[data-state="tap"] .team-open {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.team-recipient[data-state="tap"] .team-open {
  background: #f7fbff;
  animation: button-press 720ms var(--ease) both;
}

@keyframes button-press {
  0% { transform: translate(-50%, -50%) scale(1); }
  34% { transform: translate(-50%, -50%) scale(.89); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.team-click {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 55%;
  width: clamp(1.75rem, 3.3vw, 2.9rem);
  opacity: 0;
  pointer-events: none;
}

.team-click svg { display: block; width: 100%; color: #142a4c; fill: #f3f8ff; filter: drop-shadow(0 .12rem .25rem #050a16a0); }

.team-click::before {
  position: absolute;
  content: "";
  left: 35%;
  top: 12%;
  width: 1.25rem;
  aspect-ratio: 1;
  border: 2px solid #eef5ff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.team-recipient[data-state="tap"] .team-click { animation: finger-press 800ms var(--ease) both; }
.team-recipient[data-state="tap"] .team-click::before { animation: press-ring 640ms .13s ease-out both; }

@keyframes finger-press {
  0% { opacity: 0; transform: translate(.85rem, .89rem) rotate(-12deg); }
  36%, 63% { opacity: 1; transform: translate(-.36rem, -.58rem) rotate(-12deg); }
  100% { opacity: .95; transform: translate(-.23rem, -.48rem) rotate(-12deg); }
}

@keyframes press-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
  34% { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.3); }
}

.team-recipient[data-state="open"] .team-cover { visibility: hidden; opacity: 0; transform: scale(1.04); pointer-events: none; }

.team-arcs, .team-plane { position: absolute; z-index: 3; inset: 0 auto auto 0; pointer-events: none; }
.team-arcs { width: 100%; height: 100%; overflow: visible; }
.team-arcs path { fill: none; stroke: #b0cbff; stroke-width: 1.5; stroke-dasharray: 3 7; stroke-linecap: round; opacity: 0; transition: opacity 220ms ease; }
.team-arcs path[data-flying] { opacity: .64; }

.team-plane {
  display: grid;
  place-items: center;
  width: clamp(2.15rem, 3.4vw, 3.2rem);
  aspect-ratio: 1;
  border: 1px solid #f0f5ff;
  border-radius: 50%;
  color: #294b79;
  background: #e2eeff;
  box-shadow: 0 0 1.2rem #8eb4ff86, 0 .48rem .9rem #0a142e70;
  opacity: 0;
}

.team-plane[data-flying] { opacity: 1; }
.team-plane:not([data-flying]) { display: none; }
.team-plane svg { width: 49%; }

@media (max-width: 49rem) {
  .share-layout { gap: clamp(1.05rem, 3svh, 1.8rem); }
  .share-heading h2 { font-size: clamp(2.1rem, 7.3vw, 3.35rem); }
  .team-stage { grid-template-columns: minmax(0, 1fr); gap: clamp(1.45rem, 3.6svh, 2.6rem); }
  .team-sender .device--laptop { width: min(100%, 27rem); }
  .team-recipients { grid-template-areas: "tablet phone office"; grid-template-columns: minmax(0, 1fr) minmax(0, .96fr) minmax(0, 1fr); align-items: end; gap: .72rem; }
  .team-recipient .device--phone { width: min(100%, 7.25rem); }
  .team-recipient .device--tablet, .team-recipient .device--monitor { width: 100%; }
  .team-role { margin-top: .52rem; }
  .team-recipient--phone .team-role { margin-top: .72rem; }
  .device--monitor::before { bottom: -.27rem; height: .27rem; }
  .device--monitor::after { bottom: -.32rem; height: .08rem; }
  .team-open { min-height: 2.25rem; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .share-heading h2 span, .team-avatar, .team-cover, .team-open, .team-recipient .device--phone, .team-wait { transition: none; }
  .team-arcs { display: none; }
  .share-layout[data-sender-tap] .team-copy::after,
  .team-recipient[data-state="tap"] .team-open,
  .team-recipient[data-state="tap"] .team-click,
  .team-recipient[data-state="tap"] .team-click::before { animation: none; }
}
