/* ============================================================
   ОКТАР — дизайн-система
   Реализация ТЗ «Визуальная концепция и стилистика веб-сайта».

   Ключевые правила ТЗ, зашитые в этот файл:
     · палитра из четырёх цветов знака, без посторонних оттенков;
     · Montserrat на заголовки, Inter на текст;
     · line-height строго 1.5 в тексте и 1.2 в заголовках;
     · border-radius запрещён везде;
     · фаска 45° как единственная допустимая «неправильность» формы;
     · иерархия блоков — контрастом фонов и линиями 1px #D1D5DB,
       а не размытыми тенями;
     · жёсткая 12-колоночная сетка;
     · появление блоков снизу вверх, без отскоков.
   ============================================================ */

:root {
  /* Палитра ТЗ, раздел 2 */
  --graphite:  #2A3439;  /* Primary Dark — каркас сайта */
  --teal:      #2C7A7B;  /* Brand Accent — CTA и ключевые метрики */
  --deep:      #1A4B57;  /* Secondary Accent — hover и подложки */
  --concrete:  #F5F7F8;  /* Background — архитектурный бетон */
  --line:      #D1D5DB;  /* Разделители, ТЗ раздел 4 */
  --white:     #ffffff;

  /* Производные. Каждый выведен под порог контраста, не на глаз:
     --ink-mute даёт 5,7:1 на бетоне и 6,1:1 на белом;
     --teal-light — 4,6:1 на графитовой подложке, тогда как сам
     --teal на графите даёт всего 2,5:1 и как текст там негоден. */
  --ink:        #2A3439;
  --ink-dim:    #3D4A51;
  --ink-mute:   #55636A;
  --teal-light: #6BBCBC;
  --surface-dark: #35424A;  /* карточки внутри графитовых секций */
  --line-dark:  rgba(255, 255, 255, 0.16);

  --danger:  #A32217;
  --ok:      #1F6B45;

  /* Фаска 45° — единственная форма, наследующая диагональ знака.
     Ставится ровно на один угол, иначе получается октагон из ТЗ,
     а он занят логотипом. */
  --chamfer: 14px;

  --wrap: 1280px;
  --wrap-narrow: 880px;
  --gutter: 24px;
  --header-h: 76px;

  --font-head: "Montserrat", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Без overshoot: ТЗ прямо запрещает bounce-эффекты */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  color-scheme: light;
}

/* ─────────────  База  ───────────── */

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

/* ТЗ: скругления запрещены. Правило поставлено выше всех остальных,
   чтобы случайный border-radius в новом блоке не пережил ревью. */
*, *::before, *::after { border-radius: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

html, body { overflow-x: clip; max-width: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;            /* ТЗ, раздел 3 — строго */
  color: var(--ink-dim);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.2;            /* ТЗ, раздел 3 — строго */
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }

p, li, td, th, span, dd { overflow-wrap: break-word; }

a { color: var(--deep); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--teal); }

code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", monospace;
  font-size: .92em;
  color: var(--deep);
  background: rgba(44, 122, 123, 0.10);
  padding: .12em .42em;
}

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

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ТЗ: иконки линейные, толщина линии 2px */
.ico {
  width: 22px; height: 22px; flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--teal); color: var(--white);
  padding: 12px 18px; font-weight: 700;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%; max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 28px;
}
.wrap-narrow { max-width: var(--wrap-narrow); }

/* ТЗ, раздел 6: жёсткая 12-колоночная сетка.
   Все крупные блоки выравниваются по её направляющим. */
.grid12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

/* ─────────────  Шапка  ───────────── */

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: var(--concrete);
  border-bottom: 1px solid var(--line);
}
.site-header.scrolled { border-bottom-color: var(--graphite); }

.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); flex: none; }
/* Знак не квадратный — 200×208. Высота считается из ширины,
   иначе стрелка сплющивается. */
