/* ============================================================
   gavrilichev.ru — Продакшен
   Токены → база → компоненты → секции → оверлеи → утилиты
   Mobile-first. Брейкпоинты: 768 / 1024 / 1280
   ============================================================ */

/* ─── Токены ─────────────────────────────────────────────── */
:root {
  --bg:          #f7f5f0;
  --bg-alt:      #fdfcf9;
  --white:       #ffffff;

  --ink:         #1c1e1a;
  --ink-2:       #44463e;
  --ink-3:       #5c5f56;
  --muted:       #6b6e64;
  --muted-2:     #85877e;
  --muted-3:     #a5a79c;

  --line:        #e2ded3;
  --line-soft:   #ece8dd;
  --line-input:  #d8d4c8;

  --gold:        #c2a878;
  --gold-ink:    #8f7443;

  --green:       #2e4a35;
  --green-deep:  #22301f;
  --green-pale:  #b8c7ba;
  --green-mid:   #9db8a0;
  --green-dim:   #7d9480;
  --green-line:  rgba(247, 245, 240, .18);

  --err:         #a4442e;
  --err-line:    #c96a51;
  --err-bg:      #fdf3f0;

  --f-text:      'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-display:   'Onest', 'Golos Text', system-ui, sans-serif;

  --gut:         20px;
  --shell:       1248px;
  --header-h:    60px;
  --ease:        cubic-bezier(.22, .61, .36, 1);
}

@media (min-width: 768px)  { :root { --gut: 40px; } }
@media (min-width: 1280px) { :root { --gut: 96px; --header-h: 76px; } }

/* ─── База ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--f-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Фиксация страницы под меню и попапами (iOS-safe) */
body.is-locked {
  position: fixed;
  left: 0;
  width: 100%;
  overflow: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
/* <picture> — обёртка для webp-фолбэка; не должна участвовать в раскладке,
   иначе height:100% у вложенного img теряет базу для процентов */
picture { display: contents; }

h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--green); text-decoration: none; transition: opacity .18s var(--ease), color .18s var(--ease); }
a:hover { opacity: .85; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
}

::selection { background: var(--gold); color: var(--ink); }

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 300;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--bg);
  font: 500 14px var(--f-text);
  transform: translateY(-200%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; opacity: 1; }

/* Зерно поверх всей страницы */
.grain {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─── Каркас ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: calc(var(--shell) + var(--gut) * 2);
  margin: 0 auto;
  padding-inline: var(--gut);
}

.section {
  padding-block: 64px;
  scroll-margin-top: var(--header-h);
}
.section--alt  { background: var(--bg-alt); }
.section--line { border-top: 1px solid var(--line); }

@media (min-width: 768px)  { .section { padding-block: 80px; } }
@media (min-width: 1024px) { .section { padding-block: 100px; } }

