/* ==========================================================================
   Trust blocks: clients (flip tiles) and reviews
   ========================================================================== */

.ps-section__head--center { justify-content: center; text-align: center; }
.ps-section__head--center .ps-sub { margin-left: auto; margin-right: auto; max-width: 46em; }
.ps-eyebrow { margin-bottom: 8px; font-size: .78rem; font-weight: 800; letter-spacing: .12em; color: var(--ps-blue); }

/* ---- Clients ------------------------------------------------------------ */
.ps-clients { background: var(--ps-bg); }
.ps-clients__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px;
}
@media (min-width: 700px) {                       /* от планшета и выше логотипы крупнее */
  .ps-clients__grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
  .ps-client { aspect-ratio: 16 / 10; }
  .ps-client__face { padding: 22px; }
  .ps-client__name { font-weight: 800; font-size: 1.05rem; text-align: center; color: var(--ps-navy); overflow-wrap: anywhere; }
.ps-client__front img { max-width: 90%; max-height: 82%; }
  .ps-client__back { font-size: 1.1rem; }
  .ps-client__name { font-size: 1.25rem; }
 }

.ps-client { aspect-ratio: 3 / 2; perspective: 900px; outline: none; cursor: default; -webkit-tap-highlight-color: transparent; }
.ps-client__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.ps-client__face { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ps-client__front { background: #fff; border: 1px solid var(--ps-line); box-shadow: 0 6px 18px rgba(16, 38, 80, .06); }
.ps-client__front img { max-width: 82%; max-height: 74%; object-fit: contain; }
.ps-client__back { transform: rotateY(180deg); background: linear-gradient(135deg, var(--ps-blue) 0%, var(--ps-navy-2) 100%); color: #fff; text-align: center; font-weight: 800; font-size: .92rem; line-height: 1.3; box-shadow: 0 10px 24px rgba(31, 95, 216, .35); }
.ps-client__back span { overflow-wrap: break-word; }

/* tap / keyboard focus works everywhere, mouse hover only where a real hover exists */
.ps-client:focus .ps-client__inner { transform: rotateY(180deg); }
.ps-client:focus-visible { outline: 3px solid rgba(31, 95, 216, .45); outline-offset: 4px; border-radius: 16px; }
@media (hover: hover) { .ps-client:hover .ps-client__inner { transform: rotateY(180deg); } }

@media (prefers-reduced-motion: reduce) {
  .ps-client__inner, .ps-client:focus .ps-client__inner, .ps-client:hover .ps-client__inner { transform: none; transition: none; }
  .ps-client__face { backface-visibility: visible; -webkit-backface-visibility: visible; transition: opacity .2s ease; }
  .ps-client__back { transform: none; opacity: 0; }
  .ps-client:focus .ps-client__back { opacity: 1; }
  @media (hover: hover) { .ps-client:hover .ps-client__back { opacity: 1; } }
}

/* ---- Reviews ---------------------------------------------------------- */
.ps-reviews { background: #fff; }
.ps-ribbon { overflow-x: auto; scrollbar-width: none; padding: 8px 0 22px; outline: none; -webkit-overflow-scrolling: touch; }
.ps-ribbon::-webkit-scrollbar { display: none; }
.ps-ribbon__track { display: flex; width: max-content; }
.ps-ribbon__set { display: flex; gap: 18px; padding-right: 18px; }
.ps-ribbon .ps-review { flex: none; width: 340px; }
.ps-ribbon:not(.ps-ribbon--loop) .ps-ribbon__track { width: auto; justify-content: center; margin: 0 auto; }
.ps-ribbon:not(.ps-ribbon--loop) { display: flex; justify-content: center; padding-left: 16px; padding-right: 16px; }
.ps-ribbon--loop { mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
@media (max-width: 699px) { .ps-ribbon .ps-review { width: 82vw; } }
.ps-reviews__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.ps-review { display: flex; flex-direction: column; margin: 0; padding: 26px 24px 22px; background: #fff; border: 1px solid var(--ps-line); border-radius: var(--ps-radius); box-shadow: var(--ps-shadow); }
.ps-review__mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #eaf2ff; color: var(--ps-blue); }
.ps-review blockquote { flex: 1; margin: 16px 0 20px; font-size: 1rem; line-height: 1.65; color: #264574; overflow-wrap: break-word; }
.ps-review__by { display: flex; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ps-line); }
.ps-review__avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.ps-review__avatar--initials { display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--ps-blue), var(--ps-navy-2)); color: #fff; font: 800 .95rem 'Noto Sans Armenian', 'Noto Sans', sans-serif; }
.ps-review__who { display: flex; flex-direction: column; min-width: 0; }
.ps-review__who strong { font-size: .95rem; font-weight: 800; color: var(--ps-navy); }
.ps-review__who small { margin-top: 2px; font-size: .8rem; color: var(--ps-muted); }

@media (max-width: 699px) {                       /* swipeable rail on phones */
  .ps-clients__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* Отзывы разной длины: у текста фиксированная высота, длинный отзыв прокручивается внутри карточки */
.ps-ribbon .ps-review blockquote { flex: none; height: 11.5rem; margin: 16px 0 16px; padding-right: 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b9cbee transparent; }
.ps-ribbon .ps-review blockquote::-webkit-scrollbar { width: 6px; }
.ps-ribbon .ps-review blockquote::-webkit-scrollbar-thumb { background: #b9cbee; border-radius: 6px; }
.ps-ribbon .ps-review__by { margin-top: auto; }
@media (max-width: 699px) { .ps-ribbon .ps-review blockquote { height: 10.5rem; } }

/* Логотипы клиентов: рамка вокруг логотипа вдвое тоньше, на широком экране 5 в ряд */
@media (min-width: 700px) {
  .ps-clients__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .ps-client { aspect-ratio: 3 / 2; }
  .ps-client__face { padding: 11px; }
  .ps-client__front img { max-width: 96%; max-height: 92%; }
}
@media (min-width: 1100px) {
  .ps-clients__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 699px) { .ps-client__face { padding: 8px; } .ps-client__front img { max-width: 94%; max-height: 90%; } }
