/* ЖК в Грязях — hero + планировки + форма. System fonts, zero external deps. */
:root {
  --bg: #101318;
  --accent: #c93a2e;
  --accent-hover: #a92f25;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --card-bg: #ffffff;
  --card-text: #17191c;
  --card-muted: #5b6068;
  --line: #d9dde3;
  --radius: 16px;
}

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

html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* Lenis: плавная прокрутка берёт на себя scroll-behavior */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

section { scroll-margin-top: 16px; }

/* ---------- Общая кнопка ---------- */
.btn-accent {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  text-align: center;
  padding: 14px 30px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-accent:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Блок 1. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  isolation: isolate;
  overflow-x: clip;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% bottom;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(13, 16, 21, 0.88) 0%, rgba(13, 16, 21, 0.62) 45%, rgba(13, 16, 21, 0.28) 100%),
    linear-gradient(0deg, rgba(13, 16, 21, 0.55) 0%, rgba(13, 16, 21, 0) 30%);
}

.hero-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 64px 24px 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.chip {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 20px;
  background: rgba(13, 16, 21, 0.35);
}

h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
  text-wrap: balance;
}

.lead {
  font-size: clamp(16px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 30em;
  margin-bottom: 22px;
}

.points {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}
.points li {
  position: relative;
  padding-left: 26px;
  font-size: 15.5px;
  color: var(--muted);
}
.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
}

.hero-cta { padding: 16px 38px; font-size: 17px; }

/* ---------- Блок 2. Планировки ---------- */
.plans {
  background: #ffffff;
  color: var(--card-text);
  padding: 72px 24px 80px;
}

.plans-inner {
  max-width: 1160px;
  margin: 0 auto;
}

.plans h2 {
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  max-width: 22em;
  text-wrap: balance;
}

.plans-lead {
  font-size: clamp(15.5px, 1.5vw, 18px);
  color: var(--card-muted);
  max-width: 42em;
  margin-bottom: 40px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 22px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.plan-card:hover {
  box-shadow: 0 14px 40px rgba(16, 19, 24, 0.12);
  transform: translateY(-2px);
}

.plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.plan-head h3 {
  font-size: 19px;
  font-weight: 700;
}
.plan-area {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: #fbeae8;
  border-radius: 999px;
  padding: 3px 12px;
}

.plan-fig {
  margin: 0 0 14px;
  border: 1px solid #edeff2;
  border-radius: 10px;
  background: #fff;
  height: 364px;
  padding: 10px;
}
.plan-fig img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.plan-cap {
  font-size: 14.5px;
  color: var(--card-muted);
  margin-bottom: 16px;
}

.plan-btn { margin-top: auto; width: 100%; }

/* Открытие планировки */
.plan-link { display: block; height: 100%; cursor: zoom-in; }
.plan-fig { overflow: hidden; }
.plan-link img { transition: transform 0.35s ease; }
.plan-link:hover img,
.plan-link:focus-visible img { transform: scale(1.04); }
.plan-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* ---------- Появление блоков ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Лайтбокс ---------- */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 14, 0.92);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lightbox.open { opacity: 1; }
.lightbox figure {
  margin: 0;
  max-width: min(1100px, 94vw);
  text-align: center;
  background: #fff;
  padding: 14px 14px 12px;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  transform: scale(0.94);
  transition: transform 0.25s ease;
}
.lightbox.open figure { transform: scale(1); }
.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  background: #fff;
  border-radius: 6px;
}
.lightbox figcaption {
  color: var(--card-muted);
  font-size: 14px;
  margin-top: 10px;
}
.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(13, 16, 21, 0.5);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.lb-close:hover { background: var(--accent); border-color: var(--accent); }
.lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Блок 3. Форма ---------- */
.lead-section {
  position: relative;
  background:
    linear-gradient(0deg, rgba(13, 16, 21, 0.9), rgba(13, 16, 21, 0.9)),
    url("/assets/bg2.webp") center / cover no-repeat;
  padding: 72px 24px 84px;
  overflow-x: clip;
}

.lead-inner {
  max-width: 520px;
  margin: 0 auto;
}

.lead-form {
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.lead-form h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.form-sub {
  font-size: 14px;
  color: var(--card-muted);
  margin-bottom: 18px;
}

.field {
  display: block;
  margin-bottom: 14px;
}
.field span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--card-muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--card-text);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease;
}
.field input::placeholder { color: #9aa0a8; }
.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.lead-form button {
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lead-form button:hover { background: var(--accent-hover); }
.lead-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lead-form button[disabled] { background: #b9bec5; cursor: default; }

.consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--card-muted);
  cursor: pointer;
}
.consent input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: none;
}
.consent a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.form-msg {
  margin-top: 12px;
  font-size: 14px;
  min-height: 1.4em;
  text-align: center;
}
.form-msg.ok { color: #1c7c3c; font-weight: 600; }
.form-msg.err { color: var(--accent); font-weight: 600; }

.form-done {
  text-align: center;
  padding: 28px 6px;
}
.form-done h2 { margin-bottom: 10px; }
.form-done p { color: var(--card-muted); font-size: 15px; }

/* ---------- Футер ---------- */
.foot {
  background: #0b0e12;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 24px;
}
.foot-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 26px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.6);
}
.foot-brand { font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.foot-link {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.foot-link:hover { color: #fff; }

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #101318;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13.5px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.cookie a { color: #f2b8b3; text-decoration: underline; text-underline-offset: 2px; }
.cookie button {
  flex: none;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 9px 18px;
  cursor: pointer;
}
.cookie button:hover { background: var(--accent-hover); }
.cookie button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cookie[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .plan-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .plan-fig { height: 440px; }
}

@media (max-width: 900px) {
  .hero-inner { padding-bottom: 64px; }
  .hero-bg img { object-position: 72% top; }
  .hero-overlay {
    background:
      linear-gradient(0deg, rgba(13, 16, 21, 0.92) 0%, rgba(13, 16, 21, 0.72) 55%, rgba(13, 16, 21, 0.45) 100%);
  }
}

@media (max-width: 400px) {
  .hero-inner { padding: 44px 16px; }
  .plans { padding: 52px 16px 60px; }
  .lead-section { padding: 52px 16px 60px; }
  .lead-form { padding: 24px 18px 22px; }
  h1 { font-size: 31px; }
  .foot-inner { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .lightbox { opacity: 1; }
  .lightbox figure { transform: none; }
}