/* ─── Типографика ────────────────────────────────────────── */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font: 500 12px var(--f-text);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.eyebrow--green {
  color: var(--green);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.eyebrow__rule {
  flex: 0 0 auto;
  width: 32px;
  height: 1px;
  background: var(--gold);
}
.eyebrow__num { letter-spacing: 1px; }

.h2 {
  margin-bottom: 24px;
  font: 500 clamp(28px, 4.4vw, 44px)/1.12 var(--f-display);
  letter-spacing: -.5px;
  color: var(--ink);
  text-wrap: balance;
}

.h3 {
  margin-bottom: 20px;
  font: 500 clamp(22px, 2.6vw, 28px)/1.2 var(--f-display);
  color: var(--ink);
}
.h3__note { color: var(--muted-2); font-weight: 400; }

.h4 {
  margin-bottom: 12px;
  font: 500 clamp(20px, 2.2vw, 25px)/1.25 var(--f-display);
  color: var(--ink);
}

.lead {
  max-width: 760px;
  margin-bottom: 32px;
  font: 400 clamp(16px, 1.5vw, 18px)/1.6 var(--f-text);
  color: var(--ink-3);
  text-wrap: pretty;
}

.prose {
  font: 400 16px/1.65 var(--f-text);
  color: var(--ink-2);
  text-wrap: pretty;
}
.prose + .prose { margin-top: 12px; }
@media (min-width: 1024px) {
  .prose { font-size: 17px; }
  .prose--lg { font-size: 18px; }
  .prose + .prose { margin-top: 14px; }
}

.logo {
  font: 700 15px var(--f-text);
  letter-spacing: 1.2px;
  color: var(--ink);
}
.logo--light { color: var(--bg); }
@media (min-width: 1024px) { .logo { font-size: 16px; } }

/* ─── Кнопки ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  border: 1px solid transparent;
  padding: 17px 28px;
  font: 600 16px var(--f-text);
  text-align: center;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:hover { opacity: 1; }
.btn:active { transform: translateY(1px); }

.btn--gold {
  background: var(--gold);
  color: var(--ink);
}
.btn--gold:hover { background: #cdb689; }

.btn--green {
  background: var(--green);
  color: var(--bg);
}
.btn--green:hover { background: #3a5c43; }

.btn--ghost-gold {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
  padding: 14px 26px;
}
.btn--ghost-gold:hover { background: var(--gold); color: var(--ink); }

.btn--ghost-dark {
  background: transparent;
  border-color: #5a6057;
  color: #f2efe7;
  font-weight: 500;
}
.btn--ghost-dark:hover { border-color: #8a9083; }

.btn--block { display: block; width: 100%; }
.btn--sm { padding: 13px 24px; font-size: 14px; }

@media (min-width: 1024px) {
  .btn { padding: 20px 40px; font-size: 17px; }
  .btn--ghost-gold { padding: 15px 30px; font-size: 16px; }
  .btn--sm { padding: 13px 26px; font-size: 14px; }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-inline: -8px;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
}

/* ─── Шапка ──────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}
.header__left { display: flex; align-items: center; gap: 64px; }

.nav { display: none; gap: 36px; align-items: center; }
.nav a {
  position: relative;
  font: 400 15px var(--f-text);
  color: var(--ink-3);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }
.nav a.is-active { color: var(--ink); }

.header__right { display: none; align-items: center; gap: 28px; }
.header__addr  { font: 400 14px var(--f-text); color: var(--muted-2); }
.header__phone { font: 600 16px var(--f-text); color: var(--ink); }

.header__mobile { display: flex; align-items: center; gap: 16px; }

@media (min-width: 1024px) {
  .nav, .header__right { display: flex; }
  .header__mobile { display: none; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .header__left { gap: 36px; }
  .nav { gap: 24px; }
  .header__addr { display: none; }
}

/* ─── Мобильное меню ─────────────────────────────────────── */
.mmenu {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: menu-in .22s var(--ease);
}
.mmenu[hidden] { display: none; }

@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

.mmenu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding-inline: 20px;
  border-bottom: 1px solid var(--line);
}
.mmenu__nav {
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  overflow-y: auto;
}
.mmenu__nav a {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font: 500 clamp(22px, 6.4vw, 26px) var(--f-display);
  color: var(--ink);
}
.mmenu__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px 32px;
}
.mmenu__addr  { font: 400 14px var(--f-text); color: var(--muted-2); margin-bottom: 4px; }
.mmenu__phone { font: 600 18px var(--f-text); color: var(--ink); }

/* ─── Hero ───────────────────────────────────────────────── */
.hero { overflow: hidden; }
.hero__inner { display: flex; flex-direction: column; }

.hero__media {
  position: relative;
  height: clamp(320px, 52vw, 440px);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 14%;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(247, 245, 240, 0) 35%);
}

.hero__content { padding: 8px var(--gut) 56px; }

.hero__title {
  margin-bottom: 16px;
  font: 500 clamp(31px, 10.2vw, 46px)/1.08 var(--f-display);
  letter-spacing: -.5px;
  color: var(--ink);
}
.hero__lead {
  max-width: 560px;
  margin-bottom: 32px;
  font: 300 clamp(18px, 2.2vw, 24px)/1.45 var(--f-display);
  color: var(--ink-3);
  text-wrap: pretty;
}

.facts {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
}
.fact {
  border-left: 2px solid var(--gold);
  padding-left: 16px;
}
.fact__num {
  display: block;
  font: 600 clamp(26px, 3.4vw, 34px) var(--f-display);
  color: var(--gold-ink);
  white-space: nowrap;
}
.fact__label {
  display: block;
  margin-top: 5px;
  font: 400 15px/1.4 var(--f-text);
  color: var(--muted);
}

