/* ==========================================================================
   МК-Инжиниринг — стили сайта
   Цвета, шрифты и отступы собраны в переменных ниже (:root).
   Чтобы поменять, например, акцентный цвет — измените --accent.
   ========================================================================== */

@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-cyrillic-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Цвета */
  /* Цвета логотипа: бирюзовый #00A0AA и зелёный #80C038.
     Яркие оттенки — для крупных акцентов и линий,
     глубокие — для текста и кнопок (чтобы читалось). */
  --brand-teal: #00A0AA;
  --brand-green: #80C038;
  --bg: #F3F6F5;          /* светлый фон с лёгким бирюзовым оттенком */
  --surface: #FFFFFF;     /* белые поверхности */
  --ink: #1C2426;         /* графитовый текст */
  --ink-2: #53605F;       /* второстепенный текст */
  --line: #D2DBD9;        /* тонкие разделители */
  --accent: #00747C;      /* бирюзовый логотипа, глубокий — для текста */
  --accent-ink: #00595F;
  --green-ink: #447A16;   /* зелёный логотипа, глубокий — для текста */

  --btn-bg: #00747C;           /* основная кнопка — бирюза */
  --btn-text: #FFFFFF;
  --btn-hover: #447A16;        /* при наведении — зелёный */
  --media-bg: #DCE5E3;         /* фон под фото, пока оно грузится */
  --inverse-bg: #00646B;       /* блок «Преимущества» — глубокая бирюза */
  --inverse-text: #F1FAFA;
  --inverse-line: rgba(255, 255, 255, .24);
  --header-bg: var(--bg);

  /* Типографика */
  --font-display: var(--font);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-lead: clamp(1.25rem, 1.06rem + 0.75vw, 1.75rem);
  --fs-h2: clamp(2rem, 1.4rem + 2.3vw, 3.5rem);
  --fs-h3: clamp(1.3rem, 1.15rem + 0.6vw, 1.75rem);
  --fs-hero: clamp(2.6rem, 1.3rem + 4.6vw, 5.75rem);

  /* Сетка и отступы */
  --gutter: clamp(20px, 4vw, 64px);
  --gap: clamp(16px, 2vw, 32px);
  --section: clamp(88px, 10vw, 168px);
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--btn-text); }

.container { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px;
}
.skip-link:focus { top: 12px; }