.brand-mark { width: 42px; height: auto; flex: none; }
.brand-text b {
  display: block;
  font-family: var(--font-head); font-size: 1.22rem; font-weight: 800;
  letter-spacing: .1em; line-height: 1.1;
}
.brand-text small {
  display: block;
  font-size: .62rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-mute);
}

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a {
  padding: 9px 12px;
  font-size: .85rem; font-weight: 500;
  color: var(--ink-dim);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.nav a:hover { color: var(--graphite); border-bottom-color: var(--line); }
.nav a.active { color: var(--teal); border-bottom-color: var(--teal); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav + .header-actions { margin-left: 0; }

.header-phone {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 18px;
  font-size: .88rem; font-weight: 700;
  color: var(--white); background: var(--teal);
  white-space: nowrap;
  transition: background .2s var(--ease);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.header-phone:hover { background: var(--deep); color: var(--white); }
.header-phone .ico { width: 18px; height: 18px; }

.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--graphite);
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }

.nav-toggle { display: none; }
.nav-toggle .ico-shut { display: none; }
.nav-toggle[aria-expanded="true"] .ico-open { display: none; }
.nav-toggle[aria-expanded="true"] .ico-shut { display: block; }

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

.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 6vw, 88px) 0 clamp(56px, 7vw, 96px);
  border-bottom: 1px solid var(--line);
}

/* ТЗ, раздел 5: паттерн строительной сетки осей с низкой непрозрачностью */
.hero-axes {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 80px);
  opacity: .55;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  pointer-events: none;
}

/* Колонки тянутся на одну высоту: графитовая панель работает
   как несущий пилон рядом с текстом, а не висит половиной экрана. */
.hero-inner { position: relative; align-items: stretch; }
.hero-text { grid-column: span 7; }
.hero-panel { grid-column: span 5; display: flex; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--teal);
  padding-left: 16px;
  border-left: 3px solid var(--teal);
  margin-bottom: 22px;
}

