/* ---------- Tokens ---------- */
:root {
  --bg: #cbc9c6;
  --card: #fffefb;
  --card-light: #f7f5f1;
  --dark: #131313;
  --dark-hover: #2b2b2b;
  --text: #131313;
  --text-2: #3a3936;
  --muted: #6b6a67;
  --line: #e4e1db;
  --line-strong: #c9c4bb;
  --accent: #ebf213;
  --accent-hover: #dfe60a;
  --accent-soft: #f7f9b8;
  --danger: #b42318;

  --on-dark: #faf9f6;
  --muted-dark: #b5b4b1;
  --muted-dark-2: #9b9a97;
  --faint-dark: #77766f;
  --line-dark: #2a2a2a;

  --hero-bg: #8f8d89;
  --hero-ph-1: #a19f9b;
  --hero-ph-2: #8a8884;
  --hero-ph-3: #74726e;

  --yellow: #fcffa8;
  --lavender: #e0dbff;
  --pink: #ffd6f8;
  --lime: #eefcd1;
  --blue: #dae8fd;

  --control-h: 48px;
  --control-h-compact: 44px;
  --control-h-lg: clamp(48px, 3.2vw, 60px);

  --radius-l: 20px;
  --radius-m: 16px;
  --radius-s: 10px;
  --gap: 12px;
  --side: 24px;
  --pad: clamp(20px, 3.6vw, 52px);
  --maxw: 2560px;

  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  padding: 20px var(--side) var(--side);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html, body { overflow-x: clip; }
img { max-width: 100%; display: block; }
/* Кнопки и поля в браузерах не наследуют шрифт сами, отсюда системный шрифт на iOS */
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

main, .header, .footer { max-width: var(--maxw); margin-inline: auto; }
main { display: flex; flex-direction: column; gap: var(--gap); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius-l);
  padding: var(--pad);
}
.card--light { background: var(--card-light); }
.card--dark { background: var(--dark); color: var(--on-dark); }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.eyebrow--light { color: var(--muted-dark-2); }

.section__head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section__title {
  font-size: clamp(30px, 4.2vw, 52px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 0 24px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  font-size: clamp(15px, .85vw, 17px);
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--accent { background: var(--accent); color: var(--dark); }
.btn--accent:hover { background: var(--accent-hover); }
.btn--ghost { border-color: rgba(255,255,255,.5); color: var(--on-dark); }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: var(--on-dark); }
.btn--dark { background: var(--dark); color: var(--on-dark); }
.btn--dark:hover { background: var(--dark-hover); }
.btn--outline { border-color: var(--line); background: var(--card); color: var(--dark); }
.btn--outline:hover { border-color: var(--dark); }

/* Текст кнопки прокручивается вверх при наведении, снизу выезжает копия (как в Pipely) */
.btn__roll { display: inline-block; overflow: hidden; vertical-align: top; line-height: 1.3; }
.btn__text { display: block; position: relative; transition: transform .45s cubic-bezier(.65, 0, .35, 1); }
.btn__text::after { content: attr(data-text); position: absolute; left: 0; top: 100%; width: 100%; }
@media (hover: hover) {
  .btn:hover .btn__text { transform: translateY(-100%); }
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 20px;
  z-index: 50;
  margin-bottom: 24px;
}
.header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-l);
  min-height: clamp(72px, 4.6vw, 92px);
  padding: 12px clamp(14px, 1.6vw, 18px) 12px clamp(20px, 1.9vw, 38px);
}

.logo { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; justify-self: start; }
.logo__mark { width: clamp(30px, 1.8vw, 36px); height: clamp(30px, 1.8vw, 36px); }
.logo__text { display: inline-flex; align-items: center; font-size: clamp(17px, 1.15vw, 22px); font-weight: 600; letter-spacing: -0.02em; }
.logo__sep { width: .24em; height: .62em; margin: .08em .42em 0; background: var(--dark); }
.logo--light .logo__sep { background: var(--accent); }
.logo__sub { font-weight: 400; color: var(--muted); }
.logo--light .logo__sub { color: var(--muted-dark-2); }

.nav { display: flex; gap: clamp(4px, 1.4vw, 28px); }
.nav a {
  padding: 10px 14px;
  border-radius: var(--radius-s);
  font-size: clamp(15px, .9vw, 17px);
  color: var(--text-2);
  transition: background-color .2s, color .2s;
}
.nav a:hover { background: var(--card-light); color: var(--dark); }
.nav a.is-active { color: var(--dark); background: var(--card-light); }

.header__cta { min-height: var(--control-h-lg); padding: 0 clamp(24px, 1.8vw, 36px); justify-self: end; }