/* ---------- Кнопки и ссылки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px;
  background: var(--btn-bg); color: var(--btn-text);
  font-weight: 500; font-size: 1rem; letter-spacing: 0.005em;
  border: 1px solid var(--btn-bg);
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn:hover { background: var(--btn-hover, var(--accent)); border-color: var(--btn-hover, var(--accent)); }
.btn--small { min-height: 42px; padding: 0 20px; font-size: 0.9375rem; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.link-call {
  position: relative; font-weight: 500; padding-block: 6px;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: color .3s var(--ease), background-size .4s var(--ease);
}
.link-call:hover { color: var(--accent); background-size: 0% 1px; background-position: right bottom; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Шапка ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--header-bg); /* сплошной фон: текст никогда не просвечивает */
  border-bottom: 1px solid transparent;
  transition: border-color .35s var(--ease);
}
.header.is-scrolled, .header.is-open { border-bottom-color: var(--line); }
/* Тонкая полоса цветов логотипа над шапкой */
.header::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-teal) 0 50%, var(--brand-green) 50% 100%);
}
.header__inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand__mark { width: 40px; height: auto; }
.brand__text { display: grid; line-height: 1.1; }
.brand__name { font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand__tag { font-size: 0.8125rem; color: var(--ink-2); margin-top: 3px; }

.nav { display: flex; gap: 28px; margin-left: auto; font-size: 0.9375rem; }
.nav a {
  position: relative; padding-block: 6px; color: var(--ink);
  transition: color .3s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav a:hover { color: var(--accent); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.header__actions { display: flex; align-items: center; gap: 20px; }
.header__phone { font-weight: 500; font-feature-settings: "tnum" 1; white-space: nowrap; transition: color .3s var(--ease); }
.header__phone:hover { color: var(--accent); }
.header__call, .menu-toggle { display: none; }

.menu-toggle__lines, .menu-toggle__lines::before, .menu-toggle__lines::after {
  display: block; width: 20px; height: 1.6px; background: currentColor;
  transition: transform .35s var(--ease), opacity .2s;
}
.menu-toggle__lines { position: relative; }
.menu-toggle__lines::before, .menu-toggle__lines::after { content: ""; position: absolute; left: 0; }
.menu-toggle__lines::before { top: -6px; }
.menu-toggle__lines::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 0; background: var(--bg);
  overflow-y: auto; padding-block: 24px 40px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__nav { display: grid; }
.mobile-menu__nav a {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em;
  padding-block: 14px; border-bottom: 1px solid var(--line);
}
.mobile-menu__contacts { display: grid; gap: 6px; }
.mobile-menu__contacts a { font-size: 1.25rem; font-weight: 500; font-feature-settings: "tnum" 1; }
.mobile-menu__contacts p { color: var(--ink-2); margin-top: 10px; }

/* ---------- Первый экран ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex;
  min-height: min(100svh, 1000px);
  padding-top: var(--header-h);
  background: #00282C; color: #FFFFFF;
}
/* Фото — на весь экран, под текстом */
.hero__media { position: absolute; inset: 0; z-index: -1; margin: 0; background: #00282C; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 45%; }
/* Затемнение слева и снизу — чтобы текст читался */
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 34, 38, .9) 0%, rgba(0, 34, 38, .72) 38%, rgba(0, 34, 38, .18) 78%, rgba(0, 34, 38, .08) 100%),
    linear-gradient(0deg, rgba(0, 30, 34, .7) 0%, rgba(0, 30, 34, 0) 42%);
}
.hero__inner {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-content: end; width: 100%;
  padding-top: clamp(72px, 14vh, 180px); padding-bottom: clamp(28px, 5vh, 48px);
}
.hero__title {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: var(--fs-hero); font-weight: 560; line-height: 0.98; letter-spacing: -0.045em;
  color: #FFFFFF;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.hero__title .line > span { display: inline-block; }
.hero__text { grid-column: 1 / span 5; margin-top: clamp(28px, 4.5vh, 48px); }
.hero__lead {
  max-width: 34ch;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); line-height: 1.5; color: rgba(255, 255, 255, .82);
}
.hero__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 28px; margin-top: 36px; }

