/* Remember, Learn, Grow: "Pip shows you".
   Each block has a drawing of Pip who stands on a floor line and sticks out of the top of his block.
   Every selector starts with .fx-pip so nothing leaks to the rest of the page. */

.fx-pip { background: var(--white); }

/* --fx-pop is how far Pip sticks out above his block. */
.fx-pip .fx-pip__grid {
  --fx-pop: 172px;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: calc(48px + var(--fx-pop)) var(--gutter) 96px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.fx-pip .fx-pip__card {
  border: var(--outline);
  border-radius: 32px;
  box-shadow: 6px 6px 0 var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.fx-pip .fx-pip__card--coral { background: var(--coral); transform: rotate(-1.5deg); }
.fx-pip .fx-pip__card--blue { transform: rotate(1deg); }
.fx-pip .fx-pip__card--yellow { transform: rotate(-1deg); }
.fx-pip .fx-pip__card--blue { background: var(--blue); color: var(--white); }
.fx-pip .fx-pip__card--yellow { background: var(--yellow); }

/* Drawn at 280 by 340 and never scaled, so its outlines are 3px like the block's. */
.fx-pip .fx-pip__art {
  display: block;
  flex: none;
  width: 280px;
  height: 340px;
  margin-top: calc(-1 * var(--fx-pop));
}

/* The top border is the floor Pip stands on. */
.fx-pip .fx-pip__text {
  align-self: stretch;
  border-top: var(--outline);
  padding: 22px 16px 28px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.fx-pip .fx-pip__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
}
.fx-pip .fx-pip__text p {
  margin: 0;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
  text-wrap: balance;
}

/* Keeps each short sentence whole, so lines break between sentences. */
.fx-pip .fx-pip__s { display: inline-block; }

/* Tablet: one block per row. Pip stands on the bottom edge, words beside him. */
@media (max-width: 999px) {
  .fx-pip .fx-pip__grid {
    --fx-pop: 110px;
    max-width: 728px;
    grid-template-columns: minmax(0, 1fr);
    gap: calc(28px + var(--fx-pop));
  }
  .fx-pip .fx-pip__card {
    flex-direction: row;
    align-items: flex-end;
    padding: 0 24px 0 32px;
    gap: 28px;
    text-align: left;
  }
  .fx-pip .fx-pip__card--coral { transform: rotate(-0.75deg); }
  .fx-pip .fx-pip__card--blue { transform: rotate(0.75deg); }
  .fx-pip .fx-pip__card--yellow { transform: rotate(-0.75deg); }
  .fx-pip .fx-pip__text {
    align-self: center;
    border-top: 0;
    padding: 24px 0;
    gap: 12px;
  }
  .fx-pip .fx-pip__title { font-size: 60px; }
  .fx-pip .fx-pip__text p { font-size: 22px; }
}

/* Phone: Pip on top, words underneath. */
@media (max-width: 719px) {
  .fx-pip .fx-pip__grid {
    --fx-pop: 150px;
    max-width: 408px;
    padding-bottom: 72px;
    gap: calc(24px + var(--fx-pop));
  }
  .fx-pip .fx-pip__card {
    flex-direction: column;
    align-items: center;
    padding: 0;
    gap: 0;
    text-align: center;
  }
  .fx-pip .fx-pip__card--coral { transform: rotate(-1.5deg); }
  .fx-pip .fx-pip__card--blue { transform: rotate(1deg); }
  .fx-pip .fx-pip__card--yellow { transform: rotate(-1deg); }
  .fx-pip .fx-pip__text {
    align-self: stretch;
    border-top: var(--outline);
    padding: 20px 16px 26px;
    gap: 8px;
  }
  .fx-pip .fx-pip__title { font-size: 44px; }
  .fx-pip .fx-pip__text p { font-size: 18px; }
}
