:root {
  --hexa-primary: #4b669b;
  --hexa-primary-dark: #30476f;
  --hexa-bg: #f5f5f7;
  --header-height: 48px;
  --page-width: 1080px;

  --text-main: #30476f;
  --text-muted: #8391AC;
}

/* ===== BASE ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui,
  sans-serif;
  font-size: 14px;
  line-height: 1.4;
  background: var(--hexa-bg);
  color: var(--text-main);
}

html.nav-open {
  cursor: default;
}

/* ===== HEADER / NAVBAR ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* затемнение + blur под меню — блюр управляется отдельным классом */

.site-header::after {
  content: "";
  position: fixed;
  inset: var(--header-height) 0 0 0;
  background: rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition:
    opacity 0.24s ease-out,
    backdrop-filter 0.24s ease-out,
    -webkit-backdrop-filter 0.24s ease-out;
  z-index: 900;
}

html.nav-blur-visible .site-header::after {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* шапка: обычная / стеклянная при скролле */

.site-header-bar {
  position: relative;
  z-index: 1100;
  background: var(--hexa-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

html.header-scrolled:not(.nav-open) .site-header-bar {
  background: rgba(46, 76, 140, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.2);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

/* контейнер в шапке */

.nav-inner {
  position: relative;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
}

/* логотип слева */

.nav-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-logo img {
  display: block;
  height: 18px;
  width: auto;
}

/* меню – строго по центру окна, логотип не влияет */

.nav-menu {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  border: 0;
  background: none;
  padding: 0 16px;
  margin: 0;
  font: inherit;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  height: var(--header-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-item.is-active > .nav-link {
  color: #ffffff;
}

/* ===== OVERLAY / MEGA-MENU ===== */

.nav-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-height);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, -6px, 0);
  background: #ffffff;
  border-bottom: 1px solid #e5e5ea;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  transition:
    opacity 0.28s ease-out,
    transform 0.4s ease-out;
  z-index: 1050;
}

html.nav-open .nav-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

/* контейнер overlay: только ширина и анимируемая высота */

.nav-overlay-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  height: 0;
  overflow: hidden;
  transition: height 0.22s ease-out;
}

/* при первом открытии — немного медленнее раскрытие */
html.nav-opening .nav-overlay-inner {
  transition: height 0.32s ease-out;
}

/* панель */

.nav-panel {
  position: absolute;
  inset: 0 0 auto 0;
  padding: 48px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.3fr);
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease-out;
}

/* при первом открытии — чуть медленнее + задержка */
html.nav-opening .nav-panel {
  transition: opacity 0.30s ease-out 0.08s;
}

.nav-panel.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* левая часть панелей: таблица 2 столбца × до 3 строк */

.nav-panel-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  align-content: flex-start;
  row-gap: 12px;
}

/* обёртка группы "растворяем" —
   все .nav-panel-item становятся ячейками grid */

.nav-panel-group {
  min-width: 0;
  display: contents;
}

.nav-panel-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hexa-primary);
  margin-bottom: 16px;
  grid-column: 1 / -1; /* заголовок над обоими столбцами */
}

/* элементы списков */

.nav-panel-item {
  display: flex;
  align-items: flex-start;
  text-decoration: none;
  padding: 10px 0;
  gap: 10px;
  opacity: 0;
  transform: none;
  transition:
    opacity 0.12s ease-out,
    color 0.18s ease;
}

/* обычное состояние при активной панели — мягкий fade, без дёрганий */
.nav-panel.is-active .nav-panel-item {
  opacity: 1;
}

/* первый запуск дроп-листа: каскадное "падение" сверху */

@keyframes navPanelItemDrop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html.nav-opening .nav-panel.is-active .nav-panel-item {
  opacity: 0;
  transform: translateY(-12px);
  animation: navPanelItemDrop 0.38s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

html.nav-opening .nav-panel.is-active .nav-panel-item:nth-of-type(1) { animation-delay: 0.04s; }
html.nav-opening .nav-panel.is-active .nav-panel-item:nth-of-type(2) { animation-delay: 0.08s; }
html.nav-opening .nav-panel.is-active .nav-panel-item:nth-of-type(3) { animation-delay: 0.12s; }
html.nav-opening .nav-panel.is-active .nav-panel-item:nth-of-type(4) { animation-delay: 0.16s; }
html.nav-opening .nav-panel.is-active .nav-panel-item:nth-of-type(5) { animation-delay: 0.20s; }
html.nav-opening .nav-panel.is-active .nav-panel-item:nth-of-type(6) { animation-delay: 0.24s; }

.nav-panel-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-panel-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--hexa-primary-dark);
}