/* Кнопка первого экрана — зелёная, как в логотипе */
.btn.btn--hero { background: var(--brand-green); border-color: var(--brand-green); color: #0F2207; font-weight: 600; }
.btn.btn--hero:hover { background: #FFFFFF; border-color: #FFFFFF; color: #00464B; }
.hero .link-call { color: #FFFFFF; font-feature-settings: "tnum" 1; }
.hero .link-call:hover { color: var(--brand-green); }

/* Строка «полный цикл» внизу первого экрана */
.hero__steps {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap);
  margin-top: clamp(56px, 10vh, 120px);
  border-top: 1px solid rgba(255, 255, 255, .24);
}
.hero__steps li {
  position: relative; padding-top: 18px;
  font-size: clamp(0.9375rem, 0.88rem + 0.25vw, 1.0625rem); font-weight: 500; color: rgba(255, 255, 255, .9);
}
.hero__steps li::before {
  content: ""; position: absolute; left: 0; top: -2px; width: 32px; height: 3px;
  background: var(--brand-green);
}
.hero__steps li:nth-child(even)::before { background: var(--brand-teal); }

/* Анимация первого экрана — один раз при загрузке */
.js .hero__title .line > span { transform: translateY(105%); }
.js .hero__lead, .js .hero__actions, .js .hero__steps { opacity: 0; transform: translateY(12px); }
.js .hero__media img { transform: scale(1.08); opacity: .4; }
.is-loaded .hero__title .line > span { transform: none; transition: transform 1s var(--ease); }
.is-loaded .hero__title .line:nth-child(2) > span { transition-delay: .08s; }
.is-loaded .hero__lead, .is-loaded .hero__actions, .is-loaded .hero__steps { opacity: 1; transform: none; transition: opacity .8s .45s var(--ease), transform .8s .45s var(--ease); }
.is-loaded .hero__actions { transition-delay: .55s; }
.is-loaded .hero__steps { transition-delay: .7s; }
.is-loaded .hero__media img { transform: none; opacity: 1; transition: transform 2.2s var(--ease), opacity 1.2s var(--ease); }

/* ---------- Секции: общая сетка ---------- */
.section { padding-block: var(--section); }
.section + .section > .container { position: relative; }
.section__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap);
  align-items: start;
}
.section__title {
  font-family: var(--font-display);
  grid-column: 1 / span 4;
  font-size: var(--fs-h2); font-weight: 520; line-height: 1.04; letter-spacing: -0.035em;
}
.section__intro {
  grid-column: 7 / span 6;
  font-size: var(--fs-lead); line-height: 1.4; color: var(--ink-2);
  padding-top: 0.35em;
}

/* ---------- О компании ---------- */
.about { border-top: 1px solid var(--line); }
.about__body { grid-column: 5 / span 8; }
.about__lead { font-size: var(--fs-lead); line-height: 1.4; max-width: 34em; }

.about__subtitle { font-size: var(--fs-body); font-weight: 600; margin: clamp(40px, 5vw, 64px) 0 0; }
.about__list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--gap);
  margin-top: 16px;
}
.about__list li {
  padding: 16px 0 18px; border-top: 1px solid var(--line);
  color: var(--ink-2); max-width: 30em;
}

/* Направления: строка из четырёх ячеек с тонкими иконками */
.directions {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(64px, 8vw, 120px);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line);
}
.direction {
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  min-height: clamp(180px, 16vw, 240px);
  padding: clamp(22px, 2.4vw, 32px) clamp(16px, 2vw, 28px) clamp(22px, 2.4vw, 32px) 0;
  min-width: 0;
}
.direction + .direction { border-left: 1px solid var(--line); padding-left: clamp(16px, 2vw, 28px); }
.direction__icon {
  width: 40px; height: 40px; fill: none; stroke: var(--accent);
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .6s var(--ease);
}
.direction:hover .direction__icon { transform: rotate(-12deg); }
/* Иконки направлений чередуют два цвета логотипа */
.direction:nth-child(odd) .direction__icon { stroke: var(--brand-teal); }
.direction:nth-child(even) .direction__icon { stroke: var(--brand-green); }
.direction__name {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 0.9rem + 0.9vw, 1.75rem); font-weight: 520;
  letter-spacing: -0.025em; line-height: 1.15;
}

/* ---------- Услуги ---------- */
.services { background: var(--surface); }
.service-list { margin-top: clamp(48px, 6vw, 88px); border-top: 1px solid var(--ink); }
.service {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap);
  align-items: baseline;
  padding-block: clamp(22px, 2.6vw, 34px);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.service::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.service:hover::before { transform: scaleX(1); }
.service__name {
  font-family: var(--font-display);
  grid-column: 1 / span 6;
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1;
  transition: transform .5s var(--ease), color .3s var(--ease);
}
.service:hover .service__name { transform: translateX(10px); color: var(--accent); }
.service__text { grid-column: 7 / span 5; color: var(--ink-2); max-width: 32em; }

.services__body { margin-top: clamp(48px, 6vw, 88px); }
.services__body .service-list { margin-top: 0; }

