/* =========================================================================
   Оформление сайта. Тёмная тема, строительная тематика.

   Все цвета собраны в одном месте — в блоке :root ниже. Чтобы перекрасить
   сайт целиком, достаточно поменять там несколько строк.
   ========================================================================= */

:root {
  /* Фон: от самого тёмного к светлому */
  --bg:          #0A0C10;
  --bg-2:        #0E1218;
  --surface:     #151A23;
  --surface-2:   #1C232F;

  /* Линии и границы */
  --border:      #252E3C;
  --border-soft: #1A2029;

  /* Текст */
  --text:        #E9EEF6;
  --text-2:      #A5AFC0;
  --text-3:      #6F7B8D;

  /* Сигнальный оранжевый — как строительная каска и разметка */
  --accent:      #FF7A18;
  --accent-hi:   #FF9440;
  --accent-soft: rgba(255, 122, 24, 0.12);

  /* Чертёжный голубой — для сеток и второстепенных акцентов */
  --blueprint:   #4E9BFF;

  --radius:      14px;
  --radius-sm:   9px;

  --shadow:      0 18px 44px rgba(0, 0, 0, 0.5);

  --maxw:        1180px;
}

/* ---------- Сброс ---------- */

*, *::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: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

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

p { margin: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================================
   Шапка
   ========================================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.logo-mark {
  width: 30px;
  height: 30px;
  color: var(--accent);
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
}

.site-nav a { color: var(--text-2); transition: color 0.15s; }
.site-nav a:hover { color: var(--text); }

.nav-cta {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent) !important; }

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

/* Первый экран — ровно во всю высоту окна под шапкой (68 px + линия), текст по центру по
   вертикали: на любом мониторе снизу не выглядывает начало следующего раздела. Если текст выше
   окна (низкий экран ноутбука) — экран растёт по тексту. svh — без панелей браузера телефона. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 69px);
  min-height: calc(100svh - 69px - env(safe-area-inset-top, 0px));
  padding: 64px 0 104px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero > .container { width: 100%; }

/* Подсказка внизу первого экрана: ниже — работы */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.15s;
}
.hero-scroll:hover { color: var(--text); }
.hero-scroll svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  animation: hero-bob 2.4s ease-in-out infinite;
}
@keyframes hero-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Низкий экран (ноутбук 1366 x 768 с панелями браузера): отступы меньше — первый экран
   помещается в окно вместе с подсказкой */
@media (max-height: 760px) {
  .hero { padding: 28px 0 78px; }
  .hero h1 { margin-bottom: 16px; }
  .hero-lead { margin-bottom: 24px; }
  .hero-scroll { bottom: 18px; }
}

/* переход по «Работы», «Как это работает» — заголовок раздела не под закреплённой шапкой */
#works, #how { scroll-margin-top: 69px; }

/* Чертёжная сетка на фоне — задаётся только через CSS, картинок не нужно */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  /* Большой мягкий овал — сетка тянется почти до самых краёв, включая зону
     фотографии, и гаснет плавно, а не обрывается посередине секции. */
  -webkit-mask-image: radial-gradient(ellipse 125% 100% at 50% 18%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 125% 100% at 50% 18%, #000 30%, transparent 100%);
  opacity: 0.75;
  pointer-events: none;
}

/* Тёплое свечение сверху — оживляет тёмный фон */
.hero::after {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  height: 420px;
  background: radial-gradient(ellipse at center, rgba(255,122,24,0.16), transparent 68%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

/* Фотография сливается с фоном: чёрное поле снимка исчезает в screen-режиме,
   контуры каски и кранов остаются светящимся контуром. Маска гасит края,
   чтобы не было видно прямоугольника картинки. */
.hero-visual {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(50%, 640px);
  pointer-events: none;
  z-index: 0;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  /* Отражаем по горизонтали */
  transform: scaleX(-1);
  mix-blend-mode: screen;
  opacity: 0.92;
  /* Угасание по прямой линии — в отличие от овала, гаснет плавно на ЛЮБОЙ
     высоте картинки, без резкого шва у заголовка. Направление "to left",
     потому что картинка отражена через scaleX(-1): маска считается ДО
     отражения, поэтому после него угасающий край окажется слева (у текста),
     как и нужно. */
  -webkit-mask-image: linear-gradient(to left, transparent 0%, rgba(0,0,0,0.5) 26%, #000 58%);
          mask-image: linear-gradient(to left, transparent 0%, rgba(0,0,0,0.5) 26%, #000 58%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(255,122,24,0.28);
  border-radius: 999px;
  color: var(--accent-hi);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 26px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255,122,24,0.18);
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px);
  margin-bottom: 22px;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-lead {
  font-size: clamp(16px, 1.9vw, 19px);
  color: var(--text-2);
  max-width: 620px;
  margin-bottom: 34px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-point {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
}

.hero-point svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

/* =========================================================================
   Секции
   ========================================================================= */

.section { padding: 76px 0; }

.section-head { margin-bottom: 38px; }

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  margin-bottom: 10px;
}

.section-head p { color: var(--text-2); font-size: 17px; }

/* Тёплое свечение позади раздела с работами — перекликается со свечением
   на первом экране, оживляет плоский тёмный фон. */
#works {
  position: relative;
  overflow: hidden;
}

#works::before {
  content: '';
  position: absolute;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 480px;
  background: radial-gradient(ellipse at center, rgba(255,122,24,0.13), transparent 70%);
  pointer-events: none;
}

#works > .container {
  position: relative;
  z-index: 1;
}

