:root {
  color-scheme: light;

  --page: #fcfdfb;
  --surface: #ffffff;
  --soft: #f3f7f1;
  --mint: #eaf3e7;
  --text: #293a33;
  --muted: #69786f;
  --accent: #55795b;
  --accent-hover: #426348;
  --border: #e1e9df;

  --radius: 24px;
  --shadow: 0 18px 55px rgba(65, 92, 67, 0.07);
  --header-height: 82px;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button,
a {
  touch-action: manipulation;
}

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

button {
  cursor: pointer;
}

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

button[hidden],
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #8caf7c;
  outline-offset: 5px;
}

.container {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 12px;
  background: white;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 54px;
  padding: 16px 25px;
  border: 1px solid transparent;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-white {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.btn-white:hover {
  background: white;
  border-color: #b9cdb5;
}

/* Шапка */

.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  border-bottom: 1px solid rgba(225, 233, 223, 0.8);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition:
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.header.scrolled {
  box-shadow: 0 6px 24px rgba(65, 92, 67, 0.06);
}

/* Прозрачная шапка поверх видео на главной */

.header--over-media {
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header--over-media:not(.scrolled) .logo,
.header--over-media:not(.scrolled) .nav a,
.header--over-media:not(.scrolled) .nav-user,
.header--over-media:not(.scrolled) .nav-button,
.header--over-media:not(.scrolled) .header-phone {
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.header--over-media:not(.scrolled) .nav a:hover,
.header--over-media:not(.scrolled) .nav-button:hover {
  color: #d9ebcf;
}

.header--over-media:not(.scrolled) .logo span {
  color: #d9ebcf;
}

.header--over-media:not(.scrolled) .logo-image {
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.header--over-media:not(.scrolled) .header-phone {
  border-left-color: rgba(255, 255, 255, 0.35);
}

.header--over-media:not(.scrolled) .burger {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.header--over-media:not(.scrolled) .burger span {
  background: #fff;
}

.header--over-media.scrolled {
  border-bottom-color: rgba(225, 233, 223, 0.8);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

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

.logo {
  flex-shrink: 0;
  color: var(--text);
  font-size: 27px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.1em;
}

.logo span {
  color: #87a46f;
}

.logo-image {
  display: block;
  width: auto;
  max-width: 150px;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
}

.footer .logo-image {
  max-height: 34px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
}

.nav a {
  padding-block: 10px;
  color: var(--muted);
  transition: color 0.2s;
}

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

.nav .nav-cta {
  color: var(--accent);
  font-weight: 600;
}

.nav-user {
  max-width: 170px;
  overflow: hidden;
  padding-block: 10px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-form {
  display: flex;
}

.nav-button {
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

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

.header-phone {
  padding-left: 28px;
  border-left: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: white;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

/* Видеобаннер (без подложки-затемнения, текст белый) */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-height);
  overflow: hidden;
  background: #1e3328;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    url("img/hero-poster.jpg") center / cover no-repeat,
    linear-gradient(135deg, #2c4937, #16281e);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.hero-layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  padding-top: 72px;
  padding-bottom: 26px;
}

.hero-content {
  max-width: 820px;
  margin-block: auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #83a86d;
}

.hero h1 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
}

.hero h1 span {
  color: var(--accent);
}

.hero-description {
  max-width: 520px;
  margin: 28px 0 32px;
  color: #56685b;
  font-size: 18px;
  line-height: 1.75;
}

/* Форматированный текст из визуального редактора */
.rich-text > :first-child {
  margin-top: 0;
}

.rich-text > :last-child {
  margin-bottom: 0;
}

.rich-text p {
  margin: 0 0 16px;
}

.rich-text ul,
.rich-text ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.rich-text li {
  margin-bottom: 6px;
}

.rich-text h2,
.rich-text h3 {
  margin: 24px 0 12px;
  line-height: 1.3;
}

.rich-text a {
  color: var(--accent);
  text-decoration: underline;
}

.about-content > .rich-text {
  max-width: 520px;
  margin-top: 24px;
  color: var(--muted);
}

.hero-description.rich-text p {
  margin: 0 0 10px;
}

.apartment-description.rich-text p {
  margin: 0 0 8px;
}

.section-description.rich-text p,
.benefit-text.rich-text p,
.contacts-description.rich-text p,
.contact-note.rich-text p {
  margin: 0 0 8px;
}

.benefit-text.rich-text {
  color: var(--muted);
  font-size: 13px;
}

.detail-section .rich-text {
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 48px;
}

.hero-facts div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hero-facts strong {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.hero-facts span {
  color: var(--muted);
  font-size: 12px;
}

.hero-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
}

.scroll-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #576b5b;
  font-size: 12px;
}

.scroll-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #cbdac5;
  border-radius: 50%;
  font-size: 17px;
}

/* Управление видео и музыкой */

.media-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 480px;
}

.media-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid rgba(197, 214, 189, 0.9);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
}

.media-button:hover {
  background: white;
}

.media-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.music-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a6b39e;
}

.media-button[aria-pressed="true"] .music-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px #e3efdd;
}

.music-status {
  width: 100%;
  color: #586b5d;
  font-size: 12px;
  text-align: right;
}

.music-status:empty {
  display: none;
}

/* Общие секции */

.section {
  padding-block: 108px;
}

h2 {
  margin: 0;
  font-size: clamp(31px, 3.6vw, 50px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 44px;
}

.section-description {
  max-width: 350px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* О компании */

.about {
  background: white;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 80px;
}

.about-content > p:not(.eyebrow) {
  max-width: 520px;
  margin: 24px 0 0;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  margin-top: 28px;
  padding-bottom: 7px;
  border-bottom: 1px solid #bbceb1;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.about-visual {
  position: relative;
  padding-bottom: 28px;
}

.about-image {
  height: 490px;
  border-radius: 150px 24px 24px 24px;
  background:
    url("img/about.jpg") center / cover no-repeat,
    linear-gradient(145deg, #edf2df, #cfddc5);
}

.about-badge {
  position: absolute;
  right: 24px;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.about-badge-number {
  color: var(--accent);
  font-size: 50px;
  font-weight: 400;
  line-height: 1;
}

.about-badge div {
  display: flex;
  flex-direction: column;
}

.about-badge strong {
  font-size: 16px;
  font-weight: 600;
}

.about-badge div span {
  color: var(--muted);
  font-size: 12px;
}

/* Квартиры */

.apartments {
  background: var(--soft);
}

.apartment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.apartment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s;
}

.apartment-card:hover,
.apartment-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* Вся карточка ведёт на детальную страницу квартиры */
.apartment-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.apartment-card .apartment-image,
.apartment-card .card-contact {
  position: relative;
  z-index: 2;
}

.apartment-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background-position: center;
  background-size: cover;
}

.apartment-image-1 {
  background-image:
    url("img/apartment-1.jpg"),
    linear-gradient(135deg, #e9edde, #c9d8bb);
}

.apartment-image-2 {
  background-image:
    url("img/apartment-2.jpg"),
    linear-gradient(135deg, #f3ecdf, #deccb0);
}

.apartment-image-3 {
  background-image:
    url("img/apartment-3.jpg"),
    linear-gradient(135deg, #e3efe8, #bbd5c4);
}

.apartment-image-4 {
  background-image:
    url("img/apartment-4.jpg"),
    linear-gradient(135deg, #edf0df, #d3d9ba);
}

.image-label {
  position: absolute;
  top: 18px;
  left: 18px;
  max-width: calc(100% - 90px);
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
}

.apartment-number {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  font-size: 11px;
}

.apartment-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 28px;
}

.apartment-category {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.apartment-body h3 {
  margin: 0;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.apartment-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.apartment-meta span {
  padding-inline: 5px;
  color: #a6b29f;
}

.apartment-address {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}

.apartment-address svg,
.detail-address svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.apartment-description {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 20px 0 24px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 7px 11px;
  border-radius: 100px;
  background: var(--soft);
  color: #61715b;
  font-size: 11px;
  line-height: 1.3;
}

.apartment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: auto;
  padding-top: 21px;
  border-top: 1px solid var(--border);
}

.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.price strong {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.price span {
  color: var(--muted);
  font-size: 12px;
}

.card-contact {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* Преимущества */

.benefits {
  background: white;
}

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

.benefit {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fdfefb;
}

.benefit-number {
  display: inline-grid;
  width: 36px;
  height: 36px;
  margin-bottom: 30px;
  place-items: center;
  border-radius: 50%;
  background: #edf4e8;
  color: var(--accent);
  font-size: 12px;
}

.benefit h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
}

.benefit p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Контакты */

.contacts {
  padding-top: 0;
  background: white;
}

.contacts-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 60px;
  padding: 64px;
  border: 1px solid #e0ead9;
  border-radius: 30px;
  background: #edf5e7;
}

.contacts-description {
  max-width: 410px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.contacts-details {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
}

.contact-phone {
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.04em;
}

.contact-email {
  margin-top: 12px;
  color: var(--accent);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.contact-note {
  max-width: 350px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* Футер */

.footer {
  border-top: 1px solid var(--border);
  background: #f9fbf6;
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-block: 46px;
}

.footer-main p {
  max-width: 280px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  color: var(--muted);
  font-size: 13px;
}

.footer-nav a:hover {
  color: var(--accent);
}

.back-top {
  display: inline-flex;
  gap: 14px;
  font-size: 13px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

/* Планшеты */

@media (max-width: 1050px) {
  .about-grid {
    gap: 40px;
  }

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

  .contacts-panel {
    gap: 35px;
    padding: 40px;
  }

  .contact-actions {
    flex-direction: column;
    width: 100%;
  }

  .contact-actions .btn {
    width: 100%;
  }
}

/* Мобильная версия */

@media (max-width: 760px) {
  :root {
    --header-height: 72px;
  }

  .container {
    width: calc(100% - 32px);
  }

  .header-inner {
    gap: 16px;
  }

  .logo {
    font-size: 24px;
  }

  .header-phone {
    margin-left: auto;
    padding-left: 0;
    border-left: 0;
    font-size: 12px;
  }

  .burger {
    display: inline-flex;
    flex-shrink: 0;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 24px 20px;
    border-bottom: 1px solid var(--border);
    background: white;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }

  /* Раскрытое мобильное меню — тёмный текст на белой панели */

  .header--over-media:not(.scrolled) .nav.open a,
  .header--over-media:not(.scrolled) .nav.open .nav-user,
  .header--over-media:not(.scrolled) .nav.open .nav-button {
    color: var(--muted);
    text-shadow: none;
  }

  .header--over-media:not(.scrolled) .nav.open a:hover,
  .header--over-media:not(.scrolled) .nav.open .nav-button:hover {
    color: var(--accent);
  }

  .header--over-media:not(.scrolled) .nav.open .nav-cta {
    color: var(--accent);
  }

  .header--over-media:not(.scrolled) .nav.open .nav-cta:hover {
    color: var(--accent-hover);
  }

  .hero-layout {
    padding-top: 58px;
    padding-bottom: 20px;
  }

  .hero h1 {
    font-size: 10px;
  }

  .eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .hero-description {
    max-width: 470px;
    margin-block: 24px 28px;
    font-size: 16px;
  }

  .hero-facts {
    gap: 26px;
    margin-top: 36px;
  }

  .hero-facts strong {
    font-size: 24px;
  }

  .hero-facts span {
    font-size: 10px;
  }

  .hero-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
    margin-top: 40px;
  }

  .media-controls {
    justify-content: flex-start;
  }

  .music-status {
    text-align: left;
  }

  .section {
    padding-block: 68px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
  }

  .section-description {
    max-width: 500px;
  }

  .about-grid,
  .apartment-grid,
  .contacts-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-grid {
    gap: 36px;
  }

  .about-image {
    height: 360px;
    border-top-left-radius: 100px;
  }

  .apartment-body {
    padding: 23px;
  }

  .apartment-body h3 {
    font-size: 21px;
  }

  .contacts {
    padding-top: 0;
  }

  .contacts-panel {
    gap: 30px;
    padding: 30px 24px;
    border-radius: 24px;
  }

  .contact-actions {
    flex-direction: row;
  }

  .contact-actions .btn {
    width: auto;
  }

  .footer-main {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 28px;
    padding-block: 36px;
  }
}

@media (max-width: 440px) {
  .header-phone {
    font-size: 11px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-facts {
    justify-content: space-between;
    gap: 12px;
  }

  .hero-facts span {
    max-width: 90px;
  }

  .benefits-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .benefit-number {
    margin-bottom: 20px;
  }

  .contact-actions {
    flex-direction: column;
    width: 100%;
  }

  .contact-actions .btn {
    width: 100%;
  }

  .footer-nav {
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Ссылки на названия квартир */

.apartment-body h3 a {
  transition: color 0.2s;
}

.apartment-body h3 a:hover {
  color: var(--accent);
}

/* Детальная страница квартиры */

.detail-main {
  min-height: 70vh;
  padding-top: calc(var(--header-height) + 36px);
  padding-bottom: 90px;
  background: var(--page);
}

.detail-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
  color: var(--muted);
  font-size: 12px;
}

.detail-breadcrumbs a:hover {
  color: var(--accent);
}

.detail-heading {
  max-width: 950px;
  margin-bottom: 36px;
}

.detail-heading h1,
.detail-empty h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 4.7vw, 62px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
}

.detail-subtitle {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.detail-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 36px;
}

.detail-content {
  min-width: 0;
}

.detail-photo {
  width: 100%;
  aspect-ratio: 16 / 11;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--soft);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Галерея квартиры */

.gallery {
  min-width: 0;
}

.gallery-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 11;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--soft);
}

.gallery-viewport:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.35s ease;
}

.gallery-slide {
  flex: 0 0 100%;
  height: 100%;
}

.gallery-slide img,
.gallery-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-placeholder {
  background: linear-gradient(135deg, #edf2e5, #d4e3ca);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.gallery-nav:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-50%) scale(1.06);
}

.gallery-prev {
  left: 14px;
}

.gallery-next {
  right: 14px;
}

.gallery-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 30, 20, 0.65);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumb {
  flex: 0 0 82px;
  height: 60px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--soft);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb:hover,
.gallery-thumb.is-active {
  opacity: 1;
}

.gallery-thumb.is-active {
  border-color: var(--accent);
}

/* Слайдер фотографий в карточке квартиры */

.card-gallery-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.card-gallery-dots {
  position: absolute;
  bottom: 16px;
  left: 18px;
  z-index: 3;
  display: flex;
  gap: 6px;
}

.card-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.2s ease, width 0.2s ease;
}

.card-gallery-dot.is-active {
  width: 18px;
  border-radius: 99px;
  background: #fff;
}

@media (max-width: 600px) {
  .gallery-nav {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .gallery-prev {
    left: 8px;
  }

  .gallery-next {
    right: 8px;
  }

  .gallery-thumb {
    flex-basis: 66px;
    height: 50px;
  }
}

.detail-section {
  margin-top: 42px;
}

.detail-section h2 {
  margin-bottom: 20px;
  font-size: clamp(25px, 2.5vw, 32px);
}

.detail-section p {
  margin: 0 0 16px;
  color: var(--muted);
}

.detail-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.detail-specs div {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.detail-specs dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-specs dd {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
}

.detail-amenities,
.detail-rules {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-amenities {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-amenities li,
.detail-rules li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 14px;
}

.detail-amenities li::before,
.detail-rules li::before {
  content: "";
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #90ad7e;
}

.detail-contact {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.detail-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-price strong {
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.detail-price span {
  color: var(--muted);
  font-size: 13px;
}

.detail-contact-description {
  margin: 20px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.detail-contact .btn {
  width: 100%;
  margin-bottom: 10px;
}

.detail-small-note,
.detail-section .detail-small-note {
  color: var(--muted);
  font-size: 12px;
}

.detail-contact-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--border);
}

.detail-phone {
  color: var(--accent);
  font-size: 17px;
  font-weight: 500;
}

.detail-empty {
  padding: 50px 0 80px;
}

.detail-empty p:not(.eyebrow) {
  max-width: 550px;
  margin: 24px 0;
  color: var(--muted);
}

.detail-notice {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--soft);
  color: var(--text);
}

@media (max-width: 950px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-contact {
    position: static;
    max-width: 550px;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .detail-main {
    padding-top: calc(var(--header-height) + 24px);
    padding-bottom: 60px;
  }

  .detail-breadcrumbs {
    margin-bottom: 26px;
    font-size: 11px;
  }

  .detail-heading {
    margin-bottom: 28px;
  }

  .detail-subtitle {
    font-size: 13px;
  }

  .detail-section {
    margin-top: 32px;
  }

  .detail-contact {
    padding: 24px;
  }

  .detail-amenities {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 380px) {
  .detail-specs {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Авторизация */

.auth-main {
  min-height: 70vh;
  padding-top: calc(var(--header-height) + 52px);
  padding-bottom: 90px;
  background: var(--page);
}

.auth-wrap {
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 460px);
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card-wide {
  width: min(100%, 540px);
}

.auth-head {
  margin-bottom: 26px;
}

.auth-head h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.auth-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.form-field input:not([type="checkbox"]) {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--page);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:not([type="checkbox"])::placeholder {
  color: #9aa79f;
}

.form-field input:not([type="checkbox"]):focus {
  border-color: #9dba8f;
  outline: none;
  box-shadow: 0 0 0 4px rgba(140, 175, 124, 0.16);
}

.form-field input[aria-invalid="true"] {
  border-color: #d17a72;
}

.form-error {
  margin: 0;
  color: #b4433a;
  font-size: 12px;
  line-height: 1.4;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.auth-form .btn {
  width: 100%;
  margin-top: 4px;
}

.auth-links {
  margin-top: 18px;
  font-size: 13px;
}

.auth-links a {
  color: var(--accent);
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-footer {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.alert {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.alert-success {
  border: 1px solid #c6dfc0;
  background: #eef7ea;
  color: #3f6138;
}

.alert-error {
  border: 1px solid #e7c6c2;
  background: #fdf4f3;
  color: #8f4a43;
}

@media (max-width: 760px) {
  .nav-user {
    max-width: none;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-form {
    display: block;
  }

  .nav-button {
    width: 100%;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }

  .auth-main {
    padding-top: calc(var(--header-height) + 28px);
    padding-bottom: 60px;
  }
}

@media (max-width: 520px) {
  .auth-card {
    padding: 28px 22px;
    border-radius: 20px;
  }

  .auth-head h1 {
    font-size: 30px;
  }
}

/* Страница ошибки */

.error-page {
  padding-block: 140px 140px;
}

.error-wrap {
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
}

.error-code {
  margin: 28px 0 10px;
  font-size: clamp(96px, 18vw, 158px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, #9cc488, #5f7f56);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-text {
  max-width: 460px;
  margin: 0 auto 38px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.error-page .hero-actions {
  justify-content: center;
}

@media (max-width: 760px) {
  .error-page {
    padding-block: 96px 96px;
  }
}

/* Белый текст на видеобаннере */

.hero .eyebrow,
.hero h1,
.hero .hero-description,
.hero .hero-facts strong,
.hero .hero-facts span,
.hero .scroll-link,
.hero .music-status {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.38);
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.88);
}

.hero h1 span {
  color: #d9ebcf;
}

.hero .hero-description {
  color: rgba(255, 255, 255, 0.9);
}

.hero .hero-facts span {
  color: rgba(255, 255, 255, 0.78);
}

.hero .scroll-link {
  color: rgba(255, 255, 255, 0.9);
}

.hero .scroll-icon {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.hero .music-status {
  color: rgba(255, 255, 255, 0.8);
}

/* Страница «О г. Мирный» */

.city-hero {
  padding-top: calc(var(--header-height) + 54px);
  padding-bottom: 64px;
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(129, 168, 109, 0.22), transparent 60%),
    linear-gradient(135deg, #eef5e7 0%, #f8fbf4 55%, #e6f0dd 100%);
}

.city-hero .detail-breadcrumbs {
  margin-bottom: 30px;
}

.city-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(40px, 5.6vw, 76px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.05em;
  overflow-wrap: break-word;
}

.city-lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: #52645a;
  font-size: 18px;
  line-height: 1.75;
}

.city-body {
  padding-block: 68px 110px;
  background: var(--page);
}

.city-text {
  max-width: 820px;
}

.city-text p {
  margin: 0 0 20px;
  color: #4c5c52;
  font-size: 16px;
  line-height: 1.85;
}

.city-text p:first-child {
  color: var(--text);
  font-size: 19px;
  line-height: 1.75;
}

.city-gallery-section {
  margin-top: 72px;
}

.city-gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.city-gallery-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.city-gallery-head p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.city-gallery .gallery-viewport {
  aspect-ratio: 16 / 8;
}

.city-actions {
  margin-top: 56px;
}

@media (max-width: 760px) {
  .city-hero {
    padding-top: calc(var(--header-height) + 34px);
    padding-bottom: 42px;
  }

  .city-body {
    padding-block: 48px 80px;
  }

  .city-gallery-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .city-gallery .gallery-viewport {
    aspect-ratio: 4 / 3;
  }
}


/* Кнопка «Наверх» в футере: при прокрутке становится плавающей */

.back-top-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.back-top {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.back-top.is-floating {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 90;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(31, 42, 36, 0.22);
  animation: back-top-appear 0.22s ease;
}

.back-top.is-floating:hover {
  background: var(--accent-hover);
  color: #fff;
}

.back-top.is-floating:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@keyframes back-top-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-top.is-floating {
    animation: none;
  }
}
