/* How it works, step 4 (Earn): the scene, and Reach in use on a phone, one screen after another,
   beside its own console (how-console.css draws it). The workbench steps aside while it plays, and
   the scene takes its place at the same size. The phone's colors are Reach's own
   (reach/design/theme.ts), as apps.css carries each customer app's; the rest is Dawn's tokens. */

/* The workbench steps aside; the scene takes its place */
.cw {
  transition: opacity 400ms var(--ease-out);
}
.hw[data-step="4"] .cw {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 400ms var(--ease-out),
    visibility 0s 400ms;
}
.hw-earn {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 400ms var(--ease-out),
    visibility 0s 400ms;
}
.hw[data-step="4"] .hw-earn {
  opacity: 1;
  visibility: visible;
  transition: opacity 400ms var(--ease-out);
}
.hw-earn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* The phone: Reach in use, one screen after another; a tap sends the update */
.ea-scr {
  position: relative;
  display: block;
  aspect-ratio: 390 / 844;
  overflow: hidden;
  border-radius: 33px;
  background: #eef0f3;
}
.ea-scr img {
  position: absolute;
  inset: 0;
  height: 100%;
}
.hw.js .hw-earn .ea-scr img {
  opacity: 0;
  translate: none;
  transition: opacity 450ms var(--ease-out);
}
.hw.js .hw-earn .ea-scr img.on {
  opacity: 1;
}
.hw.js .hw-earn .ea-scr img.on.gone {
  opacity: 0;
  translate: none;
}
.tap {
  position: absolute;
  left: 50%;
  top: 89.9%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(18, 20, 23, 0.22);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}
.hw.js .hw-earn .tap {
  opacity: 0;
  scale: 0.5;
  translate: none;
  transition:
    opacity 200ms var(--ease-out),
    scale 300ms var(--ease-out);
}
.hw.js .hw-earn .tap.on {
  opacity: 1;
  scale: 1;
}
.hw.js .hw-earn .tap.on.gone {
  opacity: 0;
  scale: 1.3;
  translate: none;
}
.ea-pill {
  position: absolute;
  left: 50%;
  top: 89.9%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 92%;
  min-height: 6.4%;
  padding: 6px 12px;
  translate: -50% -50%;
  border-radius: 12px;
  background: #1b1e23;
  box-shadow: 0 16px 32px -12px rgba(18, 20, 23, 0.4);
  color: #ffffff;
  font-size: 12px;
  font-weight: 560;
  line-height: 16px;
  text-align: center;
}
.hw.js .hw-earn .ea-pill {
  opacity: 0;
  translate: -50% -30%;
  transition:
    opacity 300ms var(--ease-out),
    translate 300ms var(--ease-out);
}
.hw.js .hw-earn .ea-pill.on {
  opacity: 1;
  translate: -50% -50%;
}
.ea-pill svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
  color: #3fbf86;
}

/* Narrower: a smaller phone */
@container (max-width: 960px) {
  .hw-earn {
    grid-template-columns: 30% minmax(0, 1fr);
    gap: var(--space-6);
  }
}

/* On a phone: the console fills the stage, and the phone stands in front of its corner */
@container (max-width: 680px) {
  .hw-earn {
    display: block;
  }
  .ea-phone {
    position: absolute;
    right: calc(-1 * var(--space-2));
    bottom: calc(-1 * var(--space-6));
    z-index: 2;
    width: 40%;
    padding: 4px;
    border-radius: 22px;
  }
  .ea-scr {
    border-radius: 18px;
  }
  /* The sent button keeps its check; its words don't fit a phone this small */
  .ea-pill {
    border-radius: 8px;
  }
  .ea-pill span {
    display: none;
  }
}