/* =========================================================================
   Карточки работ
   ========================================================================= */

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.work-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,122,24,0.42);
  box-shadow: var(--shadow);
}

.work-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}

.work-cover img {
  width: 100%;
  height: 100%;
  /* Обложки заливаются ровно 4:3 — cover укладывает их встык, без рамки по краям */
  object-fit: cover;
  transition: transform 0.35s ease;
}

.work-card:hover .work-cover img { transform: scale(1.04); }

/* Заглушка, если обложка не загружена: чертёжная сетка */
.work-cover--empty {
  background-image:
    linear-gradient(rgba(78,155,255,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78,155,255,0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  background-color: var(--surface-2);
  display: grid;
  place-items: center;
}

.work-cover--empty svg { width: 52px; height: 52px; color: var(--text-3); opacity: 0.55; }

.work-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  background: rgba(10,12,16,0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.work-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.work-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.work-sub {
  font-size: 14px;
  color: var(--text-3);
  flex: 1;
}

.work-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.work-price {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.work-price .old {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: line-through;
  margin-left: 8px;
}

.work-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.work-more svg { width: 14px; height: 14px; transition: transform 0.2s; }
.work-card:hover .work-more svg { transform: translateX(3px); }

/* =========================================================================
   Как это работает
   ========================================================================= */

.how { background: var(--bg-2); border-top: 1px solid var(--border-soft); }

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step-num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(255,122,24,0.3);
  border-radius: 10px;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

.step h3 { font-size: 16px; margin-bottom: 7px; }
.step p { font-size: 14px; color: var(--text-2); }

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

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-note {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-3);
  max-width: 420px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
  color: var(--text-2);
}

.footer-links a:hover { color: var(--accent); }

/* =========================================================================
   Страница отдельной работы
   ========================================================================= */

.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.15s;
}
.back-link svg { width: 14px; height: 14px; }
.back-link:hover { color: var(--accent); }

.product-hero {
  padding: 36px 0 44px;
  border-bottom: 1px solid var(--border-soft);
}

.product-title {
  font-size: clamp(28px, 4.2vw, 42px);
  margin: 18px 0 10px;
  max-width: 760px;
}

.product-subtitle {
  font-size: 17px;
  color: var(--text-2);
  max-width: 640px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.product-block { margin-bottom: 48px; scroll-margin-top: 90px; }   /* якорь — не под закреплённой шапкой */
.product-block:last-child { margin-bottom: 0; }

.block-title {
  font-size: 21px;
  margin-bottom: 18px;
}

/* ---------- Галерея примеров ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: zoom-in;
  padding: 0;
  display: block;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s;
}
.gallery-item:hover { border-color: rgba(255,122,24,0.42); transform: translateY(-2px); }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-tag {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 4px 10px;
  background: rgba(10,12,16,0.82);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 12px 10px;
  /* Под текстом почти сплошная подложка — подпись читается и на белом чертеже */
  background: linear-gradient(to top, rgba(10,12,16,0.92) calc(100% - 18px), rgba(10,12,16,0));
  font-size: 12.5px;
  color: var(--text);
}

.gallery-item--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  cursor: default;
  border-style: dashed;
  background-image:
    linear-gradient(rgba(78,155,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78,155,255,0.08) 1px, transparent 1px);
  background-size: 22px 22px;
}
.gallery-item--empty:hover { transform: none; border-color: var(--border); }
.gallery-item--empty svg { width: 30px; height: 30px; color: var(--text-3); }

.gallery-caption--muted {
  position: static;
  background: none;
  padding: 0;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}

.hint-text {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-3);
}

