@media (max-width: 1279px) {
  .grid--services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* верхний ряд (2 колонки) — горизонтальную "шину" рисуем на grid, не на карточках */
  .step-card:nth-child(-n + 2)::after {
    display: none;
  }

  /* второй и последующие ряды (2 колонки) — линия между рядами по gap */
  .step-card:nth-child(n + 3) {
    --step-connector: 18px;
  }

  /* первая карточка в каждой строке (2 колонки) — без горизонтальной линии слева */
  .step-card:nth-child(4n + 1)::after {
    display: block;
  }

  .step-card:nth-child(2n + 1)::after {
    display: none;
  }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 500px);
  }

  .hero__title {
    font-size: 3.45rem;
  }

  body.page-home .hero__title {
    max-width: min(860px, 100%);
    font-size: clamp(38px, 3.9vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.03em;
  }
}

@media (max-width: 1023px) {
  .hero__grid,
  .dark-block__grid,
  .cta-block__grid,
  .system-shift__grid,
  .grid--courses,
  .grid--pain {
    grid-template-columns: 1fr;
  }

  .system-block__left h2 {
    font-size: 2rem;
  }

  .system-shift__visual {
    justify-content: center;
  }

  .system-shift__img {
    max-width: 100%;
  }

  .footer > .container.footer__grid {
    max-width: 1280px;
    margin-inline: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 32px;
  }

  .grid--vacancies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-title {
    font-size: 2.1rem;
  }

  .hero__title {
    font-size: 3rem;
  }

  body.page-home .hero__title {
    font-size: clamp(34px, 5.8vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.03em;
  }

  .dark-block,
  .cta-block {
    padding: 42px 34px;
  }
}

/* Экраны 1, 2, 5: hero, system-shift, «Наш подход» */
@media (max-width: 1022px) {
  .hero__notions {
    display: none;
  }

  .hero-visual__image-wrap {
    display: none;
  }

  .hero__aside,
  .hero__cards-grid {
    display: none;
  }

  body.page-home .hero__content,
  body.page-home .hero__aside {
    display: contents;
  }

  body.page-home .hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
  }

  body.page-home .hero__content {
    text-align: center;
  }

  body.page-home .hero-badge {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    text-align: center;
  }

  body.page-home .hero__title {
    grid-column: 1;
    grid-row: 2;
    text-align: center;
    max-width: 100%;
  }

  body.page-home .hero__text,
  body.page-home .hero__text--home-lead {
    grid-column: 1;
    grid-row: 3;
    text-align: center;
    max-width: 100%;
  }

  body.page-home .hero-visual__image-wrap {
    display: block;
    grid-column: 1;
    grid-row: 4;
    margin-top: 16px;
    width: min(100%, 440px);
    justify-self: center;
  }

  body.page-home .hero-visual__image {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
  }

  body.page-home .hero__actions {
    grid-column: 1;
    grid-row: 5;
    margin-top: 16px;
    justify-content: center;
    justify-self: center;
    width: 100%;
  }

  body.page-home .hero__cards-grid {
    display: none;
  }

  /* system-shift: весь текстовый блок по центру */
  .system-shift__grid {
    justify-items: center;
  }

  .system-block__left {
    margin-top: 0;
    width: 100%;
    max-width: min(100%, 560px);
    text-align: center;
  }

  .system-block__left h2 {
    text-align: center;
  }

  .system-block__text {
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
  }

  .system-block__why {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: min(100%, 520px);
    margin-top: 28px;
    margin-inline: auto;
    gap: 12px;
    text-align: center;
  }

  .system-block__why > div {
    min-width: 0;
    text-align: center;
  }

  .system-block__star {
    width: 100%;
    height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .system-block__star-icon {
    display: none;
  }

  .system-block__star-img {
    display: block;
    width: 100%;
    max-width: min(440px, 94vw);
    margin-inline: auto;
    border-radius: 0;
  }

  .system-block__why h3,
  .system-block__why p {
    text-align: center;
  }

  .system-block__note {
    text-align: center;
    margin-inline: auto;
  }

  .system-shift__visual {
    display: none;
  }

  /* «Наш подход»: по центру, схема под заголовком */
  .approach-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .approach-content {
    display: contents;
  }

  .approach-badge {
    order: 1;
    margin-inline: auto;
  }

  .approach-title {
    order: 2;
    text-align: center;
    width: 100%;
    max-width: min(100%, 560px);
    margin-inline: auto;
  }

  .approach-visual {
    order: 3;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: min(100%, 400px);
    margin: 28px auto 32px;
    padding: 0;
  }

  .approach-visual__img,
  .approach-visual img {
    width: 100%;
    max-width: min(300px, 78vw);
    height: auto;
    margin-inline: auto;
  }

  .approach-text {
    order: 4;
    max-width: min(100%, 560px);
    margin-inline: auto;
    text-align: center;
  }

  .approach-text p {
    text-align: center;
  }

  .approach-accent {
    order: 5;
    width: fit-content;
    max-width: min(100%, 430px);
    margin-inline: auto;
    padding-left: 24px;
    padding-top: 0;
    text-align: left;
  }

  .approach-accent::before {
    left: 0;
    top: 3px;
    transform: none;
    width: 2px;
    height: calc(100% - 6px);
  }
}

/* Блок заявки (экран 6): компактнее текст и форма */
@media (max-width: 966px) {
  #requestForm {
    overflow-x: visible;
  }

  #requestForm .container {
    display: flex;
    justify-content: center;
    overflow: visible;
  }

  .cta-block {
    width: 100%;
    max-width: min(640px, calc(100% - 4px));
    margin-inline: auto;
    padding: 20px 14px;
    border-radius: 20px;
    overflow: visible;
    background: #fffdfa;
    box-shadow: 0 0 0 1px rgba(213, 207, 198, 0.88);
  }

  .cta-block::before {
    display: none;
  }

  .cta-block__grid {
    gap: 16px;
  }

  #requestForm .section-title {
    font-size: clamp(1.32rem, 4.2vw, 1.62rem);
    line-height: 1.18;
    letter-spacing: -0.03em;
  }

  .cta-block__text {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.62;
    max-width: 100%;
  }

  .cta-form {
    padding: 14px;
    border-radius: 18px;
    overflow: visible;
    background: #fff;
  }

  .cta-form.card--border::after {
    border-radius: 18px;
  }

  .cta-form .form-fields {
    gap: 10px;
  }

  .cta-form .field {
    padding: 10px 12px;
    font-size: 0.88rem;
    border-radius: 12px;
  }

  .cta-form .field--select {
    padding-right: 40px;
  }

  .cta-form .field--textarea {
    min-height: 76px;
  }

  .cta-form .select-arrow {
    right: 10px;
    width: 24px;
    height: 24px;
  }

  .cta-form .button--full {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.88rem;
    border-radius: 12px;
  }
}

