/* Базовый сброс */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --section-spacing: 84px;
  --color-bg: #09090b;
  --color-bg-top: #131116;
  --color-surface: #141318;
  --color-surface-strong: #1a191f;
  --color-surface-soft: #201f26;
  --color-text: #f5efe4;
  --color-text-muted: #b8ad9d;
  --color-text-soft: #8e8376;
  --color-accent: #c9a66b;
  --color-accent-strong: #e1c087;
  --color-accent-deep: #8d6b35;
  --color-on-accent: #181209;
  --color-border: rgba(201, 166, 107, 0.16);
  --color-border-strong: rgba(201, 166, 107, 0.28);
  --color-overlay: rgba(5, 5, 7, 0.74);
  --shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.28);
  --shadow-strong: 0 28px 70px rgba(0, 0, 0, 0.42);
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(201, 166, 107, 0.14), transparent 28%), radial-gradient(circle at 85% 12%, rgba(141, 107, 53, 0.18), transparent 24%),
    linear-gradient(180deg, var(--color-bg-top) 0%, var(--color-bg) 36%, #050507 100%);
  background-attachment: fixed;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

/* Общие служебные классы */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 14px;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
}

.catalog__title,
.about__section-title,
.purchase__title,
.gallery__title,
.location__title,
.faq__title {
  text-transform: uppercase;
}

/* Кнопки */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 14px;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.button--primary {
  color: var(--color-on-accent);
  background: linear-gradient(135deg, var(--color-accent-strong), var(--color-accent));
  box-shadow: 0 16px 36px rgba(141, 107, 53, 0.34);
}

.button--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(141, 107, 53, 0.44);
  background: linear-gradient(135deg, #ebcb92, #d4af73);
}

.button--secondary {
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  background-color: rgba(255, 255, 255, 0.02);
}

.button--secondary:hover {
  border-color: rgba(201, 166, 107, 0.42);
  background-color: rgba(201, 166, 107, 0.08);
}

/* Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 20px 0;
  background-color: rgba(8, 8, 10, 0.82);
  border-bottom: 1px solid rgba(201, 166, 107, 0.08);
  backdrop-filter: blur(10px);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.header__nav {
  margin: 0 auto;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__link {
  font-size: 15px;
  transition: 0.3s ease;
}

.nav__link:hover {
  color: var(--color-accent);
}

.header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  align-items: center;
  justify-content: center;
}

.header__burger-line {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 10px;
  background-color: var(--color-text);
}

/* Раскрытое состояние мобильного меню.
   Класс добавляется и удаляется через JavaScript. */
.header__nav--open {
  display: block;
  position: absolute;
  top: calc(100% + 10px);
  left: 12px;
  right: 12px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background-color: rgba(20, 19, 24, 0.96);
  box-shadow: var(--shadow-strong);
}

.header__nav--open .nav__list {
  flex-direction: column;
  align-items: flex-start;
}

/* Главный экран */
.hero {
  position: relative;
  padding: 0;
  margin-bottom: var(--section-spacing);
  background:
    linear-gradient(90deg, rgba(5, 5, 7, 0.9) 0%, rgba(5, 5, 7, 0.74) 34%, rgba(5, 5, 7, 0.48) 62%, rgba(5, 5, 7, 0.64) 100%),
    url("img/hero.png") center center / cover no-repeat;
}

.hero__container {
  display: flex;
  align-items: flex-start;
  min-height: 760px;
  padding-top: 185px;
  padding-bottom: 83px;
}

.hero__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-width: 640px;
}

.hero__title {
  margin-bottom: 24px;
  font-size: 72px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero__text {
  max-width: 560px;
  margin-bottom: 40px;
  font-size: 19px;
  line-height: 1.7;
  color: rgba(245, 239, 228, 0.82);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* Общий вертикальный ритм между секциями */
.catalog,
.about,
.purchase,
.gallery,
.location,
.faq {
  margin-bottom: var(--section-spacing);
}

/* Общие верхние строки секций */
.catalog__top,
.gallery__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

/* Секция "Резиденции" */
.catalog__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto 18px;
}

.catalog__tab {
  min-height: 52px;
  min-width: 0;
  padding: 14px 28px;
  border: 1px solid var(--color-border-strong);
  border-radius: 14px;
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 400;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.catalog__tab:hover {
  border-color: rgba(201, 166, 107, 0.42);
  background-color: rgba(201, 166, 107, 0.08);
}

.catalog__tab--active {
  color: var(--color-on-accent);
  border-color: transparent;
  background: linear-gradient(135deg, var(--color-accent-strong), var(--color-accent));
  box-shadow: 0 16px 36px rgba(141, 107, 53, 0.34);
}

.catalog__tab--active:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(141, 107, 53, 0.44);
  background: linear-gradient(135deg, #ebcb92, #d4af73);
}

.catalog__filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 320px));
  justify-content: center;
  gap: 18px 22px;
  max-width: 1120px;
  padding: 30px 28px;
  margin: 0 auto 28px;
  border: 1px solid rgba(201, 166, 107, 0.1);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), linear-gradient(160deg, rgba(20, 19, 24, 0.95), rgba(14, 13, 17, 0.95));
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.22);
}

