/* ==========================================================================
   Шаблон сайта компании — основные стили
   Цвета, шрифты и отступы меняются в блоке :root (переменные ниже).
   ========================================================================== */

:root {
  /* Фирменные цвета — замените на свои */
  --color-primary: #12355b;        /* основной (тёмно-синий) */
  --color-primary-dark: #0b2440;
  --color-accent: #e8772e;         /* акцент (кнопки, выделения) */
  --color-accent-dark: #c96119;

  --color-text: #1d2733;
  --color-muted: #5b6878;
  --color-bg: #ffffff;
  --color-bg-alt: #f3f6f9;
  --color-border: #dde3ea;

  --font-base: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(18, 53, 91, 0.08);
  --shadow-hover: 0 12px 32px rgba(18, 53, 91, 0.16);
  --container: 1200px;
  --header-h: 72px;
  --transition: 0.25s ease;
}

/* ---------- Базовые стили ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; color: var(--color-primary-dark); }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); font-weight: 750; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 1000;
  background: var(--color-accent); color: #fff; padding: 8px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; }

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

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-dark); color: #fff; }
.btn--outline { border-color: currentColor; color: #fff; background: transparent; }
.btn--outline:hover { background: #fff; color: var(--color-primary); }
.btn--ghost { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn--ghost:hover { background: var(--color-primary); color: #fff; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; /* без backdrop-filter: он ломает выпадающее мобильное меню */
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--color-primary-dark); }
.logo img { width: 40px; height: 40px; }
.logo:hover { color: var(--color-primary-dark); }

.nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--color-text); font-weight: 500;
}
.nav__link:hover { background: var(--color-bg-alt); color: var(--color-primary); }
.nav__link.is-active { background: var(--color-primary); color: #fff; }

.header__actions { display: flex; align-items: center; gap: 16px; }
.header__phone { font-weight: 700; color: var(--color-primary-dark); white-space: nowrap; }

.burger {
  display: none; width: 44px; height: 44px; border: 0; background: var(--color-bg-alt);
  border-radius: var(--radius-sm); cursor: pointer; position: relative;
}
.burger span, .burger::before, .burger::after {
  content: ""; position: absolute; left: 11px; right: 11px; height: 2px; background: var(--color-primary-dark);
  transition: transform var(--transition), opacity var(--transition);
}
.burger::before { top: 14px; }
.burger span { top: 21px; }
.burger::after { top: 28px; }
.burger[aria-expanded="true"]::before { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span { opacity: 0; }
.burger[aria-expanded="true"]::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Первый экран (главная) ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    linear-gradient(90deg, rgba(11, 36, 64, 0.85) 0%, rgba(11, 36, 64, 0.55) 60%, rgba(11, 36, 64, 0.25) 100%),
    url("../img/hero.jpg") center / cover no-repeat;
  padding: clamp(64px, 12vw, 140px) 0;
}
.hero::after {
  display: none;
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to left, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to left, #000 0%, transparent 70%);
}
.hero__content { position: relative; z-index: 1; max-width: 720px; }
.hero h1 { color: #fff; }
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.25rem); opacity: 0.9; margin-bottom: 2em; }
.hero__buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__badge {
  display: inline-block; padding: 6px 14px; margin-bottom: 20px; border-radius: 999px;
  background: rgba(255,255,255,.12); font-size: 0.9rem; font-weight: 600;
}

/* ---------- Заголовок внутренних страниц ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff; padding: 48px 0 56px;
}
.page-hero h1 { color: #fff; margin-bottom: 0.3em; }
.page-hero p { opacity: 0.85; max-width: 680px; margin: 0; font-size: 1.1rem; }

.breadcrumbs { margin-bottom: 16px; font-size: 0.9rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; opacity: 0.6; }
.breadcrumbs a { color: rgba(255,255,255,.8); }
.breadcrumbs a:hover { color: #fff; }

/* ---------- Секции ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--color-bg-alt); }
.section__head { max-width: 680px; margin-bottom: 40px; }
.section__head--center { text-align: center; margin-left: auto; margin-right: auto; }
.section__eyebrow {
  display: inline-block; color: var(--color-accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin-bottom: 8px;
}
.section__head p { color: var(--color-muted); font-size: 1.05rem; }
.section__more { margin-top: 40px; text-align: center; }

/* ---------- Сетки ---------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Карточки ---------- */
.card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.card__img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--color-bg-alt); }
.card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card__body p { color: var(--color-muted); }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.875rem; color: var(--color-muted); margin-top: auto; }
.card__link { margin-top: auto; font-weight: 600; }
.card__link::after { content: " →"; }

