/* ==========================================================================
   Testimonials section
   ========================================================================== */

.testi {
  --testi-blue: #1c45c2;
  --testi-h: 1202px;
  --testi-canvas: 1920px;
  --testi-wrap-w: 1440px;
  --testi-aside-w: 240px;
  --testi-card-w: 338px;
  --testi-card-h: 265px;
  --testi-cards-gap: 20px;
  --testi-cards-w: calc(var(--testi-card-w) * 3 + var(--testi-cards-gap) * 2);
  --testi-cards-h: calc(var(--testi-card-h) * 3 + var(--testi-cards-gap) * 2);
  --testi-stage-gap: 32px;
  --testi-pad-top: 84px;
  --testi-page-top: 3192px; /* Figma section top */
  --testi-gbadge-w: 318px;
  --testi-gbadge-h: 72px;
  --testi-gbadge-page-top: 4202px;
  --testi-gbadge-page-left: 240px;
  --testi-gbadge-top: calc(var(--testi-gbadge-page-top) - var(--testi-page-top));
  --testi-gbadge-gap: 20px;
  --testi-gbadge-pad-y: 20px;
  --testi-gbadge-pad-x: 30px;
  --testi-person-w: 370px;
  --testi-person-h: 533px;
  --testi-person-page-top: 3638px;
  --testi-person-page-left: 240px;
  --testi-person-top: calc(var(--testi-person-page-top) - var(--testi-page-top));
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: var(--testi-h);
  min-height: var(--testi-h);
  max-height: var(--testi-h);
  padding: var(--testi-pad-top) 0 72px;
  background: #1c45c2;
  color: #fff;
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
}

.testi .container,
.testi-layout {
  width: 100%;
  max-width: var(--testi-wrap-w);
  margin: 0 auto;
  padding: 0 16px;
}

.testi-featured {
  display: block;
}

@media (min-width: 769px) {
  .testi-featured {
    display: contents;
  }

  .testi-header {
    width: var(--testi-cards-w);
    max-width: 100%;
    margin-left: auto;
    margin-bottom: 24px;
  }

  .testi-cards {
    margin-left: auto;
  }
}

.testi-stage {
  display: grid;
  grid-template-columns: var(--testi-cards-w);
  gap: var(--testi-stage-gap);
  align-items: end;
  justify-content: end;
  width: 100%;
  max-width: var(--testi-wrap-w);
  margin: 0 auto;
}

/* Figma: 370×533 at page top 3638 / left 240, opacity 1 */
.testi-person {
  position: absolute;
  top: var(--testi-person-top);
  left: max(16px, calc((min(100vw, var(--testi-canvas)) - var(--testi-canvas)) / 2 + var(--testi-person-page-left)));
  z-index: 2;
  box-sizing: border-box;
  margin: 0;
  width: 370px;
  min-width: 370px;
  max-width: 370px;
  height: 533px;
  min-height: 533px;
  max-height: 533px;
  opacity: 1;
  transform: rotate(0deg);
  line-height: 0;
}

.testi-person img {
  width: 370px;
  height: 533px;
  max-width: 370px;
  max-height: 533px;
  display: block;
  object-fit: contain;
  object-position: bottom center;
  opacity: 1;
}

/* Figma: 318×72 at page top 4202 / left 240, gap 20, radius 10, padding 20/30, opacity 1 */
.testi-gbadge {
  position: absolute;
  top: var(--testi-gbadge-top);
  left: max(16px, calc((min(100vw, var(--testi-canvas)) - var(--testi-canvas)) / 2 + var(--testi-gbadge-page-left)));
  z-index: 3;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 318px;
  min-width: 318px;
  max-width: 318px;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  margin: 0;
  padding: 20px 30px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
}

.testi-gbadge > svg,
.testi-gbadge__g {
  width: 88px;
  height: 30px;
  max-height: 32px;
  flex: 0 0 auto;
  object-fit: contain;
}

