@charset "UTF-8";

/* ==========================================================================
   ПРОМЭКСПЕРТ ЭНЕРГО

   Визуальная идея. На схемах теплоснабжения подающий трубопровод чертят
   красным, обратный — синим. Эта пара и стала фирменной. Фон — цвет бумаги
   технического чертежа, не белый. Радиусы почти нулевые: документ, а не
   приложение. Шрифт IBM Plex Sans создавался для инженерной документации
   и имеет полную кириллицу.
   ========================================================================== */

:root {
  /* Цвет */
  --paper:      #eef1f3;
  --surface:    #ffffff;
  --surface-2:  #f7f9fa;
  --ink:        #0d1519;
  --ink-2:      #45555f;
  /* Затемнён с #6d7c85: тот давал контраст 3.8 на фоне шапки при норме
     WCAG AA 4.5. Стало 4.58 на --paper и 5.20 на белом. */
  --ink-3:      #606f78;
  --line:       #ccd6db;
  --line-soft:  #e2e9ec;

  --supply:     #bf2a1b;   /* подача */
  --supply-dk:  #94200f;
  --return:     #12508e;   /* обратка */
  --return-dk:  #0b3763;
  --return-tint:#e8eff6;

  /* Типографика */
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --t-xs:   0.75rem;
  --t-sm:   0.8125rem;
  --t-base: 1rem;
  --t-md:   1.0625rem;
  --t-lg:   1.375rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-3xl:  3rem;
  --t-4xl:  3.75rem;

  /* Ритм */
  --gap:      1.5rem;
  --shell:    1160px;
  --prose:    66ch;
  --r:        2px;
  --r-lg:     10px;

  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--return);
}

/* ------------------------------------------------------------------ reset */

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

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.62;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r);
}

.skip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-200%);
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 999;
}
.skip:focus { transform: none; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

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

/* ---------------------------------------------------------------- шапка */

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(238, 241, 243, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.masthead__row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  flex-shrink: 0;
}

/* Логотип-картинка, если компания его предоставит */
.brand__logo {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Одиночные иллюстрации со страниц.
   Фотографии из конструктора приходят с разными пропорциями и часто
   с белым фоном. Голая картинка встык с текстом выглядит как случайно
   вставленный файл, поэтому: фиксированная пропорция, рамка, подложка
   и тонкая линия фирменного цвета сверху — тот же приём, что у панелей. */
.figure-plain {
  margin: 2.25rem 0;
  border: 1px solid var(--line);
  border-top: 3px solid var(--supply);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
}
.figure-plain img {
  width: 100%;
  display: block;
  /* 21:9 срезал почти всё, 3:2 во всю ширину занимал пол-экрана.
     16:9 показывает объект и не выдавливает остальное со страницы. */
  aspect-ratio: 16 / 9;
  max-height: 420px;
  object-fit: cover;
  object-position: center;
  background: var(--surface-2);
}
.figure-plain figcaption {
  padding: 0.65rem 0.9rem;
  font-size: var(--t-sm);
  color: var(--ink-3);
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
@media (max-width: 700px) {
  .figure-plain { margin: 1.75rem 0; }
  .figure-plain img { aspect-ratio: 4 / 3; }
}

/* Пока картинка не загрузилась — подложка, а не белый провал */
.figure-plain::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg,
    var(--surface-2) 0 12px, var(--line-soft) 12px 13px);
  z-index: -1;
}

/* Свидетельство СРО: документ, а не фотография — показываем целиком,
   не обрезая, и даём открыть в полный размер. */
.doc-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0.75rem;
  cursor: zoom-in;
  display: block;
  width: 100%;
}
.doc-card img {
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
  display: block;
}
.doc-card figcaption,
.doc-card .doc-card__cap {
  margin-top: 0.6rem;
  font-size: var(--t-sm);
  color: var(--ink-3);
  line-height: 1.45;
}

/* Знак: сечение трубы — подача над обраткой */
.brand__mark {
  width: 26px; height: 26px;
  flex-shrink: 0;
}

