:root {
  --bg: #202022;
  --surface: #29292c;
  --line: #3a3a3e;
  --line-dim: #2f2f32;
  --text: #ece8e1;
  --text-2: #a7a39c;
  --accent: #ffb200;
  --accent-dim: #6e5410;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --display: 'Unbounded', var(--sans);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s, border-color .2s, background .2s; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.tech {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.hazard {
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 9px, transparent 9px 22px);
  opacity: .55;
}

/* осевая разметка (широкие экраны) */
.axis { display: none; }
@media (min-width: 1240px) {
  .axis {
    display: flex; align-items: center; justify-content: center;
    position: absolute; left: -72px; top: 8px;
    width: 34px; height: 34px;
    border: 1px solid var(--line); border-radius: 50%;
    font-family: var(--mono); font-size: 14px; color: var(--text-2);
  }
  .axis::after {
    content: ''; position: absolute; left: 100%;
    width: 38px; height: 1px; background: var(--line-dim);
  }
  section { position: relative; }
}

/* размерная линия */
.dim {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .06em; color: var(--accent);
  text-transform: uppercase; white-space: nowrap;
}
.dim .l { flex: 1; height: 1px; background: var(--accent-dim); position: relative; min-width: 24px; }
.dim .l::before, .dim .l::after {
  content: ''; position: absolute; top: -5px;
  width: 1px; height: 11px; background: var(--accent-dim);
}
.dim .l::before { left: 0; }
.dim .l::after { right: 0; }