.burger {
  display: none;
  width: var(--control-h-compact); height: var(--control-h-compact);
  margin-left: auto;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--accent);
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute; left: 13px; right: 13px; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: transform .25s var(--ease), opacity .2s;
}
.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21px; }
.burger span:nth-child(3) { top: 27px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Placeholder ---------- */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.04) 0 12px, transparent 12px 24px),
    rgba(0,0,0,.06);
  border-radius: var(--radius-m);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ph__label {
  font-size: 13px;
  color: rgba(0,0,0,.45);
  background: rgba(255,255,255,.6);
  padding: 6px 10px;
  border-radius: 6px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(560px, calc(100vh - 160px), 1000px);
  padding-inline: clamp(24px, 7vw, 140px);
  background: var(--hero-bg);
  color: var(--on-dark);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% center;
  border-radius: 0;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(34,33,31,.62) 0%, rgba(34,33,31,.4) 35%, rgba(34,33,31,.08) 62%, rgba(34,33,31,0) 80%),
    rgba(34,33,31,.08);
  pointer-events: none;
}
.hero--empty .hero__bg {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 14px, transparent 14px 28px),
    linear-gradient(160deg, var(--hero-ph-1) 0%, var(--hero-ph-2) 55%, var(--hero-ph-3) 100%);
  place-items: center end;
  padding-right: 12%;
}
.hero--empty .hero__bg .ph__label { background: rgba(255,255,255,.8); }
.hero__content {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 2vw, 36px);
  max-width: 680px;
}
.hero__title {
  font-size: clamp(48px, 5.4vw, 108px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
}
.hero__roles { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.hero__roles li {
  position: relative;
  padding-left: 22px;
  font-size: clamp(17px, 1.1vw, 20px);
  line-height: 1.35;
  color: rgba(255,255,255,.92);
}
/* Буллет повторяет ножку буквы Т из логотипа */
.hero__roles li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .32em;
  width: .3em;
  height: .72em;
  background: var(--accent);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 4px; }
.hero__actions .btn { min-height: var(--control-h-lg); padding: 0 clamp(24px, 1.8vw, 36px); }

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.stat {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: clamp(20px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 220px;
}
.stat__num {
  font-size: clamp(48px, 5.6vw, 80px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat__unit { font-size: .42em; letter-spacing: -0.02em; font-weight: 400; color: var(--muted); }
.stat__text { font-size: 17px; line-height: 1.4; color: var(--text-2); max-width: 300px; }
.stat--accent { background: var(--accent); }
.stat--accent .stat__unit,
.stat--accent .stat__text { color: var(--dark); }

/* ---------- Services (sticky stack) ---------- */
.services { display: flex; flex-direction: column; gap: var(--gap); }
.service {
  position: sticky;
  top: 96px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  padding: 16px;
  border-radius: var(--radius-l);
  min-height: 380px;
  box-shadow: 0 -1px 0 rgba(0,0,0,.04);
}
.service:nth-child(2) { top: 112px; }
.service:nth-child(3) { top: 128px; }
.service:nth-child(4) { top: 144px; }
.service:nth-child(5) { top: 160px; }
.service--yellow { background: var(--yellow); }
.service--lavender { background: var(--lavender); }
.service--pink { background: var(--pink); }
.service--lime { background: var(--lime); }
.service--blue { background: var(--blue); }
.service__img { min-height: 260px; border-radius: var(--radius-m); overflow: hidden; }
.service__img img { width: 100%; height: 100%; object-fit: cover; }
.service__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(8px, 2vw, 24px) clamp(4px, 1vw, 16px) 8px 0;
}
.service__num { font-size: 13px; font-weight: 600; letter-spacing: .1em; color: rgba(0,0,0,.45); }
.service__title {
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 520px;
}
.service__text { font-size: 17px; line-height: 1.5; color: rgba(0,0,0,.65); max-width: 520px; }
.service .btn { margin-top: auto; }

/* ---------- Cases ---------- */
.cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.case {
  text-align: left;
  font: inherit;
  color: inherit;
  border: 1px solid transparent;
  background: var(--card);
  border-radius: var(--radius-m);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
}
.case:focus-visible { outline: 2px solid var(--dark); outline-offset: 3px; }
.case__img { aspect-ratio: 4 / 3; border-radius: var(--radius-s); overflow: hidden; }
.case__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
@media (hover: hover) {
  .case:hover .case__img img { transform: scale(1.05); }
}
.case__tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card-light);
  border: 1px solid var(--line);
}
.case__tags--flush { padding: 0; }
.case__title { font-size: 21px; font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; padding: 0 8px; }
.case__text { font-size: 15px; color: var(--muted); padding: 0 8px; }
.case__more {
  margin-top: auto;
  padding: 0 8px 8px;
  font-size: 15px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.case__more::after { content: "→"; }

/* ---------- Modal ---------- */
.modal {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  border: 0;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--card);
  color: var(--text);
}
.modal::backdrop { background: rgba(19,19,19,.55); backdrop-filter: blur(4px); }
.modal[open] { animation: modal-in .3s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal__close {
  position: absolute; top: 12px; right: 12px;
  width: var(--control-h-compact); height: var(--control-h-compact); border-radius: var(--radius-s);
  border: 0; background: var(--accent); color: var(--dark); font: 400 24px/1 var(--font); padding: 0; -webkit-appearance: none; appearance: none; cursor: pointer;
  z-index: 1;
}
.modal__body { padding: clamp(20px, 4vw, 40px); display: flex; flex-direction: column; gap: 20px; }
.modal__img { aspect-ratio: 16 / 9; border-radius: var(--radius-m); overflow: hidden; }
.modal__img img { width: 100%; height: 100%; object-fit: cover; }
.modal__title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 400; line-height: 1.12; letter-spacing: -0.025em; }
.modal__block h4 { margin: 0 0 6px; font-size: 15px; color: var(--muted); font-weight: 500; }
.modal__block p { font-size: 17px; line-height: 1.55; }
.modal__block + .modal__block { border-top: 1px solid var(--line); padding-top: 20px; }

/* ---------- Lead form ---------- */
.lead { width: min(560px, calc(100vw - 24px)); }
.lead:focus { outline: none; }
.lead .modal__title, .modal__body > :first-child { margin-right: 48px; }
.lead__form, .lead__done { padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 16px; }
.lead__done { align-items: flex-start; }
.lead__form[hidden], .lead__done[hidden] { display: none; }
.lead__text { color: var(--muted); font-size: 16px; margin-top: -4px; }
.options { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.options .field__label { padding: 0; margin-bottom: 4px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card-light);
  font-size: 15px;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.option:hover { border-color: var(--line-strong); }
.option input {
  appearance: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--card);
  transition: border-color .2s, border-width .2s;
}
.option input:checked { border: 5px solid var(--dark); }
.option input:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.option:has(input:checked) { border-color: var(--dark); background: var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 500; }
.field__opt { font-weight: 400; color: var(--muted); }
.field__input {
  font: inherit;
  font-size: 16px;
  min-height: var(--control-h);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card-light);
  color: var(--text);
  transition: border-color .2s, background-color .2s;
}
.field__input:hover { border-color: var(--line-strong); }
.field__input:focus { outline: none; border-color: var(--dark); background: var(--card); }
.field__input--area { resize: vertical; min-height: 96px; }
.field__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--dark); }
.check a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.lead__error { font-size: 14px; color: var(--danger); }
.lead__error[hidden] { display: none; }
.lead__submit { align-self: stretch; margin-top: 4px; }
.lead__submit:disabled { opacity: .6; cursor: progress; }