/* ---------- Описание ---------- */

.prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text-2);
  font-size: 15.5px;
  max-width: 680px;
}
.prose p { line-height: 1.7; }

/* ---------- Оферта, политика, согласие ---------- */

.legal { max-width: 760px; gap: 12px; }
.legal h2 {
  margin: 22px 0 2px;
  font-size: 19px;
  color: var(--text);
}
.legal h2:first-child { margin-top: 0; }
.legal ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.legal li { line-height: 1.6; }
.legal-requisites { list-style: none; padding-left: 0 !important; gap: 4px !important; }

/* ---------- Что входит ---------- */

.included-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}

.included-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 15px;
  color: var(--text);
}

.included-list svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  padding: 3px;
  box-sizing: content-box;
}

/* ---------- Состав работы ---------- */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.spec-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.spec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.spec-head b { display: block; font-size: 16px; }
.spec-head span { display: block; font-size: 13px; color: var(--text-3); }

.spec-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  border: 1px solid rgba(255,122,24,0.3);
  border-radius: 10px;
  color: var(--accent);
}
.spec-icon svg { width: 22px; height: 22px; }

/* разделы ПЗ — с номерами, как в содержании записки; титул и литература — без номера */
.spec-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sec;
  display: grid;
  gap: 7px;
}
.spec-list li {
  position: relative;
  padding-left: 30px;
  font-size: 14px;
  color: var(--text-2);
  counter-increment: sec;
}
.spec-list li::before {
  content: counter(sec);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
}
.spec-list li.spec-extra { counter-increment: none; }
.spec-list li.spec-extra::before { content: '—'; background: none; }

.spec-sheet { padding: 12px 0; border-top: 1px solid var(--border-soft); }
.spec-head + .spec-sheet { padding-top: 0; border-top: none; }
.spec-sheet b { display: block; margin-bottom: 4px; font-size: 14px; }
.spec-sheet p { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.spec-note { margin-top: 6px; font-size: 13px; color: var(--text-3); }

/* ---------- Как проходит заказ (шаги на странице работы) ---------- */

.steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.steps--3 .step { padding: 20px 18px; }

/* ---------- Вопросы ---------- */

.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.faq details { background: var(--surface); border-top: 1px solid var(--border); }
.faq details:first-child { border-top: none; }
.faq summary {
  position: relative;
  padding: 15px 46px 15px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;   /* без синей вспышки при касании */
}
.faq summary:focus { outline: none; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 400;
  color: var(--accent);
}
.faq details[open] summary::after { content: '−'; }
.faq summary:hover { color: var(--accent-hi); }
.faq details p { padding: 0 18px 16px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }

/* ---------- Карточка заказа ---------- */

.order-card { position: relative; }

.order-card-inner {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.order-price {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.order-price .old {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: line-through;
  margin-left: 8px;
}

.order-facts {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-top: 1px solid var(--border-soft);
  padding-top: 18px;
}
.order-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-2);
}
.order-facts svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }

.btn-order {
  width: 100%;
  padding: 15px 20px;
  background: var(--accent);
  color: #1A0E00;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
a.btn-order { display: block; text-align: center; }
.btn-order:hover { background: var(--accent-hi); }
.btn-order:active { transform: scale(0.98); }
.btn-order:disabled {
  background: var(--surface-2);
  color: var(--text-3);
  cursor: not-allowed;
}

.order-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}

/* Кнопка заказа внизу экрана — только на телефоне и планшете (см. @media ниже) */
.order-bar,
.order-bar-spacer { display: none; }

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 88px;   /* по бокам — место под кнопки листания */
  /* Горизонтальный свайп листает фото (gallery.js), а не уводит браузер «назад» */
  touch-action: pan-y pinch-zoom;
  overscroll-behavior: contain;
  background: rgba(5, 6, 9, 0.92);
  backdrop-filter: blur(6px);
}
.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: min(100%, 1000px);
  max-height: 82vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.lightbox-caption {
  position: absolute;
  left: 0; right: 0;
  bottom: 28px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
}
.lightbox-close svg { width: 18px; height: 18px; }