.testi-gbadge__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.testi-gbadge__stars {
  color: #fab72a;
  font-size: .8rem;
  letter-spacing: 1px;
  line-height: 1;
}

.testi-gbadge__text {
  color: #000;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.testi-main {
  width: var(--testi-cards-w);
  max-width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.testi-header {
  margin-bottom: 24px;
  text-align: left;
}

.testi-title {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 0;
  width: 610px;
  min-width: 610px;
  max-width: 610px;
  height: 144px;
  min-height: 144px;
  max-height: 144px;
  margin: 0 0 14px;
  padding: 0;
  font-family: 'Gilroy-ExtraBoldItalic', var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 54px;
  line-height: 72px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fab72a;
  opacity: 1;
  transform: rotate(0deg);
  overflow: visible;
}

.testi-title__line {
  display: block;
  flex-shrink: 0;
  width: 100%;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  font-size: inherit;
  line-height: 72px;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  white-space: nowrap;
}

.testi-sub {
  box-sizing: border-box;
  width: 610px;
  min-width: 610px;
  max-width: 610px;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  margin: 0;
  padding: 0;
  font-family: 'Gilroy-Medium', var(--font);
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: 0;
  color: #fff;
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Figma cards grid: 3×338 with 20px gap → 1054×835 */
.testi-cards {
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, var(--testi-card-w));
  grid-template-rows: repeat(3, var(--testi-card-h));
  gap: var(--testi-cards-gap);
  width: var(--testi-cards-w);
  max-width: 100%;
  height: var(--testi-cards-h);
  margin-top: 24px;
  opacity: 1;
  isolation: isolate;
}

/* Extra grid-edge fade into section blue */
.testi-cards::before,
.testi-cards::after {
  content: '';
  position: absolute;
  left: -8px;
  right: -8px;
  z-index: 1;
  pointer-events: none;
}

.testi-cards::before {
  top: -6px;
  height: 42%;
  background: linear-gradient(
    180deg,
    var(--testi-blue) 0%,
    rgba(28, 69, 194, .82) 22%,
    rgba(28, 69, 194, .35) 48%,
    transparent 100%
  );
}

.testi-cards::after {
  bottom: -6px;
  height: 42%;
  background: linear-gradient(
    0deg,
    var(--testi-blue) 0%,
    rgba(28, 69, 194, .82) 22%,
    rgba(28, 69, 194, .35) 48%,
    transparent 100%
  );
}

/* Figma card: 338×265, radius 30, #FFFFFF, opacity 1 */
.tcard {
  position: relative;
  box-sizing: border-box;
  color: var(--ink);
  z-index: 2;
  width: 338px;
  min-width: 338px;
  max-width: 338px;
  height: 265px;
  min-height: 265px;
  max-height: 265px;
  border-radius: 30px;
  background: #fff;
  padding: 30px 30px 36px;
  opacity: 1;
  transform: rotate(0deg);
  box-shadow: 0 4px 18px rgba(8, 20, 50, .1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tcard--solid {
  background: #fff;
}

.tcard--fade-top {
  background: linear-gradient(
    180deg,
    var(--testi-blue) 0%,
    #3a58c6 16%,
    #6a86d6 32%,
    #a8bfe8 48%,
    #dce6f7 62%,
    #fff 78%,
    #fff 100%
  );
}

.tcard--fade-bottom {
  background: linear-gradient(
    180deg,
    #fff 0%,
    #fff 22%,
    #dce6f7 38%,
    #a8bfe8 52%,
    #6a86d6 68%,
    #3a58c6 84%,
    var(--testi-blue) 100%
  );
}

.tcard__head {
  display: block;
  margin: 0 0 8px;
  min-height: 30px;
}

.tcard__rule {
  display: block;
  width: 100%;
  max-width: 278px;
  height: 1px;
  margin: 0 0 10px;
  flex-shrink: 0;
}

.tcard__name {
  box-sizing: border-box;
  display: block;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  margin: 0;
  padding: 0;
  font-family: 'Gilroy-SemiBold', var(--font);
  font-weight: 400;
  font-style: normal;
  font-size: 20px;
  line-height: 30px;
  letter-spacing: 0;
  color: #040a10;
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcard__stars {
  position: absolute;
  top: 36px;
  left: 206px;
  box-sizing: border-box;
  display: block;
  width: 102px;
  min-width: 102px;
  max-width: 102px;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  margin: 0;
  padding: 0;
  color: #fbbb00;
  font-size: 16px;
  line-height: 18px;
  letter-spacing: 1px;
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
  white-space: nowrap;
}

.tcard__text {
  position: absolute;
  top: 95px;
  left: 30px;
  box-sizing: border-box;
  width: 278px;
  min-width: 278px;
  max-width: 278px;
  height: 140px;
  min-height: 140px;
  max-height: 140px;
  margin: 0;
  padding: 0;
  font-family: 'Gilroy-Medium', var(--font);
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: 0;
  color: #464646;
  opacity: 1;
  transform: rotate(0deg);
  overflow: hidden;
}

.tcard__g {
  position: absolute;
  top: 216px;
  left: 289px;
  right: auto;
  bottom: auto;
  width: 39px;
  min-width: 39px;
  max-width: 39px;
  height: 39px;
  min-height: 39px;
  max-height: 39px;
  margin: 0;
  padding: 0;
  opacity: 0.4;
  transform: rotate(0deg);
}

/* ------------------------------- Responsive ------------------------------- */

@media (min-width: 769px) and (max-width: 1024px) {
  .testi {
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 48px 0 56px;
    overflow: visible;
  }

  .testi-header {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .testi-title {
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .testi-title__line {
    text-align: center;
  }

  .testi-sub {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: center;
    margin: 0 auto;
    white-space: normal;
  }

  .testi-featured {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    max-width: 520px;
    margin: 0 auto 24px;
  }

  .testi-person {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 auto;
    width: min(200px, 42vw);
    min-width: 0;
    max-width: 200px;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0;
  }

  .testi-person img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
  }

  .testi-gbadge {
    position: relative;
    top: auto;
    left: auto;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 318px;
    margin: 0 0 6px;
  }

  .testi-cards {
    width: 100%;
    height: auto;
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 16px;
  }

  .tcard {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 265px;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .testi {
    box-sizing: border-box;
    width: 430px;
    min-width: 430px;
    max-width: 430px;
    height: 784px;
    min-height: 784px;
    max-height: 784px;
    margin-left: auto;
    margin-right: auto;
    padding: 36px 0 28px;
    background: #1c45c2;
    opacity: 1;
    transform: rotate(0deg);
    overflow: hidden;
  }

  .testi-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 430px;
    min-width: 430px;
    max-width: 430px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
  }

  .testi-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 0 20px;
    text-align: center;
  }

  .testi-title {
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 0 12px;
    font-size: clamp(1.35rem, 5.2vw, 30px);
    line-height: 40px;
  }

  .testi-title__line {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    line-height: 40px;
    white-space: nowrap;
    text-align: center;
  }

  .testi-sub {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 16px;
    line-height: 26px;
    white-space: normal;
    text-align: center;
    margin: 0;
    overflow: visible;
    text-overflow: unset;
  }

  .testi-featured {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0 0 18px;
    padding: 0;
  }

  .testi-person {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 148px;
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    height: 213px;
    min-height: 213px;
    max-height: 213px;
    margin: 0;
    z-index: 0;
    opacity: 1;
    transform: rotate(0deg);
  }

  .testi-person img {
    width: 148px;
    height: 213px;
    min-width: 148px;
    max-width: 148px;
    min-height: 213px;
    max-height: 213px;
    display: block;
    object-fit: contain;
    object-position: bottom left;
    opacity: 1;
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff);
  }

  .testi-gbadge {
    box-sizing: border-box;
    position: absolute;
    top: 234px; /* Figma page top 4407px − section top 4173px */
    left: 171px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 238.66725158691406px;
    min-width: 238.66725158691406px;
    max-width: 238.66725158691406px;
    height: 52.00010681152344px;
    min-height: 52.00010681152344px;
    max-height: 52.00010681152344px;
    margin: 0;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    opacity: 1;
    transform: rotate(0deg);
    z-index: 3;
    overflow: hidden;
  }

  .testi-gbadge > svg,
  .testi-gbadge__g {
    flex: 0 0 auto;
    width: 52.8px;
    height: 18px;
    max-width: 52.8px;
    max-height: 18px;
  }

  .testi-gbadge__meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1;
  }

  .testi-gbadge__stars {
    font-size: 8px;
    letter-spacing: .35px;
    line-height: 1;
  }

  .testi-gbadge__text {
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .testi-cards {
    box-sizing: border-box;
    position: absolute;
    top: 322px; /* Figma page top 4495px − section top 4173px */
    left: 20px;
    width: 390px;
    min-width: 390px;
    max-width: 390px;
    height: 412px;
    min-height: 412px;
    max-height: 412px;
    margin: 0;
    padding: 0;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    opacity: 1;
    transform: rotate(0deg);
    overflow: hidden;
    z-index: 2;
  }

  .testi-cards::before,
  .testi-cards::after {
    display: none;
  }

  .tcard:nth-child(n+7) {
    display: none;
  }

  .tcard {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 0;
    height: 100%;
    max-height: none;
    padding: 10px 10px 28px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff 0%, #fff 68%, #c5d4f0 84%, var(--testi-blue) 100%);
  }

  .tcard--fade-top,
  .tcard--fade-bottom,
  .tcard--solid {
    background: linear-gradient(180deg, #fff 0%, #fff 68%, #c5d4f0 84%, var(--testi-blue) 100%);
  }

  .tcard__head {
    position: relative;
    min-height: 0;
    margin: 0 0 6px;
    padding-right: 62px;
  }

  .tcard__name {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .tcard__stars {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 10px;
    line-height: 1;
    letter-spacing: .5px;
  }

  .tcard__rule {
    max-width: 100%;
    margin: 0 0 6px;
  }

  .tcard__text {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    font-size: 11px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
  }

  .tcard__g {
    top: auto;
    left: auto;
    right: 8px;
    bottom: 8px;
    width: 26px;
    min-width: 26px;
    max-width: 26px;
    height: 26px;
    min-height: 26px;
    max-height: 26px;
    opacity: 0.4;
  }

  /* Full-width override for mobile/tablet-small */
  .testi {
    width: 100vw;
    min-width: 0;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .testi-layout {
    width: 100%;
    min-width: 0;
    max-width: none;
    padding-left: 20px;
    padding-right: 20px;
  }

  .testi-cards {
    left: 20px;
    width: calc(100% - 40px);
    min-width: 0;
    max-width: none;
  }
}

/* ── Testimonials: 320px — gbadge same position, scaled size ── */
@media (max-width: 320px) {
  .testi-gbadge {
    top: 234px;
    left: calc(171px * 320 / 430);
    right: auto;
    gap: 6px;
    width: min(calc(238.667px * 320 / 430), calc(100% - (171px * 320 / 430)));
    min-width: 0;
    max-width: min(calc(238.667px * 320 / 430), calc(100% - (171px * 320 / 430)));
    height: calc(52px * 320 / 430);
    min-height: calc(52px * 320 / 430);
    max-height: calc(52px * 320 / 430);
    padding: 6px 7px;
  }

  .testi-gbadge > svg,
  .testi-gbadge__g {
    width: calc(52.8px * 320 / 430);
    height: calc(18px * 320 / 430);
    max-width: calc(52.8px * 320 / 430);
    max-height: calc(18px * 320 / 430);
  }

  .testi-gbadge__meta {
    gap: 1px;
    min-width: 0;
  }

  .testi-gbadge__stars {
    font-size: 7px;
    letter-spacing: 0.2px;
  }

  .testi-gbadge__text {
    font-size: 7px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── Testi person: center on 424–768px ── */