/* Офферы: контент по центру */
@media (max-width: 984px) {
  .offer-card {
    align-items: center;
    text-align: center;
  }

  .offer-card__top {
    justify-content: center;
    width: 100%;
  }

  .offer-card__title {
    text-align: center;
  }

  .offer-card__main {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
  }

  .offer-card__text {
    text-align: center;
    max-width: 100%;
  }

  .offer-card__art {
    justify-content: center;
    width: 100%;
  }

  .offer-card__svg,
  .offer-card__img {
    margin-inline: auto;
  }

  .offer-card__more {
    align-self: center;
  }
}

/* Офферы: компактные карточки */
@media (max-width: 855px) {
  .offers-dual-grid {
    gap: 14px;
  }

  .offer-card {
    padding: 24px 20px;
    gap: 14px;
    border-radius: 16px;
  }

  .offer-card__top {
    gap: 10px;
  }

  .offer-card__icon--pulse-mark,
  .offer-card__icon--search-mark {
    width: 44px;
    height: 44px;
  }

  .offer-card__title {
    font-size: 1.02rem;
    line-height: 1.22;
  }

  .offer-card__main {
    gap: 12px;
  }

  .offer-card__text {
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .offer-card__art {
    min-height: 72px;
  }

  .offer-card__svg,
  .offer-card__img {
    max-width: 140px;
  }

  .offer-card__more {
    padding: 8px 16px;
    font-size: 0.82rem;
  }
}

@media (max-width: 767px) {
  :root {
    /* фактическая высота шапки на мобилке (под панель меню) */
    --mobile-header-height: 76px;
  }

  .header {
    z-index: 1000;
  }

  .container {
    padding-left: clamp(16px, 4.5vw, 22px);
    padding-right: clamp(16px, 4.5vw, 22px);
  }

  .header__inner {
    gap: 16px;
    justify-content: space-between;
  }

  .header__nav {
    display: none;
  }

  .header > .header__mobile {
    display: none;
  }

  .header__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(213, 207, 198, 0.9);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
    color: var(--black);
  }

  .header__burger-lines {
    position: relative;
    width: 18px;
    height: 12px;
    display: block;
  }

  .header__burger-lines::before,
  .header__burger-lines::after,
  .header__burger-lines {
    background: transparent;
  }

  .header__burger-lines::before,
  .header__burger-lines::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 2px;
    background: rgba(9, 9, 11, 0.86);
  }

  .header__burger-lines::before {
    top: 0;
    box-shadow: 0 5px 0 rgba(9, 9, 11, 0.86);
  }

  .header__burger-lines::after {
    bottom: 0;
  }

  /* Скрываем CTA в шапке — она будет в меню */
  .header__inner > .button.button--small,
  .header__inner > a.button.button--small {
    display: none;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .header > .header__mobile.is-open {
    display: block;
  }

  .header__mobile {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--mobile-header-height);
    bottom: 0;
    z-index: 1001;
  }

  .header__mobile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.5);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    backdrop-filter: blur(14px) saturate(1.05);
  }

  .header__mobile-panel {
    position: relative;
    width: 100%;
    min-height: calc(100dvh - var(--mobile-header-height));
    border-radius: 0;
    border: 0;
    background: #fffcf8;
    box-shadow: 0 24px 60px rgba(19, 20, 22, 0.12);
    padding: 20px;
    display: grid;
    gap: 14px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header__mobile-nav {
    display: grid;
    gap: 8px;
  }

  .header__mobile-group {
    display: grid;
    gap: 8px;
  }

  .header__mobile-group > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 10px 10px;
    border-radius: 12px;
    color: rgba(47, 44, 41, 0.92);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header__mobile-group > summary::-webkit-details-marker {
    display: none;
  }

  .header__mobile-group > summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(47, 44, 41, 0.7);
    border-bottom: 2px solid rgba(47, 44, 41, 0.7);
    transform: rotate(45deg);
    transition: transform var(--ease);
    margin-left: 10px;
    flex: 0 0 auto;
  }

  .header__mobile-group[open] > summary::after {
    transform: rotate(225deg);
  }

  .header__mobile-subnav {
    display: grid;
    gap: 6px;
    padding-left: 10px;
  }

  .header__mobile-nav a {
    padding: 10px 10px;
    border-radius: 12px;
    border: 0;
    background: transparent;
    color: rgba(47, 44, 41, 0.92);
    font-weight: 600;
    font-size: 0.9rem;
  }

  .header__mobile-subnav a {
    padding: 8px 10px;
    font-weight: 600;
    font-size: 0.86rem;
    opacity: 0.92;
  }

  .header__mobile-cta {
    width: 170px;
    justify-self: center;
    justify-content: center;
    height: 46px;
    min-height: 46px;
    padding: 8px 8px;
    font-size: 13px;
  }

  .hero__grid {
    gap: 32px;
    padding-top: 68px;
    padding-bottom: 84px;
  }

  .eyebrow {
    font-size: 0.62rem;
    padding: 5px 10px;
    margin-bottom: 12px;
    letter-spacing: 0.15em;
  }

  .hero__title {
    font-size: 2.35rem;
  }

  body.page-home .hero__title {
    font-size: clamp(30px, 7.2vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.03em;
  }

  .hero__text {
    font-size: 1rem;
    line-height: 1.8;
  }

  .hero__cards-grid,
  .grid--services,
  .grid--automations,
  .grid--steps,
  .grid--vacancies {
    grid-template-columns: 1fr;
  }

  .service-picker {
    grid-template-columns: 1fr;
  }

  /* На мобильных соединительные линии не нужны */
  .grid--steps {
    padding-top: 0;
  }

  .step-card::before,
  .step-card::after {
    display: none;
  }

  .section {
    padding: 68px 0;
  }

  .section--pb-small {
    padding-top: 0;
    padding-bottom: 68px;
  }

  .section-title {
    font-size: 26px;
  }

  .card,
  .service-card,
  .step-card,
  .vacancy-card,
  .pain-card {
    padding: 22px;
  }

  .cta-form {
    padding: 14px;
  }

  .pain-card {
    grid-template-columns: 1fr;
  }

  .dark-block {
    padding: 30px 20px;
    border-radius: 28px;
  }

  .footer > .container.footer__grid {
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 42px;
    padding-bottom: 42px;
    text-align: center;
    justify-items: center;
  }

  /* Мобилка: в футере оставляем только бренд + контакты */
  .footer > .container.footer__grid > :nth-child(2),
  .footer > .container.footer__grid > :nth-child(3) {
    display: none;
  }

  .footer__text {
    max-width: 34ch;
    margin-left: auto;
    margin-right: auto;
  }

  .footer__list {
    justify-items: center;
  }
}