.hero__cta { display: flex; flex-direction: column; gap: 12px; }
.hero__cta .btn { display: block; }
.hero__note {
  font: 400 13px var(--f-text);
  color: var(--muted-2);
  text-align: center;
}

@media (min-width: 1024px) {
  .hero__inner {
    display: grid;
    grid-template-columns: 1fr 44%;
    align-items: stretch;
    max-width: calc(var(--shell) + var(--gut) * 2);
    min-height: 620px;
    margin: 0 auto;
    padding-right: var(--gut);
  }
  .hero__media {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
  }
  .hero__media img { object-position: 62% 50%; }
  .hero__scrim { background: linear-gradient(90deg, var(--bg) 0%, rgba(247, 245, 240, 0) 30%); }

  .hero__content {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px 24px 56px var(--gut);
  }
  /* Заголовок масштабируется по ширине колонки: «Кирилл Сергеевич» держится в две строки */
  .hero__title {
    margin-bottom: 24px;
    font-size: min(4.9vw, 70px);
    line-height: 1.05;
    letter-spacing: -1px;
  }
  .hero__lead  { margin-bottom: 44px; }

  .facts {
    flex-direction: row;
    gap: 24px;
    margin-bottom: 48px;
  }
  .fact { padding-left: 20px; }
  .fact__label { max-width: 180px; margin-top: 6px; }

  .hero__cta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
  .hero__cta .btn { display: inline-block; white-space: nowrap; }
  .hero__note { font-size: 14px; text-align: left; }
}

@media (min-width: 1280px) {
  /* Поля контейнера вырастают до 96px — компенсируем шириной колонки с фото */
  .hero__inner { grid-template-columns: 1fr 41%; min-height: 744px; }
  .hero__content { padding: 56px 24px 72px var(--gut); }
  .facts { gap: 48px; margin-bottom: 60px; }
}

@media (min-width: 1440px) {
  .hero__inner { grid-template-columns: 1fr 592px; }
}

/* ─── Карточка ───────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 28px 24px;
}
.section:not(.section--alt) .card { background: var(--bg-alt); }
@media (min-width: 1024px) { .card { padding: 40px 48px; } }

/* ─── 01 · Услуги ────────────────────────────────────────── */
.services {
  display: grid;
  gap: 20px;
}
@media (min-width: 900px) {
  .services { grid-template-columns: 1fr 1fr; gap: 32px; align-items: stretch; }
}

.services__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  font: 500 clamp(20px, 2.4vw, 26px) var(--f-display);
  color: var(--ink);
}
.services__head svg { flex: 0 0 auto; color: var(--gold-ink); width: 24px; height: 24px; }
@media (min-width: 1024px) {
  .services__head { gap: 16px; margin-bottom: 24px; }
  .services__head svg { width: 28px; height: 28px; }
}

.rowlist li {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  font: 400 16px/1.5 var(--f-text);
  color: var(--ink-2);
}
@media (min-width: 1024px) { .rowlist li { padding: 14px 0; font-size: 17px; } }

/* ─── 02 · Награды ───────────────────────────────────────── */
.highlight {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 1px solid var(--gold);
  padding: 24px;
  margin-bottom: 36px;
}
.highlight__icon { color: var(--gold); width: 36px; height: 36px; }
.highlight__text {
  font: 500 clamp(18px, 2.1vw, 24px)/1.4 var(--f-display);
  color: var(--ink);
  text-wrap: pretty;
}
.highlight__text em { font-style: normal; color: var(--gold-ink); }

@media (min-width: 1024px) {
  .highlight {
    flex-direction: row;
    align-items: center;
    gap: 40px;
    padding: 36px 48px;
    margin-bottom: 48px;
  }
  .highlight__icon { width: 44px; height: 44px; }
}