/* ---------- Фото-вставка ---------- */
.band { height: clamp(320px, 64vh, 760px); overflow: hidden; background: #2A3033; }
.band img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }

/* ---------- Объекты ---------- */
.projects__intro .section__title { grid-column: 1 / span 6; }
.ongoing { margin-top: clamp(120px, 12vw, 200px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line); }
.project__cover { background: var(--media-bg); overflow: hidden; }
.project__cover img { width: 100%; aspect-ratio: 5 / 3; object-fit: cover; transition: transform 1.1s var(--ease); }
.project--ongoing:hover .project__cover img { transform: scale(1.03); }
.project__status.project__status--ongoing { color: var(--accent); }
.project__status.project__status--ongoing::before { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-teal); }
.projects__intro .projects__hint { margin-top: 12px; font-size: var(--fs-small); }

/* Две колонки, правая смещена вниз — фото никогда не шире исходника */
.projects__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap); row-gap: clamp(48px, 5vw, 80px);
  margin-top: clamp(48px, 6vw, 88px);
}
.project { min-width: 0; }
.project:nth-child(even) { transform: translateY(clamp(0px, 6vw, 96px)); }
.projects__grid { padding-bottom: clamp(0px, 6vw, 96px); }
.project__open {
  display: block; width: 100%; padding: 0; border: 0; background: var(--media-bg);
  cursor: zoom-in; overflow: hidden; position: relative;
}
.project__open img {
  width: 100%; aspect-ratio: 5 / 3; object-fit: cover;
  transition: transform 1.1s var(--ease);
}
.project__open:hover img { transform: scale(1.03); }
.project__open::after {
  content: ""; position: absolute; right: 16px; bottom: 16px; width: 40px; height: 40px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E2326' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: 0; transform: translateY(6px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.project__open:hover::after, .project__open:focus-visible::after { opacity: 1; transform: none; }
.project figcaption { display: grid; gap: 2px; margin-top: 16px; padding-right: 12px; }
.project__status {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font-size: 0.8125rem; font-weight: 500; color: var(--green-ink); margin-bottom: 6px;
}
.project__status::before { content: ""; width: 14px; height: 2px; background: var(--brand-green); }
.project__type { font-size: 0.875rem; color: var(--ink-2); }
.project__name {
  font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 520; letter-spacing: -0.02em; line-height: 1.2; }
.project__scope { font-size: var(--fs-small); color: var(--ink-2); max-width: 36em; margin-top: 4px; }


/* ---------- Преимущества ---------- */
.advantages { background: var(--inverse-bg); color: var(--inverse-text); }
.advantages .section__title { color: var(--inverse-text); }
.advantages__list li { display: flex; align-items: baseline; gap: 0.5em; }
.advantages__list li::before {
  content: ""; flex: 0 0 auto; width: 0.55em; height: 3px; background: var(--brand-green);
  transform: translateY(-0.28em);
}
.advantages__list { grid-column: 5 / span 8; border-top: 1px solid var(--inverse-line); }
.advantages__list li {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.1rem + 2vw, 3.1rem); font-weight: 450; letter-spacing: -0.035em; line-height: 1.1;
  padding-block: clamp(18px, 2vw, 28px);
  border-bottom: 1px solid var(--inverse-line);
}

/* ---------- Как мы работаем ---------- */
.steps {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap);
  margin-top: clamp(48px, 6vw, 88px);
  counter-reset: none;
}
.step { border-top: 1px solid var(--ink); padding-top: 18px; position: relative; }
.step::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 28px; height: 3px; background: var(--brand-green);
}
.step__num { display: block; font-size: var(--fs-small); color: var(--accent); font-weight: 600; font-feature-settings: "tnum" 1; }
.step__name { font-size: 1.1875rem; font-weight: 560; letter-spacing: -0.015em; line-height: 1.25; margin-top: 40px; min-height: 2.5em; }
.step p { margin-top: 10px; color: var(--ink-2); font-size: var(--fs-small); }