/* ---------- Documents ---------- */
.docs { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.doc {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.doc__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-s);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  background: var(--card-light);
}
.doc__icon--pdf { background: var(--pink); }
.doc__icon--doc, .doc__icon--docx { background: var(--blue); }
.doc__icon--xls, .doc__icon--xlsx { background: var(--lime); }
.doc__icon--odt, .doc__icon--rtf, .doc__icon--txt { background: var(--lavender); }
.doc__icon--zip { background: var(--yellow); }
.doc__name { font-size: 18px; font-weight: 500; line-height: 1.3; }
.doc__meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.docs__empty { padding: 32px 0; color: var(--muted); border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.footer { margin-top: var(--gap); display: flex; flex-direction: column; gap: clamp(48px, 8vw, 120px); }
.footer__top {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: end;
}
.footer__title {
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
}
.footer__lead { margin-top: 20px; color: var(--muted-dark); font-size: 17px; max-width: 420px; }
.footer__contacts { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.footer__link {
  font-size: clamp(24px, 3vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
  font-variant-numeric: tabular-nums;
}
.footer__link:hover { border-color: var(--accent); }
.footer__btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.footer .btn--ghost { border-color: rgba(255,255,255,.35); }
.footer__bottom {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.footer__nav a {
  font-size: 15px; color: var(--muted-dark);
  transition: color .2s;
}
.footer__nav a:hover { color: var(--on-dark); }
.footer__copy { font-size: 14px; line-height: 1.6; color: var(--faint-dark); }
.footer__copy a { text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.footer__copy a:hover { color: var(--on-dark); }

/* ---------- Legal page ---------- */
.legal { max-width: none; }
.legal__title { margin-bottom: 12px; }
.legal__date { color: var(--muted); margin-bottom: clamp(28px, 4vw, 48px); }
.legal__body { max-width: 760px; font-size: 17px; line-height: 1.6; color: var(--text-2); }
.legal__body h2 { font-size: clamp(20px, 1.6vw, 24px); font-weight: 500; line-height: 1.3; letter-spacing: -0.015em; color: var(--text); margin: 40px 0 12px; }
.legal__body h2:first-child { margin-top: 0; }
.legal__body p + p { margin-top: 12px; }
.legal__body ul { margin: 8px 0 0; padding-left: 0; display: flex; flex-direction: column; gap: 6px; }
.legal__body li { position: relative; padding-left: 20px; }
.legal__body ol { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal__body ol li { padding-left: 4px; }
.legal__body ol li::before { display: none; }
.legal__body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.legal__body strong { font-weight: 600; color: var(--text); }
.legal__body li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 4px; height: 10px; background: var(--dark); }

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed;
  right: var(--side);
  bottom: var(--side);
  z-index: 60;
  width: min(440px, calc(100vw - 2 * var(--side)));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--dark);
  color: var(--on-dark);
  border-radius: var(--radius-l);
}
.cookie[hidden] { display: none; }
.cookie__text { font-size: 15px; line-height: 1.5; color: var(--muted-dark); }
.cookie__text a { color: var(--on-dark); text-decoration: underline; text-underline-offset: 3px; }
.cookie__btn { min-height: var(--control-h-compact); }

/* ---------- Появление справа налево, как в Pipely ---------- */
.js :is(.hero__title, .hero__roles li, .hero__actions, .eyebrow, .section__title, .stat, .service__body, .case, .doc, .legal__body, .footer__title, .footer__lead, .footer__contacts) {
  opacity: 0;
  transform: translateX(75px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js :is(.hero__title, .hero__roles li, .hero__actions, .eyebrow, .section__title, .stat, .service__body, .case, .doc, .legal__body, .footer__title, .footer__lead, .footer__contacts):is(.is-in),
.reveal-all :is(.hero__title, .hero__roles li, .hero__actions, .eyebrow, .section__title, .stat, .service__body, .case, .doc, .legal__body, .footer__title, .footer__lead, .footer__contacts) {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .nav a { padding: 10px 8px; font-size: 14px; }
}
@media (max-width: 1040px) {
  .header__cta { display: none; }
  .header__bar { grid-template-columns: auto 1fr; }
  .nav { justify-self: end; }
}

@media (max-width: 900px) {
  :root { --gap: 8px; --side: 8px; }
  .header__bar { display: flex; min-height: 64px; padding: 10px 10px 10px 18px; }
  .header { top: var(--gap); margin-bottom: var(--gap); }
  body { padding-top: var(--gap); }
  .hero { padding-inline: var(--pad); }
  .burger { display: block; }
  .nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    justify-self: stretch;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    background: var(--card);
    border-radius: var(--radius-m);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,.3);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s, transform .25s var(--ease);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { padding: 14px 12px; font-size: 18px; }

  /* Фиксированная высота: от высоты окна баннер скачет, когда в мобильном браузере прячутся панели */
  .hero { align-items: flex-end; min-height: 600px; }
  .hero::after { background: linear-gradient(0deg, rgba(34,33,31,.8) 0%, rgba(34,33,31,.45) 45%, rgba(34,33,31,0) 72%); }
  /* Фото выше баннера и прижато к низу: сверху срезается пустая стена над головой */
  .hero__bg { top: auto; bottom: 0; height: 110%; object-position: 77% bottom; }
  .hero--empty .hero__bg { place-items: start center; padding: 18% 0 0; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .cases { grid-template-columns: repeat(2, 1fr); }

  .service { grid-template-columns: 1fr; min-height: 0; top: 84px; }
  .service:nth-child(n) { top: 84px; }
  .service__img { min-height: 0; aspect-ratio: 16 / 9; }
  .service__body { padding: 4px 8px 8px; }

  .footer__top { grid-template-columns: 1fr; }
  .footer__nav { margin-left: 0; }
}

@media (max-width: 560px) {
  .header__bar { padding-left: 14px; }
  .logo__text { font-size: 16px; }
  .stats, .cases { grid-template-columns: 1fr; }
  .stat { min-height: 0; gap: 24px; }
  .hero__roles li { font-size: 16px; }
  .hero__actions .btn { flex: 1; }
  .service { position: relative; top: auto; }
  .service:nth-child(n) { top: auto; }
  .doc { grid-template-columns: 44px 1fr; gap: 14px; }
  .doc__icon { width: 44px; height: 44px; }
  .doc .btn { grid-column: 1 / -1; width: 100%; }
  .cookie { padding: 18px; gap: 12px; }
  .cookie__text { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js :is(.hero__title, .hero__roles li, .hero__actions, .eyebrow, .section__title, .stat, .service__body, .case, .doc, .legal__body, .footer__title, .footer__lead, .footer__contacts) { opacity: 1; transform: none; }
}