.hero h1 { margin-bottom: 24px; }
.hero .lead { font-size: clamp(1.05rem, 1.5vw, 1.24rem); color: var(--ink-dim); max-width: 46ch; }
.hero .lead strong { color: var(--graphite); font-weight: 700; }
.hero .sub { margin-top: 16px; font-size: .98rem; color: var(--ink-mute); max-width: 50ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* Панель метрик: монолитный графитовый блок — «фундамент» экрана */
.hero-panel { background: var(--graphite); }
.hero-stats { list-style: none; width: 100%; display: flex; flex-direction: column; }
.hero-stats li {
  flex: 1;
  display: flex; align-items: baseline; gap: 18px;
  padding: 22px 26px;
  border-bottom: 1px solid var(--line-dark);
}
.hero-stats li:last-child { border-bottom: 0; }
.hero-stats b {
  font-family: var(--font-head); font-size: 2.1rem; font-weight: 800;
  line-height: 1; color: var(--teal-light);
  min-width: 68px;
}
.hero-stats span { font-size: .92rem; color: rgba(255, 255, 255, 0.78); }

/* ─────────────  Секции  ───────────── */

.section { padding: clamp(56px, 7vw, 100px) 0; }
.section-tint { background: var(--white); border-block: 1px solid var(--line); }
.section-dark { background: var(--graphite); }

.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .section-lead { color: rgba(255, 255, 255, 0.78); }
.section-dark .eyebrow { color: var(--teal-light); border-left-color: var(--teal-light); }

.section-head { max-width: 66ch; margin-bottom: clamp(34px, 4vw, 52px); }
.section-head h2 { margin-bottom: 16px; }
.section-lead { font-size: 1.02rem; color: var(--ink-mute); }

/* ─────────────  Направления  ───────────── */

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
/* ТЗ, раздел 4: объём и иерархия — контрастом фонов и линиями 1px,
   а не размытыми тенями. Поэтому карточки склеены в монолит,
   а зазор между ними — та самая линия. */
.service {
  background: var(--white);
  padding: 32px 30px;
  transition: background .25s var(--ease);
}
.service:hover { background: var(--concrete); }

.service-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.service-ico {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  background: var(--teal); color: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.service-ico .ico { width: 26px; height: 26px; }
.service-num {
  font-family: var(--font-head); font-size: 2.4rem; font-weight: 800;
  line-height: 1;
  /* Не --line: цветом разделителя номер даёт 1,47:1 и перестаёт
     читаться как нумерация. Это Primary Dark в половину силы —
     остаётся приглушённым, но проходит порог для крупного текста. */
  color: rgba(42, 52, 57, 0.58);
}
.service h3 { margin-bottom: 10px; }
.service > p { font-size: .93rem; color: var(--ink-mute); margin-bottom: 20px; }

.service-list { list-style: none; border-top: 1px solid var(--line); }
.service-list li {
  position: relative;
  padding: 11px 0 11px 22px;
  font-size: .9rem;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line);
}
.service-list li::before {
  content: ''; position: absolute; left: 0; top: 1.15em;
  width: 8px; height: 2px; background: var(--teal);
}

/* ─────────────  Процесс  ───────────── */

.process { list-style: none; counter-reset: stage; }
.stage {
  display: grid; grid-template-columns: 92px 1fr; gap: 28px;
  padding: 26px 0;
  border-top: 1px solid var(--line-dark);
}
.stage:last-child { border-bottom: 1px solid var(--line-dark); }
.stage-num {
  font-family: var(--font-head); font-size: 1.6rem; font-weight: 800;
  line-height: 1; color: var(--teal-light);
  padding-top: 2px;
}
.stage h3 { margin-bottom: 8px; }
.stage p { font-size: .94rem; color: rgba(255, 255, 255, 0.78); max-width: 78ch; }
.stage-out {
  display: inline-block; margin-top: 14px;
  padding: 7px 14px;
  font-size: .78rem; font-weight: 600; letter-spacing: .04em;
  color: var(--white);
  background: var(--deep);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

/* ─────────────  Зона ответственности  ───────────── */

.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.scope-card {
  background: var(--white);
  padding: 28px 26px;
  transition: background .25s var(--ease);
}
.scope-card:hover { background: var(--concrete); }
.scope-ico {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 18px;
  color: var(--deep);
  border: 2px solid var(--deep);
}
.scope-card h3 { margin-bottom: 8px; }
.scope-card p { font-size: .9rem; color: var(--ink-mute); }

.callout {
  display: flex; gap: 18px; align-items: flex-start;
  margin-top: 28px; padding: 24px 26px;
  background: var(--white);
  border-left: 4px solid var(--teal);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.callout .ico { color: var(--teal); margin-top: 2px; }
.callout p { font-size: .94rem; color: var(--ink-dim); }
.callout b { color: var(--graphite); }

/* ─────────────  Форматы участия  ───────────── */

.formats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
}
.format {
  background: var(--concrete);
  border: 1px solid var(--line);
  border-top: 3px solid var(--graphite);
  padding: 30px 28px;
  transition: border-top-color .25s var(--ease);
}
.format:hover { border-top-color: var(--teal); }
.format-tag {
  display: inline-block; margin-bottom: 16px;
  padding: 6px 14px;
  font-family: var(--font-head);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--white); background: var(--deep);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
}
.format h3 { margin-bottom: 10px; }
.format > p { font-size: .92rem; color: var(--ink-mute); margin-bottom: 20px; }
.format-meta { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.format-meta dt {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 4px;
}
.format-meta dd { font-size: .89rem; color: var(--ink-dim); }

/* ─────────────  Конфигуратор  ───────────── */

.config {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gutter);
  align-items: start;
}

.config-form {
  display: grid; gap: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 32px 30px;
}

.field { display: grid; gap: 10px; border: 0; }
.field > label, .field > legend {
  font-family: var(--font-head);
  font-size: .82rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--graphite);
  padding: 0;
}
.field .req { color: var(--teal); }
.hint { font-size: .82rem; color: var(--ink-mute); }

input[type="text"], input[type="tel"], input[type="email"],
input[type="number"], textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body); font-size: .98rem;
  color: var(--ink);
  background: var(--concrete);
  border: 1px solid var(--line);
  transition: border-color .2s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-mute); }
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
textarea { resize: vertical; min-height: 110px; }

.radio-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio { cursor: pointer; }
.radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio span {
  display: block; height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--concrete);
  font-size: .84rem; color: var(--ink-mute);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.radio span b { display: block; font-family: var(--font-head); color: var(--graphite); font-size: .94rem; margin-bottom: 3px; }
