/* What groups use it for: a bento box of six moments. Each cell leads with
   the problem someone actually types, set large, and answers it with one
   bot's reply in that bot's colour. Cells alternate wide and narrow so the
   box reads as a composed tray rather than a row of equal cards. On first
   view the replies arrive one after another, the way answers land in a chat. */
.usecases-section {
  max-width: 1240px;
  margin-inline: auto;
  padding-block: clamp(64px, 9vw, 128px) 0;
}
.usecases-section h2 {
  margin: 0 0 clamp(28px, 4vw, 48px);
  font-size: clamp(40px, 5.4vw, 78px);
  font-weight: 550;
  line-height: 0.98;
  letter-spacing: -0.035em;
}
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.usecase-card {
  --bot: 204 255 0;
  position: relative;
  grid-column: span 5;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: clamp(230px, 23vw, 320px);
  padding: clamp(20px, 2.4vw, 32px);
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  /* Each cell is lit from its corner by the bot that answers in it. */
  background:
    radial-gradient(70% 80% at 100% 100%, rgb(var(--bot) / 9%), rgb(var(--bot) / 0%) 70%),
    rgb(27 23 19 / 58%);
}
.usecase-card:nth-child(4n + 1),
.usecase-card:nth-child(4n) {
  grid-column: span 7;
}
.usecase-card[data-bot="pill"] {
  --bot: 255 150 72;
}
.usecase-card[data-bot="drop"] {
  --bot: 178 140 255;
}
.usecase-card h3 {
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.usecase-chat {
  display: grid;
  gap: clamp(14px, 1.6vw, 22px);
  margin-top: auto;
}
/* The problem, in the words someone would type. */
.usecase-ask {
  max-width: 17ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 2.5vw, 34px);
  font-weight: 550;
  line-height: 1.06;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.usecase-card:nth-child(4n + 1) .usecase-ask,
.usecase-card:nth-child(4n) .usecase-ask {
  max-width: 20ch;
  font-size: clamp(26px, 3.1vw, 44px);
}
.usecase-reply {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 34rem;
}
.usecase-reply img {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #2b251f;
}
.usecase-reply p {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgb(var(--bot) / 30%);
  border-radius: 18px 18px 18px 5px;
  background: rgb(var(--bot) / 8%);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}
.usecase-reply strong {
  display: block;
  margin-bottom: 2px;
  color: rgb(var(--bot));
  font-size: 12px;
  font-weight: 600;
}
[dir="rtl"] .usecase-reply p {
  border-radius: 18px 18px 5px 18px;
}
[dir="rtl"] .usecase-card {
  background:
    radial-gradient(70% 80% at 0% 100%, rgb(var(--bot) / 9%), rgb(var(--bot) / 0%) 70%),
    rgb(27 23 19 / 58%);
}
.usecases-more {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 14px;
}
.usecases-more a {
  color: var(--ink);
  text-underline-offset: 3px;
}
.usecases-more span {
  color: var(--ink-faint);
  font-size: 13px;
}

/* Replies wait, then land one after another. */
.usecase-grid.is-armed .usecase-reply {
  opacity: 0;
  transform: translateY(10px);
}
.usecase-grid.is-lit .usecase-reply {
  opacity: 1;
  transform: none;
  transition:
    opacity 520ms var(--ease-out),
    transform 520ms var(--ease-out);
}
.usecase-grid.is-lit .usecase-card:nth-child(2) .usecase-reply { transition-delay: 140ms; }
.usecase-grid.is-lit .usecase-card:nth-child(3) .usecase-reply { transition-delay: 280ms; }
.usecase-grid.is-lit .usecase-card:nth-child(4) .usecase-reply { transition-delay: 420ms; }
.usecase-grid.is-lit .usecase-card:nth-child(5) .usecase-reply { transition-delay: 560ms; }
.usecase-grid.is-lit .usecase-card:nth-child(6) .usecase-reply { transition-delay: 700ms; }

@media (max-width: 960px) {
  .usecase-card,
  .usecase-card:nth-child(4n + 1),
  .usecase-card:nth-child(4n) {
    grid-column: span 6;
  }
  .usecase-card:nth-child(4n + 1) .usecase-ask,
  .usecase-card:nth-child(4n) .usecase-ask {
    font-size: clamp(24px, 3.4vw, 34px);
  }
}
/* Phones swipe through the cells instead of scrolling past six of them. */
@media (max-width: 600px) {
  .usecase-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    /* Holds the cards' screen-reader text inside the strip; without it, on
       right-to-left pages that text sits outside and widens the whole page. */
    position: relative;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .usecase-grid::-webkit-scrollbar {
    display: none;
  }
  .usecase-card,
  .usecase-card:nth-child(4n + 1),
  .usecase-card:nth-child(4n) {
    grid-column: auto;
    min-height: 260px;
    scroll-snap-align: start;
  }
  /* In a swipe strip only the first cells are on screen: no staged entry. */
  .usecase-grid.is-armed .usecase-reply {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .usecase-grid.is-armed .usecase-reply {
    opacity: 1;
    transform: none;
  }
}