.tag {
  display: inline-block; align-self: flex-start; padding: 4px 12px; margin-bottom: 12px; border-radius: 999px;
  background: rgba(232, 119, 46, 0.12); color: var(--color-accent-dark); font-size: 0.8rem; font-weight: 600;
}

.icon-box {
  width: 56px; height: 56px; border-radius: 14px; margin-bottom: 20px;
  display: grid; place-items: center;
  background: rgba(18, 53, 91, 0.08); color: var(--color-primary);
}
.icon-box svg { width: 28px; height: 28px; }

/* ---------- Цифры ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { text-align: center; padding: 24px 12px; }
.stat__num { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; color: var(--color-accent); line-height: 1; }
.stat__label { color: var(--color-muted); margin-top: 8px; }

/* ---------- О компании ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split__img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.checklist { list-style: none; padding: 0; margin: 0 0 1.5em; }
.checklist li { position: relative; padding-left: 32px; margin-bottom: 12px; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%; background: var(--color-accent); color: #fff;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700;
}

/* ---------- Услуги (подробно) ---------- */
.service-row {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center;
  padding: 48px 0; border-bottom: 1px solid var(--color-border);
}
.service-row:last-child { border-bottom: 0; }
.service-row:nth-child(even) .service-row__img { order: 2; }
.service-row__img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Этапы работы ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { position: relative; padding: 28px 24px; background: #fff; border-radius: var(--radius); border: 1px solid var(--color-border); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: block; font-size: 2rem; font-weight: 800; color: var(--color-accent); margin-bottom: 8px;
}
.step p { color: var(--color-muted); margin: 0; }

/* ---------- Фильтр проектов ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter__btn {
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--color-border);
  background: #fff; font: inherit; font-weight: 500; cursor: pointer; color: var(--color-text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.filter__btn:hover { border-color: var(--color-primary); }
.filter__btn.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.is-hidden { display: none !important; }

/* ---------- Лицензии ---------- */
.doc-card { cursor: pointer; }
.doc-card .card__img { aspect-ratio: 3 / 4; object-fit: cover; }
.doc-card__btn {
  all: unset; display: block; cursor: zoom-in;
}
.doc-card__btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }
.doc-list { list-style: none; padding: 0; margin: 0 0 12px; font-size: 0.9rem; color: var(--color-muted); }
.doc-list li { padding: 4px 0; border-bottom: 1px dashed var(--color-border); }
.doc-list b { color: var(--color-text); font-weight: 600; }