.catalog__filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: none;
}

.catalog__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

.catalog__select {
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--color-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

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

.catalog-card {
  overflow: hidden;
  border-radius: 22px;
  background-color: rgba(20, 19, 24, 0.9);
}

.catalog-card__image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.catalog-card__title {
  padding: 20px 20px 8px;
  font-size: 22px;
  font-weight: 700;
}

.catalog-card__text {
  display: grid;
  gap: 6px;
  padding: 0 20px 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.catalog-card__text span {
  display: block;
}

/* Секция "О проекте" */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, 1fr);
  grid-template-areas:
    "content stat1 stat2"
    "content stat3 stat4";
  gap: 28px;
}

.about__section-title {
  margin-bottom: 24px;
}

.about__content,
.about__stat {
  padding: 40px;
  border-radius: 24px;
  background-color: rgba(20, 19, 24, 0.9);
}

.about__content {
  grid-area: content;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(10, 10, 12, 0.74), rgba(10, 10, 12, 0.88)),
    linear-gradient(120deg, rgba(20, 19, 24, 0.82), rgba(20, 19, 24, 0.46)),
    url("img/about-bg.png") center center / cover no-repeat;
}

.about__content .button {
  margin-top: 36px;
  align-self: flex-start;
}

.about__title {
  margin-bottom: 24px;
}

.about__text {
  max-width: 520px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--color-text-muted);
}

.about__stat:nth-child(2) {
  grid-area: stat1;
}

.about__stat:nth-child(3) {
  grid-area: stat2;
}

.about__stat:nth-child(4) {
  grid-area: stat3;
}

.about__stat:nth-child(5) {
  grid-area: stat4;
}

.about__stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 220px;
}

.about__stat-number {
  font-size: 92px;
  line-height: 0.95;
  font-weight: 700;
  color: var(--color-accent);
}

/* Подпись в статистике прижата к низу карточки,
   чтобы все карточки выглядели ровнее по композиции. */
.about__stat-text {
  margin-top: auto;
  max-width: 210px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* Секция "Преимущества" */
.purchase__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.purchase__title {
  margin-bottom: 24px;
}

.purchase-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 28px;
  border-radius: 22px;
  background-color: rgba(20, 19, 24, 0.9);
}

.purchase-card__title {
  min-height: 3.4em;
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.12;
}