/* хедер */
.header { border-bottom: 1px solid var(--line); }
.header .wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding-top: 16px; padding-bottom: 14px;
}
@media (min-width: 640px) {
  .header .wrap {
    flex-direction: row; justify-content: space-between;
    gap: 16px;
    padding-top: 18px; padding-bottom: 18px;
  }
}
.logo { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.logo b { color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
@media (min-width: 640px) { .nav { gap: 26px; } }
.nav a {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-2);
  border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* герой главной */
.hero { padding: 56px 0 52px; }
.hero-geo { margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.hero-geo::before { content: ''; width: 8px; height: 8px; background: var(--accent); }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 4.6vw, 44px);
  line-height: 1.25; letter-spacing: -.005em;
  max-width: 680px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .dim { max-width: 460px; margin: 26px 0 24px; }
.hero-sub { color: var(--text-2); font-size: 17px; max-width: 560px; margin-bottom: 34px; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

/* кнопки */
.btn {
  display: inline-block;
  background: var(--accent); color: #1c1500;
  font-weight: 600; font-size: 16px;
  padding: 15px 30px;
  transition: transform .2s, background .2s;
}
.btn:hover { background: #ffc233; }
.btn:active { transform: scale(.97); }
.btn-o {
  display: inline-block;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-weight: 500; font-size: 14px;
  padding: 12px 18px;
  transition: color .2s, border-color .2s, transform .2s;
}
.btn-o:hover { color: var(--text); border-color: var(--accent); }
.btn-o:active { transform: scale(.97); }
.link2 {
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-2);
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
}
.link2:hover { color: var(--text); border-bottom-color: var(--accent); }

/* заголовки секций */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.sec-head h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(19px, 3vw, 26px);
  letter-spacing: .01em;
}

/* ведомость услуг */
.services { padding: 56px 0 64px; }
.spec { border-top: 1px solid var(--line); margin-top: 24px; }
.spec-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-areas: "idx name" "idx desc" "idx price";
  width: 100%; text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  transition: background .2s, padding .2s;
}
.spec-row:hover { background: var(--surface); padding-left: 14px; padding-right: 14px; }
.spec-row:active { background: var(--line-dim); }
.spec-idx {
  grid-area: idx; font-family: var(--mono); font-size: 13px;
  color: var(--text-2); padding-top: 4px; transition: color .2s;
}
.spec-row:hover .spec-idx { color: var(--accent); }
.spec-name { grid-area: name; font-weight: 600; font-size: 18px; line-height: 1.4; }
.spec-name::after { content: ' ↗'; color: var(--line); transition: color .2s; }
.spec-row:hover .spec-name::after { color: var(--accent); }
.spec-desc { grid-area: desc; color: var(--text-2); font-size: 15px; margin-top: 4px; }
.spec-price { grid-area: price; font-family: var(--mono); font-size: 14px; color: var(--accent); margin-top: 10px; white-space: nowrap; }
@media (min-width: 760px) {
  .spec-row {
    grid-template-columns: 72px 240px 1fr auto;
    grid-template-areas: "idx name desc price";
    align-items: baseline; gap: 0 24px;
  }
  .spec-desc, .spec-price { margin-top: 0; }
}

/* модалки услуг: dialog, на мобильном — bottom-sheet */
dialog.sheet {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0;
  width: min(540px, calc(100% - 40px));
  margin: auto;
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .65); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.sheet-head .tech { color: var(--accent); }
.sheet-close {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  color: var(--text-2); font-size: 16px;
  transition: color .2s, border-color .2s, transform .2s;
}
.sheet-close:hover { color: var(--text); border-color: var(--accent); }
.sheet-close:active { transform: scale(.97); }
.sheet-body { padding: 22px; }
.sheet-body h3 { font-family: var(--display); font-weight: 700; font-size: 19px; margin-bottom: 12px; }
.sheet-body p { color: var(--text-2); font-size: 15px; margin-bottom: 14px; }
.sheet-body ul { list-style: none; margin-bottom: 16px; }
.sheet-body li { color: var(--text-2); font-size: 15px; padding-left: 18px; position: relative; margin-bottom: 8px; }
.sheet-body li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }
.sheet-body li strong { color: var(--text); font-weight: 600; }
.note {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  border-left: 2px solid var(--accent-dim);
  padding-left: 12px;
}
.sheet-foot { padding: 18px 22px; border-top: 1px solid var(--line); }
.sheet-price { font-family: var(--mono); font-size: 15px; color: var(--accent); display: block; margin-bottom: 14px; }
.sheet-contacts { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-contacts .btn { padding: 12px 20px; font-size: 15px; }

@media (max-width: 759px) {
  dialog.sheet {
    width: 100%; max-width: 100%;
    margin: auto 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  .sheet-grip { width: 44px; height: 4px; background: var(--line); margin: 10px auto 0; }
}
@media (min-width: 760px) { .sheet-grip { display: none; } }

dialog.sheet[open] { animation: sheet-in .22s ease-out; }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* цифры */
.stats { padding: 56px 0 64px; border-top: 1px solid var(--line); }
.stats-grid { display: grid; gap: 36px; margin-top: 28px; }
.stat .dim { margin-bottom: 12px; }
.stat-value {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(36px, 6.4vw, 54px); line-height: 1.1;
}
.stat-value small { font-size: .42em; color: var(--accent); font-weight: 500; margin-left: 6px; }
.stat-label { color: var(--text-2); font-size: 15px; margin-top: 6px; max-width: 240px; }
@media (min-width: 760px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .stat:nth-child(2) { margin-top: 36px; }
  .stat:nth-child(3) { margin-top: 72px; }
}

/* витрина: сетка направлений */
.catalog { padding: 56px 0 72px; border-top: 1px solid var(--line); }
.catalog.no-rule { border-top: 0; padding-top: 40px; }
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 28px; }
.cat-card {
  display: block; position: relative;
  border: 1px solid var(--line);
  padding: 22px;
  transition: border-color .2s, transform .2s;
}
.cat-card:hover { border-color: var(--accent); }
.cat-card:active { transform: scale(.98); }
.cat-code {
  font-family: var(--mono); font-size: 13px;
  color: var(--accent); letter-spacing: .1em;
  display: block; margin-bottom: 36px;
}
.cat-card h3 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.cat-card p { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.cat-card::after {
  content: '→'; position: absolute; top: 18px; right: 20px;
  color: var(--line); font-size: 18px;
  transition: color .2s, transform .2s;
}
.cat-card:hover::after { color: var(--accent); transform: translateX(3px); }
@media (min-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-card.wide { grid-column: span 2; }
}
@media (min-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-card.wide { grid-column: span 1; }
}

/* ===== страница направления ===== */
.crumbs {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 0 0;
}
.crumbs a { border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--text); border-bottom-color: var(--accent); }
.crumbs .sep { color: var(--line); }
.crumbs .here { color: var(--accent); }

.page-head { padding: 28px 0 36px; }
.page-head h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.25;
  margin-bottom: 14px;
}
.page-intro { color: var(--text-2); font-size: 16px; max-width: 640px; }
.page-intro strong { color: var(--text); font-weight: 600; }

/* сетка галереи */
.gallery { padding: 0 0 64px; }
.gal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .gal-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
.gal-item {
  position: relative;
  border: 1px solid var(--line);
  padding: 0;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.gal-item:hover { border-color: var(--accent); }
.gal-item:active { transform: scale(.98); }
.gal-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.gal-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px 12px 10px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .04em; text-align: left;
  color: var(--text);
  background: rgba(22, 22, 23, .82);
  opacity: 0;
  transition: opacity .2s;
}
.gal-item:hover figcaption { opacity: 1; }
@media (hover: none) { .gal-item figcaption { display: none; } }

.gal-empty {
  border: 1px dashed var(--line);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
}

