/* ==========================================================================
   Лендинг строительной компании.
   Мобильный-first, системные шрифты, один акцентный цвет.
   Переменные --accent* переопределяются инлайновым <style> из настроек сайта.
   ========================================================================== */

:root {
  /* Палитра */
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1c1917;
  --text-soft: #44403c;
  --muted: #78716c;
  --line: #e7e5e4;
  --line-strong: #d6d3d1;

  /* Акцент (значения по умолчанию, перекрываются настройками) */
  --accent: #c2410c;
  --accent-text: #c2410c;
  --accent-strong: #c2410c;
  --accent-deep: #9f350a;
  --accent-soft: #faf0ec;
  --accent-line: #eecabb;

  /* Геометрия */
  --container: 1120px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 60px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
  --shadow-md: 0 10px 30px rgba(28, 25, 23, .10);

  --focus-ring: #1c1917;

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Базовые стили
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0;
}

ul, ol, dl, dd {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent-text);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-deep);
}

button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* --------------------------------------------------------------------------
   Утилиты
   -------------------------------------------------------------------------- */

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -120px;
  left: var(--gutter);
  z-index: 200;
  padding: 0.7rem 1.1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem;
}

.icon {
  width: 24px;
  height: 24px;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.prose p {
  margin-bottom: 0.7em;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.btn--primary {
  background: var(--accent-strong);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--accent-deep);
  color: #ffffff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: var(--surface);
  border-color: var(--text);
  color: var(--text);
}

.btn--outline {
  background: var(--surface);
  color: var(--accent-text);
  border-color: var(--accent-line);
}

.btn--outline:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.btn--wide {
  width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-strong);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__tagline {
  display: none;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav {
  display: none;
}

.site-header.is-nav-open .site-nav {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.site-nav__list {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.5rem var(--gutter) 1rem;
}

.site-nav__link {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link[aria-current] {
  color: var(--accent-text);
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-phone:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.header-phone .icon--sm {
  color: var(--accent-text);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* На совсем узких экранах подпись прячем, но имя кнопки для скринридера остаётся */
@media (max-width: 399px) {
  .nav-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav-toggle__bars {
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before {
  top: -6px;
}

.nav-toggle__bars::after {
  top: 6px;
}

/* Телефон в шапке на узких экранах — только иконка, но с доступным именем */
@media (max-width: 599px) {
  .header-phone {
    justify-content: center;
    min-width: 44px;
  }

  .header-phone__value {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

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

main {
  display: block;
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.section--alt {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

/* две светлые секции подряд не должны давать двойную линию */
.section--alt + .section--alt {
  border-top: 0;
}

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
}

.section-head__title {
  font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.25rem);
}

.section-head__sub {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   Первый экран
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: clamp(2.5rem, 7vw, 4.5rem);
}

.hero__inner {
  display: grid;
  gap: clamp(1.75rem, 5vw, 3rem);
}

.hero__text {
  min-width: 0;
}

.hero__eyebrow {
  margin-bottom: 0.75rem;
  color: var(--accent-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(2rem, 1.35rem + 2.9vw, 3.15rem);
}

.hero__lead {
  margin-top: 1rem;
  max-width: 34rem;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.hero__facts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.98rem;
}

.hero__facts li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.hero__facts li::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero__media {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: var(--shadow-md);
}

.hero__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Блок «о компании» под первым экраном */
.about {
  margin-top: clamp(2.5rem, 7vw, 4rem);
  border-top: 1px solid var(--line);
}

.about__inner {
  display: grid;
  gap: 0.75rem;
  padding-top: clamp(1.75rem, 4vw, 2.5rem);
}

.about__title {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem);
}

.about__text {
  max-width: 58ch;
  color: var(--text-soft);
}

/* --------------------------------------------------------------------------
   Услуги
   -------------------------------------------------------------------------- */

.services-grid {
  display: grid;
  gap: 1rem;
}

.service-card {
  padding: 1.35rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.service-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.service-card__title {
  margin: 0.9rem 0 0.4rem;
  font-size: 1.12rem;
}

.service-card__text {
  color: var(--muted);
  font-size: 0.98rem;
}

/* --------------------------------------------------------------------------
   Проекты
   -------------------------------------------------------------------------- */

.projects-grid {
  display: grid;
  gap: 1.25rem;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

/* карточка без фотографий не «поднимается» — по ней некуда кликать */
.project-card--static:hover {
  border-color: var(--line);
  box-shadow: none;
}

.project-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--line);
  overflow: hidden;
}

.project-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.project-card:hover .project-card__photo {
  transform: scale(1.03);
}

.project-card__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  background:
    repeating-linear-gradient(135deg, var(--line) 0 10px, var(--bg) 10px 20px);
}

.project-card__tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(28, 25, 23, .82);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
}

.project-card__body {
  flex: 1 1 auto;
  padding: 1rem 1.1rem 1.25rem;
}

.project-card__title {
  font-size: 1.1rem;
}

.project-card__open {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.project-card__open::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project-card__open:hover {
  color: var(--accent-text);
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.project-card__meta span + span::before {
  content: "·";
  margin-right: 0.4rem;
  color: var(--line-strong);
}

.project-card__count {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Цены
   -------------------------------------------------------------------------- */

.price-groups {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.25rem);
}

.price-group__title {
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table__title {
  display: block;
  font-weight: 500;
}

.price-table__note {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Мобильный вид: строки превращаются в карточки */
@media (max-width: 719px) {
  .price-table thead {
    display: none;
  }

  .price-table,
  .price-table tbody,
  .price-table tr,
  .price-table td {
    display: block;
    width: 100%;
  }

  .price-table tr {
    margin-bottom: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }

  .price-table td {
    padding: 0;
  }

  .price-table td[data-label] {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.45rem;
    font-size: 0.95rem;
  }

  .price-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
  }

  .price-table__value {
    font-weight: 600;
  }
}

@media (min-width: 720px) {
  .price-table th {
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--line-strong);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }

  .price-table td {
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }

  .price-table__work {
    width: 60%;
  }

  .price-table th:last-child,
  .price-table__value {
    text-align: right;
  }

  .price-table__unit {
    color: var(--muted);
    white-space: nowrap;
  }

  .price-table__value {
    font-weight: 600;
    white-space: nowrap;
  }
}

.prices-note {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  max-width: 62rem;
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
  padding: 1rem 1.1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.95rem;
}

.prices-note__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  border-radius: 50%;
  background: var(--accent-strong);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Партнёры
   -------------------------------------------------------------------------- */

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.partner__box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

a.partner__box:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.partner__logo {
  max-height: 54px;
  width: auto;
  object-fit: contain;
}

.partner__plaque {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}

.partner__mono {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.partner__name {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
}

.partner__note {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

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

.contacts-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.contact-list {
  border-top: 1px solid var(--line);
}

.contact-row {
  display: grid;
  gap: 0.1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-row dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.contact-row dd {
  font-size: 1.05rem;
}

.contact-strong {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}

.contact-strong:hover {
  color: var(--accent-text);
}

.contact-cta {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-self: start;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-cta__text {
  color: var(--text-soft);
}

.contact-cta__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.contact-cta__row .btn {
  flex: 1 1 8rem;
}

/* --------------------------------------------------------------------------
   Форма заявки
   -------------------------------------------------------------------------- */

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.lead-form__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.lead-form__label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-soft);
  font-size: 0.875rem;
  font-weight: 600;
}

.lead-form__input,
.lead-form__select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.8rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  /* 16px ровно: при меньшем размере iOS увеличивает страницу на фокусе */
  font-size: 16px;
  line-height: 1.4;
}

.lead-form__input:focus,
.lead-form__select:focus {
  border-color: var(--accent);
}

.lead-form__input.is-error {
  border-color: #b91c1c;
}

.lead-form__area {
  min-height: 96px;
  resize: vertical;
}

/* Ловушка для ботов: уводим за экран, а не прячем через display — скрытые
   поля заполняются реже, чем те, что бот «видит» в разметке. */
.lead-form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lead-form__note {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.9rem;
}

.lead-form__note.is-error {
  color: #b91c1c;
}

.lead-form__note.is-ok {
  font-weight: 600;
}

.lead-form__policy {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.lead-form__done {
  margin: 0;
  font-weight: 600;
}

.lead-form .btn[disabled] {
  opacity: 0.65;
  cursor: default;
}

/* --------------------------------------------------------------------------
   Подвал
   -------------------------------------------------------------------------- */

.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: grid;
  gap: 0.35rem;
}

.site-footer__brand {
  font-weight: 700;
}

.site-footer__legal,
.site-footer__copy {
  color: var(--muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Кнопка звонка на мобильных
   -------------------------------------------------------------------------- */

.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem var(--gutter);
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(28, 25, 23, .10);
  transition: transform .25s ease;
}

.callbar.is-hidden {
  transform: translateY(130%);
}

.callbar__call,
.callbar__chat {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

.callbar__call {
  flex: 2 1 0;
  background: var(--accent-strong);
  color: #ffffff;
}

.callbar__chat {
  flex: 1 1 0;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-text);
}

body:has(.callbar) {
  padding-bottom: 5.5rem;
}

/* --------------------------------------------------------------------------
   Лайтбокс
   -------------------------------------------------------------------------- */

.is-lightbox-open {
  overflow: hidden;
  padding-right: var(--scrollbar-gap, 0px);
}

.lightbox {
  --focus-ring: #ffffff;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2.5vw, 2rem);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, .93);
}

.lightbox__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(1100px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #f5f5f4;
}

.lightbox__close,
.lightbox__nav {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .30);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: background-color .18s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgba(255, 255, 255, .22);
}

.lightbox__close {
  align-self: flex-end;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
}

.lightbox__close svg {
  width: 22px;
  height: 22px;
}

.lightbox__stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
  touch-action: pan-y;
}

.lightbox__nav {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

.lightbox__nav[hidden] {
  display: none;
}

.lightbox__nav svg {
  width: 24px;
  height: 24px;
}

.lightbox__figure {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
}

.lightbox__image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  transition: opacity .2s ease;
}

.lightbox__image.is-loading {
  opacity: .3;
}

.lightbox__caption {
  max-width: 62ch;
  margin-inline: auto;
  text-align: center;
}

.lightbox__title {
  font-size: 1.15rem;
}

.lightbox__meta {
  margin-top: 0.25rem;
  color: #d6d3d1;
  font-size: 0.9rem;
}

.lightbox__desc {
  margin-top: 0.5rem;
  color: #e7e5e4;
  font-size: 0.95rem;
}

.lightbox__counter {
  margin-top: 0.5rem;
  color: #a8a29e;
  font-size: 0.85rem;
}

/* На узких экранах стрелки лежат поверх снимка */
@media (max-width: 639px) {
  .lightbox__nav {
    position: absolute;
    bottom: 0.5rem;
    z-index: 2;
  }

  .lightbox__nav--prev {
    left: 0.5rem;
  }

  .lightbox__nav--next {
    right: 0.5rem;
  }

  .lightbox__image {
    max-height: 60vh;
  }
}

/* --------------------------------------------------------------------------
   Планшет
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
  .services-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-row {
    grid-template-columns: 10rem 1fr;
    align-items: baseline;
    gap: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Десктоп
   -------------------------------------------------------------------------- */

@media (min-width: 900px) {
  :root {
    --header-h: 72px;
  }

  .brand__tagline {
    display: block;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    flex: 0 1 auto;
  }

  .site-header.is-nav-open .site-nav {
    position: static;
    border-bottom: 0;
    box-shadow: none;
    background: transparent;
  }

  .site-nav__list {
    display: flex;
    gap: 0.35rem;
    padding: 0;
  }

  .site-nav__link {
    padding: 0.5rem 0.75rem;
    border-bottom: 0;
    border-radius: var(--radius-sm);
    font-size: 0.98rem;
  }

  .site-nav__link:hover {
    background: var(--accent-soft);
  }

  .site-nav__link[aria-current] {
    background: var(--accent-soft);
    font-weight: 600;
  }

  .header-phone {
    font-size: 1.05rem;
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
  }

  .hero--plain .hero__inner {
    grid-template-columns: minmax(0, 46rem);
  }

  .hero__photo {
    aspect-ratio: 5 / 4;
  }

  .about__inner {
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    gap: 2rem;
  }

  .contacts-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }

  .callbar {
    display: none;
  }

  body:has(.callbar) {
    padding-bottom: 0;
  }
}

@media (min-width: 1000px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Уважение к настройке «меньше движения»
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .project-card:hover .project-card__photo {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Печать
   -------------------------------------------------------------------------- */

@media print {
  .site-header,
  .skip-link,
  .callbar,
  .lightbox,
  .hero__actions,
  .hero__media,
  .contact-cta,
  .project-card__count,
  .btn {
    display: none;
  }

  body {
    padding-bottom: 0;
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  .section,
  .hero {
    padding-block: 1rem;
    background: #ffffff;
    border: 0;
  }

  .container {
    max-width: none;
    padding-inline: 0;
  }

  .section-head,
  .price-group,
  .service-card,
  .project-card,
  .partner,
  .contact-row {
    break-inside: avoid;
  }

  .service-card,
  .project-card,
  .partner__box,
  .prices-note {
    border-color: #999999;
    box-shadow: none;
  }

  .price-table tr {
    break-inside: avoid;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }
}