.purchase-card__text {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.purchase-card__link {
  color: var(--color-accent);
  font-weight: 700;
}

/* Секция "Галерея проекта" */
.gallery__slider {
  width: min(100%, 860px);
  margin: 0 auto;
}

.gallery__viewport {
  overflow: hidden;
}

.gallery__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gallery__arrow {
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  font-size: 18px;
  transition: 0.3s ease;
}

.gallery__arrow:hover {
  border-color: rgba(201, 166, 107, 0.4);
  background-color: rgba(201, 166, 107, 0.1);
}

/* Слайды двигаются по горизонтали через transform,
   который обновляется из JavaScript. */
.gallery__track {
  display: flex;
  transition: transform 0.45s ease;
  will-change: transform;
}

.gallery__slide {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
}

.gallery__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Секция "Локация" */
.location__title {
  margin-bottom: 28px;
}

.location__map {
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 21 / 8;
  border-radius: 24px;
}

.location__map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Секция FAQ */
.faq__list {
  display: grid;
  gap: 16px;
}

.faq__title {
  margin-bottom: 24px;
}

.faq__item--active {
  background-color: var(--color-surface-strong);
}

.faq__item {
  overflow: hidden;
  border-radius: 20px;
  background-color: rgba(20, 19, 24, 0.9);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 24px 28px;
  text-align: left;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.faq__icon {
  font-size: 28px;
  line-height: 1;
  color: var(--color-accent);
}

.faq__answer {
  padding: 0 28px 24px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* Подвал сайта */
.footer {
  padding: 0 0 var(--section-spacing);
}

.footer__container {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 0.9fr;
  gap: 32px;
  padding: 0;
  background: none;
}

.footer__logo {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 30px;
  font-weight: 700;
}

.footer__text {
  max-width: 280px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.footer__subtitle {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 700;
}

.footer__list {
  display: grid;
  gap: 12px;
}

.footer__item,
.footer__link {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* Модальное окно */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background-color: var(--color-overlay);
}

.modal__content {
  position: relative;
  z-index: 1;
  width: calc(100% - 32px);
  max-width: 520px;
  margin: 80px auto 0;
  padding: 36px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), linear-gradient(160deg, rgba(26, 25, 31, 0.98), rgba(14, 13, 17, 0.98));
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 32px;
  color: var(--color-text);
}

.modal__title {
  margin-bottom: 12px;
  font-size: 32px;
  font-weight: 700;
}

.modal__text {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.modal__form {
  display: grid;
  gap: 14px;
}

.modal__input {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background-color: var(--color-surface-soft);
  color: var(--color-text);
}

/* Общие карточные поверхности и поля форм */
.catalog__filters,
.catalog-card,
.about__content,
.about__stat,
.purchase-card,
.location__item,
.faq__item,
.modal__content {
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.gallery__slide,
.location__map {
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-strong);
}

.catalog-card__image,
.gallery__image,
.location__map-image {
  filter: saturate(0.88) brightness(0.88);
}

.modal__input::placeholder {
  color: var(--color-text-soft);
}

/* Адаптив: 1444 px */
@media (max-width: 1444px) {
  .hero__title {
    font-size: 60px;
  }

  .hero__container {
    min-height: 680px;
    padding-top: 144px;
    padding-bottom: 96px;
  }
}

/* Адаптив: 1024 px */
@media (max-width: 1024px) {
  .section-title {
    font-size: 30px;
  }

  .hero__container {
    min-height: 620px;
    padding-top: 150px;
    padding-bottom: 58px;
  }

  .about__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "content content"
      "stat1 stat2"
      "stat3 stat4";
  }

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

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

/* Адаптив: 768 px */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }

  .header__button,
  .header__nav {
    display: none;
  }

  .header__burger {
    display: flex;
    margin-left: auto;
  }

  .hero {
    background-position: center center;
  }

  .hero__title {
    font-size: 46px;
  }

  .hero__text {
    font-size: 16px;
  }

  .hero__container {
    min-height: 540px;
    padding-top: 138px;
    padding-bottom: 50px;
  }

  .catalog__cards,
  .purchase__grid,
  .footer__container {
    grid-template-columns: 1fr;
  }

  .catalog__tabs {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
  }

  .catalog__tab {
    min-width: 0;
    min-height: 52px;
    padding: 14px 24px;
  }

  .catalog__filters {
    grid-template-columns: 1fr;
    padding: 22px 18px;
    border-radius: 24px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 20px;
    grid-template-areas:
      "content"
      "stat1"
      "stat2"
      "stat3"
      "stat4";
  }

  .about__section-title {
    margin-bottom: 24px;
  }

  .about__content,
  .about__stat {
    padding: 30px 24px;
  }

  .about__text {
    font-size: 16px;
    line-height: 1.7;
  }

  .about__stat {
    min-height: 184px;
  }

  .about__stat-number {
    font-size: 76px;
  }

  .purchase-card__title {
    min-height: auto;
  }

  .gallery__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal__content {
    margin-top: 40px;
    padding: 28px 20px;
  }
}

/* Адаптив: 375 px */
@media (max-width: 375px) {
  .section-title {
    font-size: 26px;
  }

  .button {
    width: 100%;
    padding: 14px 20px;
  }

  .hero__title {
    font-size: 36px;
  }

  .hero__actions {
    flex-direction: column;
  }

  .catalog__tab {
    width: 100%;
  }

  .faq__question {
    padding: 20px;
    font-size: 16px;
  }

  .faq__answer {
    padding: 0 20px 20px;
  }

  .footer__container {
    padding: 24px 20px;
  }
}