/* Окно просмотра (лайтбокс) */
.lightbox {
  position: fixed; inset: 0; z-index: 500; display: none;
  background: rgba(8, 18, 32, 0.92); padding: 24px;
  align-items: center; justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox__img { max-height: 88vh; max-width: 100%; border-radius: var(--radius-sm); background: #fff; }
.lightbox__close {
  position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
.lightbox__close:hover { background: rgba(255,255,255,.3); }
.lightbox__caption { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #fff; padding: 0 20px; }

/* ---------- Контакты ---------- */
.contacts { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: start; }
.contact-item { display: flex; gap: 16px; margin-bottom: 28px; }
.contact-item .icon-box { flex-shrink: 0; margin: 0; }
.contact-item__label { font-size: 0.875rem; color: var(--color-muted); }
.contact-item__value { font-weight: 600; font-size: 1.1rem; color: var(--color-primary-dark); }

.form { background: #fff; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius); box-shadow: var(--shadow); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { margin-bottom: 16px; }
.form__field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form__field input, .form__field textarea, .form__field select {
  width: 100%; padding: 14px 16px; font: inherit; color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg-alt);
  transition: border-color var(--transition), background var(--transition);
}
.form__field input:focus, .form__field textarea:focus, .form__field select:focus {
  outline: none; border-color: var(--color-primary); background: #fff;
}
.form__field textarea { min-height: 130px; resize: vertical; }
.form__check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.875rem; color: var(--color-muted); margin-bottom: 20px; }
.form__check input { margin-top: 4px; }
.form__hp { position: absolute; left: -9999px; } /* защита от спам-ботов */
.form__status { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-sm); display: none; }
.form__status.is-ok { display: block; background: #e6f6ec; color: #1b6b3a; }
.form__status.is-error { display: block; background: #fdecec; color: #a12626; }

.map {
  border-radius: var(--radius); overflow: hidden; background: var(--color-bg-alt);
  min-height: 380px; display: grid; place-items: center; color: var(--color-muted); text-align: center; padding: 24px;
  border: 2px dashed var(--color-border);
}
.map iframe { width: 100%; height: 420px; border: 0; display: block; }
.map:has(iframe) { padding: 0; border: 0; display: block; }

.requisites { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.requisites th, .requisites td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.requisites th { width: 40%; color: var(--color-muted); font-weight: 500; }

/* ---------- Карта сайта (страница) ---------- */
.sitemap-tree { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.sitemap-tree > li { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 24px; }
.sitemap-tree > li > a { font-weight: 700; font-size: 1.15rem; }
.sitemap-tree ul { list-style: none; padding: 0; margin: 12px 0 0; }
.sitemap-tree ul li { padding: 6px 0; border-top: 1px solid var(--color-border); }

/* ---------- Призыв к действию ---------- */
.cta {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff; border-radius: var(--radius); padding: clamp(32px, 5vw, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta h2 { color: #fff; margin: 0 0 8px; }
.cta p { margin: 0; opacity: 0.92; }
.cta .btn { background: #fff; color: var(--color-accent-dark); }
.cta .btn:hover { background: var(--color-primary-dark); color: #fff; }

/* ---------- Подвал ---------- */
.site-footer { background: var(--color-primary-dark); color: rgba(255,255,255,.75); padding: 64px 0 24px; font-size: 0.95rem; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; margin-bottom: 48px; }
.footer__title { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.footer__list { list-style: none; padding: 0; margin: 0; }
.footer__list li { margin-bottom: 10px; }
.site-footer .logo { color: #fff; margin-bottom: 16px; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.875rem;
}

/* Кнопка «наверх» */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 48px; height: 48px;
  border-radius: 50%; border: 0; background: var(--color-accent); color: #fff; font-size: 20px;
  cursor: pointer; box-shadow: var(--shadow); opacity: 0; visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { transform: translateY(-3px); }

/* Плавное появление блоков при прокрутке */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Страница 404 */
.error-page { text-align: center; padding: 120px 0; }
.error-page__code { font-size: clamp(5rem, 18vw, 10rem); font-weight: 900; color: var(--color-accent); line-height: 1; }

/* ==========================================================================
   Адаптивность: планшеты и телефоны
   ========================================================================== */
@media (max-width: 1080px) {
  .header__phone { display: none; }
  .grid--4, .steps { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .burger { display: block; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #fff; padding: 24px 20px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__link { padding: 16px; font-size: 1.15rem; border-radius: var(--radius-sm); }
  .nav__mobile-extra { display: block !important; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--color-border); }
  .header__actions .btn { display: none; }

  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .split, .contacts, .service-row { grid-template-columns: 1fr; gap: 32px; }
  .service-row:nth-child(even) .service-row__img { order: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  body.menu-open { overflow: hidden; }
}

@media (max-width: 600px) {
  .grid--2, .grid--3, .grid--4, .steps { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__buttons .btn { width: 100%; }
  .cta { flex-direction: column; align-items: flex-start; }
  .cta .btn { width: 100%; }
  .requisites th, .requisites td { display: block; width: 100%; padding: 4px 0; border: 0; }
  .requisites tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
}