.brand__text { line-height: 1.1; }

.brand__name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.055em;
  color: var(--ink);
}

.brand__sub {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.09em;
  color: var(--ink-3);
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; }

.nav__link {
  padding: 0.5rem 0.7rem;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav__link:hover { color: var(--ink); border-bottom-color: var(--line); }
.nav__link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--supply); }

.masthead__tel {
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.masthead__tel:hover { border-color: var(--ink-3); }

.burger {
  display: none;
  width: 42px; height: 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  padding: 0;
}
.burger span {
  display: block;
  width: 18px; height: 1.5px;
  margin: 3px auto;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

@media (max-width: 940px) {
  .burger { display: block; margin-left: auto; }
  .masthead__tel { margin-left: 0.5rem; }
  .nav {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.25rem;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav__link {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 1.0625rem;
  }
  .nav__link[aria-current="page"] { border-bottom-color: var(--supply); }
}

@media (max-width: 460px) {
  .masthead__tel { display: none; }
  .brand__sub { display: none; }
}

/* ---------------------------------------------------------------- герой */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  font-size: clamp(1.75rem, 3.6vw, 2.875rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
  max-width: 17ch;
}

.hero__lead {
  margin-top: 1.15rem;
  max-width: 46ch;
  font-size: clamp(1rem, 1.4vw, 1.0625rem);
  color: var(--ink-2);
}

/* География работ: без неё компанию принимают за местную */
.hero__geo {
  margin-top: 0.9rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--supply);
  max-width: 46ch;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

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

/* Факты — строка исходных данных, как в шапке отчёта.
   Сетка, а не flex: три позиции обязаны стоять в один ряд, иначе
   «СРО-Э-150» уезжает вниз и строка перестаёт читаться как одна. */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.facts__item {
  padding: 1rem 1rem 1rem 0;
  border-right: 1px solid var(--line-soft);
}
.facts__item:last-child { border-right: 0; padding-right: 0; }
.facts__value {
  font-family: var(--mono);
  font-size: clamp(0.9375rem, 1.5vw, 1.1875rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--return-dk);
  white-space: nowrap;
}
.facts__label {
  margin-top: 0.15rem;
  font-size: var(--t-xs);
  line-height: 1.4;
  color: var(--ink-3);
}

.hero__figure { align-self: center; }

.hero__caption {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 0.6rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.hero__caption i { font-style: normal; display: inline-flex; align-items: center; gap: 0.35rem; }
.hero__caption i::before {
  content: "";
  width: 14px; height: 3px;
  border-radius: 2px;
}
.hero__caption .is-supply::before { background: var(--supply); }
.hero__caption .is-return::before { background: var(--return); }

@media (max-width: 900px) {
  /* Схема остаётся ниже заголовка: первым экраном должен быть текст,
     иначе посетитель с телефона не увидит, чем занимается компания. */
  .hero__grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero__figure { padding-bottom: 0; }
  .hero__title { max-width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; }
}

@media (max-width: 620px) {
  /* Три колонки на 390 px давали по 18 знаков в строке и рваный текст.
     Переходим на строки: значение слева, подпись справа. */
  .facts {
    grid-template-columns: 1fr;
    margin-top: 1.75rem;
  }
  .facts__item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .facts__item:last-child { border-bottom: 0; padding-bottom: 0; }
  .facts__value { font-size: 1.0625rem; min-width: 5.5rem; }
  .facts__label { margin-top: 0; font-size: 0.8125rem; }
}

/* Движение теплоносителя по схеме — единственная анимация на сайте */
.flow {
  stroke-dasharray: 5 9;
  animation: flow 2.4s linear infinite;
}
.flow--back { animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -28; } }

@media (prefers-reduced-motion: reduce) {
  .flow { animation: none; stroke-dasharray: none; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn--primary { background: var(--supply); color: #fff; }
.btn--primary:hover { background: var(--supply-dk); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--ink-3); background: var(--surface-2); }

.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------------------------------------------------------------- секции */

.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.section__title {
  font-size: clamp(1.5rem, 3.2vw, var(--t-xl));
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section__aside { font-size: var(--t-sm); color: var(--ink-3); }

.link-more {
  font-size: 0.9375rem;
  color: var(--return);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.link-more:hover { color: var(--return-dk); }

/* ------------------------------------------------- реестр направлений
   Не карточки, а перечень работ, как в проектной документации. */

.register { border-top: 1px solid var(--line-soft); }

.register__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  position: relative;
  transition: background-color 0.15s;
}
.register__row::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--supply);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.18s ease;
}
.register__row:hover { background: var(--surface-2); }
.register__row:hover::before,
.register__row:focus-visible::before { transform: scaleY(1); }

.register__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.register__desc { color: var(--ink-2); font-size: 0.9688rem; }

.register__regs {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-3);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

@media (max-width: 860px) {
  .register__row { grid-template-columns: 1fr; gap: 0.4rem; }
  .register__regs { white-space: normal; }
}

/* ---------------------------------------------------------------- проза */

.prose { max-width: var(--prose); }
.prose > * + * { margin-top: 1.15rem; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2 {
  margin-top: 2.75rem;
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.prose a { color: var(--return); text-decoration-thickness: 1px; text-underline-offset: 2px; }

/* Список состава работ: маркер — врезка трубы */
.checklist { display: grid; gap: 0.7rem; }
.checklist li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink-2);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 10px;
  height: 2px;
  background: var(--return);
}

/* Нормативная база */
.regs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.regs li {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.02em;
  padding: 0.3rem 0.55rem;
  background: var(--return-tint);
  color: var(--return-dk);
  border-radius: var(--r);
}

/* -------------------------------------------------------------- страница */

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(2rem, 5vw, 3rem);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: var(--t-sm);
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}
.crumbs a { color: var(--ink-3); text-decoration: none; display: inline-block; padding-block: 4px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-right: 0.45rem; color: var(--line); }
.crumbs li { display: inline-flex; }

.page-title {
  font-size: clamp(1.75rem, 4.4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  max-width: 22ch;
  text-wrap: balance;
}

/* На узком экране ограничение в 22 символа рвало заголовок на четыре
   короткие строки — там ширину не режем. */
@media (max-width: 700px) {
  .page-title { max-width: 100%; }
  .crumbs { font-size: var(--t-xs); }
}

.page-lead {
  margin-top: 1.1rem;
  max-width: 56ch;
  font-size: 1.125rem;
  color: var(--ink-2);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

.sidebar { position: sticky; top: 92px; display: grid; gap: 1.25rem; }
@media (max-width: 980px) { .sidebar { position: static; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
}
.panel__title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line-soft);
}
.panel__list { display: grid; gap: 0.3rem; font-size: 0.9375rem; }
.panel__list a { display: block; padding-block: 3px; }
.panel__list a { color: var(--ink-2); text-decoration: none; }
.panel__list a:hover { color: var(--return); }

/* ------------------------------------------- переключатель направлений
   Раньше переход между услугами требовал возврата в общий список.
   Здесь все направления доступны с любой страницы услуги. */

.switcher {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.switcher__title {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
}

.switcher__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.4rem 1.25rem;
}

.switcher__item {
  display: block;
  padding: 0.45rem 0.6rem 0.45rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--ink-2);
  text-decoration: none;
  border-left: 2px solid var(--line-soft);
  border-radius: 0 var(--r) var(--r) 0;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.switcher__item:hover {
  color: var(--ink);
  border-left-color: var(--return);
  background: var(--surface-2);
}
.switcher__item.is-current {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--supply);
  background: var(--surface-2);
}

@media (max-width: 700px) {
  /* На телефоне — лента с прокоруткой вбок: занимает одну строку,
     а не половину экрана десятью пунктами. */
  .switcher__list {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    margin-inline: -1.5rem;
    padding-inline: 1.5rem;
    scrollbar-width: thin;
  }
  .switcher__list li { flex: 0 0 auto; scroll-snap-align: start; }
  .switcher__item {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-left-width: 2px;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    background: var(--surface);
  }
  .switcher__item.is-current {
    border-color: var(--supply);
    background: var(--surface);
  }
}

/* -------------------------------------------- соседние направления */

.neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
}

.neighbors__item {
  display: block;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.neighbors__item:hover { border-color: var(--return); transform: translateY(-1px); }
.neighbors__item--next { text-align: right; }

.neighbors__dir {
  display: block;
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 0.35rem;
}
.neighbors__name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

@media (max-width: 700px) {
  .neighbors { grid-template-columns: 1fr; }
  .neighbors__item--next { text-align: left; }
}

/* -------------------------------------------------------------- галерея */

/* Ровно три колонки: в галереях по 5-6 снимков, при автоподборе
   получалось 5+1 с одиноким кадром во второй строке. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 700px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.gallery button {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: repeating-linear-gradient(135deg,
    var(--surface-2) 0 12px, var(--line-soft) 12px 13px);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  position: relative;
}
.gallery button:hover {
  border-color: var(--return);
  box-shadow: 0 6px 18px -10px rgba(13, 21, 25, 0.45);
  transform: translateY(-1px);
}
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Снимки из конструктора часто с полями: лёгкое приближение убирает
     белую кайму по краям, не искажая пропорции. */
  transform: scale(1.01);
}

/* Заглушка для ещё не скачанных фотографий */
.gallery button.is-missing {
  cursor: default;
  background:
    repeating-linear-gradient(135deg,
      var(--surface-2) 0 10px, var(--line-soft) 10px 11px);
  display: grid;
  place-items: center;
  padding: 0.75rem;
}
.gallery__missing {
  font-size: var(--t-xs);
  line-height: 1.4;
  color: var(--ink-3);
  text-align: center;
  background: var(--surface);
  padding: 0.4rem 0.6rem;
  border-radius: var(--r);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 15, 19, 0.93);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lightbox[open], .lightbox.is-open { display: flex; }
.lightbox img { max-width: min(94vw, 1200px); max-height: 88vh; border-radius: var(--r); }
.lightbox__close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--r);
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(255,255,255,0.1); }