.radio:hover span { border-color: var(--ink-mute); }
.radio input:checked + span { border-color: var(--teal); background: var(--white); box-shadow: inset 0 0 0 1px var(--teal); }
.radio input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.check-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { cursor: pointer; display: block; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check span {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--concrete);
  font-size: .9rem; color: var(--ink-dim);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.check span::before {
  content: ''; flex: none;
  width: 18px; height: 18px;
  border: 2px solid var(--ink-mute);
  transition: all .2s var(--ease);
}
.check input:checked + span { border-color: var(--teal); background: var(--white); color: var(--graphite); font-weight: 500; }
.check input:checked + span::before {
  background: var(--teal); border-color: var(--teal);
  /* Галочка нарисована фоном, чтобы не тащить ещё один элемент в разметку */
  background-image: linear-gradient(45deg, transparent 42%, #fff 42%, #fff 55%, transparent 55%),
                    linear-gradient(-45deg, transparent 55%, #fff 55%, #fff 68%, transparent 68%);
}
.check input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

.config-out {
  display: block;
  background: var(--graphite);
  padding: 32px 30px;
}
.config-lead { padding-bottom: 24px; border-bottom: 1px solid var(--line-dark); }
.config-label {
  display: block;
  font-family: var(--font-head);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.config-value { display: block; margin-top: 8px; font-size: 1rem; color: rgba(255, 255, 255, 0.78); }
.config-value b {
  font-family: var(--font-head); font-size: 2.8rem; font-weight: 800;
  line-height: 1; color: var(--teal-light);
  margin-right: 8px;
}

.config-block { padding: 22px 0; border-bottom: 1px solid var(--line-dark); }
.config-block h3 {
  font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 14px;
}
.list-check, .list-dot { list-style: none; display: grid; gap: 10px; }
.list-check li, .list-dot li {
  position: relative; padding-left: 24px;
  font-size: .9rem; color: var(--white);
}
.list-check li::before {
  content: ''; position: absolute; left: 0; top: .42em;
  width: 11px; height: 6px;
  border-left: 2px solid var(--teal-light);
  border-bottom: 2px solid var(--teal-light);
  transform: rotate(-45deg);
}
.list-dot li::before {
  content: ''; position: absolute; left: 2px; top: .62em;
  width: 7px; height: 7px; background: var(--teal-light);
}

.config-note {
  margin-top: 20px;
  font-size: .85rem;
  color: rgba(255, 255, 255, 0.78);
  border-left: 3px solid var(--teal-light);
  padding-left: 14px;
}
.config-note:empty { display: none; }
.config-out .btn { margin-top: 24px; }

/* ─────────────  FAQ  ───────────── */

.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); background: transparent; }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 4px;
  font-family: var(--font-head);
  font-weight: 700; font-size: 1rem; color: var(--graphite);
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ''; flex: none;
  width: 14px; height: 14px;
  background:
    linear-gradient(var(--teal), var(--teal)) center/14px 2px no-repeat,
    linear-gradient(var(--teal), var(--teal)) center/2px 14px no-repeat;
  transition: transform .25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); background-size: 14px 2px, 2px 0; }
.faq-item summary:hover { color: var(--teal); }
.faq-item > div { padding: 0 4px 22px; }
.faq-item p { font-size: .94rem; color: var(--ink-mute); max-width: 80ch; }

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