.awards__row {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.awards__row:last-child { border-bottom: 1px solid var(--line); }

.awards__logo {
  height: var(--logo-h-m);
  width: auto;
  margin-bottom: 12px;
}
.awards__place {
  display: block;
  margin-bottom: 4px;
  font: 600 20px/1.25 var(--f-display);
  color: var(--gold-ink);
}
.awards__cat {
  display: block;
  font: 400 15px/1.45 var(--f-text);
  color: var(--muted);
}

@media (min-width: 900px) {
  .awards__row {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(140px, 220px) 1fr;
    gap: 40px;
    align-items: center;
    padding: 26px 0;
  }
  .awards__logo  { height: var(--logo-h); margin-bottom: 0; justify-self: start; }
  .awards__place { margin-bottom: 0; font-size: 24px; }
  .awards__cat   { font-size: 16px; }
}

/* ─── CTA-лента ──────────────────────────────────────────── */
.cta-band { background: var(--green); padding-block: 48px; }
.cta-band__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.cta-band__title {
  margin-bottom: 8px;
  font: 500 clamp(20px, 2.6vw, 28px)/1.28 var(--f-display);
  color: var(--bg);
  text-wrap: balance;
}
.cta-band__note {
  font: 400 15px/1.5 var(--f-text);
  color: var(--green-pale);
}
.cta-band .btn { display: block; }

@media (min-width: 900px) {
  .cta-band { padding-block: 64px; }
  .cta-band__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
  }
  .cta-band__note { font-size: 16px; }
  .cta-band .btn { display: inline-block; flex-shrink: 0; }
}

/* ─── 03 · Биография ─────────────────────────────────────── */
.bio { display: grid; gap: 28px; }
.bio__aside { order: -1; }

@media (min-width: 1024px) {
  .bio {
    grid-template-columns: minmax(320px, 480px) 1fr;
    gap: 64px;
    /* Без align-items: start — колонка должна растянуться на всю высоту
       строки, иначе sticky-обёртке внутри некуда ехать и фото уплывает */
    align-items: stretch;
  }
  .bio__aside { order: 0; align-self: stretch; }
  .bio__sticky { position: sticky; top: calc(var(--header-h) + 24px); }
}
@media (min-width: 1280px) { .bio { gap: 80px; } }

.bio__photo {
  height: clamp(340px, 90vw, 420px);
  overflow: hidden;
  background: var(--line-soft);
}
.bio__photo img {
  width: 100%;
  height: 100%;
  /* Кадр смещён влево: в портретную рамку попадают камин, фигура и диван,
     справа остаётся воздух по направлению взгляда */
  object-fit: cover;
  object-position: 38% 50%;
}
@media (min-width: 1024px) {
  /* Кадр не выше экрана — иначе sticky «уезжает» и низ фото не виден */
  .bio__photo { height: clamp(440px, calc(100dvh - var(--header-h) - 64px), 620px); }
}

/* Плейсхолдер изображения */
.img-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, rgba(194, 168, 120, .05) 0 12px, transparent 12px 24px),
    var(--bg);
  color: var(--muted-2);
  font: 400 14px var(--f-text);
  text-align: center;
  padding: 20px;
}
.img-slot svg { color: var(--gold); opacity: .7; }
.img-slot--dark {
  border-color: var(--green-line);
  background:
    repeating-linear-gradient(135deg, rgba(247, 245, 240, .05) 0 12px, transparent 12px 24px),
    rgba(0, 0, 0, .12);
  color: var(--green-pale);
}

/* Аккордеоны */
.acc { display: flex; flex-direction: column; }
.bio__body .acc { margin-top: 24px; }
@media (min-width: 1024px) { .bio__body .acc { margin-top: 20px; } }
.acc__item { border-top: 1px solid var(--line); }
.acc__item:last-child { border-bottom: 1px solid var(--line); }

.acc__sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  list-style: none;
  cursor: pointer;
  font: 500 19px/1.3 var(--f-display);
  color: var(--ink);
}
.acc__sum::-webkit-details-marker { display: none; }
.acc__sum > span { flex: 1; }
.acc__sum .chev {
  flex: 0 0 auto;
  color: var(--gold-ink);
  transition: transform .22s var(--ease);
}
.acc__item[open] > .acc__sum .chev { transform: rotate(180deg); }
.acc__body { padding-bottom: 20px; }