.nav-panel-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-panel-item:hover .nav-panel-item-title {
  color: var(--hexa-primary);
}

/* иконки пунктов — только сам SVG, без подложки */

.nav-panel-item-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 0;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-panel-item-icon::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* svg-иконки – лежат в img/icon/*.svg */

.nav-icon-architecture::before {
  background-image: url("img/icon/architecture.svg");
}
.nav-icon-families::before {
  background-image: url("img/icon/families.svg");
}
.nav-icon-addons::before {
  background-image: url("img/icon/addons.svg");
}
.nav-icon-visualization::before {
  background-image: url("img/icon/visualization.svg");
}
.nav-icon-scripts::before {
  background-image: url("img/icon/scripts.svg");
}
.nav-icon-education::before {
  background-image: url("img/icon/education.svg");
}
.nav-icon-news::before {
  background-image: url("img/icon/news.svg");
}
.nav-icon-blog::before {
  background-image: url("img/icon/blog.svg");
}
.nav-icon-download-revit::before {
  background-image: url("img/icon/download-revit.svg");
}
.nav-icon-download-families::before {
  background-image: url("img/icon/download-families.svg");
}
.nav-icon-download-scripts::before {
  background-image: url("img/icon/download-scripts.svg");
}
.nav-icon-about-studio::before {
  background-image: url("img/icon/about-studio.svg");
}
.nav-icon-about-method::before {
  background-image: url("img/icon/about-method.svg");
}
.nav-icon-mail::before {
  background-image: url("img/icon/mail.svg");
}
.nav-icon-telegram::before {
  background-image: url("img/icon/telegram.svg");
}

/* новые иконки */

.nav-icon-project-private-house::before {
  background-image: url("img/icon/project_private_house.svg");
}
.nav-icon-project-car-showrooms::before {
  background-image: url("img/icon/project_car_showrooms.svg");
}
.nav-icon-project-public-spaces::before {
  background-image: url("img/icon/project_public_spaces.svg");
}
.nav-icon-project-interior::before {
  background-image: url("img/icon/project_interior.svg");
}
.nav-icon-roadmap::before {
  background-image: url("img/icon/roadmap.svg");
}

/* правая колонка – превью */

.nav-panel-preview {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

/* превью: картинка на всю высоту панели, текст белый поверх снизу */

.nav-preview-card {
  position: relative;
  width: 162px;      /* было 240px — сузили под вертикаль */
  height: 100%;      /* та же высота, что и у панели */
  min-height: 200px;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 6px;
}

/* картинка заполняет всю карточку */

.nav-preview-image-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #e4e7f1; /* фон под jpg, если нет картинки */
}

.nav-preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* текст поверх картинки, внизу, с градиентом корпоративного синего */

.nav-preview-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 18px 18px;
  box-sizing: border-box;
  background: linear-gradient(
    to top,
    rgba(75, 102, 155, 0.8),
    rgba(75, 102, 155, 0.0)
  );
}

.nav-preview-title {
  margin: 0 0 4px;
  font-size: 13px; /* чуть меньше, чем 14px */
  font-weight: 600;
  color: #ffffff;
}

.nav-preview-text {
  margin: 0;
  font-size: 11px; /* чуть меньше, чем 12px */
  color: #ffffff;
}

/* ===== MAIN PAGE ===== */

.page {
  min-height: 100vh;
}

/* hero */

.hero {
  max-width: var(--page-width);
  margin: 80px auto 0;
  padding: 0 24px 56px;
  text-align: center;
}

.hero-title {
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--hexa-primary-dark);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0;
}

/* общая сетка секций */

.section {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin-bottom: 32px;
}

.section-header {
  margin-bottom: 32px;
}

.section-header-center {
  text-align: center;
}

.section-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hexa-primary);
}

.section-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
  color: var(--hexa-primary-dark);
}

.section-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* услуги / направления */

.section-services {
  padding-top: 32px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
}

.service-card {
  display: flex;
  flex-direction: column;
  max-width: 360px;
}

/* иконки в карточках услуг*/

.service-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.service-card-icon::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* переиспользуем те же svg, что и в overlay */

.service-card-icon.nav-icon-architecture::before {
  background-image: url("img/icon/architecture.svg");
}
.service-card-icon.nav-icon-visualization::before {
  background-image: url("img/icon/visualization.svg");
}
.service-card-icon.nav-icon-families::before {
  background-image: url("img/icon/families.svg");
}
.service-card-icon.nav-icon-scripts::before {
  background-image: url("img/icon/scripts.svg");
}
.service-card-icon.nav-icon-addons::before {
  background-image: url("img/icon/addons.svg");
}
.service-card-icon.nav-icon-education::before {
  background-image: url("img/icon/education.svg");
}