/* ---------- Заказчики ---------- */
.clients { border-top: 1px solid var(--line); }
.logos {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
/* 8 логотипов: два ряда по четыре */
.logo-cell {
  grid-column: span 3;
  display: flex; align-items: center; justify-content: center;
  height: clamp(150px, 13vw, 200px); padding: 20px 24px; min-width: 0;
  background: var(--surface);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.logo-cell img {
  display: block; width: auto; height: auto;
  max-width: 78%; max-height: var(--h, 3rem);
  filter: grayscale(1); opacity: .82;
  transition: filter .5s var(--ease), opacity .5s var(--ease);
}
.logo-cell:hover img { filter: none; opacity: 1; }

/* ---------- Контакты ---------- */
.contacts { background: var(--surface); }
.contacts__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap);
  align-items: stretch;
}
.contacts__info { grid-column: 1 / span 5; display: flex; flex-direction: column; }
.contacts__info .section__title { display: block; }
.contacts__lead { margin-top: 24px; color: var(--ink-2); max-width: 26em; }
.contacts__phones { display: grid; gap: 4px; margin-top: clamp(40px, 5vw, 64px); }
.contacts__phones a {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.9rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15;
  font-feature-settings: "tnum" 1; width: fit-content;
  transition: color .3s var(--ease);
}
.contacts__phones a:hover { color: var(--accent); }
.contacts__address { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 1.125rem; max-width: 24em; }
.contacts__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 40px; }
.contacts__media { grid-column: 7 / span 6; position: relative; min-height: 520px; overflow: hidden; }
.contacts__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 56px 40px; font-size: var(--fs-small); }
.footer__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.brand--footer { grid-column: 1 / span 4; }
.footer__nav { grid-column: 5 / span 4; display: grid; grid-template-columns: 1fr 1fr; gap: 8px var(--gap); }
.footer__nav a, .footer__contacts a { transition: color .3s var(--ease); width: fit-content; }
.footer__nav a:hover, .footer__contacts a:hover { color: var(--accent); }
.footer__contacts { grid-column: 9 / span 4; display: grid; gap: 4px; }
.footer__contacts a { font-weight: 500; font-feature-settings: "tnum" 1; }
.footer__contacts p { color: var(--ink-2); margin-top: 8px; }
.footer__copy { grid-column: 1 / -1; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); }

/* ---------- Лайтбокс ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-rows: 1fr auto;
  background: rgba(20, 23, 25, .97); color: #EEF0EF;
  opacity: 0; transition: opacity .35s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-visible { opacity: 1; }
.lightbox__stage { display: grid; place-items: center; padding: clamp(16px, 4vw, 56px); min-height: 0; touch-action: pan-y; }
.lightbox__img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  transform: scale(.985); opacity: 0; transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.lightbox.is-visible .lightbox__img.is-ready { transform: none; opacity: 1; }
.lightbox__bar {
  display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter); border-top: 1px solid rgba(255,255,255,.14);
}
.lightbox__caption { display: grid; gap: 2px; margin-right: auto; min-width: 0; }
.lightbox__name { font-size: 1.125rem; font-weight: 520; }
.lightbox__meta { font-size: var(--fs-small); color: #A9B1B3; }
.lightbox__count { font-size: var(--fs-small); color: #A9B1B3; font-feature-settings: "tnum" 1; white-space: nowrap; }
.lightbox__controls { display: flex; gap: 8px; }
.lightbox .icon-btn { color: #fff; border-color: rgba(255,255,255,.25); }
.lightbox .icon-btn:hover { border-color: #fff; background: rgba(255,255,255,.06); }
body.is-locked { overflow: hidden; }

/* ==========================================================================
   Адаптивность
   ========================================================================== */