.acc--inline { margin-top: 0; }
.acc__item--bare,
.acc__item--bare:last-child { border: 0; }
.acc__sum--link {
  display: inline-flex;
  gap: 8px;
  padding: 0;
  font: 500 15px var(--f-text);
  color: var(--gold-ink);
}
.acc__sum--link > span {
  flex: 0 1 auto;
  border-bottom: 1px dashed var(--gold);
  padding-bottom: 2px;
}
.acc--inline .acc__body { padding: 12px 0 0; }

/* На десктопе аккордеоны раскрыты и не кликабельны — как в макете */
@media (min-width: 1024px) {
  .acc .acc__sum {
    cursor: default;
    pointer-events: none;
    padding: 36px 0 16px;
    font: 500 25px/1.25 var(--f-display);
  }
  .acc .acc__sum .chev { display: none; }
  .acc .acc__item:last-child { border-bottom: 0; }
  .acc .acc__body { padding: 0; }
  .acc .acc__item + .acc__item { margin-top: 40px; }

  .acc .acc__item--plain { border-top: 0; }
  .acc .acc__item--plain > .acc__sum { display: none; }
  .acc .acc__item--plain + .acc__item { margin-top: 48px; }

  .acc--inline .acc__sum { display: none; }
  .acc--inline .acc__item + .acc__item,
  .acc--inline .acc__item { margin-top: 0; }
}

/* ─── 04 · Клиенты и проекты ─────────────────────────────── */
.cols2 {
  display: grid;
  gap: 14px;
  margin-bottom: 36px;
}
@media (min-width: 1024px) {
  .cols2 { grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 64px; }
}

/* Карточки проектов: слайдер на мобильном, сетка на десктопе */
.projects {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gut);
  margin: 0 calc(var(--gut) * -1) 16px;
  padding-inline: var(--gut);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.projects::-webkit-scrollbar { display: none; }

.project {
  flex: 0 0 min(300px, 78vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 24px;
}
.project__title {
  margin-bottom: 18px;
  font: 500 16px/1.4 var(--f-text);
  color: var(--ink);
}
.project__foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.project__key {
  display: block;
  margin-bottom: 3px;
  font: 400 13px var(--f-text);
  color: var(--muted-2);
}
.project__val {
  display: block;
  margin-bottom: 6px;
  font: 600 19px/1.25 var(--f-display);
  color: var(--gold-ink);
}
.project__fee {
  display: block;
  font: 400 14px var(--f-text);
  color: var(--muted);
}

.snap-hint {
  margin-bottom: 40px;
  font: 400 13px var(--f-text);
  color: var(--muted-2);
}

@media (min-width: 768px) {
  .projects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    overflow: visible;
    margin: 0 0 64px;
    padding-inline: 0;
  }
  .project { padding: 26px; }
  .snap-hint { display: none; }
}
@media (min-width: 1024px) { .projects { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
@media (min-width: 1280px) {
  .projects { grid-template-columns: repeat(4, 1fr); margin-bottom: 72px; }
  .project { padding: 28px; }
  .project__title { margin-bottom: 28px; font-size: 17px; }
  .project__foot { padding-top: 14px; }
  .project__key { margin-bottom: 4px; }
  .project__val { margin-bottom: 10px; font-size: 21px; }
}

/* Дела в производстве */
.cases__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.cases__row:last-child { border-bottom: 1px solid var(--line); }

.cases__name {
  flex: 0 0 100%;
  margin-bottom: 8px;
  font: 400 16px/1.5 var(--f-text);
  color: var(--ink);
}
.cases__sum { font: 500 16px var(--f-text); color: var(--gold-ink); }
.cases__fee { font: 400 14px var(--f-text); color: var(--muted); }
.cases__fee::before { content: '· '; }

@media (min-width: 900px) {
  .cases__row {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 240px) minmax(150px, 200px);
    gap: 32px;
    align-items: baseline;
    padding: 20px 0;
  }
  .cases__name { flex: initial; margin-bottom: 0; font-size: 17px; }
  .cases__sum  { font-size: 17px; }
  .cases__fee  { font-size: 15px; }
  .cases__fee::before { content: none; }
}

/* ─── 05 · Медиа ─────────────────────────────────────────── */
.media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 40px;
  max-width: 1000px;
}
.media-list li { font: 500 14px var(--f-text); color: var(--muted-2); }
.media-list__more { font-weight: 400 !important; color: var(--muted-3) !important; }
@media (min-width: 1024px) {
  .media-list { gap: 12px 28px; margin-bottom: 56px; }
  .media-list li { font-size: 15px; }
}

