/* ДАСКОН-СТРОЙ — стили блоков ниже первого экрана.
   Палитра задаётся CSS-переменными в каждом варианте (:root в inline-CSS). */

/* ---------- секции ---------- */
.section { padding: clamp(56px, 9vw, 110px) 0; background: var(--bg); color: var(--text); }
.section-alt { background: var(--surface); }
.section-label {
  font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 12px;
}
.section-title {
  font-family: var(--font-head); font-size: clamp(28px, 4.5vw, 44px); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 28px;
}
.section-sub { color: var(--text-muted); max-width: 60ch; margin: -12px 0 28px; }
.muted { color: var(--text-muted); font-weight: 400; }

/* ---------- о компании ---------- */
.about-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 5fr 7fr; } }
.about-text p { line-height: 1.65; margin: 0 0 16px; max-width: 62ch; }
.about-req { font-size: 14px; color: var(--text-muted); }
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px;
}
.feature .icon { width: 30px; height: 30px; color: var(--accent); }
.feature h3 { font-family: var(--font-head); font-size: 17px; margin: 14px 0 8px; }
.feature p { font-size: 14px; line-height: 1.55; color: var(--text-muted); margin: 0; }

/* ---------- услуги ---------- */
.cards { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 0 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.card h3 { font-family: var(--font-head); font-size: 18px; margin: 18px 20px 10px; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin: 0 20px 16px; flex: 1; }
.card-media { display: block; aspect-ratio: 16 / 10; }
/* Заглушки под фото фактур — заменить на WebP-фото заказчика */
.media-topping  { background: linear-gradient(135deg, #3a3f46 0%, #565d66 45%, #2e3237 100%); }
.media-polymer  { background: linear-gradient(135deg, #4a5568 0%, #7a8699 50%, #3d4757 100%); }
.media-repair   { background: linear-gradient(135deg, #44403c 0%, #6b6560 50%, #35322f 100%); }
.media-screed   { background: linear-gradient(135deg, #52525b 0%, #7c7c86 50%, #3f3f46 100%); }
.media-sandwich { background: repeating-linear-gradient(0deg, #4b5563 0 18px, #414b58 18px 36px); }
.media-monolit  { background: linear-gradient(135deg, #3f3f46 0%, #5b616b 55%, #33363c 100%),
                              repeating-linear-gradient(90deg, transparent 0 46px, rgba(0,0,0,.18) 46px 48px); background-blend-mode: overlay; }
.card-actions {
  display: flex; justify-content: space-between; gap: 12px; margin: 0 20px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.card-link {
  padding: 6px 0; background: none; border: 0; text-decoration: none;
  color: var(--accent); font: 600 14px/1 var(--font-body); text-align: left; cursor: pointer;
}
.card-link:hover { text-decoration: underline; }
/* сетка 3×2 для шести услуг */
@media (min-width: 1100px) { .cards.cards-3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- этапы ---------- */
.stages {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
  grid-template-columns: 1fr;
  counter-reset: stage;
}
@media (min-width: 640px) { .stages { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .stages { grid-template-columns: repeat(4, 1fr); } }
.stage {
  position: relative; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stage-num {
  font-family: var(--font-head); font-size: 30px; font-weight: 800; color: var(--accent);
  opacity: .85; letter-spacing: -0.03em;
}
.stage h3 { font-family: var(--font-head); font-size: 16px; margin: 10px 0 6px; }
.stage p { font-size: 13.5px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ---------- портфолио ----------
   Объекты идут одним столбиком на всех экранах — и на главной, и на странице
   «Наши работы»: описание объекта читается как запись, а не как плитка.
   Без фона и рамки — объекты разделяет только воздух между ними. */
.gallery { display: grid; gap: 64px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gallery { gap: 76px; } }
.work { margin: 0; }
/* Пара «до / после» не растягивается во всю ширину страницы: в одну колонку
   она иначе становится непропорционально крупной. Миниатюры галереи и так
   фиксированного размера, их это не касается. */
.work-media {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border);
  max-width: 760px;
}
.work-media.split span {
  display: flex; align-items: flex-end; padding: 14px;
  font: 600 12px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: #fff;
}
.work-media.split span:first-child { background: linear-gradient(160deg, #57534e, #292524); }
.work-media.split span:last-child {
  background: linear-gradient(160deg, #64748b, #334155);
  border-left: 3px solid var(--accent);
}
/* Описание идёт перед фотографиями. */
.work figcaption { font-size: 14px; color: var(--text-muted); margin: 0 0 18px; display: grid; gap: 7px; }
.work-title { color: var(--text); font-weight: 700; font-family: var(--font-head); font-size: 17.5px; line-height: 1.3; }
.work-facts { font-size: 13px; color: var(--accent); letter-spacing: .02em; }
.work-desc { font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.work-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.work-cat {
  display: inline-block; padding: 3px 10px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 12.5px; color: var(--text-muted);
}
.work-media.single { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.work-media.single img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* кнопка «посмотреть все» под блоком */
.section-more { display: flex; justify-content: center; margin-top: 34px; }

/* страница «Наши работы» — тот же столбик, только с отступом сверху */
.gallery-page { padding: 40px 0 16px; }
.works-filter { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 26px; }
.works-filter a {
  display: inline-block; padding: 9px 16px; min-height: 40px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted);
  text-decoration: none; font: 600 13.5px/1.5 var(--font-body); transition: border-color .2s, color .2s;
}
.works-filter a:hover { border-color: var(--accent); color: var(--accent); }
.works-filter a.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.works-filter a.active .muted { color: rgba(23,25,29,.7); }

/* ---------- отзывы ---------- */
.reviews { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .reviews { grid-template-columns: repeat(3, 1fr); } }
.review {
  margin: 0; background: var(--card-bg); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 22px;
}
.review p { line-height: 1.6; margin: 0 0 14px; }
.review footer { font-size: 13.5px; color: var(--text-muted); }

/* ---------- контакты ---------- */
.contacts-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .contacts-grid { grid-template-columns: 6fr 5fr; } }
.contact-list { margin: 0 0 24px; display: grid; gap: 16px; }
.contact-list dt { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.contact-list dd { margin: 0; font-size: 16px; }
.contact-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--accent); }
.share-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text);
  text-decoration: none; font: 600 14px/1 var(--font-body); transition: border-color .2s, color .2s;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn .icon { width: 18px; height: 18px; }
/* Карта — во всю ширину страницы, без полей и скруглений */
.map {
  width: 100%; height: clamp(300px, 45vh, 440px);
  background: var(--card-bg); display: grid; place-items: center; overflow: hidden;
}
.map iframe { width: 100%; height: 100%; border: 0; }
.map-hint { color: var(--text-muted); font-size: 14px; }

/* ---------- формы ---------- */
.lead-form {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px;
}
.lead-form h3 { font-family: var(--font-head); font-size: 20px; margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px);
  background: var(--bg); color: var(--text); font: 400 16px/1.4 var(--font-body);
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.btn:focus-visible, .card-link:focus-visible, a:focus-visible, .burger:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.form-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 12px 0 0; }
.form-note a { color: var(--text-muted); }
.form-status { font-size: 14px; margin: 10px 0 0; min-height: 1em; }
.form-status.ok { color: #22c55e; }
.form-status.error { color: var(--danger, #ef4444); }

/* ---------- модальное окно ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000; background: rgba(10, 12, 14, .6);
  display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 440px; max-height: 90dvh; overflow: auto;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.modal h3 { font-family: var(--font-head); font-size: 22px; margin: 0 0 18px; padding-right: 40px; }
.modal .lead-form { border: 0; padding: 0; background: none; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
  display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--text-muted);
}
.modal-close:hover { color: var(--text); }
.modal-close svg { width: 22px; height: 22px; }

/* ---------- подвал ---------- */
.footer { background: var(--footer-bg, #111315); color: #a1a1aa; padding: 32px 0; font-size: 14px; }
.footer-services {
  display: flex; flex-wrap: wrap; gap: 8px 22px; padding-bottom: 20px; margin-bottom: 20px;
  border-bottom: 1px solid #26292e; font-size: 13.5px;
}
.footer-grid { display: grid; gap: 10px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1fr auto auto; align-items: center; gap: 28px; } }
.footer a { color: #d4d4d8; text-decoration: none; }
.footer a:hover { color: #fff; }
.footer p { margin: 0; }

/* ---------- калькулятор ---------- */
.calc {
  display: grid; gap: 24px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
@media (min-width: 860px) { .calc { grid-template-columns: 1fr 1fr; align-items: center; } }
.calc-controls { display: grid; gap: 16px; }
.calc-result {
  display: grid; gap: 10px; justify-items: start; padding: 22px;
  background: var(--bg); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.calc-label { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.calc-result strong {
  font-family: var(--font-head); font-size: clamp(28px, 5vw, 42px); font-weight: 800;
  letter-spacing: -.02em; color: var(--accent); font-variant-numeric: tabular-nums;
}
.calc-note { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
/* калькулятор внутри страницы услуги — без своей секции и контейнера */
.calc-inline { display: block; margin: 40px 0 8px; }
.calc-inline .section-label { font-size: 13px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.calc-inline .section-title { font-family: var(--font-head); font-size: clamp(21px, 3vw, 28px);
  font-weight: 800; letter-spacing: -.015em; line-height: 1.2; margin: 0 0 20px; }
.calc-rate { font-size: 14px; color: var(--text-muted); margin: 0; }
.calc-rate strong { color: var(--text); font-family: var(--font-head); }
.calc .field[hidden] { display: none; }

/* ---------- блок блога на главной ---------- */
.blog-cta {
  display: grid; gap: 28px; background: var(--card-bg); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 32px;
}
@media (min-width: 900px) { .blog-cta { grid-template-columns: 6fr 5fr; align-items: center; gap: 44px; } }
.blog-cta .section-title { margin-bottom: 12px; }
.blog-cta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.blog-cta-list li {
  display: grid; gap: 3px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.blog-cta-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.blog-cta-list a { color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.4; }
.blog-cta-list a:hover { color: var(--accent); }
.blog-cta-list .muted { font-size: 12.5px; }

/* ---------- ловушка для ботов (не показывается людям) ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- крупная картинка на странице услуги/статьи ---------- */
.page-hero-img {
  width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); margin-top: 28px; border: 1px solid var(--border);
}

/* ---------- реальные фото «до/после» ---------- */
.work-media.split.real { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.work-media.split.real img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-media.split.real img:last-child { border-left: 3px solid var(--accent); }

/* ---------- список статей ---------- */
.post-list { display: grid; gap: 22px; padding: 40px 0; }
@media (min-width: 760px) { .post-list { grid-template-columns: repeat(2, 1fr); } }
.post-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.post-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-date { font-size: 12.5px; color: var(--text-muted); letter-spacing: .06em; }
.post-body h2 { font-family: var(--font-head); font-size: 19px; line-height: 1.3; }
.post-body h2 a { color: var(--text); text-decoration: none; }
.post-body h2 a:hover { color: var(--accent); }
.post-body p { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; flex: 1; }

/* ---------- фотографии объекта: ровная сетка квадратов ----------
   Все снимки приводятся к одному квадрату, поэтому блок выглядит аккуратно
   при любом количестве и любой форме фото. Кадрирование по центру; чтобы
   увидеть снимок целиком, посетитель открывает его во весь экран по клику. */
/* Миниатюры одного размера независимо от того, сколько фото у объекта:
   колонки заданы в пикселях, а не долями, поэтому два снимка выглядят так же,
   как десять — просто занимают меньше рядов. Меняется размер только от ширины
   экрана. */
.work-squares {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, 135px);   /* телефон */
}
@media (min-width: 560px)  { .work-squares { grid-template-columns: repeat(auto-fill, 160px); } }
@media (min-width: 1000px) { .work-squares { grid-template-columns: repeat(auto-fill, 180px); } }

.work-squares img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border-radius: 8px; background: var(--surface);
}

/* фотографии, которые можно открыть на весь экран */
img[data-lightbox] { cursor: zoom-in; transition: opacity .2s ease; }
img[data-lightbox]:hover { opacity: .88; }
img[data-lightbox]:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* ---------- просмотр во весь экран ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1200; background: rgba(8, 9, 11, .94);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 8px; padding: 20px;
}
.lightbox[hidden] { display: none; }
.lb-stage { margin: 0; display: grid; place-items: center; gap: 12px; min-width: 0; height: 100%; }
.lb-stage img {
  max-width: 100%; max-height: calc(100dvh - 120px); width: auto; height: auto;
  object-fit: contain; border-radius: 6px; display: block;
}
.lb-caption { color: #d4d4d8; font-size: 14px; text-align: center; max-width: 70ch; }
.lb-close {
  position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; z-index: 2;
  display: grid; place-items: center; background: rgba(255,255,255,.08); border: 0;
  border-radius: 50%; color: #fff; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.18); }
.lb-close svg { width: 24px; height: 24px; }
.lb-nav {
  width: 52px; height: 52px; display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.08); border: 0; border-radius: 50%; color: #fff; cursor: pointer;
}
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav[hidden] { visibility: hidden; display: grid; }
.lb-nav svg { width: 26px; height: 26px; }
.lb-counter {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: #a1a1aa; font-size: 13px; letter-spacing: .08em;
}
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 1fr; padding: 12px; }
  .lb-nav { position: absolute; bottom: 46px; }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .lb-stage img { max-height: calc(100dvh - 160px); }
}

/* ---------- баннер о cookie (152-ФЗ) ---------- */
.cookie-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
/* Без этого правила display:flex перебивает атрибут hidden и плашка не скрывается. */
.cookie-bar[hidden] { display: none; }
@media (min-width: 760px) { .cookie-bar { left: auto; right: 24px; bottom: 24px; max-width: 420px; } }
.cookie-bar p { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; margin: 0; flex: 1 1 220px; }
.cookie-bar a { color: var(--accent); }
.cookie-bar .btn { min-height: 40px; padding: 9px 18px; font-size: 14px; }

/* ---------- анимация появления ----------
   По умолчанию блок ВИДЕН. Прячет его только класс .pre, который навешивает
   скрипт. Так контент не может пропасть из-за ошибки в JS или отключённого
   JavaScript — анимация остаётся приятным дополнением, а не условием показа. */
.reveal { transition: opacity .45s ease, transform .45s ease; }
.reveal.pre { opacity: 0; transform: translateY(16px); }
.reveal.pre.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.pre { opacity: 1; transform: none; transition: none; }
  .card, .card:hover { transition: none; transform: none; }
}
