/* ==========================================================================
   layout.css — топбар, шапка, секции, сетки блоков, футер
   ========================================================================== */

/* ------------------------------- Топбар --------------------------------- */

.topbar {
  background: var(--dark);
  color: rgba(255, 255, 255, .78);
  font-size: .85rem;
}

.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  min-height: 44px;
}

.topbar__contacts { display: flex; flex-wrap: wrap; gap: 6px 22px; }

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 1.05em;
}
.topbar__link:hover { color: #fff; }
.topbar__link .ico { font-size: 1.1em; color: var(--brand); }

.topbar__side { display: flex; align-items: center; gap: 14px; }

.topbar__social {
  display: inline-flex;
  color: rgba(255, 255, 255, .7);
  font-size: 1.15rem;
}
.topbar__social:hover { color: var(--brand); }

/* ------------------------------- Шапка ---------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #fff;
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}
.header.is-stuck { box-shadow: var(--shadow-sm); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
  transition: min-height .3s var(--ease);
}
.header.is-stuck .header__inner { min-height: 72px; }

.header__logo { display: block; flex: none; }
.header__logo img {
  width: auto;
  height: 66px;
  transition: height .3s var(--ease);
}
.header.is-stuck .header__logo img { height: 52px; }

/* ----------------------------- Навигация -------------------------------- */

.nav__list { display: flex; align-items: center; gap: 4px; }

.nav__list a {
  position: relative;
  display: block;
  padding: 10px 14px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.nav__list a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav__list a:hover { color: var(--brand); }
.nav__list a:hover::after,
.nav__list a.is-current::after { transform: scaleX(1); }
.nav__list a.is-current { color: var(--brand); }

.nav__close { display: none; }

/* ------------------------------- Секции --------------------------------- */

.section { padding: clamp(56px, 7vw, 104px) 0; }
.section--alt { background: var(--bg-alt); }
/* Служебная полоса (аккредитации): не должна спорить по весу с основными секциями */
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }

.section__head {
  max-width: 720px;
  margin: 0 auto clamp(32px, 4vw, 56px);
  text-align: center;
}
.section__title { margin-bottom: .35em; }
.section__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 18px auto 0;
  background: var(--brand);
  border-radius: 2px;
}
.section__lead { color: var(--body); font-size: 1.05rem; }

/* Заголовок вне .section__head (например в «О компании») — линия слева */
.about__aside .section__title::after { margin-inline: 0; }

/* ------------------------------- Цифры ---------------------------------- */

.stats {
  padding: clamp(28px, 3.5vw, 44px) 0;
  background: var(--brand);
  color: #fff;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat + .stat { border-left: 1px solid rgba(255, 255, 255, .22); }

.stat__num { font-size: 2.4rem; font-weight: 900; line-height: 1.1; }
.stat__num--sm { font-size: 1.15rem; font-weight: 800; }
.stat__label { font-size: .85rem; color: rgba(255, 255, 255, .82); }

/* ------------------------ Основные направления -------------------------- */

.offers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
  margin-bottom: clamp(36px, 4.5vw, 60px);
}

@media (max-width: 899px) {
  .offers { grid-template-columns: 1fr; }
}

/* --------------------------- Аккредитации ------------------------------- */

.creds__logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 920px;
  margin-inline: auto;
}

/* ----------------------------- О компании ------------------------------- */

/* Заголовок с акцентом слева, текст справа: колонка текста остаётся узкой
   (так он читается легче), но секция при этом занимает всю ширину */
.about {
  display: grid;
  grid-template-columns: minmax(230px, 0.66fr) 1.34fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

/* Заголовок остаётся на виду, пока читается длинный текст справа */
.about__aside { position: sticky; top: calc(var(--header-h) + 28px); }

/* --------------------- Миссия / видение / ценности ---------------------- */

.mvv {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.mvv__media { position: sticky; top: calc(var(--header-h) + 24px); }
.mvv__media img { width: 100%; height: auto; }

.mvv__list { display: grid; gap: 28px; }

/* ------------------------------ Контакты -------------------------------- */

.contact {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

/* ------------------------------- Футер ---------------------------------- */

.footer {
  padding: clamp(48px, 6vw, 80px) 0 0;
  background: var(--dark);
  color: rgba(255, 255, 255, .7);
  font-size: .95rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: clamp(28px, 4vw, 56px);
}

.footer__logo {
  height: 62px;
  width: auto;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: #fff;
  border-radius: var(--radius-sm);
}

/* Знаки отличия под описанием компании: у файлов белый непрозрачный фон,
   поэтому на тёмном футере каждый получает свою белую подложку */
.footer__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

.footer__badge {
  height: 46px;
  width: auto;
  padding: 6px 10px;
  background: #fff;
  border-radius: var(--radius-sm);
}

.footer__title {
  margin-bottom: 18px;
  color: #fff;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer__title--follow { margin-top: 28px; }

.footer__text { color: rgba(255, 255, 255, .62); }

.footer__nav { display: grid; gap: 10px; }
.footer__nav a { color: rgba(255, 255, 255, .7); }
.footer__nav a:hover { color: var(--brand); }

.footer__social { display: flex; gap: 12px; font-size: 1.2rem; }
.footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border-radius: 50%;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.footer__social a:hover { background: var(--brand); transform: translateY(-2px); }

.footer__bottom {
  margin-top: clamp(36px, 5vw, 56px);
  padding-block: 22px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem;
  color: rgba(255, 255, 255, .5);
  text-align: center;
}

/* ============================== Адаптив ================================= */

@media (max-width: 1023px) {
  .about { grid-template-columns: 1fr; gap: 28px; }
  .about__aside { position: static; }

  .mvv { grid-template-columns: 1fr; }
  .mvv__media { position: static; max-width: 320px; margin-inline: auto; }

  .contact { grid-template-columns: 1fr; }

  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__col:first-child { grid-column: 1 / -1; }
}

/* Бургер-меню */
@media (max-width: 899px) {
  :root { --header-h: 74px; }

  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 90;
    width: min(320px, 84vw);
    padding: 84px 24px 32px;
    background: #fff;
    box-shadow: var(--shadow-lg);
    transform: translateX(105%);
    transition: transform .35s var(--ease);
    overflow-y: auto;
  }
  .nav.is-open { transform: none; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__list a { padding: 14px 12px; font-size: 1.05rem; }
  .nav__list a::after { display: none; }
  .nav__list a.is-current { background: var(--brand-light); }

  .nav__close {
    display: inline-flex;
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px;
    font-size: 1.4rem;
    background: none;
    border: 0;
    cursor: pointer;
  }

  .header__logo img { height: 52px; }
  .header.is-stuck .header__logo img { height: 46px; }

  /* Плиток три: две в ряд, третья на всю ширину под ними */
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:last-child { grid-column: 1 / -1; border-left: 0; }
}

@media (max-width: 639px) {
  body { font-size: 16px; }

  /* Основной логотип во всю ширину, два знака отличия под ним */
  .creds__logos { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .creds__logo:first-child { grid-column: 1 / -1; }

  .topbar { font-size: .8rem; }
  .topbar__inner { justify-content: center; text-align: center; }
  .topbar__contacts { justify-content: center; gap: 4px 16px; }
  /* На узких экранах в топбаре остаётся только телефон — почта дублируется
     в секции контактов и в футере */
  .topbar__contacts .topbar__link:nth-child(2) span:last-child { display: none; }

  .footer__grid { grid-template-columns: 1fr; }
}