.media-grid { display: grid; gap: 20px; align-items: stretch; }
@media (min-width: 1024px) {
  .media-grid { grid-template-columns: 1fr minmax(360px, 480px); gap: 32px; }
}

.media-note {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.media-note .prose { max-width: 560px; }
@media (min-width: 1024px) { .media-note { padding: 44px 48px; } }

.tg {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--green);
  color: var(--bg);
  padding: 28px 24px;
}
.tg__bg {
  position: absolute;
  right: -30px;
  bottom: -36px;
  width: 160px;
  height: 160px;
  color: var(--bg);
  opacity: .08;
  transform: rotate(-8deg);
}
.tg > *:not(.tg__bg) { position: relative; }
.tg__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font: 500 12px var(--f-text);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green-pale);
}
.tg__eyebrow svg { width: 14px; height: 14px; }
.tg__title {
  margin-bottom: 10px;
  font: 500 clamp(20px, 2.4vw, 26px)/1.22 var(--f-display);
}
.tg__text {
  margin-bottom: 22px;
  font: 400 15px/1.55 var(--f-text);
  color: var(--green-pale);
}
.tg__text strong { color: var(--bg); font-weight: 600; }
.tg .btn { align-self: flex-start; margin-top: auto; }

@media (min-width: 1024px) {
  .tg { padding: 44px 48px; }
  .tg__bg { right: -36px; bottom: -44px; width: 210px; height: 210px; }
  .tg__eyebrow { margin-bottom: 20px; font-size: 13px; letter-spacing: 2.5px; }
  .tg__eyebrow svg { width: 16px; height: 16px; }
  .tg__title { margin-bottom: 12px; }
  .tg__text { margin-bottom: 28px; font-size: 16px; }
}

/* ─── 06 · Контакты ──────────────────────────────────────── */
.contacts { display: grid; align-items: stretch; }
@media (min-width: 900px) { .contacts { grid-template-columns: 1fr 1fr; } }

.contacts__info {
  display: flex;
  flex-direction: column;
  background: var(--green);
  color: var(--bg);
  padding: 32px 24px;
}
.contacts__title {
  margin-bottom: 18px;
  font: 500 clamp(20px, 2.4vw, 26px) var(--f-display);
  color: var(--bg);
}
.contacts__item {
  padding: 12px 0;
  border-top: 1px solid var(--green-line);
}
.contacts__item dt {
  margin-bottom: 4px;
  font: 400 13px var(--f-text);
  color: var(--green-pale);
}
.contacts__item dd {
  font: 400 16px/1.5 var(--f-text);
  color: var(--bg);
}
.contacts__link { color: var(--bg); font-weight: 500; }
.contacts__link:hover { color: var(--gold); opacity: 1; }
.contacts__tbd { color: var(--green-pale) !important; font-style: italic; }

.contacts__photo {
  min-height: 200px;
  margin-top: 24px;
  overflow: hidden;
}
/* min-height у img берётся через inherit от родительского ЭЛЕМЕНТА, а не от
   containing block, поэтому обёртке <picture> нужно пробросить значение дальше */
.contacts__photo picture { min-height: inherit; }
.contacts__photo img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  object-position: 50% 55%;
}

@media (min-width: 900px) {
  .contacts__info { padding: 40px 32px; }
  .contacts__item:last-child { border-bottom: 1px solid var(--green-line); }
  .contacts__photo { flex: 1; min-height: 220px; margin-top: 32px; }
}
@media (min-width: 1280px) {
  .contacts__info { padding: 52px 56px; }
  .contacts__title { margin-bottom: 28px; }
  .contacts__item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    padding: 14px 0;
  }
  .contacts__item dt { margin-bottom: 0; font-size: 15px; }
  .contacts__photo { margin-top: 36px; }
}

.contacts__form {
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-top: none;
  padding: 32px 24px;
}
@media (min-width: 900px) {
  .contacts__form { border-top: 1px solid var(--line); border-left: none; padding: 40px 32px; }
}
@media (min-width: 1280px) { .contacts__form { padding: 52px 56px; } }