@media (max-width: 1180px) {
  .directions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .direction:nth-child(3) { border-left: 0; padding-left: 0; }
  .direction:nth-child(n+3) { border-top: 1px solid var(--line); }
  .nav { gap: 20px; }
  .header__phone { display: none; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 48px; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .nav, .header__actions .btn--small { display: none; }
  .header__actions { margin-left: auto; gap: 8px; }
  .header__call, .menu-toggle { display: inline-grid; }

  .hero { min-height: min(92svh, 860px); }
  .hero__title { grid-column: 1 / -1; }
  .hero__text { grid-column: 1 / span 9; }
  .hero__media img { object-position: 70% 50%; }
  .hero__media::after {
    background:
      linear-gradient(0deg, rgba(0, 30, 34, .94) 0%, rgba(0, 30, 34, .78) 48%, rgba(0, 30, 34, .35) 100%);
  }

  .section__title, .section__intro, .about__body, 
  .advantages__list, .contacts__info, .contacts__media { grid-column: 1 / -1; }
  .section__intro { padding-top: 0; margin-top: 8px; }
  .projects__intro .section__title { grid-column: 1 / -1; }
  .about__body { margin-top: 28px; }
  .advantages__list { margin-top: 36px; }
  
  .directions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .direction:nth-child(3) { border-left: 0; padding-left: 0; }
  .direction:nth-child(n+3) { border-top: 1px solid var(--line); }

  .service__name, .services__body .service__name { grid-column: 1 / -1; }
  .service__text, .services__body .service__text { grid-column: 1 / -1; margin-top: 4px; }

  .service:hover .service__name { transform: none; }


  .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-cell, .logo-cell:nth-child(-n+3) { grid-column: auto; height: 132px; padding: 16px; }

  .contacts__media { min-height: 0; aspect-ratio: 4 / 3; margin-top: 48px; }
  .contacts__actions { margin-top: 32px; padding-top: 0; }

  .brand--footer, .footer__nav, .footer__contacts { grid-column: 1 / -1; }
  .footer__nav { margin-top: 12px; }
}

@media (max-width: 640px) {
  :root { --fs-body: 1rem; }
  .brand__tag { display: none; }
  .hero__actions { gap: 20px; }
  .hero__text { grid-column: 1 / -1; }
  .hero__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; margin-top: 48px; }
  .about__list { grid-template-columns: 1fr; }
  .projects__grid { grid-template-columns: 1fr; padding-bottom: 0; }
  .project:nth-child(even) { transform: none; }
  .steps { grid-template-columns: 1fr; row-gap: 32px; }
  .step__name { margin-top: 14px; min-height: 0; }
  .logo-cell, .logo-cell:nth-child(-n+3) { height: 112px; padding: 12px; }
  .logo-cell img { max-width: 84%; max-height: calc(var(--h, 3rem) * .72); }
  .directions { grid-template-columns: 1fr; }
  .direction, .direction + .direction, .direction:nth-child(3) {
    flex-direction: row; align-items: center; gap: 18px; min-height: 0;
    padding: 18px 0; border-left: 0;
  }
  .direction + .direction { border-top: 1px solid var(--line); }
  .direction__icon { width: 32px; height: 32px; flex-shrink: 0; }
  .direction__name { font-size: 1.25rem; }
    .contacts__actions .btn { flex: 1 1 100%; }
  .lightbox__bar { flex-wrap: wrap; gap: 12px 16px; }
  .lightbox__caption { flex: 1 1 100%; }
  .lightbox__controls { margin-left: auto; }
}

@media (max-width: 380px) {
  .brand { gap: 10px; }
  .brand__mark { width: 32px; }
  .brand__name { font-size: 1rem; }
  .header__actions { gap: 6px; }
  .icon-btn { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; transition-delay: 0s !important; }
  .js .hero__title .line > span, .js .hero__lead, .js .hero__actions, .js .hero__steps, .js .hero__media img {
    transform: none; opacity: 1; clip-path: none;
  }
}
