/* =========================================================
   Адаптив
   ≥1530px      — макет 1:1 (1rem = 10px)
   1100–1529px  — десктоп масштабируется пропорционально (rem от ширины)
   ≤1099px      — планшет / мобильная версия (1rem = 10px)
   ========================================================= */

/* ---------- Пропорциональный десктоп ---------- */
@media (min-width: 1100px) and (max-width: 1529.98px) {
  html {
    font-size: calc(100vw / 153);
  }
}

/* ---------- Планшет и мобильная версия ---------- */
@media (max-width: 1099.98px) {
  :root {
    --gutter: 2rem;
  }

  .h2 { font-size: 2.8rem; line-height: 1.2; }
  .h4 { font-size: 2rem; }
  .h2 br, .hero__title br, .consult__title br { display: none; }

  .section-head { gap: 1.6rem; }

  .btn--lg { padding: 1.8rem 2.4rem; }

  /* шапка */
  .header__inner {
    height: 6.4rem;
    padding: 0 var(--gutter);
  }

  .logo img { width: 8.8rem; }

  .header__contacts { display: none; }

  .burger {
    position: relative;
    display: block;
    width: 4rem;
    height: 4rem;
  }

  .burger span {
    position: absolute;
    left: 0.8rem;
    width: 2.4rem;
    height: 2px;
    background-color: var(--color-white);
    transition: transform var(--transition), opacity var(--transition), top var(--transition);
  }

  .burger span:nth-child(1) { top: 1.3rem; }
  .burger span:nth-child(2) { top: 1.9rem; }
  .burger span:nth-child(3) { top: 2.5rem; }

  .burger.is-active span:nth-child(1) { top: 1.9rem; transform: rotate(45deg); }
  .burger.is-active span:nth-child(2) { opacity: 0; }
  .burger.is-active span:nth-child(3) { top: 1.9rem; transform: rotate(-45deg); }

  .nav {
    position: fixed;
    top: 6.4rem;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4rem;
    padding: 3.2rem var(--gutter) 4rem;
    overflow-y: auto;
    background-color: var(--color-graphite);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1rem);
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
  }

  .nav__link { font-size: 2.4rem; font-weight: 500; }

  .nav__contacts {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--color-white);
  }

  .nav__phone { font-size: 2rem; }
  .nav__email { color: var(--color-white-muted); }

  /* первый экран */
  .hero__inner {
    flex-direction: column;
    min-height: 0;
    padding: 2rem var(--gutter) 4rem;
  }

  .hero__aside { display: contents; }

  .hero__crumbs {
    order: 1;
    width: auto;
    height: auto;
    padding: 0 0 4rem;
    border: none;
  }

  .hero__content {
    order: 2;
    gap: 3.2rem;
    padding: 0;
  }

  .hero__title { font-size: 3.2rem; }

  .hero__btns {
    flex-direction: column;
    align-self: stretch;
    gap: 1rem;
  }

  .hero__lead {
    order: 3;
    width: auto;
    margin-top: 3.2rem;
    padding: 2.4rem 0 0;
    font-size: 1.6rem;
    border-bottom: none;
    border-top: 1px solid var(--color-line-dark);
  }

  .hero__tags {
    order: 4;
    padding: 2rem 0 0;
  }

  /* секции с колонкой */
  .section-split__inner { flex-direction: column; }

  .section-split__aside {
    order: 2;
    width: auto;
    padding: 0 var(--gutter);
    border-right: none;
  }

  .section-split__main { order: 1; }

  .section-split__spacer { display: none; }

  .feature-list__item { padding: 2rem 0; }
  .feature-list__item:first-child { border-top: 1px solid var(--color-line); }
  .feature-list__item:last-child { border-bottom: none; }
  .feature-list__title { font-size: 1.6rem; }

  /* задача */
  .task__head { padding: 6rem var(--gutter) 3.2rem; border-bottom: none; }
  .task__content { padding: 0 var(--gutter) 4rem; }

  .levels {
    width: auto;
    height: 31.5rem;
    margin-right: calc(var(--gutter) * -1);
    padding-right: var(--gutter);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .levels::-webkit-scrollbar { display: none; }

  /* состав */
  .sostav__inner { gap: 3.2rem; padding: 6rem 0 0; }
  .sostav__head { padding: 0 var(--gutter); }

  .sostav .scheme {
    width: 100%;
    height: auto;
    aspect-ratio: 1490 / 739;
  }

  .scheme__leader,
  .scheme__callout { display: none; }

  /* жертвенная логика */
  .sacrifice__inner { padding: 4rem 0 0; }
  .sacrifice__box { gap: 3.2rem; padding: 6rem var(--gutter); }
  .sacrifice__head { flex-direction: column; align-items: stretch; gap: 3.2rem; }
  .sacrifice__btn { width: 100%; }
  .sacrifice__cards { grid-template-columns: 1fr; }
  .dark-card { min-height: 0; }
  .dark-card__title { font-size: 2rem; }

  /* проектирование */
  .design__main { gap: 3.2rem; padding: 6rem var(--gutter) 4rem; }
  .design__aside { gap: 2.4rem; padding-top: 0; padding-bottom: 6rem; }
  .design__subtitle { font-size: 2rem; }

  .stages {
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    padding: 2.4rem 2rem;
  }

  .stages__item {
    position: static;
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--color-line);
  }

  .stages__item:last-of-type { border-bottom: none; }

  .stages__title,
  .stages__item--4 .stages__title {
    position: static;
    width: auto;
    margin-top: 0.8rem;
    font-size: 2rem;
    white-space: normal;
  }

    .stages__lines { display: none; }

  /* применение */
  .usage__aside { padding-left: var(--gutter); }
  .usage__head { padding: 6rem var(--gutter) 3.2rem; border-bottom: none; }
  .usage__content { width: auto; gap: 3.2rem; padding: 0 var(--gutter) 4rem; }
  .objects { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .object__name { font-size: 1.6rem; }

  /* связанные решения */
  .related { gap: 3.2rem; }
  .related__head { flex-direction: column; }
  .related__caption { order: 2; width: auto; padding: 0 var(--gutter) 3.2rem; border-right: none; }
  .related__title { order: 1; padding: 6rem var(--gutter) 1.6rem; }
  .related__cards { grid-template-columns: 1fr; padding: 0 var(--gutter); }
  .solution { height: 44.5rem; }
  .solution__media { left: auto; width: 43.1rem; opacity: 0.9; }

  /* результат */
  .result__inner { gap: 3.2rem; padding: 6rem var(--gutter); }
  .result__head { padding-left: 0; }

  .mosaic {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: auto;
    height: auto;
    margin: 0;
  }

  .r-card {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    min-height: 22rem;
  }

  .r-card--stage,
  .r-card--continuity,
  .r-card--build,
  .r-card--repair { left: auto; top: auto; width: auto; padding: 2rem; }

  .r-card__title { font-size: 2rem; }
  .r-card__text { margin-top: 4rem; font-size: 1.6rem; }

  .r-card--risk { left: auto; top: auto; width: auto; padding: 2rem; }
  .risk-stat { position: relative; left: auto; top: auto; margin-top: 2.4rem; align-self: flex-start; }

  .risk-chart {
    position: relative;
    inset: auto;
    height: 22rem;
    margin: 2rem -2rem 0;
    overflow: hidden;
  }

  .risk-chart__graph { left: -4rem; top: 1rem; }
  .risk-chart__dot { left: 26rem; }
  .risk-chart__dot--high { top: 1.5rem; }
  .risk-chart__dot--low { top: 12.1rem; }
  .risk-chart__note--high { left: 28rem; top: 1rem; }
  .risk-chart__note--low { left: 28rem; top: 11.6rem; }

  .r-card--single { left: auto; top: auto; width: auto; height: auto; aspect-ratio: 433 / 562; }

  /* документы */
  .docs__inner {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 6rem var(--gutter) 0;
  }

  .docs__line,
  .docs__timeline { display: none; }

  .docs__left,
  .docs__right,
  .docs__block,
  .docs__left .doc-item { position: static; }

  .docs__right { order: 1; display: flex; flex-direction: column; gap: 3.2rem; }
  .docs__left { order: 2; display: flex; flex-direction: column; gap: 3.2rem; margin-top: 4rem; }
  .docs__block { width: auto !important; }
  .docs__list, .docs__norm, .docs__note, .doc-item__text { font-size: 1.6rem; }
  .docs__norm b { font-size: 2rem; }
  .btn--doc, .doc-item--1 .btn--doc { width: 100%; margin-top: 1.6rem; }
  .btn--outline { padding: 1.8rem 2.4rem; }

  .docs__photo {
    position: relative;
    order: 3;
    right: auto;
    top: auto;
    width: calc(100% + var(--gutter) * 2);
    height: 20rem;
    margin: 4rem calc(var(--gutter) * -1) 0;
  }

  .docs__photo img { top: 0; height: 100%; object-fit: cover; }

  /* заголовок с подписью */
  .split-head { flex-direction: column-reverse; align-items: flex-start; gap: 1.6rem; }
  .split-head__caption, .need__caption { width: auto; padding-right: 0; }

  /* вопросы */
  .faq__inner { gap: 3.2rem; padding: 6rem var(--gutter) 4rem; }
  .faq-item__head { gap: 1.2rem; padding: 1.6rem; font-size: 1.6rem; }
  .faq-item__num { width: auto; }
  .faq-item__icon { font-size: 2.8rem; }
  .faq-item__body { padding: 0 1.6rem 1.6rem; font-size: 1.6rem; }

  /* что нужно */
  .need__inner { gap: 3.2rem; padding: 2rem var(--gutter) 6rem; }
  .need__cards { grid-template-columns: repeat(2, 1fr); }
  .need-card { min-height: 14rem; font-size: 1.6rem; }

  /* консультация */
  .consult__inner { flex-direction: column; gap: 3.2rem; min-height: 0; padding: 4rem var(--gutter) 6rem; }
  .consult__card { width: 100%; height: 50rem; }
  .consult__title { right: 2rem; font-size: 2.8rem; }
  .consult__text { width: auto; right: 2rem; }
  .consult__photo { left: auto; right: 0; top: auto; bottom: 0; width: 24rem; height: 32.6rem; }
  .consult__icon { display: none; }

  .form { width: 100%; grid-template-columns: 1fr 1fr; }
  .form__bottom { flex-direction: column; align-items: stretch; gap: 2rem; }
  .form__submit { width: 100%; }

  /* подвал */
  .footer__inner { padding: 4rem var(--gutter) 3rem; }
  .footer__top { flex-direction: column; gap: 4rem; }
  .footer__logo img { width: 16rem; }
  .footer__cols { flex-wrap: wrap; gap: 3.2rem 4rem; }
  .footer__bottom { flex-direction: column; gap: 1.2rem; margin-top: 4rem; }
}

/* ---------- Телефоны ---------- */
@media (max-width: 599.98px) {
  .form { grid-template-columns: 1fr; }
  .need__cards { grid-template-columns: 1fr 1fr; }
  .objects { grid-template-columns: 1fr 1fr; }
  .object { height: 15rem; }
  .object__img { height: 8.4rem; }

  .solution__media { width: 30rem; opacity: 0.6; }
  .solution__title, .solution__text { max-width: 60%; }
  .solution__btn { left: 2rem; right: 2rem; width: auto; }

  .consult__card { height: 54rem; }
  .consult__photo { width: 20rem; height: 27rem; }
}