/* ─── Формы ──────────────────────────────────────────────── */
.form__title {
  margin-bottom: 6px;
  font: 500 clamp(20px, 2.4vw, 26px) var(--f-display);
  color: var(--ink);
}
.form__sub {
  margin-bottom: 24px;
  font: 400 14px/1.5 var(--f-text);
  color: var(--muted);
}
@media (min-width: 1024px) {
  .form__title { margin-bottom: 8px; }
  .form__sub { margin-bottom: 28px; font-size: 15px; }
}

.form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.field { margin-bottom: 16px; }
.field--grow { display: flex; flex-direction: column; flex: 1; }
@media (min-width: 1024px) { .field { margin-bottom: 18px; } }

.field__label {
  display: block;
  margin-bottom: 6px;
  font: 500 14px var(--f-text);
  color: var(--ink-2);
}
@media (min-width: 1024px) { .field__label { margin-bottom: 8px; } }

.input {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line-input);
  padding: 14px;
  font: 400 16px var(--f-text);
  color: var(--ink);
  outline: none;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.input:hover { border-color: #c3bfb1; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194, 168, 120, .18); }
.input::placeholder { color: #9a9c91; }
@media (min-width: 1024px) { .input { padding: 15px 16px; } }

.textarea {
  line-height: 1.5;
  resize: vertical;
  min-height: 96px;
}
.textarea--tall { flex: 1; min-height: 120px; }
@media (min-width: 1024px) { .textarea--tall { min-height: 140px; } }

.field__error {
  margin-top: 6px;
  font: 400 13px/1.4 var(--f-text);
  color: var(--err);
}

.field.is-invalid .field__label { color: var(--err); }
.field.is-invalid .input {
  background: var(--err-bg);
  border-color: var(--err-line);
}
.field.is-invalid .input:focus { box-shadow: 0 0 0 3px rgba(201, 106, 81, .18); }

/* Ловушка для ботов: не показываем, но и не прячем через display:none —
   так поле остаётся в разметке и наивный спам-бот его заполняет. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font: 400 13px/1.5 var(--f-text);
  color: var(--muted);
}
.consent input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  width: 17px;
  height: 17px;
  accent-color: var(--green);
  cursor: pointer;
}
.consent a { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 2px; }
.consent.is-invalid { color: var(--err); }
.consent.is-invalid input { outline: 2px solid var(--err-line); outline-offset: 2px; }

.consent + .field__error { margin-bottom: 0; }
.form .consent { margin-bottom: 20px; }
.form .consent + .field__error { margin: -14px 0 20px; }
@media (min-width: 1024px) {
  .consent { gap: 12px; font-size: 14px; }
  .form .consent { margin-bottom: 24px; }
}

.form__hint {
  margin-top: 10px;
  font: 400 13px/1.5 var(--f-text);
  color: var(--muted-2);
  text-align: center;
}
.form__fail {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--err-bg);
  border: 1px solid var(--err-line);
  font: 400 13px/1.5 var(--f-text);
  color: var(--err);
  text-align: center;
}
.form__fail a { color: var(--err); font-weight: 600; text-decoration: underline; }
.form button[type="submit"][data-busy] { opacity: .65; pointer-events: none; }

/* Блок «О ведении дела» */
.note-box {
  border: 1px solid var(--gold);
  margin-top: 32px;
  padding: 24px;
}
.note-box .prose { max-width: 1000px; }
@media (min-width: 1024px) { .note-box { margin-top: 48px; padding: 40px 48px; } }

/* ─── Подвал ─────────────────────────────────────────────── */
.footer { background: var(--green-deep); padding-block: 36px; }
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.footer__mid { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.footer__addr  { font: 400 14px var(--f-text); color: var(--green-mid); }
.footer__phone { font: 500 15px var(--f-text); color: var(--bg); }
.footer__phone:hover { color: var(--gold); opacity: 1; }
.footer__legal { font: 400 12px var(--f-text); color: var(--green-dim); }
.footer__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 900px) {
  .footer { padding-block: 44px; }
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    gap: 32px;
  }
  .footer__mid { flex-direction: row; gap: 40px; }
  .footer__legal { font-size: 13px; }
}

/* ─── Попапы ─────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal[hidden] { display: none; }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(28, 30, 26, .55);
  animation: fade-in .2s var(--ease);
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--bg-alt);
  padding: 40px 24px;
  animation: modal-in .24s var(--ease);
}
.modal__box--sm { max-width: 440px; }
@media (min-width: 768px) { .modal__box { padding: 48px 52px; } }

@keyframes fade-in  { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } }

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--muted-2);
  cursor: pointer;
}
.modal__close:hover { color: var(--ink); }
@media (min-width: 768px) { .modal__close { top: 20px; right: 20px; } }

.success { text-align: center; }
.success__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-ink);
}
.success__title {
  margin-bottom: 12px;
  font: 500 clamp(22px, 3vw, 26px) var(--f-display);
  color: var(--ink);
}
.success__text {
  margin-bottom: 32px;
  font: 400 16px/1.6 var(--f-text);
  color: var(--ink-3);
}
.success .btn { padding-inline: 48px; }

/* ─── Cookies ────────────────────────────────────────────── */
.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  padding: 12px;
  animation: cookie-in .3s .4s var(--ease) backwards;
}
.cookie[hidden] { display: none; }