/* ---------------------------------------------------------------- формы */

.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.field .hint { font-size: var(--t-sm); color: var(--ink-3); }

.field input,
.field textarea {
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--return);
  box-shadow: 0 0 0 3px var(--return-tint);
}
.field textarea { min-height: 130px; resize: vertical; }

.field--check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
}
.field--check input { width: 24px; height: 24px; margin-top: 0.05rem; }
.field--check label { font-size: var(--t-sm); font-weight: 400; color: var(--ink-2); }

/* Ловушка для ботов. Прячем клипом, а не выносом за левый край:
   вынос за экран расширяет документ и ловится аудитами как переполнение. */
.honeypot {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.honeypot input { width: 1px; min-width: 0; padding: 0; border: 0; }

.form-status {
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--r);
  font-size: 0.9375rem;
  display: none;
}
.form-status.is-ok { display: block; background: var(--return-tint); color: var(--return-dk); }
.form-status.is-error { display: block; background: #fdeceb; color: var(--supply-dk); }

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

.contact-card {
  display: grid;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.75rem;
}
.contact-card dt {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 0.2rem;
}
.contact-card dd { margin: 0; font-size: 1.0625rem; }
.contact-card a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-card a:hover { border-bottom-color: var(--ink); }
.contact-card .big { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }

.map-frame {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  min-height: 380px;
}
.map-frame iframe { width: 100%; height: 420px; border: 0; display: block; }

/* ------------------------------------------------------------------ FAQ */

.faq { border-top: 1px solid var(--line-soft); max-width: 72ch; }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer;
  padding: 1.05rem 2rem 1.05rem 0;
  font-weight: 500;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 0.95rem;
  font-size: 1.35rem;
  color: var(--ink-3);
  font-weight: 400;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { color: var(--return-dk); }
.faq__answer { padding: 0 0 1.2rem; color: var(--ink-2); max-width: 62ch; }

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

.footer {
  background: var(--ink);
  color: #b9c6ce;
  /* Снизу запас под плавающую кнопку консультанта, иначе она
     перекрывает последние строки подвала на телефоне. */
  padding: 3rem 0 5.5rem;
  font-size: 0.9375rem;
}
.footer a { color: #d6e0e6; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr; gap: 1.75rem; } }

.footer__title {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  color: #7f929d;
  margin-bottom: 0.9rem;
}
/* Вертикальные отступы поднимают высоту нажатия с 18 до 24 px —
   рекомендованный минимум для пальца. Внешне ничего не меняется. */
.footer__list { display: grid; gap: 0.25rem; }
.footer__list a, .footer__list li { display: block; padding-block: 3px; }

.footer__bottom a { display: inline-block; padding-block: 3px; }

.footer__bottom {
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: var(--t-sm);
  color: #7f929d;
}

/* ------------------------------------------------------- cookie-баннер */

.cookie {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 150;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--return);
  border-radius: var(--r);
  box-shadow: 0 12px 32px -12px rgba(13, 21, 25, 0.35);
  padding: 1.15rem 1.25rem;
  display: none;
}
.cookie.is-visible { display: block; }
.cookie__text { font-size: 0.875rem; line-height: 1.5; color: var(--ink-2); }
.cookie__actions { margin-top: 0.85rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cookie .btn { padding: 0.5rem 1rem; font-size: 0.875rem; }

@media (max-width: 620px) {
  /* На телефоне баннер не должен закрывать первый экран: узкая полоса
     у нижнего края, кнопки в один ряд. */
  .cookie {
    left: 0.5rem; right: 0.5rem; bottom: 0.5rem;
    padding: 0.9rem 1rem;
  }
  .cookie__text { font-size: 0.8125rem; line-height: 1.45; }
  .cookie__actions { margin-top: 0.7rem; flex-wrap: nowrap; }
  .cookie .btn { flex: 1; padding: 0.55rem 0.4rem; font-size: 0.8125rem; }
}

/* -------------------------------------------------------------- ошибка */

.error-page {
  min-height: 58vh;
  display: grid;
  align-content: center;
  padding: 4rem 0;
}
.error-page__code {
  font-family: var(--mono);
  font-size: 4rem;
  font-weight: 600;
  color: var(--line);
  line-height: 1;
}

/* ---------------------------------------------------------------- прочее */

.table-simple { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table-simple th, .table-simple td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.table-simple th { font-weight: 600; color: var(--ink-3); font-size: var(--t-sm); }

.stack-lg > * + * { margin-top: 2.5rem; }
.stack-md > * + * { margin-top: 1.5rem; }

/* ==========================================================================
   Панель управления
   ========================================================================== */

.adminnav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.adminnav__item {
  padding: 0.5rem 0.9rem;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.adminnav__item:hover { border-color: var(--ink-3); color: var(--ink); }
.adminnav__item.is-current {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.adminnav__exit { margin-left: auto; color: var(--supply); }

.admin__h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.admin__empty {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.kpi__card {
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--return);
  border-radius: var(--r);
}
.kpi__card--accent { border-top-color: var(--supply); }
.kpi__value {
  display: block;
  font-family: var(--mono);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}
.kpi__label {
  display: block;
  margin-top: 0.3rem;
  font-size: var(--t-xs);
  color: var(--ink-3);
  line-height: 1.35;
}

.chartbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem;
  overflow-x: auto;
}
.chartbox svg { min-width: 640px; width: 100%; height: auto; }
.chartbox__legend {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-top: 0.6rem;
  font-size: var(--t-sm);
  color: var(--ink-3);
}
.chartbox__legend i {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.bars { display: grid; gap: 0.4rem; }
.bars__row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) 1fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.875rem;
}
.bars__label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bars__track {
  height: 18px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.bars__fill { display: block; height: 100%; background: var(--return); opacity: 0.85; }
.bars__num { font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-3); }

@media (max-width: 700px) {
  .bars__row { grid-template-columns: 1fr auto; }
  .bars__track { grid-column: 1 / -1; }
}

.chats { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .chats { grid-template-columns: 1fr; } }

.chats__list {
  display: grid;
  gap: 0.4rem;
  max-height: 70vh;
  overflow-y: auto;
}
.chats__item {
  display: block;
  padding: 0.75rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
}
.chats__item:hover { border-left-color: var(--return); }
.chats__item.is-current { border-left-color: var(--supply); background: var(--surface-2); }
.chats__q {
  display: block;
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.chats__meta {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
}
.chats__view {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem;
  min-height: 340px;
  max-height: 70vh;
  overflow-y: auto;
}
.chats__time {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  opacity: 0.6;
}

/* ==========================================================================
   Карточки направлений с фотографиями
   Пришли на смену текстовому реестру: он читался как сплошная стена букв,
   а три десятка снимков с объектов лежали только на одной странице.
   ========================================================================== */

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--return);
  box-shadow: 0 16px 34px -20px rgba(13, 21, 25, 0.5);
}

.card__media {
  display: block;
  aspect-ratio: 3 / 2;
  background: repeating-linear-gradient(135deg,
    var(--surface-2) 0 12px, var(--line-soft) 12px 13px);
  overflow: hidden;
  position: relative;
}
.card__media::after {
  /* Тонкая линия подачи по нижнему краю снимка — связывает фото с фирменным знаком */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--supply) 0 38%, var(--return) 38% 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.card:hover .card__media::after { opacity: 1; }

.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}
.card:hover .card__media img { transform: scale(1.04); }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem 1.25rem;
  flex: 1;
}
.card__title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.card__lead {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
  flex: 1;
}
.card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--return);
}
.card__more i { font-style: normal; transition: transform 0.2s ease; }
.card:hover .card__more i { transform: translateX(4px); }

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; gap: 1rem; }
  .card__media { aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   Появление секций при прокрутке.
   Без библиотек и без React: короткий сдвиг с прозрачностью, один раз.
   Для тех, кто просил уменьшить анимации, всё отключается.
   ========================================================================== */

/* По умолчанию всё видно. Прячем только когда скрипт точно жив и сам
   вернёт видимость: иначе при ошибке JS или отключённых скриптах
   половина страницы просто исчезнет. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease var(--d, 0ms), transform 0.5s ease var(--d, 0ms);
}
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}


/* ==========================================================================
   Лента работ на главной
   ========================================================================== */

.worksband { background: var(--ink); }
.worksband .section__title { color: #fff; }
.worksband .link-more { color: #8fb8e6; }
.worksband .section__head { border-bottom-color: rgba(255,255,255,0.15); }

.photostrip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 0 1.5rem 1rem;
  max-width: calc(var(--shell) + 3rem);
  margin-inline: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a4a55 transparent;
}
.photostrip::-webkit-scrollbar { height: 6px; }
.photostrip::-webkit-scrollbar-thumb { background: #3a4a55; border-radius: 3px; }

.photostrip__item {
  scroll-snap-align: start;
  border-radius: var(--r);
  overflow: hidden;
  background: #17242b;
  position: relative;
}
.photostrip__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: saturate(0.92);
  transition: filter 0.3s ease, transform 0.5s ease;
}
.photostrip__item:hover img { filter: none; transform: scale(1.03); }

.photostrip__item figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.75rem 0.85rem 0.7rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #eef3f6;
  background: linear-gradient(to top, rgba(9,15,19,0.92), rgba(9,15,19,0));
}

@media (max-width: 560px) {
  .photostrip { grid-auto-columns: minmax(220px, 78%); padding-inline: 1.5rem; }
}
