/* Native adaptive tablet flow. Figma 793:6067; phone composition is kept
   at the narrow end so text never becomes a scaled-down desktop canvas. */
@media (min-width:431px) and (max-width:860px) ,  (width > 430px) and (max-width:860px) {
  body.tablet-flow .about-page { width:100%; min-width:0; padding:100px 0 60px; }
  body.tablet-flow .about-page > .container,
  body.tablet-flow .ab-team > .container { width:100%; max-width:none; height:auto; padding:0 50px; }
  body.tablet-flow .ab-header { width:100%; height:auto; margin-bottom:52px; }
  body.tablet-flow .ab-subtitle { width:100%; max-width:415px; }
  body.tablet-flow .ab-story { width:100%; height:auto; display:flex; flex-direction:column; gap:58px; margin-bottom:56px; }
  body.tablet-flow .ab-story__col { position:relative; inset:auto; padding:0; max-width:100%; }
  body.tablet-flow .ab-story__col--left { width:472px; }
  body.tablet-flow .ab-story__col--right { width:458px; align-self:flex-end; }
  /* 14px is the authored 12px Gilroy leading. Keep its ratio under CSS zoom
     so WebKit's minimum glyph size does not outgrow the line spacing. */
  body.tablet-flow .ab-story__col p { font-size:12px; line-height:1.1667; text-wrap: pretty; }
  /* [85].1/.3 — переносы: снимаем висячие слова в описаниях и балансим
     заголовки. text-wrap:pretty/balance деградирует без вреда. */
  body.tablet-flow .ab-title, body.tablet-flow .ab-subtitle,
  body.tablet-flow .ab-feature__body, body.tablet-flow .ab-feature__note,
  body.tablet-flow .ab-team__name { text-wrap: pretty; }
  body.tablet-flow .ab-feature__title, body.tablet-flow .ab-why__title { text-wrap: balance; }
  body.tablet-flow .ab-story__cta { width:100%; min-height:46px; height:auto; white-space:normal; padding:14px; }
  body.tablet-flow .ab-story__watermark { left:auto; right:0; width:min(603px,80%); }
  body.tablet-flow .ab-team { width:100%; height:auto; padding:60px 0 43px; margin-bottom:60px; }
  body.tablet-flow .ab-team > .container { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); column-gap:26px; align-items:start; }
  body.tablet-flow .ab-team__grid { display:contents; }
  body.tablet-flow .ab-team__card { min-width:0; }
  body.tablet-flow .ab-team__badge {
    width:max-content; min-width:116px; max-width:calc(100% - 28px);
    height:auto; min-height:28px; padding-inline:8px; white-space:nowrap; line-height:1.23;
  }
  /* #167 (раунд 4) — снято из Figma (793:6221 секция команды → 793:6223
     контейнер карточек, 793:6224/6232/6244 карточки 1-3 в ряду 1 —
     верх ряда y=0 (у карточки 1 y=7, у 2 и 3 y=0), низ ряда 1 = max
     высота 367 → низ 367. Карточка 4 (793:6256) начинается на y=410,
     то есть отступ от низа ряда 1 = 410-367=43px. Было 57px «на глаз». */
  body.tablet-flow .ab-team__card:nth-child(4) { grid-row:2 / span 2; margin-top:43px; }
  body.tablet-flow .ab-team__photo > img:not(.ab-team__sticker) { width:100%; height:auto; aspect-ratio:236 / 289; object-fit:cover; }
  body.tablet-flow .ab-team__photo > img.ab-lazy { display:none; }
  body.tablet-flow .ab-team__adaptive-photo { display:block; position:relative; width:100%; aspect-ratio:236 / 289; overflow:hidden; border-radius:4px; }
  body.tablet-flow .ab-team__adaptive-photo img { position:absolute; max-width:none; width:151.695%; height:185.813%; left:-25.847%; top:-21.453%; }
  body.tablet-flow .ab-team__card:nth-child(2) .ab-team__adaptive-photo img { width:168.22%; height:205.88%; left:-34.32%; top:-34.602%; }
  body.tablet-flow .ab-team__card:nth-child(3) .ab-team__adaptive-photo img { width:131.356%; height:160.553%; left:-15.678%; top:-20.415%; }
  body.tablet-flow .ab-team__card:nth-child(4) .ab-team__adaptive-photo img { width:176.695%; height:216.263%; left:-37.288%; top:-36.678%; }
  body.tablet-flow .ab-team__name { font-size:20px; }
  body.tablet-flow .ab-team__title { position:relative; inset:auto; grid-column:2 / span 2; grid-row:2; justify-self:end; margin:232px 0 9px; font-size:50px; letter-spacing:.06em; white-space:normal; }
  body.tablet-flow .ab-team__more { position:relative; inset:auto; grid-column:2 / span 2; grid-row:3; width:max-content; min-width:260px; max-width:100%; justify-self:start; margin-left:113px; margin-top:-32px; min-height:46px; height:auto; padding:14px 12px; line-height:1.25; }
  body.tablet-flow .ab-team__photo > img.ab-team__sticker--hat { width:33.9%; left:71.19%; top:-44px; }
  body.tablet-flow .ab-team__photo > img.ab-team__sticker--carrot { width:32.84%; left:81.78%; top:57.44%; }
  body.tablet-flow .ab-why__header { width:100%; height:auto; margin-bottom:49px; }
  body.tablet-flow .ab-why__title { white-space:nowrap; font-size:50px; }
  /* The legacy <=600px canvas places this star after the title. Restore the
     authored tablet treatment at the 430→431px breakpoint. */
  body.tablet-flow .ab-why__title::after { content:none; }
  body.tablet-flow .ab-why__sub .subtitle-star { display:block; }
  body.tablet-flow .about-page .ab-feature,
  body.tablet-flow .ab-feature--flip,
  body.tablet-flow .ab-feature--tall { display:grid; grid-template-columns:minmax(0,390.5fr) minmax(0,369.5fr); width:100%; height:auto; min-height:320px; margin-bottom:44px; }
  body.tablet-flow .ab-feature:last-child { margin-bottom:0; }
  /* #181 (раунд 4) — зубец у фото карточек задан тем же SVG-путём, что и на
     десктопе (main.style.css .ab-feature, шаг 26.333x8.67, скругление ~2.5px
     зашито в кривую конкретно под это соотношение сторон). mask-size тянет
     этот путь до --ab-tooth-w/--ab-tooth-h НЕ пропорционально: было
     38.889x17 при родном 26.333x8.67 — по X масштаб ×1.477, по Y ×1.961,
     то есть кривая скругления растягивается сильнее по вертикали, чем по
     горизонтали, и зубцы визуально «расплываются» неодинаково для разных
     карточек (ширина фото/колонки у --flip и обычных карточек разная, а
     значит и видимая доля растяжения разная). Сохранена ширина шага, высота
     приведена к тому же соотношению, что и в исходном пути (8.67/26.333),
     чтобы скругление растягивалось равномерно по обеим осям. */
  /* Раунд 5: на планшете (Figma 793:6067) зубцы те же, что на десктопе, ×1.479
     равномерно (шаг 38.889, глубина 14.4): скругления везде одинаковые. */
  body.tablet-flow .about-page .ab-feature { --ab-tooth-w:38.889px; --ab-tooth-h:15.87px; --ab-tooth-x:-0.06px; }
  body.tablet-flow .ab-feature__text,
  body.tablet-flow .ab-feature--flip .ab-feature__text { position:relative; inset:auto; opacity:1; padding:54px 7px 32px 53px; grid-column:1; grid-row:1; min-width:0; }
  body.tablet-flow .ab-feature--flip .ab-feature__text { grid-column:2; padding-left:54.5px; padding-right:35px; }
  body.tablet-flow .ab-feature__title { max-width:none; font-size:34px; line-height:38px; margin-bottom:21px; }
  /* Preserve the same authored 1.1667 leading ratio as the story copy. */
  body.tablet-flow .ab-feature__body { width:100%; max-width:none; font-size:12px; line-height:1.1667; }
  body.tablet-flow .ab-feature__note { max-width:none; font-size:9px; line-height:1.1667; margin-top:21px; }
  body.tablet-flow .ab-feature__img, body.tablet-flow .ab-feature__texture { display:none; }
  body.tablet-flow .ab-feature__mobile-img { display:block; position:relative; z-index:1; inset:auto; grid-column:2; grid-row:1; width:100%; height:100%; min-height:320px; overflow:hidden; mask-image:linear-gradient(#000,#000),var(--ab-tooth-mask); mask-size:100% calc(100% - var(--ab-tooth-h) + 2px),var(--ab-tooth-w) var(--ab-tooth-h); mask-position:0 0,var(--ab-tooth-x) bottom; mask-repeat:no-repeat,repeat-x; }
  body.tablet-flow .ab-feature--flip .ab-feature__mobile-img { grid-column:1; }
  /* Раунд 5: зубцы фото и подложки на одной решётке. Колонка фото начинается на
     390.5/760 ширины карточки (у перевёрнутой — с нуля), фаза маски считается от
     её левого края, поэтому сдвигаем её на остаток от шага (mod + container units). */
  @supports (width: mod(10px, 3px)) {
    body.tablet-flow .about-page .ab-feature { container-type:inline-size; }
    body.tablet-flow .ab-feature:not(.ab-feature--flip) .ab-feature__mobile-img { mask-position:0 0,calc(var(--ab-tooth-x) - mod(51.382cqw, var(--ab-tooth-w))) bottom; }
  }
  body.tablet-flow .ab-feature__mobile-img > img { position:absolute; inset:0; width:100%; height:100%; max-width:none; object-fit:fill; }
  body.tablet-flow .ab-feature:not(.ab-feature--love) .ab-feature__title > span { display:block; }
  body.tablet-flow .ab-feature:not(.ab-feature--tall):not(.ab-feature--flip) .ab-feature__body { max-width:281px; }
  body.tablet-flow .ab-feature--tall .ab-feature__text { padding-right:0; }
  body.tablet-flow .ab-feature--tall .ab-feature__mobile-img > img { width:99.922%; height:173.225%; left:0; top:-48.806%; }
  body.tablet-flow .ab-feature--flip:not(.ab-feature--love) .ab-feature__mobile-img > img { width:140.1%; height:113.74%; left:-14.59%; top:-11.8%; }
  body.tablet-flow .ab-feature:not(.ab-feature--flip):not(.ab-feature--tall) .ab-feature__mobile-img > img { width:169.36%; height:130.1%; left:-13.59%; top:-24.5%; }
  body.tablet-flow .ab-feature--love .ab-feature__mobile-img > img { width:128.37%; height:104.44%; left:-28.38%; top:-2.225%; }
}

/* [scaling.4] на узком планшете индивидуальные width/height/left/top
   заточены под 768; на 431–800 картинки заметно искажаются object-fit:fill
   и обрезаются коробкой. Возвращаем природные пропорции через cover. */
/* Снят подбрейкпоинт «@media (min-width:431px) and (max-width:800px)»: полоса 431–860 показывает один макет 860, разницу делает zoom. */

/* Снят подбрейкпоинт «@media (min-width:431px) and (max-width:680px)»: полоса 431–860 показывает один макет 860, разницу делает zoom. */

/* At natural widths just above the phone frame, keep the existing story flow
   and stack feature copy beneath its image instead of squeezing two columns. */
@media (min-width: 431px) and (max-width: 600px) , (width > 430px) and (max-width: 600px){
  body.fluid-flow .about-page > .container,
  body.fluid-flow .ab-team > .container { padding-inline: 24px; }
  body.fluid-flow .ab-team > .container { width: calc(100% - 48px); max-width: none; display: block; }
  body.fluid-flow .ab-team__grid {
    position: relative; inset: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 22px; align-items: start; width: 100%; margin: 0;
  }
  body.fluid-flow .ab-team__card,
  body.fluid-flow .ab-team__card:nth-child(4) { width: 100%; min-width: 0; margin: 0; grid-row: auto; }
  body.fluid-flow .ab-team__title {
    position: relative; inset: auto; width: 100%; margin: 49px 0 16px;
    font-size: clamp(30px, 8.6vw, 37px); white-space: normal;
  }
  body.fluid-flow .ab-team__more {
    position: relative; inset: auto; width: 100%; min-height: 46px; height: auto;
    margin: 0; padding: 14px 12px;
  }
  body.fluid-flow .ab-why__title {
    width: min(267px, 100%); max-width: 100%; font-size: clamp(28px, 8.6vw, 37px);
    line-height: 1.16; white-space: normal;
  }
  body.fluid-flow .ab-why__header { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  body.fluid-flow .ab-why__sub { width: 100%; max-width: 350px; }
  body.fluid-flow .about-page .ab-feature,
  body.fluid-flow .about-page .ab-feature--flip,
  body.fluid-flow .about-page .ab-feature--tall {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto;
    min-height: 0; row-gap: 0;
  }
  body.fluid-flow .about-page .ab-feature__text,
  body.fluid-flow .about-page .ab-feature--flip .ab-feature__text {
    grid-column: 1; grid-row: 2; padding: 28px 24px 30px;
  }
  body.fluid-flow .about-page .ab-feature__mobile-img,
  body.fluid-flow .about-page .ab-feature--flip .ab-feature__mobile-img {
    grid-column: 1; grid-row: 1; width: 100%; height: auto; min-height: 0;
    aspect-ratio: 1.6; mask-image: none; overflow: hidden;
  }
  body.fluid-flow .about-page .ab-feature__mobile-img > img,
  body.fluid-flow .about-page .ab-feature--tall .ab-feature__mobile-img > img,
  body.fluid-flow .about-page .ab-feature--flip .ab-feature__mobile-img > img {
    inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  }
  body.fluid-flow .about-page .ab-feature__title { font-size: clamp(27px, 5.67vw, 34px); line-height: 1.12; }
  body.fluid-flow .about-page .ab-feature__body { max-width: none; font-size: 14px; line-height: 1.25; }
}

@media (min-width: 431px) and (max-width: 860px) ,  (width > 430px) and (max-width: 860px) {
  body.fluid-flow .ab-title { font-size: clamp(37px, calc(22px + 3.256vw), 50px); line-height: 1.16; }
  body.fluid-flow .ab-story { gap: clamp(39px, calc(20px + 4.42vw), 58px); }
  body.fluid-flow .ab-story__col--left { width: min(472px, 100%); }
  body.fluid-flow .ab-story__col--right { width: min(458px, 100%); }
  body.fluid-flow .ab-story__col p {
    font-size: clamp(12px, calc(20.65px - 1.081vw), 16px);
    line-height: clamp(14px, calc(24px - 1.163vw), 19px);
  }
  body.fluid-flow .ab-team__name { font-size: clamp(15px, calc(10px + 1.163vw), 20px); }
  body.fluid-flow .ab-team__title { font-size: clamp(37px, calc(22px + 3.256vw), 50px); }
  body.fluid-flow .ab-why__title { font-size: clamp(37px, calc(22px + 3.256vw), 50px); }
  body.fluid-flow .about-page .ab-feature__title {
    font-size: clamp(32px, calc(30px + .4651vw), 34px);
    line-height: clamp(36px, calc(33.95px + .471vw), 38px);
  }
  body.fluid-flow .about-page .ab-feature__body {
    font-size: clamp(12px, calc(17.72px - .665vw), 16px);
    line-height: clamp(14px, calc(22.6px - .977vw), 18px);
  }
  body.fluid-flow .about-page .ab-feature__note {
    font-size: clamp(9px, calc(17px - .93vw), 13px);
    line-height: clamp(10.5px, calc(19.5px - 1.047vw), 15px);
  }
}

/* Fluid desktop band: the fixed 1200px story columns no longer collapse at
   861px. Feature cards use the same live image/text treatment as tablet. */
@media (min-width: 861px) and (max-width: 1199px) ,  (width > 860px) and (max-width: 1199px) ,  (min-width: 861px) and (width < 1200px) {
  body.fluid-flow .about-page { width: 100%; min-width: 0; padding: 120px 0 60px; }
  body.fluid-flow .about-page > .container,
  body.fluid-flow .ab-team > .container { width: 100%; max-width: none; height: auto; padding: 0 50px; }
  body.fluid-flow .ab-header { width: 100%; height: auto; margin-bottom: 52px; gap: clamp(32px, calc((100vw - 861px) * .7), 237px); flex-wrap: nowrap; }
  body.fluid-flow .ab-subtitle { width: min(438px, 100%); max-width: 100%; }
  body.fluid-flow .ab-story { width: 100%; height: auto; min-height: 0; display: flex; flex-direction: column; gap: 58px; margin-bottom: 56px; }
  body.fluid-flow .ab-story__col { position: relative; inset: auto; padding: 0; max-width: 100%; }
  body.fluid-flow .ab-story__col--left { width: min(472px, 100%); }
  body.fluid-flow .ab-story__col--right { width: min(458px, 100%); align-self: flex-end; }
  body.fluid-flow .ab-story__col p { font-size: 12px; line-height: 14px; text-wrap: pretty; }
  body.fluid-flow .ab-story__cta { width: 100%; min-height: 46px; height: auto; padding: 14px; white-space: normal; }
  body.fluid-flow .ab-story__watermark { left: auto; right: 0; width: min(603px, 80%); }
  body.fluid-flow .ab-team { width: 100%; height: auto; padding: 60px 0 43px; margin-bottom: 60px; }
  body.fluid-flow .ab-team > .container { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 26px; align-items: start; }
  body.fluid-flow .ab-team__grid { display: contents; }
  body.fluid-flow .ab-team__card { min-width: 0; }
  body.fluid-flow .ab-team__card:nth-child(4) { grid-row: 2 / span 2; margin-top: 43px; }
  body.fluid-flow .ab-team__photo > img:not(.ab-team__sticker) { width: 100%; height: auto; aspect-ratio: 236 / 289; object-fit: cover; }
  body.fluid-flow .ab-team__photo > img.ab-lazy { display: none; }
  body.fluid-flow .ab-team__adaptive-photo { display: block; position: relative; width: 100%; aspect-ratio: 236 / 289; overflow: hidden; border-radius: 4px; }
  body.fluid-flow .ab-team__adaptive-photo img { position: absolute; max-width: none; width: 151.695%; height: 185.813%; left: -25.847%; top: -21.453%; }
  body.fluid-flow .ab-team__card:nth-child(2) .ab-team__adaptive-photo img { width: 168.22%; height: 205.88%; left: -34.32%; top: -34.602%; }
  body.fluid-flow .ab-team__card:nth-child(3) .ab-team__adaptive-photo img { width: 131.356%; height: 160.553%; left: -15.678%; top: -20.415%; }
  body.fluid-flow .ab-team__card:nth-child(4) .ab-team__adaptive-photo img { width: 176.695%; height: 216.263%; left: -37.288%; top: -36.678%; }
  body.fluid-flow .ab-team__title { position: relative; inset: auto; grid-column: 2 / span 2; grid-row: 2; justify-self: end; margin: 232px 0 9px; font-size: 50px; white-space: normal; }
  body.fluid-flow .ab-team__more { position: relative; inset: auto; grid-column: 2 / span 2; grid-row: 3; width: min(260px, 100%); justify-self: start; margin: -32px 0 0 113px; min-height: 46px; height: auto; padding: 14px 12px; }
  body.fluid-flow .about-page .ab-feature,
  body.fluid-flow .ab-feature--flip,
  body.fluid-flow .ab-feature--tall {
    display: grid; grid-template-columns: minmax(0, 390.5fr) minmax(0, 369.5fr);
    width: 100%; height: auto; min-height: 320px; margin-bottom: 44px;
  }
  body.fluid-flow .ab-feature:last-child { margin-bottom: 0; }
  body.fluid-flow .about-page .ab-feature { --ab-tooth-w: 38.889px; --ab-tooth-h: 15.87px; --ab-tooth-x: -.06px; container-type: inline-size; }
  body.fluid-flow .ab-feature__text,
  body.fluid-flow .ab-feature--flip .ab-feature__text { position: relative; inset: auto; opacity: 1; padding: 54px 7px 32px 53px; grid-column: 1; grid-row: 1; min-width: 0; }
  body.fluid-flow .ab-feature--flip .ab-feature__text { grid-column: 2; padding-left: 54.5px; padding-right: 35px; }
  body.fluid-flow .ab-feature__title { max-width: none; font-size: 34px; line-height: 38px; margin-bottom: 21px; }
  body.fluid-flow .ab-feature__body { width: 100%; max-width: none; font-size: 12px; line-height: 14px; }
  body.fluid-flow .ab-feature__note { max-width: none; font-size: 9px; line-height: 10.5px; margin-top: 21px; }
  body.fluid-flow .ab-feature__img,
  body.fluid-flow .ab-feature__texture { display: none; }
  body.fluid-flow .ab-feature__mobile-img { display: block; position: relative; z-index: 1; inset: auto; grid-column: 2; grid-row: 1; width: 100%; height: 100%; min-height: 320px; overflow: hidden; }
  body.fluid-flow .ab-feature--flip .ab-feature__mobile-img { grid-column: 1; }
  body.fluid-flow .ab-feature__mobile-img > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
  body.fluid-flow .ab-feature:not(.ab-feature--love) .ab-feature__title > span { display: block; }
  body.fluid-flow .ab-feature__mobile-img { mask-image: linear-gradient(#000,#000),var(--ab-tooth-mask); mask-size: 100% calc(100% - var(--ab-tooth-h) + 2px),var(--ab-tooth-w) var(--ab-tooth-h); mask-position: 0 0,var(--ab-tooth-x) bottom; mask-repeat: no-repeat,repeat-x; }
}