/* лайтбокс */
dialog.lightbox {
  width: 100vw;
  height: 100vh; height: 100dvh;
  max-width: 100vw;
  max-height: 100vh; max-height: 100dvh;
  margin: 0; padding: 0; border: 0;
  background: rgba(18, 18, 19, .97);
  color: var(--text);
}
dialog.lightbox::backdrop { background: transparent; }
.lb-top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  z-index: 2;
}
.lb-counter { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--accent); }
.lb-close {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  color: var(--text-2); font-size: 18px;
  background: var(--bg);
  transition: color .2s, border-color .2s;
}
.lb-close:hover { color: var(--text); border-color: var(--accent); }
.lb-track {
  display: flex;
  height: 100vh; height: 100dvh;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  padding: 64px 16px 56px;
}
.lb-slide img, .lb-slide video {
  max-width: 100%;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  object-fit: contain;
  border: 1px solid var(--line);
}
.lb-slide figcaption {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .04em; color: var(--text-2);
  text-align: center;
}
.lb-arrow {
  display: none;
  position: fixed; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px; height: 48px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text-2); font-size: 20px;
  transition: color .2s, border-color .2s;
}
.lb-arrow:hover { color: var(--text); border-color: var(--accent); }
@media (min-width: 760px) {
  .lb-arrow { display: flex; }
  .lb-prev { left: 20px; }
  .lb-next { right: 20px; }
}

/* CTA внизу страницы направления */
.page-cta {
  border: 1px solid var(--line);
  padding: 28px 24px;
  margin-bottom: 72px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.page-cta p { font-weight: 600; font-size: 17px; max-width: 420px; line-height: 1.5; }
.page-cta p span { display: block; font-weight: 400; font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* футер-штамп */
.footer { padding: 0 0 36px; }
.stamp {
  border: 1px solid var(--line);
  display: grid; gap: 1px;
  background: var(--line);
  margin-top: 56px;
}
.stamp > div { background: var(--bg); padding: 16px 18px; }
.stamp .k {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-2);
  display: block; margin-bottom: 4px;
}
.stamp .v { font-size: 15px; font-weight: 500; }
.stamp .v a { border-bottom: 1px solid var(--line); }
.stamp .v a:hover { color: var(--accent); border-bottom-color: var(--accent); }
@media (min-width: 760px) {
  .stamp { grid-template-columns: 2fr 2fr 1fr 1fr; }
  .stamp .span2 { grid-column: span 2; }
}
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }

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

/* карточки объектов внутри направления */
.obj-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 24px; }
@media (min-width: 760px) { .obj-grid { grid-template-columns: repeat(2, 1fr); } }
.obj-card {
  display: block;
  border: 1px solid var(--line);
  transition: border-color .2s, transform .2s;
}
.obj-card:hover { border-color: var(--accent); }
.obj-card:active { transform: scale(.98); }
.obj-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.obj-body { display: block; padding: 16px 18px 18px; }
.obj-meta { display: block; margin-bottom: 8px; color: var(--accent); }
.obj-body h3 { font-size: 16px; font-weight: 600; line-height: 1.45; }
.obj-body p { color: var(--text-2); font-size: 14px; margin-top: 4px; }

/* значок видео в сетке галереи */
.gal-item .play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.gal-item .play span {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22, 22, 23, .8);
  border: 1px solid var(--accent);
  color: var(--accent); font-size: 16px;
  padding-left: 3px;
  transition: transform .2s;
}
.gal-item:hover .play span { transform: scale(1.08); }


/* мозаика-превью карточки объекта: 2×2 равных кадра */
.obj-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  position: relative;
  background: var(--line-dim);
}
.m-thumb { position: relative; display: block; overflow: hidden; }
.m-thumb.m-solo { grid-column: 1 / -1; }
.m-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.m-more {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22, 22, 23, .62);
  font-family: var(--mono); font-size: 15px;
  color: var(--accent);
}
.m-count {
  position: absolute; top: 10px; left: 10px;
  background: rgba(22, 22, 23, .82);
  color: var(--text);
  padding: 4px 8px;
  border-left: 2px solid var(--accent);
}

/* страховка для браузеров без aspect-ratio: жёсткие высоты вместо растяжения */
@supports not (aspect-ratio: 1 / 1) {
  .gal-item img { height: 150px; }
  .m-thumb img { height: 140px; }
  .obj-card img { height: 200px; }
}


/* кнопка «Вопрос» в шапке */
.nav-ask {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-2);
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-ask b { color: var(--accent); font-weight: 600; }
.nav-ask:hover { color: var(--text); border-bottom-color: var(--accent); }

/* опции окна «Вопрос» */
.ask-options { display: grid; gap: 10px; margin-top: 16px; }
.ask-opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 15px; font-weight: 500;
  transition: border-color .2s, background .2s, transform .2s;
}
.ask-opt .tech { color: var(--accent); }
.ask-opt:hover { border-color: var(--accent); background: var(--line-dim); }
.ask-opt:active { transform: scale(.98); }
.ask-back {
  display: block;
  margin-bottom: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  width: fit-content;
  transition: color .2s, border-color .2s;
}
.ask-back:hover { color: var(--text); border-bottom-color: var(--accent); }