/*
  Фаска только у главной кнопки. Это не прихоть: clip-path режет
  и рамку тоже, поэтому у кнопки-призрака срез оставил бы открытый
  угол. Заодно получилась иерархия — срезано то, что нажимают.
*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px;
  font-family: var(--font-head);
  font-size: .92rem; font-weight: 700; letter-spacing: .02em;
  border: 1px solid transparent;
  cursor: pointer; text-align: center;
  transition: background .22s var(--ease), color .22s var(--ease), border-color .22s var(--ease);
}
.btn-primary {
  background: var(--teal); color: var(--white);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%);
}
.btn-primary:hover { background: var(--deep); color: var(--white); }
.btn-ghost { background: transparent; color: var(--graphite); border-color: var(--graphite); }
.btn-ghost:hover { background: var(--graphite); color: var(--white); }
.section-dark .btn-ghost { color: var(--white); border-color: rgba(255, 255, 255, 0.5); }
.section-dark .btn-ghost:hover { background: var(--white); color: var(--graphite); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 11px 20px; font-size: .84rem; --chamfer: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }

.link-btn {
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--deep);
  cursor: pointer; text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: var(--teal); }

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

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gutter);
  align-items: start;
}

.lead-form {
  display: grid; gap: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 34px 32px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: flex; gap: 13px; align-items: flex-start; font-size: .86rem; color: var(--ink-mute); }
.consent input { margin-top: 2px; accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.consent .link-btn { font-size: inherit; }

.form-status { font-size: .9rem; }
.form-status.ok { color: var(--ok); font-weight: 600; }
.form-status.err { color: var(--danger); font-weight: 600; }
.form-status:empty { display: none; }
.form-fallback { font-size: .84rem; color: var(--ink-mute); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }

.contact-info {
  background: var(--graphite);
  padding: 34px 32px;
}
.contact-info h3 {
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 800;
  letter-spacing: .1em; color: var(--white);
}
.contact-sub {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal-light); margin-bottom: 26px;
}
.contact-list { list-style: none; display: grid; gap: 20px; margin-bottom: 26px; }
.contact-list li { display: flex; gap: 15px; align-items: flex-start; }
.contact-list .ico { color: var(--teal-light); margin-top: 2px; }
.contact-list span {
  display: block;
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.contact-list a, .contact-list .plain {
  display: block; margin-top: 3px;
  font-size: .98rem; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  color: var(--white);
}
.contact-list a:hover { color: var(--teal-light); }

.hours {
  padding: 18px 20px; margin-bottom: 22px;
  border: 1px solid var(--line-dark);
}
.hours span { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.hours b { display: block; font-family: var(--font-head); font-size: 1.1rem; color: var(--white); margin: 5px 0 7px; }
.hours small { display: block; font-size: .82rem; color: rgba(255, 255, 255, 0.78); }

.contact-info .btn-ghost { color: var(--white); border-color: rgba(255, 255, 255, 0.5); }
.contact-info .btn-ghost:hover { background: var(--white); color: var(--graphite); }

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

/* ТЗ: глобальный футер — зона Primary Dark */
.site-footer {
  background: var(--graphite);
  color: rgba(255, 255, 255, 0.78);
  padding-top: clamp(44px, 5vw, 68px);
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.33fr));
  gap: 36px var(--gutter);
  padding-bottom: 44px;
}
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
/* В подвале — выворотка logo-mark-mono.png: зазоры между гранями
   в знаке прозрачные, и на графите цветные грани потеряли бы
   очертания. Белый силуэт сохраняет огранку читаемой. */
.footer-brand .brand-mark { width: 48px; height: auto; }
.footer-brand b {
  display: block;
  font-family: var(--font-head); font-size: 1.2rem; font-weight: 800;
  letter-spacing: .1em; color: var(--white); margin-bottom: 12px;
}
.footer-brand p { font-size: .88rem; max-width: 44ch; }
.legal-line { margin-top: 12px; font-size: .78rem !important; color: rgba(255, 255, 255, 0.78); }

.footer-nav { display: grid; gap: 10px; align-content: start; }
.footer-nav b {
  font-family: var(--font-head);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--white); margin-bottom: 4px;
}
.footer-nav a, .footer-nav span, .footer-nav .link-btn {
  font-size: .88rem; color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
}
.footer-nav a:hover, .footer-nav .link-btn:hover { color: var(--teal-light); }

.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  justify-content: space-between;
  padding-block: 22px;
  border-top: 1px solid var(--line-dark);
  font-size: .82rem;
}

/* ─────────────  Модальное окно  ───────────── */

.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(42, 52, 57, 0.72); }
.modal-box {
  position: relative;
  width: 100%; max-width: 780px; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--white);
  border-top: 4px solid var(--teal);
  animation: rise .3s var(--ease);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 1.2rem; }
.modal-body { padding: 28px; overflow-y: auto; }
.modal-body h3 { font-size: 1.1rem; margin-bottom: 16px; }
.modal-body h4 { margin: 24px 0 8px; color: var(--graphite); }
.modal-body p { font-size: .92rem; margin-bottom: 10px; }
.modal-body ul { margin: 0 0 14px 20px; }
.modal-body li { font-size: .92rem; margin-bottom: 6px; }
.modal-body .muted { color: var(--ink-mute); font-size: .86rem; }
.req-list { list-style: none; margin: 0 0 20px !important; display: grid; gap: 10px; }
.req-list li { font-size: .92rem; color: var(--ink-dim); }
.req-list b { color: var(--graphite); font-weight: 700; }

body.modal-open { overflow: hidden; }

/* ─────────────  Cookie  ───────────── */