@keyframes cookie-in { from { opacity: 0; transform: translateY(100%); } }

.cookie__box { background: var(--ink); padding: 20px; }
.cookie__text {
  margin-bottom: 16px;
  font: 400 13px/1.55 var(--f-text);
  color: #b9beb3;
}
.cookie__text a { color: var(--gold); text-decoration: underline; }
.cookie__actions { display: flex; flex-direction: column; gap: 10px; }

@media (min-width: 900px) {
  .cookie { padding: 0; }
  .cookie__box {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 24px var(--gut);
  }
  .cookie__text { flex: 1; margin-bottom: 0; font-size: 14px; }
  .cookie__actions { flex-direction: row; gap: 12px; flex-shrink: 0; }
  .cookie__actions [data-cookie="necessary"] { order: -1; }
}

/* ─── Правовые страницы (политика конфиденциальности) ────── */
.legal { padding-block: 40px 64px; }
@media (min-width: 768px)  { .legal { padding-block: 56px 80px; } }
@media (min-width: 1024px) { .legal { padding-block: 72px 100px; } }

/* Колонка чтения выравнивается по левому краю шелла, как .lead на главной */
.legal__title,
.legal__h2,
.legal p,
.legal__list { max-width: 860px; }

.legal p {
  font: 400 16px/1.7 var(--f-text);
  color: var(--ink-2);
  text-wrap: pretty;
}
.legal p + p { margin-top: 12px; }
.legal a { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 1024px) { .legal p { font-size: 17px; } }

.legal a.legal__back {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font: 500 14px var(--f-text);
  color: var(--gold-ink);
}
.legal__back:hover { color: var(--ink); opacity: 1; }

.legal__title {
  margin-bottom: 12px;
  font: 500 clamp(26px, 3.8vw, 40px)/1.15 var(--f-display);
  letter-spacing: -.5px;
  color: var(--ink);
  text-wrap: balance;
}
.legal p.legal__meta {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  font: 400 14px/1.6 var(--f-text);
  color: var(--muted);
}
@media (min-width: 1024px) { .legal p.legal__meta { margin-bottom: 44px; } }

.legal__h2 {
  margin: 36px 0 14px;
  font: 500 clamp(19px, 2.1vw, 23px)/1.3 var(--f-display);
  color: var(--ink);
}
.legal__h2:first-of-type { margin-top: 0; }

.legal__list { display: flex; flex-direction: column; gap: 12px; }
.legal__list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
  font: 400 16px/1.7 var(--f-text);
  color: var(--ink-2);
}
.legal__list li b {
  font-weight: 500;
  color: var(--gold-ink);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 768px)  { .legal__list li { grid-template-columns: 48px 1fr; gap: 12px; } }
@media (min-width: 1024px) { .legal__list li { font-size: 17px; } }

/* ─── Появление при скролле ──────────────────────────────── */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ─── Печать ─────────────────────────────────────────────── */
@media print {
  .grain, .header, .mmenu, .cookie, .modal, .cta-band .btn, .snap-hint { display: none !important; }
  body { background: #fff; }
  .section { padding-block: 24px; break-inside: avoid; }
  .projects { display: grid !important; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}