.service-card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--hexa-primary-dark);
}

.service-card-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* портфолио */

.section-portfolio {
  background: #ffffff;
}

.portfolio-gallery {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-slot {
  min-height: 110px;
  background: #e4e7f1;
  border-radius: 4px;
}

/* free families */

.section-families {
  background: #ffffff;
}

.families-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
  gap: 40px;
  align-items: center;
}

.families-meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.families-tag {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(48, 71, 111, 0.2);
  font-size: 11px;
  color: var(--hexa-primary-dark);
}

.families-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.families-thumb-row {
  display: flex;
  gap: 8px;
}

.families-thumb {
  flex: 1;
  min-height: 70px;
  background: #e4e7f1;
  border-radius: 4px;
}

/* download блок */

.section-download {
  background: #f5f5f7;
}

.download-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.download-card {
  background: #ffffff;
  border-radius: 4px;
  padding: 20px 20px 22px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.download-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hexa-primary);
  margin-bottom: 6px;
}

.download-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--hexa-primary-dark);
}

.download-text {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* контакты */

.section-contacts {
  background: #ffffff;
}

.contacts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 40px;
  align-items: flex-start;
}

.contacts-email {
  margin: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--hexa-primary-dark);
}

.contacts-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.contacts-link {
  font-size: 13px;
  color: var(--hexa-primary);
  text-decoration: none;
}

.contacts-link:hover {
  text-decoration: underline;
}

.contacts-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row {
  width: 100%;
}

.form-input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 2px;
  border: 1px solid rgba(48, 71, 111, 0.25);
  font: inherit;
  color: inherit;
  background: #ffffff;
}

.form-input-multiline {
  min-height: 90px;
  resize: vertical;
}

.form-input:focus {
  outline: none;
  border-color: var(--hexa-primary);
}

.form-submit {
  margin-top: 8px;
  align-self: flex-start;
}

/* кнопки */

.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--hexa-primary);
  color: #ffffff;
  border-color: var(--hexa-primary);
}

.btn-primary:hover {
  background: var(--hexa-primary-dark);
  border-color: var(--hexa-primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--hexa-primary-dark);
  border-color: rgba(75, 102, 155, 0.4);
}

.btn-outline:hover {
  border-color: var(--hexa-primary-dark);
}

/* ===== FOOTER ===== */

.site-footer {
  border-top: 1px solid rgba(48, 71, 111, 0.1);
  background: #f5f5f7;
  padding: 24px 24px 32px;
  font-size: 12px;
  color: var(--text-muted);
}

.section-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hexa-primary-dark);
}

.footer-text {
  margin: 0;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  flex: 1;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-back {
  color: var(--hexa-primary);
  text-decoration: none;
  white-space: nowrap;
}

.footer-back:hover {
  text-decoration: underline;
}

/* ===== ADAPTIVE ===== */

/* ===== ADAPTIVE ===== */

@media (max-width: 900px) {
  .nav-inner {
    padding: 0 16px;
  }

  /* сам оверлей уже не в край экрана */
  .nav-overlay-inner {
    padding: 0 16px;
  }

  .nav-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  /* колонка с пунктами – фиксированная ширина + внутренний паддинг */
  .nav-panel-main {
    grid-template-columns: minmax(0, 1fr);
    max-width: 640px;
    margin: 0 auto;
    padding: 0 8px 16px;   /* <- слева/справа паддинг */
  }

  .nav-panel-preview {
    margin-top: 16px;
    justify-content: center;
  }

  .nav-preview-card {
    width: 100%;
    max-width: 360px;
    min-height: 200px;
  }

  .hero {
    margin-top: 64px;
    padding: 0 16px 40px;
  }

  .hero-title {
    font-size: 28px;
  }

  .section {
    padding: 0 16px 64px;
  }

  .services-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .families-layout,
  .download-grid,
  .contacts-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .download-grid {
    gap: 16px;
  }

  .site-footer {
    padding: 20px 16px 28px;
  }

  .section-inner {
    padding: 0 16px;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}


@media (max-width: 720px) {
  .nav-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  /* фикс ширины, чтобы колонка не "прыгала" между панелями */
  .nav-panel-main {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;          /* всегда на всю доступную ширину */
    max-width: 640px;     /* но не шире 640 */
    margin: 0 auto;       /* центрируем */
  padding-left: 32px;
  padding-right: 32px;
  }

  .nav-panel-preview {
    margin-top: 16px;
    justify-content: center;
  }

  .nav-preview-card {
    width: 100%;
    max-width: 360px;
    min-height: 200px;
  }
}