/* Адаптация без масштабирования текста. Десктоп от 1200 px сохраняет исходный макет. */
.site-header__menu { display: none; }
@media (max-width: 999px) {
  :root { --page-padding: clamp(20px, 4vw, 48px); }
  .site-viewport { width: 100%; overflow: clip; }
  .site-canvas { width: 100%; min-height: 0; }
  .site-canvas > section, .site-canvas > footer {
    width: 100%; height: auto; min-height: 0;
    padding: 48px var(--page-padding);
    overflow: clip;
  }
  .site-canvas > section > h2, .process__section > .process__text,
  .site-canvas > footer > h2 {
    position: relative; inset: auto; width: auto; height: auto;
    transform: none; white-space: normal; font-size: clamp(24px, 3.2vw, 32px);
    line-height: 1.3; word-break: normal; overflow-wrap: anywhere;
  }
  .site-canvas > section > [class*="__eyebrow"], .site-canvas > footer > [class*="__eyebrow"] {
    position: relative; inset: auto; width: auto; height: auto;
    white-space: normal; line-height: 1.5; font-size: 12px;
  }
  .site-canvas button, .site-canvas a { touch-action: manipulation; }
  .site-canvas .contact-button { min-height: 44px; }
  .site-canvas .contact-button span, .site-canvas .contact-button p { white-space: normal; }

  /* Хедер: читаемые элементы и меню, доступное касанием и клавиатурой. */
  .site-header { width: 100%; height: 72px; }
  .site-header__inner { width: 100%; height: 72px; display: flex; align-items: center; gap: 16px; padding-inline: var(--page-padding); }
  .site-header .hero__brand { position: static; width: auto; font-size: 16px; margin-right: auto; }
  .site-header .hero__button { position: static; height: 40px; padding: 10px 16px; }
  .site-header .hero__text-8 { font-size: 12px; }
  .site-header__menu { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid #b99aff70; border-radius: 100px; font-size: 13px; }
  .site-header .hero__navigation {
    display: none; position: absolute; inset: 72px 0 auto; transform: none;
    width: 100%; height: auto; padding: 16px var(--page-padding) 24px;
    background: var(--color-background); border-bottom: 1px solid #b99aff40;
    flex-wrap: wrap; gap: 8px 24px; box-shadow: 0 16px 24px #0003;
  }
  .site-header.menu-open .hero__navigation { display: flex; }
  .site-header nav a { display: flex; align-items: center; min-height: 44px; font-size: 15px; }

  /* 01 — первый экран. */
  .site-canvas > .hero__section { padding-top: 120px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px 24px; align-items: center; }
  .hero__layer { display: none; }
  .hero__section > .hero__eyebrow { grid-column: 1; align-self: end; }
  .hero__title { position: static; inset: auto; font-size: clamp(28px, 4vw, 42px); line-height: 1.2; grid-column: 1; }
  .hero__title span { line-height: 1.25; }
  .hero__description { position: static; inset: auto; transform: none; width: auto; font-size: 16px; line-height: 1.6; grid-column: 1; }
  .hero__button-2 { position: relative; inset: auto; justify-self: start; padding: 14px 24px; grid-column: 1; }
  .hero__text-9 { font-size: 17px; }
  .hero__layer-2 { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 560 / 464; grid-column: 2; grid-row: 1 / 5; }
  .hero__image { object-fit: contain; }

  /* 02 — работы. */
  .works__section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .works__section > .works__heading { grid-column: 1 / -1; order: -2; }
  .works__description { position: static; inset: auto; grid-column: 1 / -1; order: -1; white-space: normal; font-size: 16px; line-height: 1.6; margin-bottom: 8px; }
  .works__section > [class^="works__column"] { position: relative; inset: auto; width: 100%; height: auto; min-height: 340px; aspect-ratio: 1.25; padding: 20px; }
  .works__column-5, .works__column-7 { order: 0; }
  .works__column, .works__column-3 { order: 1; }
  .works__section > [class^="works__column"] > [class^="works__row"] { flex-wrap: wrap; align-items: end; gap: 16px; }
  .works__section [class^="works__row"] > [class^="works__column"] { width: auto; flex: 1 1 160px; min-width: 0; }
  .works__section [data-action="project"] { min-height: 44px; padding: 12px 20px; }
  .works__section [class^="works__column"] p { white-space: normal; }
  .works__layer-2, .works__layer-4, .works__layer-6, .works__layer-8 { background-image: linear-gradient(transparent 25%, #14121899 55%, #141218 100%); }

  /* 03 — задачи бизнеса. */
  .problems__section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .problems__section > h2 { grid-column: 1 / -1; order: -1; margin-bottom: 8px; }
  .problems__section > .problems__eyebrow { grid-column: 1 / -1; order: -2; }
  .problems__section > [class*="-card"] { position: relative; inset: auto; width: auto; height: auto; min-height: 170px; padding: 24px; transform: none; }
  .problems__section > [class*="-card"] > p { position: static; inset: auto; width: auto; min-width: 0; white-space: normal; }
  .problems__section > [class*="-card"] > p:first-child { font-size: 20px; line-height: 1.35; margin-bottom: 12px; }
  .problems__section > [class*="-card"] > p:last-child { font-size: 15px; line-height: 1.65; }
  .problems__section > [class^="problems__decoration"] { display: none; }

  /* 04 — портрет и биография, затем факты. */
  .about__section { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .about__section > h2 { grid-column: 1 / -1; order: -2; margin-bottom: 12px; }
  .about__section > .about__eyebrow { grid-column: 1 / -1; order: -3; }
  .about__section > .about__biography { position: relative; inset: auto; width: auto; grid-column: 1 / -1; order: -1; display: grid; grid-template-columns: minmax(180px, .7fr) 1.3fr; gap: 20px; padding: 24px; }
  .about__biography > .about__layer { display: none; }
  .about__biography > .about__layer-2 { position: relative; inset: auto; width: 100%; height: auto; min-height: 270px; grid-column: 1; grid-row: 1 / 3; }
  .about__biography-text { grid-column: 2; font-size: 15px; line-height: 1.65; gap: 14px; }
  .about__reviews-button { position: relative; inset: auto; grid-column: 2; justify-self: start; height: auto; padding: 14px 20px; }
  .about__biography > .about__decoration-2 { left: auto; right: 16px; top: auto; bottom: 16px; }
  .about__biography > .about__decoration-4 { left: auto; right: 6px; top: auto; bottom: 6px; }
  .about__section > :is(.about__experience, .about__projects, .about__industries, .about__perspective) { position: relative; inset: auto; width: 100%; height: auto; transform: none; padding: 20px 12px; gap: 8px; }
  .about__section > :is(.about__experience, .about__projects, .about__industries, .about__perspective) p { white-space: normal; line-height: 1.5; width: auto; min-width: 0; }
  .about__industries p:first-child, .about__perspective p:first-child { font-size: 20px; }
  .about__industries p:last-child, .about__perspective p:last-child { font-size: 13px; }

  /* 05 — преимущества. */
  .benefits__section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .benefits__section > h2 { grid-column: 1 / -1; order: -2; margin-bottom: 12px; }
  .benefits__section > .benefits__eyebrow { grid-column: 1 / -1; order: -3; }
  .benefits__section > [class^="benefits__card"] { position: relative; inset: auto; width: 100%; padding: 20px; gap: 14px; }
  .benefits__section > [class^="benefits__card"] > [class^="benefits__layer"] { width: 56px; height: 56px; }
  .benefits__section [class^="benefits__column"] > p { width: auto; min-width: 0; white-space: normal; line-height: 1.55; }
  .benefits__section [class^="benefits__column"] > p:first-child { font-size: 18px; line-height: 1.35; }
  .benefits__section [class^="benefits__column"] > p:last-child { font-size: 14px; }
  .benefits__consultation-button { position: relative; inset: auto; width: 100%; height: auto; min-height: 110px; order: 10; }
  .benefits__layer-4 { width: auto; font-size: 20px; line-height: 1.4; }

  /* 06 — услуги: три колонки на планшете, одна на телефоне. */
  .services__section { display: flex; flex-direction: column; gap: 16px; }
  .services__section > .services__eyebrow { order: -3; }
  .services__section > h2 { order: -2; }
  .services__description { position: static; inset: auto; width: auto; white-space: normal; font-size: 16px; line-height: 1.6; order: -1; margin-bottom: 12px; }
  .services__section > [class^="services__row"] { position: relative; inset: auto; width: 100%; display: grid; grid-template-columns: minmax(160px, .8fr) minmax(0, 1.4fr) minmax(180px, 1fr); gap: 20px; padding: 22px 0; }
  .services__section > [class^="services__row"] > * { width: auto; min-width: 0; }
  .services__section > [class^="services__row"] > p { font-size: 15px; line-height: 1.65; }
  .services__section [class^="services__column"] > p { width: auto; min-width: 0; line-height: 1.5; }
  .services__section [class^="services__column"] > p:first-child { font-size: 18px; }
  .services__section [data-action="service"] { min-height: 44px; line-height: 1.5; }
  .services__section [data-action="contact"] { min-width: 118px; }
  .service-dialog { max-height: calc(100dvh - 100px); }

  /* 07 — этапы. */
  .process__section { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; }
  .process__section > .process__text { grid-column: 1 / -1; order: -2; }
  .process__section > .process__eyebrow { grid-column: 1 / -1; order: -3; }
  .process__section > [class^="process__column"] { position: relative; inset: auto; width: auto; padding: 12px 0; gap: 10px; }
  .process__column { order: 1; } .process__column-3 { order: 2; } .process__column-5 { order: 3; }
  .process__column-2 { order: 4; } .process__column-4 { order: 5; } .process__column-6 { order: 6; }
  .process__section [class^="process__row"] { font-size: 18px; gap: 8px; white-space: normal; }
  .process__section > [class^="process__column"] > p { width: auto; min-width: 0; font-size: 14px; line-height: 1.6; }

  /* 08 — композиция портрета, затем текст и кнопка в обычном потоке. */
  .site-canvas > .consultation__section { padding-top: 385px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
  .consultation__section > .consultation__layer { top: 90px; bottom: auto; height: 290px; width: 291px; }
  .consultation__section > .consultation__layer-3 { top: 64px; bottom: auto; height: 350px; width: 350px; }
  .consultation__section > .consultation__layer-5 { top: 78px; bottom: auto; height: 320px; width: 320px; }
  .consultation__section > :is(.consultation__layer, .consultation__layer-3, .consultation__layer-5) { mask-image: linear-gradient(#000 65%, transparent 98%); }
  .consultation__layer-7 { display: none; }
  .consultation__section > h2 { text-align: center; max-width: 850px; line-height: 1.35; }
  .consultation__section h2 span { line-height: inherit; }
  .consultation__description { position: static; inset: auto; transform: none; width: auto; max-width: 720px; font-size: 16px; line-height: 1.6; text-align: center; order: 1; }
  .consultation__button { position: relative; inset: auto; transform: none; width: auto; max-width: 100%; height: auto; padding: 16px 24px; order: 2; }
  .consultation__text-3 { font-size: 17px; line-height: 1.5; white-space: normal; }
  .consultation__section > .consultation__decoration { left: auto; right: 8%; top: 180px; width: 70px; height: 80px; }
  .consultation__section > .consultation__row { left: 8%; top: 180px; width: 70px; height: 80px; }
  .consultation__row .consultation__decoration-4 { width: 70px; height: 80px; }
  .consultation__section > :is(.consultation__decoration-2, .consultation__decoration-3, .consultation__row-2, .consultation__row-3) { display: none; }

  /* 09 — вопросы. Высота растёт вместе с открытыми ответами. */
  .faq__section { display: grid; grid-template-columns: minmax(200px, .65fr) minmax(0, 1.35fr); gap: 20px 28px; align-items: start; }
  .faq__section > .faq__eyebrow { grid-column: 1 / -1; order: -3; }
  .faq__section > h2 { grid-column: 1 / -1; order: -2; margin-bottom: 12px; }
  .faq__layer { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 375 / 368; grid-column: 1; grid-row: 3; }
  .faq__list { margin: 0; width: 100%; min-width: 0; grid-column: 2; grid-row: 3; }
  .faq__item summary { font-size: 16px; gap: 10px; padding: 14px 4px; min-height: 52px; }
  .faq__item summary > span { line-height: 1.5; }
  .faq__item summary > span:first-child { width: 32px; }
  .faq__answer { font-size: 14px; line-height: 1.75; padding: 4px 4px 22px; }

  /* 10 — контакты. */
  .contacts__section { display: grid; grid-template-columns: repeat(4, 56px) minmax(0, 1fr); gap: 18px 12px; }
  .contacts__section > .contacts__eyebrow { grid-column: 1 / -1; grid-row: 1; }
  .contacts__section > h2 { grid-column: 1 / -1; grid-row: 2; }
  .contacts__message { position: static; inset: auto; width: auto; font-size: 16px; line-height: 1.6; white-space: normal; grid-column: 1 / 5; grid-row: 3; }
  .contacts__message p, .contacts__message span { line-height: 1.65; }
  .contacts__section > [data-social] { position: relative; inset: auto; width: 56px; height: 56px; grid-row: 4; }
  .contacts__layer-2 { grid-column: 1; } .contacts__layer { grid-column: 2; } .contacts__layer-3 { grid-column: 3; } .contacts__layer-4 { grid-column: 4; }
  .contacts__section > .contacts__layer-5 { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 486 / 312; grid-column: 5; grid-row: 3 / 5; align-self: center; }
  .contacts__image-5 { object-fit: contain; }
}

@media (max-width: 899px) {
  .about__section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services__section > [class^="services__row"] { grid-template-columns: minmax(0, 1fr) minmax(180px, .8fr); }
  .services__section > [class^="services__row"] > p { grid-column: 1; grid-row: 2; }
  .services__section > [class^="services__row"] > :last-child { grid-column: 2; grid-row: 1 / 3; }
  .faq__section { grid-template-columns: minmax(0, 1fr); }
  .faq__layer { grid-column: 1; grid-row: 3; width: min(260px, 65%); justify-self: center; }
  .faq__list { grid-column: 1; grid-row: 4; }
  .process__section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contacts__section { grid-template-columns: repeat(4, 56px) minmax(0, 1fr); }
}

@media (max-width: 599px), (min-width: 600px) and (max-width: 999px) and (orientation: landscape) {
  .site-canvas > section, .site-canvas > footer { padding-block: 36px; }
  .site-header__inner { gap: 10px; }
  .site-header .hero__brand { font-size: 12px; }
  .site-header .hero__button { padding: 8px 10px; height: auto; min-height: 40px; }
  .site-header .hero__text-8 { font-size: 12px; white-space: normal; max-width: 100px; text-align: center; }
  .site-header__menu { font-size: 12px; padding: 10px; }
  .site-header .hero__navigation { flex-direction: column; align-items: stretch; gap: 0; }
  .site-canvas > .hero__section { grid-template-columns: minmax(0, 1fr); padding-top: 108px; gap: 18px; }
  .hero__title { font-size: clamp(27px, 7.4vw, 38px); }
  .hero__description { font-size: 15px; }
  .hero__layer-2 { grid-column: 1; grid-row: 5; max-width: 430px; justify-self: center; margin-top: 12px; }
  .hero__button-2 { width: 100%; }
  .works__section, .problems__section, .benefits__section { grid-template-columns: minmax(0, 1fr); }
  .works__section > [class^="works__column"] { min-height: 330px; aspect-ratio: 1.05; }
  .works__section > [class^="works__column"] > [class^="works__row"] { gap: 14px; }
  .works__section [class^="works__row"] > [class^="works__column"] { flex-basis: 100%; }
  .works__section [data-action="project"] { width: 100%; }
  .problems__section > [class*="-card"] { min-height: 0; }
  .about__section > .about__biography { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .about__biography > .about__layer-2 { grid-column: 1; grid-row: 1; min-height: 0; width: min(100%, 290px); aspect-ratio: 1; justify-self: center; }
  .about__biography-text { grid-column: 1; grid-row: 2; font-size: 14px; }
  .about__reviews-button { grid-column: 1; grid-row: 3; width: 100%; padding: 14px 10px; }
  .about__industries, .about__perspective { grid-column: 1 / -1; }
  .about__projects { order: 0; } .about__industries { order: 1; } .about__perspective { order: 2; }
  .services__section > [class^="services__row"] { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 24px; }
  .services__section > [class^="services__row"] > :first-child { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
  .services__section > [class^="services__row"] > :first-child > p { flex: 1; font-size: 18px; }
  .services__section > [class^="services__row"] > p { grid-column: 1; grid-row: 2; }
  .services__section > [class^="services__row"] > :last-child { grid-column: 1; grid-row: 3; gap: 4px; }
  .services__section > [class^="services__row"] > :last-child > div { align-items: flex-end; }
  .process__section { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .process__section [class^="process__row"] { font-size: 20px; }
  .site-canvas > .consultation__section { padding-top: 340px; }
  .consultation__section > .consultation__layer { top: 66px; width: 251px; height: 250px; }
  .consultation__section > .consultation__layer-3 { top: 40px; width: 302px; height: 302px; }
  .consultation__section > .consultation__layer-5 { top: 53px; width: 276px; height: 276px; }
  .consultation__section > .consultation__decoration { right: 12px; top: 170px; width: 28px; height: 34px; }
  .consultation__section > .consultation__row { left: 12px; top: 170px; width: 28px; height: 34px; }
  .consultation__row .consultation__decoration-4 { width: 28px; height: 34px; }
  .consultation__button { width: 100%; padding: 14px 20px; }
  .consultation__text-3 { font-size: 15px; }
  .contacts__section { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .contacts__section > h2, .contacts__message { grid-column: 1 / -1; }
  .contacts__section > [data-social] { justify-self: center; }
  .contacts__section > .contacts__layer-5 { grid-column: 1 / -1; grid-row: 5; width: min(100%, 430px); justify-self: center; }
  .contact-dialog h2 { font-size: 32px; }
  .contact-dialog__messengers { gap: 10px; }
}

@media (max-height: 500px) and (max-width: 999px) {
  .site-header .hero__navigation { max-height: calc(100dvh - 72px); overflow: auto; }
  .cookie-notice { max-height: calc(100dvh - 100px); overflow: auto; }
}
/* У длинных подписей кнопок есть доступная ширина для переноса. */
@media (max-width: 999px) {
  .consultation__text-3 { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  .hero__title span { display: block; }
}
@media (max-width: 599px), (min-width: 600px) and (max-width: 999px) and (orientation: landscape) {
  .services__section > [class^="services__row"] > :first-child { flex-wrap: wrap; }
  .services__section > [class^="services__row"] > :first-child > p { flex-basis: 100%; word-break: normal; }
}
@media (max-width: 999px) {
  /* Тот же порядок карточек, что при чтении десктопного макета по строкам. */
  .services__row-2 { order: 0; } .services__row { order: 1; }
  .services__row-4 { order: 2; } .services__row-3 { order: 3; }
  .services__row-5 { order: 4; } .services__row-6 { order: 5; }
  .benefits__card-4 { order: 0; } .benefits__card-6 { order: 1; }
  .benefits__card { order: 2; } .benefits__card-5 { order: 3; }
  .benefits__card-2 { order: 4; } .benefits__card-7 { order: 5; }
  .benefits__card-3 { order: 6; }
  .about__experience { order: 0; } .about__projects { order: 1; }
  .about__industries { order: 2; } .about__perspective { order: 3; }
}
