/* FROM — home, section 1: the three ways to use FROM, each with a photograph. */

.ways {
  padding: clamp(88px, 11vw, 160px) 0;
  background: var(--paper);
}

.ways__head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px 64px;
}

.ways__title {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(34px, 4.2vw, 64px);
  line-height: 1.05;
  font-weight: 740;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.ways__lede {
  max-width: 40ch;
  font-size: clamp(17px, 1.3vw, 19px);
  line-height: 1.55;
  color: var(--ink-2);
}

/* Companies are who FROM is built for, so they get the tall card; riders and senders sit beside it. */
.ways__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  margin-top: clamp(48px, 6vw, 80px);
}

.way {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--paper-warm);
  box-shadow: inset 0 0 0 1px rgba(7, 13, 23, 0.05);
  overflow: hidden;
}

/* The picture: a round photo that fades out into the card, over FROM's orange brush stroke. The box is a size
   container, so the circle fits whichever is shorter, its width or its height, and never stretches the card. */
.way__art {
  position: relative;
  display: grid;
  place-items: center;
  margin: 10px;
  container-type: size;
}

.way__swash {
  position: absolute;
  left: 50%;
  top: 56%;
  width: min(118cqw, 140cqh);
  height: auto;
  max-width: none;
  translate: -50% -50%;
}

.way__photo {
  position: relative;
  width: min(84cqw, 88cqh);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  /* Solid in the middle, dissolving at the rim into the card and the brush stroke. */
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
}

.way__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 0 clamp(24px, 3vw, 40px) clamp(20px, 2.4vw, 32px);
}

.way__title {
  margin: 0;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.15;
  font-weight: 720;
  letter-spacing: -0.03em;
}

.way__text {
  max-width: 42ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}

.way .link-arrow {
  height: 44px;
  margin-top: 2px;
}

.way--fleet {
  grid-row: span 2;
  justify-content: space-between;
}

.way--fleet .way__art {
  flex: 1 1 auto;
  min-height: 340px;
  margin-bottom: clamp(8px, 1.6vw, 20px);
}

.way--fleet .way__swash {
  top: 47%;
  width: min(92cqw, 104cqh);
}

.way--fleet .way__title {
  font-size: clamp(28px, 2.8vw, 40px);
}

/* The two smaller cards: picture on the left, words on the right. */
.way--ride,
.way--send {
  flex-direction: row;
  align-items: center;
}

.way--ride,
.way--send {
  align-items: stretch;
}

.way--ride .way__art,
.way--send .way__art {
  flex: 0 0 44%;
  min-height: 240px;
}

.way--ride .way__body,
.way--send .way__body {
  justify-content: center;
  padding: 24px clamp(24px, 3vw, 36px) 24px 14px;
}

/* ---------- Tablet: three cards, each picture beside its words ---------- */

@media (max-width: 1000px) {
  .ways__head {
    grid-template-columns: 1fr;
  }

  .ways__grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .way--fleet {
    grid-row: auto;
  }

  .way {
    flex-direction: row;
    align-items: stretch;
  }

  .way .way__art {
    flex: 0 0 44%;
    min-height: 240px;
  }

  .way .way__body {
    justify-content: center;
    padding: 24px clamp(24px, 3vw, 36px) 24px 14px;
  }

  .way--fleet .way__title {
    font-size: clamp(24px, 2.2vw, 32px);
  }
}

/* ---------- Phone: picture on top ---------- */

@media (max-width: 640px) {
  .way {
    flex-direction: column;
    align-items: stretch;
  }

  .way .way__art {
    flex: none;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .way .way__body {
    padding: 8px 24px 20px;
  }

  .way__text {
    font-size: 16px;
  }
}
