/* Engrave — палитра взята из логотипа: тёмно-синий, красный, белый */
:root {
  --navy: #00324d;
  --navy-700: #002438;
  --navy-100: #e8eef2;
  --red: #ff1800;
  --red-700: #d81400;
  --ink: #16202a;
  --muted: #5c6b78;
  --line: #dde5ea;
  --bg: #fff;
  --bg-soft: #f5f8fa;
  --wrap: 1280px;
  --radius: 4px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(21px, 3vw, 30px); }
h3 { font-size: 18px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--red); color: #fff;
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Шапка ---------- */
.hdr { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.hdr__in { display: flex; align-items: center; gap: 20px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: 0 0 auto; }
.brand__mark { border-radius: var(--radius); }
.brand__text b { display: block; font-size: 19px; letter-spacing: .04em; }
.brand__text i { display: block; font-size: 12px; font-style: normal; color: #8fb0c4; }

.nav { margin-left: auto; }
.nav__in { display: flex; gap: 4px; flex-wrap: wrap; }
/* Верхний отступ на пиксель меньше нижнего: строка центрируется по метрикам
   шрифта, где снизу отведено место под выносные у «у», «р», «д». В коротких
   пунктах меню их нет, и текст садится ниже середины плашки. */
.nav a {
  color: #d7e5ee; text-decoration: none; font-size: 14px; padding: 7px 10px 9px;
  border-radius: var(--radius); white-space: nowrap;
  transition: background-color .18s, color .18s;
}
.nav a:hover { background: var(--navy-700); color: #fff; }

.hdr__phone {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.25); padding: 6px 14px 10px; border-radius: var(--radius);
  transition: background-color .2s, border-color .2s;
}
.hdr__phone:hover { background: var(--red); border-color: var(--red); }
/* Значок показываем только на узких экранах вместо самого номера */
.hdr__phone__ico { display: none; flex: 0 0 auto; }

.burger { display: none; }

/* ---------- Хлебные крошки ---------- */
.crumbs { font-size: 13px; color: var(--muted); padding: 14px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a::after { content: "→"; margin-left: 8px; color: var(--line); }

/* ---------- Первый экран ---------- */
.hero { background: var(--navy); color: #fff; padding: clamp(38px, 7vw, 76px) 0; }
.hero h1 { max-width: 20ch; }
.hero p { max-width: 62ch; color: #c6d8e3; font-size: 17px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* Мессенджеры в первом экране: до подвала долистывают не все.
   Селектор с .hero — иначе общее правило `.hero p` перебивает по специфичности */
.hero p.hero__msgr { margin: 14px 0 0; font-size: 15px; color: #8fb0c4; }
.hero__msgr a {
  color: #fff; text-decoration: none; margin-left: 10px;
  border-bottom: 1px solid rgba(255,255,255,.3); padding-bottom: 1px;
  transition: border-color .2s, color .2s;
}
.hero__msgr a:hover { color: var(--red); border-bottom-color: var(--red); }

/* Текст слева, снимок изделия справа, полоса фактов на всю ширину под ними */
.hero__in {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, .88fr);
  column-gap: clamp(28px, 4vw, 56px);
}
.hero__facts { grid-column: 1 / -1; }

.hero__pic { margin: 0; position: relative; }
.hero__pic img {
  width: 100%; height: clamp(300px, 32vw, 430px);
  object-fit: cover; border-radius: var(--radius);
}
.hero__pic figcaption {
  position: absolute; left: 14px; bottom: 14px; max-width: calc(100% - 28px);
  background: rgba(0, 26, 40, .82); font-size: 13px; padding: 7px 12px;
  border-radius: var(--radius);
}

.hero__facts { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 34px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.14); }
.hero__fact b { display: block; font-size: 22px; }
.hero__fact span { font-size: 13px; color: #8fb0c4; }

.btn {
  display: inline-block; padding: 11px 24px 15px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; border: 1px solid transparent; cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s;
}
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-700); }
.btn--ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.btn--ghost:hover { border-color: #fff; }

/* ---------- Секции ---------- */
.sect { padding: clamp(40px, 6vw, 72px) 0; }
.sect--soft { background: var(--bg-soft); }
.sect__head { margin-bottom: 30px; }
.sect__head p { color: var(--muted); max-width: 70ch; margin: 0; }

/* ---------- Плитки услуг ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--navy); transform: translateY(-2px); }
.card__pic { aspect-ratio: 4/3; background: var(--navy-100); overflow: hidden; }
.card__pic img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__body h3 { margin: 0; }
.card__body p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.card__price { font-weight: 700; color: var(--navy); }

/* ---------- Мозаика работ ---------- */
.mosaic { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mosaic__item {
  position: relative; display: block; border: 0; padding: 0; background: var(--navy-100);
  aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); cursor: zoom-in;
}
.mosaic__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mosaic__item:hover img { transform: scale(1.04); }
.mosaic__cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
  background: linear-gradient(transparent, rgba(0,20,32,.85));
  color: #fff; font-size: 13px; text-align: left;
}
.mosaic__item[data-nozoom] { cursor: default; }

/* ---------- Лайтбокс ---------- */
.lb {
  position: fixed; inset: 0; background: rgba(0,18,29,.94); display: none;
  align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.lb[open], .lb.is-open { display: flex; }
.lb img { max-width: 100%; max-height: 84vh; object-fit: contain; }
.lb__cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #cfe0ea; font-size: 14px; }
.lb__close, .lb__nav {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0;
  width: 46px; height: 46px; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1;
}
.lb__close { top: 18px; right: 18px; }
.lb__nav { top: 50%; transform: translateY(-50%); }
.lb__nav--prev { left: 18px; }
.lb__nav--next { right: 18px; }
.lb__close:hover, .lb__nav:hover { background: var(--red); }

/* ---------- Текстовый блок услуги ---------- */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* ---------- Цена ---------- */
.price {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; background: var(--bg-soft);
}
.price__val { font-size: 26px; font-weight: 700; color: var(--red); }
.price__note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.price__cta { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-700); }
.btn--line { border-color: var(--line); color: var(--navy); background: #fff; }
.btn--line:hover { border-color: var(--navy); }

/* ---------- Преимущества, материалы ---------- */
/* Минимальная сумма заказа — у конкурентов она в разы выше, поэтому не прячем */
.minorder {
  margin-top: 16px; padding: 16px 18px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
}
.minorder i {
  display: block; font-style: normal; font-size: 13px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--muted);
}
.minorder b { display: block; margin-top: 3px; font-size: 24px; line-height: 1.1; }
.minorder span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }

/* Что прислать для расчёта */
.src { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.src li { padding: 16px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.src b { display: block; margin-bottom: 5px; }
.src span { font-size: 14px; color: var(--muted); }

.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.feat { border-top: 2px solid var(--red); padding-top: 14px; }
.feat b { display: block; margin-bottom: 4px; }
.feat span { color: var(--muted); font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tags li {
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px;
  font-size: 14px; background: #fff;
}

/* ---------- Контакты и карта ---------- */
.contacts { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 24px; align-items: start; }
.contacts__map { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-height: 380px; }
.contacts__map iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }
.contact__row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact__row b { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-bottom: 3px; }
.contact__row a { font-size: 18px; font-weight: 600; text-decoration: none; transition: color .18s; }
.contact__row a:hover { color: var(--red); }

/* ---------- Сертификаты ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.doc {
  display: flex; gap: 12px; align-items: center; padding: 16px; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); color: inherit; background: #fff;
}
.doc { transition: border-color .18s; }
.doc:hover { border-color: var(--navy); }
.doc__ico { width: 38px; height: 38px; flex: 0 0 38px; background: var(--red); color: #fff;
  display: grid; place-items: center; border-radius: var(--radius); font-size: 11px; font-weight: 700; }
.doc b { display: block; font-size: 15px; }
/* :not(.doc__ico) обязателен — иначе это правило перебивает белый цвет значка
   по специфичности и «PDF» получается тёмным на красном */
.doc span:not(.doc__ico) { font-size: 13px; color: var(--muted); }

/* ---------- Отзывы ---------- */
.rating { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.rating__val { font-size: 40px; font-weight: 700; color: var(--navy); line-height: 1; }
.rating__meta { font-size: 14px; color: var(--muted); }

/* ---------- Подвал ---------- */
.ftr { background: var(--navy); color: #b9cfdd; margin-top: 60px; padding: 46px 0 0; font-size: 14px; }
.ftr__in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.ftr h3 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.ftr a { color: #b9cfdd; text-decoration: none; display: block; padding: 3px 0; }
.ftr a:hover { color: #fff; }
.ftr__phone { font-size: 19px !important; font-weight: 700; color: #fff !important; }
.ftr__note { color: #8fb0c4; margin: 10px 0 0; }
.brand--ftr { margin-bottom: 4px; }
.msgr { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.msgr a, .msgr span { display: inline-block; font-size: 13px; }
.ftr__legal {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 18px; padding-bottom: 22px;
  display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: #7d9db1;
}

/* ---------- Отзывы ---------- */
.ywidget { position: relative; width: 100%; max-width: 760px; overflow: hidden; }
.ywidget iframe {
  width: 100%; height: 100%; border: 1px solid var(--line);
  border-radius: var(--radius); box-sizing: border-box; display: block;
}
/* Ссылка под виджетом: видна, если iframe не загрузился */
.ywidget__fallback {
  position: absolute; left: 0; right: 0; bottom: 8px; z-index: -1;
  text-align: center; font-size: 13px; color: var(--muted);
}

/* Плашки площадок. Цифры разные, поэтому колонки равной ширины, а не по контенту */
.rbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.rbar__i {
  display: grid; gap: 3px; padding: 18px 20px; text-decoration: none; color: inherit;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
}
.sect--soft .rbar__i { background: var(--bg); }
.rbar__i { transition: border-color .18s; }
.rbar__i:hover { border-color: var(--navy); }
.rbar__name { font-size: 13px; color: var(--muted); }
.rbar__val { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--navy); }
.rbar__cnt { font-size: 14px; font-weight: 600; }
.rbar__note { font-size: 12px; color: var(--muted); }

.stars { color: var(--red); letter-spacing: 1px; font-size: 14px; line-height: 1; }
.stars i { color: var(--line); font-style: normal; }

/* align-items: start — иначе короткий отзыв растягивается по высоте соседнего
   длинного и получается карточка с пустотой в половину высоты */
.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.quote { margin: 0; padding: 20px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.sect--soft .quote { background: var(--bg); }
.quote .stars { display: block; margin-bottom: 10px; }
.quote blockquote { margin: 0 0 14px; font-size: 15px; line-height: 1.65; }
.quote figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; }
.quote figcaption b { font-size: 14px; }
.quote figcaption span { color: var(--muted); }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; row-gap: 18px; }
  .hero__pic img { height: clamp(200px, 42vw, 280px); }
  .contacts { grid-template-columns: 1fr; }
  .ftr__in { grid-template-columns: 1fr 1fr; }
  .svc-grid { grid-template-columns: 1fr !important; }

  /* В одну колонку снимок изделия уезжал под сгиб — а это главное
     доказательство. display: contents распускает .hero__text, и порядок
     задаётся поэлементно: заголовок, фото, кнопки, потом текст и цифры.
     Отступы снимаем, расстояние держит row-gap сетки */
  .hero__text { display: contents; }
  .hero__in h1 { order: 1; margin-bottom: 0; }
  .hero__pic { order: 2; }
  .hero__actions { order: 3; margin-top: 0; }
  .hero p.hero__msgr { order: 4; margin-top: 0; }
  .hero__lead { order: 5; }
  .hero__facts { order: 6; margin-top: 6px; }
}

/* Горизонтальное меню помещается в одну строку от 1200px, ниже — бургер */
@media (max-width: 1200px) {
  .burger {
    display: block; margin-left: auto; width: 42px; height: 42px; cursor: pointer;
    position: relative; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius);
  }
  .burger span, .burger span::before, .burger span::after {
    position: absolute; width: 18px; height: 2px; background: #fff; content: "";
  }
  /* left задаём отдельно: псевдоэлементы отсчитывают его от span, а не от
     кнопки, поэтому общий left сдвигал верхнюю и нижнюю полоски вправо */
  .burger span { left: 11px; top: 19px; transition: background-color .18s; }
  .burger span::before { left: 0; top: -6px; }
  .burger span::after { left: 0; top: 6px; }
  .burger span::before, .burger span::after {
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  }

  /* Открыто — значок складывается в шеврон вверх: средняя полоска гаснет,
     крайние укорачиваются вдвое и сходятся вершиной над центром кнопки.
     Смещения посчитаны от центра полоски (9px, 0): при повороте на 45°
     конец плеча уходит на 3.5px по обеим осям, поэтому сдвиг на 3.5px
     сводит оба конца ровно в одну точку.
     Саму span не трансформируем — псевдоэлементы её дети и поехали бы с ней */
  .navtoggle:checked ~ .burger span { background: transparent; }
  .navtoggle:checked ~ .burger span::before {
    transform: translate(-3.5px, 6px) rotate(-45deg) scaleX(.55);
  }
  .navtoggle:checked ~ .burger span::after {
    transform: translate(3.5px, -6px) rotate(45deg) scaleX(.55);
  }

  /* display: none не анимируется, поэтому меню раскрывается через
     grid-template-rows 0fr→1fr: высота считается по содержимому, подбирать
     max-height не нужно. visibility убирает ссылки из фокуса в закрытом
     состоянии и переключается только после анимации, иначе она бы обрезалась */
  .nav {
    order: 3; width: 100%; margin-left: 0;
    display: grid; grid-template-rows: 0fr; overflow: hidden; visibility: hidden;
    transition: grid-template-rows .3s ease, visibility 0s .3s;
  }
  .navtoggle:checked ~ .nav {
    grid-template-rows: 1fr; visibility: visible;
    transition: grid-template-rows .3s ease, visibility 0s;
  }
  /* min-height: 0 — без него грид-элемент не сжимается до нуля.
     flex-wrap: nowrap обязателен: базовое правило ставит wrap для строки
     меню, а при направлении column перенос идёт по колонкам — пока высота
     сжата, пункты расползались вправо в несколько столбцов и в конце
     анимации схлопывались в один. Без переноса они просто обрезаются,
     и меню выезжает шторкой */
  .nav__in { flex-direction: column; flex-wrap: nowrap; gap: 0; min-height: 0; }
  /* flex: none — иначе ссылки сжимаются вместе с треком вместо обрезки */
  .nav a { padding: 10px 6px 12px; border-bottom: 1px solid rgba(255,255,255,.1); flex: none; }
  /* Отступ снизу — марджином последней ссылки, а не padding'ом обёртки:
     padding обёртки не сжимается вместе с треком и в закрытом меню
     добавлял к шапке лишние 12px */
  .nav a:last-child { margin-bottom: 12px; }

  .hdr__in { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .hdr__phone { order: 2; font-size: 14px; padding: 5px 12px 9px; }
}

/* Ниже 620px номер целиком в строку не помещается и переносится вниз,
   отодвигая первый экран. Оставляем от кнопки только значок трубки */
@media (max-width: 620px) {
  .hdr__in { gap: 12px; }
  .hdr__phone {
    order: 1; margin-left: auto;
    width: 42px; height: 42px; padding: 0; justify-content: center;
  }
  .hdr__phone span { display: none; }
  .hdr__phone__ico { display: block; }
  .burger { order: 2; margin-left: 0; }
}

@media (max-width: 780px) {
  .ftr__in { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- Появление блоков при прокрутке ---------- */
/* Класс .rv навешивает скрипт. Так задумано: если он не отработал,
   содержимое остаётся видимым, а не висит прозрачным навсегда */
.rv {
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: var(--rv-d, 0s);
}
.rv.is-in { opacity: 1; transform: none; }
/* Карточке возвращаем её собственный переход: правило .rv перебивало его
   и подъём при наведении становился вялым */
.card.rv.is-in { transition: border-color .15s, transform .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .rv { opacity: 1; transform: none; }
}