@media (max-width: 479px) {
  .header__inner {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .button--small {
    width: 100%;
  }

  .hero__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero__actions .button {
    width: 100%;
  }

  .hero__title {
    font-size: 2rem;
  }

  body.page-home .hero__title {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.03em;
  }

  .course-card__head,
  .vacancy-card__top,
  .step-card__head {
    align-items: flex-start;
  }

  /* Центрируем “иконки/цифры/тексты” на мобилке:
     index.html (page-home) + страницы курсов (page-automation/page-finance) */
  body.page-home .service-card,
  body.page-home .pain-card,
  body.page-home .step-card,
  body.page-home .vacancy-card,
  body.page-automation .service-card,
  body.page-finance .service-card {
    text-align: center;
  }

  body.page-home .service-card__icon,
  body.page-home .pain-card__icon,
  body.page-home .step-card__icon,
  body.page-home .vacancy-card__icon {
    margin-left: auto;
    margin-right: auto;
  }

  body.page-home .step-card__head {
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-direction: column;
  }

  body.page-home .step-card__label {
    width: 100%;
    text-align: center;
  }

  body.page-home .pain-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  body.page-home .vacancy-card__top {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
  }

  body.page-home .vacancy-card__text {
    text-align: center;
  }

  body.page-home .section-head,
  body.page-home .section-title,
  body.page-home .hero__title,
  body.page-home .hero__text,
  body.page-home .hero-badge,
  body.page-home .cta-block__text {
    text-align: center;
  }

  body.page-home .hero__content {
    text-align: center;
  }

  body.page-home .card--course .card__title {
    text-align: center;
  }
}

@media (max-width: 767px) {
  body.page-finance .course-hero {
    padding: 48px 0 48px !important;
  }

  body.page-finance .course-hero__inner {
    display: grid !important;
    grid-template-columns: 1fr !important;
    row-gap: 18px !important;
    align-items: start !important;
  }

  body.page-finance .course-hero__content {
    display: contents !important;
  }

  body.page-finance .course-hero .eyebrow {
    grid-row: 1 !important;
    grid-column: 1 !important;
    max-width: 100% !important;
    width: fit-content !important;
    font-size: 10px !important;
    line-height: 1.45 !important;
    letter-spacing: 0.16em !important;
    padding: 6px 10px !important;
    margin: 0 !important;
  }

  body.page-finance .course-hero__title {
    grid-row: 2 !important;
    grid-column: 1 !important;
    max-width: 100% !important;
    font-size: clamp(38px, 11vw, 48px) !important;
    line-height: 0.98 !important;
    letter-spacing: -0.05em !important;
    margin: 0 !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  body.page-finance .course-hero__text {
    grid-row: 3 !important;
    grid-column: 1 !important;
    max-width: 100% !important;
    font-size: 17px !important;
    line-height: 1.75 !important;
    margin: 0 !important;
  }

  body.page-finance .course-hero .eyebrow,
  body.page-finance .course-hero__title,
  body.page-finance .course-hero__text {
    text-align: center !important;
  }

  body.page-finance .course-hero .imag {
    grid-row: 4 !important;
    grid-column: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 10px !important;
    border-radius: 26px !important;
    padding: 10px !important;
  }

  body.page-finance .course-hero .imag img {
    width: 100% !important;
    height: auto !important;
    border-radius: 20px !important;
  }

  body.page-finance .course-hero__actions {
    grid-row: 5 !important;
    grid-column: 1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-top: 4px !important;
  }

  body.page-finance .course-hero__actions .button {
    width: 100% !important;
    min-height: 54px !important;
    justify-content: center !important;
    font-size: 15px !important;
  }

  body.page-finance .schedule__row {
    text-align: center !important;
  }

  body.page-finance .schedule__date,
  body.page-finance .schedule__desc {
    text-align: center !important;
  }

  .system-block__left h2 {
    font-size: 1.75rem;
  }

  .system-block__text {
    font-size: 0.96875rem;
  }

  .system-block__why {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: min(100%, 520px);
    margin-inline: auto;
    gap: 12px;
    text-align: center;
  }

  .system-block__why > div {
    min-width: 0;
    text-align: center;
  }

  .system-block__why h3,
  .system-block__why p {
    text-align: center;
  }

  .system-block__star {
    width: 100%;
    height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .system-block__star-icon {
    display: none;
  }

  .system-block__star-img {
    display: block;
    width: 100%;
    max-width: min(440px, 94vw);
    margin-inline: auto;
    border-radius: 0;
  }

  .system-shift__visual {
    display: none;
  }
}