.cookie {
  position: fixed; z-index: 110;
  left: 24px; right: 24px; bottom: 24px;
  max-width: 660px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 18px 22px;
  background: var(--graphite);
  border-left: 4px solid var(--teal);
  animation: rise .35s var(--ease);
}
.cookie[hidden] { display: none; }
.cookie p { flex: 1 1 320px; font-size: .86rem; color: rgba(255, 255, 255, 0.78); }
.cookie .link-btn { font-size: inherit; color: var(--teal-light); }
.cookie .link-btn:hover { color: var(--white); }

/* ─────────────  Появление блоков  ─────────────
   ТЗ, раздел 6: fade-in снизу вверх, «возведение конструктива».
   Кривая без overshoot — bounce прямо запрещён.
   Класс js-reveal ставится инлайновым скриптом только при поддержке
   IntersectionObserver: иначе страница остаётся видимой целиком. */

@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.js-reveal .reveal.shown { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .reveal, .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─────────────  Адаптив  ───────────── */

@media (max-width: 1100px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .header-inner { position: relative; }
  .header-actions { margin-left: auto; }

  .nav.open {
    display: grid; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    padding: 8px 28px 20px;
    background: var(--concrete);
    border-bottom: 1px solid var(--graphite);
    /* Альбомная ориентация телефона: 375 px высоты минус шапка —
       без ограничения нижние пункты уходят за экран без прокрутки */
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav.open a { padding: 15px 4px; font-size: .98rem; border-bottom: 1px solid var(--line); }
}

@media (max-width: 1000px) {
  .hero-text, .hero-panel { grid-column: span 12; }
  .config, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formats { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .wrap { padding-inline: 20px; }
  .header-phone span { display: none; }
  .header-phone { padding: 13px; min-width: 44px; min-height: 44px; }
  .header-inner { gap: 14px; }

  .services, .scope-grid { grid-template-columns: minmax(0, 1fr); }
  .radio-row, .check-row, .field-row { grid-template-columns: minmax(0, 1fr); }
  .stage { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .lead-form, .contact-info, .config-form, .config-out { padding: 26px 20px; }
  .service, .scope-card, .format { padding: 26px 22px; }

  /* Safari на iOS приближает страницу при фокусе в поле со шрифтом
     мельче 16px — форма уезжает вбок, масштаб возвращают руками */
  input[type="text"], input[type="tel"], input[type="email"],
  input[type="number"], textarea, select { font-size: 16px; }

  /* Строки-ссылки должны быть тач-целями, а не полосками в 20 px */
  .footer-nav a, .footer-nav .link-btn, .footer-nav span {
    display: flex; align-items: center; min-height: 42px;
  }
  .footer-nav { gap: 0; }
  .contact-list a, .contact-list .plain { min-height: 40px; display: flex; align-items: center; }
  .consent input { width: 20px; height: 20px; }

  /* Подписи мельче 12 px на телефоне уже не читаются */
  .format-tag, .contact-sub, .contact-list span, .hours span,
  .footer-nav b, .config-label, .config-block h3 { font-size: .75rem; }
  .format-meta dt { font-size: .75rem; }
}

/*
  Узкие телефоны. На 320 px шапка не помещалась: логотип с подписью
  «Engineering & Construction» занимал 225 px из 320, и кнопка меню
  уезжала за край — открыть навигацию было невозможно.
  Подпись на таком экране всё равно набиралась бы кеглем 8,8 px,
  поэтому она просто убирается.
*/
@media (max-width: 430px) {
  .wrap { padding-inline: 15px; }
  .header-inner { gap: 10px; }
  .header-actions { gap: 8px; }
  .brand { gap: 10px; }
  .brand-mark { width: 36px; }
  .brand-text b { font-size: 1.02rem; letter-spacing: .06em; }
  .brand-text small { display: none; }
  .hero-stats li { flex-direction: column; gap: 4px; padding: 18px 20px; }
  .hero-stats b { min-width: 0; }
  .service-num { font-size: 1.9rem; }
  .cookie { left: 12px; right: 12px; bottom: 12px; }
}

@media print {
  .site-header, .cookie, .hero-cta, .lead-form, .nav, .modal, .hero-axes { display: none !important; }
  body { background: #fff; color: #000; }
  .js-reveal .reveal, .reveal { opacity: 1; transform: none; }
  .section-dark, .config-out, .contact-info, .site-footer { background: #fff !important; color: #000 !important; }
  .section-dark h2, .section-dark h3, .stage h3 { color: #000 !important; }
}