.lightbox-counter {
  position: absolute;
  top: 30px;
  left: 24px;
  color: var(--text-2);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* Кнопки «назад / вперёд» */
.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.lightbox-nav:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-nav[hidden] { display: none; }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* =========================================================================
   Заказ: форма, оплата, страница заказа
   ========================================================================= */

.order-form { min-width: 0; }

.form-section {
  margin: 0 0 40px;
  padding: 0;
  border: none;
  min-width: 0;
}
.form-section legend { padding: 0; font-weight: 700; letter-spacing: -0.02em; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field select { cursor: pointer; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-help  { font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.field-error { font-size: 12.5px; color: #FF6B5E; line-height: 1.4; }
.field--error input,
.field--error select,
.field--error textarea { border-color: #FF6B5E; }

/* Галочки оферты и согласия */
.consent { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.check { display: flex; align-items: flex-start; gap: 10px; }
.check input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.check label { font-size: 14px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.check--error label { color: #FFB4AC; }
.consent .field-error { margin: -4px 0 0 28px; }
.order-note--top { margin: 0 0 14px; text-align: left; }

.form-alert {
  margin-bottom: 28px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 107, 94, 0.45);
  background: rgba(255, 107, 94, 0.08);
  border-radius: var(--radius-sm);
  color: #FFB4AC;
  font-size: 14px;
}

.notice {
  margin-top: 14px;
  padding: 11px 13px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.45;
}

.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

/* Сводка заказа: «параметр — значение» */
.summary {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  padding: 10px 16px;
  font-size: 14px;
}
.summary-row:nth-child(odd) { background: var(--surface); }
.summary dt { color: var(--text-2); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* Шаги статуса */
.status-box {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.status-box p { margin-bottom: 14px; color: var(--text-2); }
.status-box p:last-child { margin-bottom: 0; }
.btn-inline { display: inline-block; width: auto; padding: 12px 22px; }

.status-steps { list-style: none; margin: 0; padding: 0; }
.status-step {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
}
.status-step:last-child { padding-bottom: 0; }
.status-step::before {                       /* линия между шагами */
  content: '';
  position: absolute;
  left: 8px;
  top: 22px;
  bottom: 2px;
  width: 2px;
  background: var(--border);
}
.status-step:last-child::before { display: none; }
.status-step.is-done::before { background: var(--accent); }
.status-dot {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
}
.status-step.is-done .status-dot { border-color: var(--accent); background: var(--accent); }
.status-step.is-active .status-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 1.6s ease-in-out infinite;
}
.status-step b { display: block; font-size: 15px; }
.status-step span { display: block; font-size: 14px; color: var(--text-2); }
.status-step:not(.is-done):not(.is-active) b { color: var(--text-3); }

@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(255, 122, 24, 0); }
}

/* Файлы готовой работы */
.file-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.file-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.file-list a:hover { border-color: var(--accent); }
.file-list svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; }
.file-size { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* =========================================================================
   Пустое состояние (работ ещё нет)
   ========================================================================= */

.empty {
  padding: 60px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
}

/* =========================================================================
   Телефоны и планшеты
   ========================================================================= */

@media (max-width: 900px) {
  .works-grid  { grid-template-columns: repeat(2, 1fr); }
  .steps       { grid-template-columns: repeat(2, 1fr); }
  .hero-visual { width: 42%; opacity: 0.7; }

  .product-layout { grid-template-columns: 1fr; }
  .order-card-inner { position: static; }

  .spec-grid { grid-template-columns: 1fr; }

  .order-bar-spacer { display: block; height: 76px; }
  .order-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;                    /* под лайтбоксом (100) */
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(14, 18, 24, 0.94);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
  }
  .order-bar-price { font-size: 20px; font-weight: 700; white-space: nowrap; }
  .order-bar .btn-order { flex: 1; padding: 13px 16px; }
}

@media (max-width: 620px) {
  .container   { padding: 0 16px; }
  .works-grid  { grid-template-columns: 1fr; }
  .steps       { grid-template-columns: 1fr; }
  .hero        { padding: 44px 0 92px; }
  .section     { padding: 54px 0; }
  .site-nav    { gap: 16px; font-size: 14px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .hero-visual { display: none; }

  .gallery { grid-template-columns: repeat(2, 1fr); }

  .form-grid { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: 1fr; gap: 2px; }

  /* На телефоне картинка во всю ширину, кнопки поверх её краёв */
  .lightbox { padding: 72px 12px; }
  .lightbox-nav {
    width: 42px;
    height: 42px;
    margin-top: -21px;
    background: rgba(21, 26, 35, 0.85);
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
