/* ТОПДОМ — страница «Посёлки»: карта → приближение → посёлок.
   Палитра компании: белый / светло-серый / тёмно-серый. */
.vpage { background: #fff; color: var(--ink); --side-w: 430px; }
.vpage .header { right: 0; z-index: 120; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.vpage .nav a { padding: 9px 11px; }
.vpage .footer { margin-right: var(--side-w); }

/* ---------- карта ---------- */
.map-area { position: relative; height: 100vh; min-height: 640px; overflow: hidden; margin-right: var(--side-w); container-type: size; background: #eef0f2; }
.mapbox { position: absolute; width: max(100cqw, calc(100cqh * 1.4045)); height: max(100cqh, calc(100cqw / 1.4045)); left: calc((100cqw - max(100cqw, 100cqh * 1.4045)) * .35); top: calc((100cqh - max(100cqh, 100cqw / 1.4045)) * .5); z-index: 1; }
.big-map { position: absolute; inset: 0; background: url("../assets/opt/map-main.webp") center / 100% 100%; }
.mapbox.pins { z-index: 6; background: none; }
.village-map { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 2; opacity: 0; filter: brightness(.78) contrast(1.05); pointer-events: none; }
.shade { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

.opened .big-map, .opened .mapbox.pins { animation: oldMapFly 1.6s cubic-bezier(.12,.82,.18,1) forwards; }
.opened .village-map { animation: newMapArrive 1.6s cubic-bezier(.12,.82,.18,1) forwards; pointer-events: auto; }
.returning .big-map, .returning .mapbox.pins { animation: backOldMap 1.6s cubic-bezier(.12,.82,.18,1) forwards; }
.returning .village-map { animation: backVillageMap 1.6s cubic-bezier(.12,.82,.18,1) forwards; }
.opened .mapbox.pins { animation-name: pinsOut; }
.returning .mapbox.pins { animation-name: pinsIn; }
.opened .big-map { transform-origin: var(--ox, 50%) var(--oy, 50%); }
@keyframes oldMapFly {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  45% { opacity: 1; transform: scale(2.25); filter: blur(10px); }
  65%, 100% { opacity: 0; transform: scale(2.6); filter: blur(18px); }
}
@keyframes backOldMap {
  0%, 35% { opacity: 0; transform: scale(2.6); filter: blur(18px); }
  55% { opacity: 1; transform: scale(2.25); filter: blur(10px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}
@keyframes newMapArrive {
  0% { opacity: 0; transform: scale(1.65); filter: blur(20px) brightness(.16); }
  55% { opacity: 0; transform: scale(1.42); filter: blur(16px) brightness(.2); }
  72% { opacity: 1; transform: scale(1.25); filter: blur(8px) brightness(.45); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) brightness(.78) contrast(1.05); }
}
@keyframes backVillageMap {
  0% { opacity: 1; transform: scale(1); filter: blur(0) brightness(.78); }
  42% { opacity: 1; transform: scale(1.42); filter: blur(10px) brightness(.2); }
  100% { opacity: 0; transform: scale(1.65); filter: blur(20px) brightness(.16); }
}
@keyframes pinsOut { 0% { opacity: 1; } 30%, 100% { opacity: 0; } }
@keyframes pinsIn { 0%, 70% { opacity: 0; } 100% { opacity: 1; } }
.opened .mapbox.pins, .opened .point { pointer-events: none; }
.opened .mapbox.pins { opacity: 0; }

/* ---------- метки-точки ---------- */
.point { position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; cursor: pointer; z-index: 6; display: block; }
.point i { position: absolute; left: 27px; top: 27px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); background: rgba(17,17,17,.1); opacity: 0; transition: opacity .25s, box-shadow .25s; }
.point:hover i, .point.is-hover i { opacity: 1; box-shadow: 0 0 0 6px rgba(17,17,17,.12); }
.point svg { display: none; position: absolute; inset: -32px; width: calc(100% + 64px); height: calc(100% + 64px); animation: spin 7s linear infinite reverse; pointer-events: none; overflow: visible; }
.point:hover svg, .point.is-hover svg { display: block; }
.point text { fill: var(--ink); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; font-family: var(--f-sans); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- маркеры внутри посёлка ---------- */
.mk { position: absolute; z-index: 8; width: 90px; height: 90px; margin: -45px 0 0 -45px; cursor: pointer; opacity: 0; display: none; }
.opened .mk { display: block; animation: markerFadeIn .55s ease forwards; animation-delay: calc(1s + var(--i, 0) * 80ms); }
.returning .mk { display: none; }
@keyframes markerFadeIn { from { opacity: 0; transform: scale(.78); } to { opacity: 1; transform: scale(1); } }
.mk i { position: absolute; left: 27px; top: 27px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; background: rgba(255,255,255,.2); animation: pulse 2.4s ease-out infinite; transition: box-shadow .25s, background .25s; }
.mk i::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.mk.infra i { background: #1f1f1f; animation: none; box-shadow: 0 0 0 4px rgba(255,255,255,.28); }
.mk:hover i, .mk.is-active i { box-shadow: 0 0 34px rgba(255,255,255,.9); animation: none; }
.mk b { position: absolute; left: 50%; top: 100%; margin-top: -14px; transform: translateX(-50%) translateY(6px); white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 12.5px; font-weight: 600; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.mk:hover b, .mk.is-active b { opacity: 1; transform: translateX(-50%); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 70%, 100% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }

/* ---------- боковая панель ---------- */
.side { position: fixed; right: 0; top: 0; z-index: 110; width: var(--side-w); height: 100vh; padding: 108px 36px 36px; background: #fff; overflow-y: auto; scrollbar-width: thin; }
.side__view[hidden] { display: none; }
.side__view { animation: sideIn .5s var(--ease); }
@keyframes sideIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.kicker { color: var(--ink-3); font-weight: 500; font-size: 14px; }
.side h1 { margin: 10px 0 0; font-size: 40px; line-height: 1.06; font-weight: 300; letter-spacing: -.04em; }
.info { margin: 22px 0 28px; color: var(--ink-2); line-height: 1.55; min-height: 80px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { min-height: 100px; padding: 18px 20px; border-radius: var(--r-md); background: var(--paper); border: 1px solid transparent; display: grid; grid-template-columns: 14px 1fr 20px; gap: 14px; color: var(--ink); align-items: start; transition: border-color .25s, background .25s; }
.card:hover, .card.is-hover { border-color: var(--ink); background: #fff; }
.card .dot { width: 9px; height: 9px; margin-top: 8px; border-radius: 50%; background: var(--ink); }
.card h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.card p, .card b { color: var(--ink-3); font-size: 14px; display: block; margin: 0; font-weight: 400; }
.card b { color: var(--ink-2); font-weight: 500; margin-top: 2px; }
.card strong { font-size: 26px; line-height: 1; font-weight: 300; }

.back { width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; margin: 0 0 26px; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; font-weight: 500; font-size: 14px; transition: border-color .25s, background .25s; }
.back:hover { border-color: var(--ink); }
.side h3.vname { font-size: 36px; line-height: 1.05; font-weight: 300; margin: 8px 0 0; letter-spacing: -.04em; }
.side .loc-line { margin-top: 16px; color: var(--ink-2); line-height: 1.6; font-size: 15px; }
.side .desc { margin-top: 16px; color: var(--ink-2); line-height: 1.6; font-size: 15px; }
.facts { display: grid; gap: 0; margin: 24px 0; }
.facts span { border-top: 1px solid var(--line); padding: 13px 0; font-weight: 500; font-size: 15px; }
.facts span:last-child { border-bottom: 1px solid var(--line); }
.main-cta { display: inline-block; margin-top: 4px; padding: 15px 24px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 500; transition: background .25s; }
.main-cta:hover { background: #2b2b2b; }
.side-house-image { height: 220px; margin-bottom: 18px; border-radius: var(--r-md); background-size: cover; background-position: center; }
.side-house-card .vname { font-size: 30px !important; }
.compact-facts { grid-template-columns: 1fr 1fr; gap: 0 16px; }
.modal-link { display: flex; align-items: center; justify-content: center; margin-top: 10px; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); font-weight: 500; transition: border-color .25s; }
.modal-link:hover { border-color: var(--ink); }

/* ---------- детали посёлка ---------- */
.village-details { position: relative; z-index: 5; margin-right: var(--side-w); background: #fff; }
.village-details[hidden] { display: none; }
.vs { padding: 80px var(--gutter); border-top: 1px solid var(--line); }
.vs:nth-child(even) { background: var(--paper); }
.vs h2 { margin: 0 0 28px; font-size: clamp(30px, 3.6vw, 56px); line-height: 1.04; font-weight: 300; letter-spacing: -.04em; }
.vs p { color: var(--ink-2); line-height: 1.6; }
.vs .eyebrow { margin-bottom: 14px; }
.story { display: grid; grid-template-columns: minmax(0, .92fr) minmax(300px, 1.08fr); gap: 12px; padding-top: 80px; border-top: 0; background: #fff !important; }
.story__copy { display: flex; min-height: 520px; flex-direction: column; justify-content: flex-end; border-radius: var(--r-lg); background: var(--paper); padding: clamp(24px, 3.4vw, 48px); }
.story__copy h2 { font-size: clamp(38px, 5vw, 84px); line-height: 1; margin: 0 0 20px; }
.story__copy p { font-size: clamp(15px, 1.2vw, 18px); max-width: 640px; }
.source-link { width: fit-content; margin-top: 22px; border-bottom: 1px solid var(--ink); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding-bottom: 3px; }
.story__photo { position: relative; min-height: 520px; overflow: hidden; border-radius: var(--r-lg); background-size: cover; background-position: center; }
.vstats { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 20px; border-top: 1px solid var(--ink); }
.vstats div { padding: 24px 20px 8px 0; }
.vstats div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.vstats b { display: block; font-size: clamp(28px, 2.8vw, 46px); white-space: nowrap; font-weight: 200; letter-spacing: -.04em; line-height: 1; }
.vstats b small { font-size: .4em; font-weight: 500; margin-left: 4px; color: var(--ink-3); letter-spacing: 0; }
.vstats span { color: var(--ink-3); font-size: 14px; display: block; margin-top: 10px; line-height: 1.35; }
.houses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hc { border-radius: var(--r-lg); overflow: hidden; background: #fff; color: var(--ink); display: flex; flex-direction: column; transition: box-shadow .3s, transform .4s var(--ease); }
.hc:hover { box-shadow: 0 16px 40px rgba(0,0,0,.09); transform: translateY(-3px); }
.hc__img { aspect-ratio: 4 / 3; overflow: hidden; }
.hc__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.hc:hover .hc__img img { transform: scale(1.05); }
.hc__b { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.hc__b small { color: var(--ink-3); font-weight: 500; font-size: 14px; }
.hc__b strong { font-size: 28px; font-weight: 300; margin-top: 4px; letter-spacing: -.03em; }
.hc__b span { margin-top: 12px; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.route { display: grid; grid-template-columns: 1fr 1.2fr; gap: 54px; align-items: center; }
.route__vis { position: relative; height: 340px; border-radius: var(--r-lg); background: var(--paper); overflow: hidden; }
.route__line { position: absolute; left: 10%; top: 55%; width: 75%; height: 2px; background: var(--ink); transform: rotate(-8deg); transform-origin: left center; }
.route__lab { position: absolute; padding: 11px 16px; border-radius: 999px; background: #fff; font-size: 14px; font-weight: 500; }
.r1 { left: 6%; top: 62%; } .r2 { left: 36%; top: 30%; background: var(--ink); color: #fff; } .r3 { right: 6%; top: 18%; }
.infra { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.infra div { border-radius: var(--r-md); background: #fff; padding: 24px; min-height: 220px; display: flex; flex-direction: column; transition: box-shadow .3s; }
.infra div:hover { box-shadow: 0 14px 36px rgba(0,0,0,.08); }
.infra em { font-style: normal; font-weight: 200; font-size: 56px; line-height: 1; letter-spacing: -.04em; margin-bottom: auto; padding-bottom: 20px; }
.infra p { font-size: 15px; color: var(--ink); }
.gal { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 12px; }
.gal figure { margin: 0; position: relative; border-radius: var(--r-md); overflow: hidden; height: 340px; }
.gal figure img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.gal figure:hover img { transform: scale(1.06); }
.gal figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 12.5px; font-weight: 600; }
.vcta { display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap; padding-bottom: 100px; }
.vcta h2 { margin-bottom: 14px; }
.vcta__act { display: flex; gap: 10px; flex-wrap: wrap; }
.vcta__act a, .vcta__act button { padding: 16px 26px; border-radius: 999px; font-weight: 500; background: var(--ink); color: #fff; transition: background .25s; }
.vcta__act a:hover, .vcta__act button:hover { background: #2b2b2b; }
.vcta__act a.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.vcta__act a.ghost:hover { background: var(--ink); color: #fff; }

@media (max-width: 1180px) {
  .vpage { --side-w: 360px; }
  .side { padding: 100px 26px 30px; }
  .infra { grid-template-columns: repeat(3, 1fr); }
  .vstats { grid-template-columns: repeat(3, 1fr); }
  .vstats div:nth-child(4) { padding-left: 0; border-left: 0; }
  .gal { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .vpage { --side-w: 0px; }
  .vpage .header { right: 0; }
  /* на телефоне карта целиком (видны все метки), при выборе посёлка область вырастает под фото */
  .map-area { height: calc(100vw / 1.4045 + 28px); min-height: 0; margin-right: 0; margin-top: var(--hdr); transition: height .7s var(--ease); background: #eef0f2; }
  .map-area.opened { height: 100vw; }
  .mapbox { width: 100cqw; height: calc(100cqw / 1.4045); left: 0; top: calc((100cqh - 100cqw / 1.4045) / 2); }
  .opened .village-map, .returning .village-map { inset: 0; }
  .side { position: relative; width: 100%; height: auto; padding: 36px var(--gutter) 40px; overflow: visible; }
  .side h1 { font-size: 34px; }
  .info { min-height: 0; margin: 14px 0 18px; }
  .side h3.vname { font-size: 32px; }
  .village-details, .vpage .footer { margin-right: 0; }
  .vs { padding: 56px var(--gutter); }
  .story, .route { grid-template-columns: 1fr; }
  .story__copy { min-height: 0; }
  .story__photo { min-height: 0; aspect-ratio: 4 / 3; }
  .houses { grid-template-columns: 1fr; }
  .infra { grid-template-columns: 1fr 1fr; }
  .vstats { grid-template-columns: 1fr 1fr; }
  .vstats div:nth-child(n) { padding-left: 0; border-left: 0; }
  .vstats div:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--line); }
  .route__vis { height: 260px; }
}
@media (max-width: 560px) {
  .infra { grid-template-columns: 1fr; }
  .infra div { min-height: 0; }
  .mk b { display: none; }
}
@media (max-width: 900px) {
  .route__vis { height: auto; padding: 16px; display: grid; gap: 8px; }
  .route__lab, .r1, .r2, .r3 { position: static; width: fit-content; }
  .route__line { display: none; }
  .gal figure { height: 220px; }
  .vcta__act a, .vcta__act button { width: 100%; text-align: center; }
}

/* ---------- карточка посёлка: крупнее и информативнее ---------- */
.side .desc--lead { margin-top: 18px; font-size: 17px; line-height: 1.6; color: var(--ink); }
.side .loc-line { font-size: 16px; }
.side-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 6px; }
.side-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.scroll-hint { margin-top: 22px; display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.scroll-hint i { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; animation: bobY 2s ease-in-out infinite; }
.scroll-hint svg { width: 15px; height: 15px; transform: rotate(90deg); }
@keyframes bobY { 50% { transform: translateY(5px); } }
@media (max-width: 900px) {
  .side .desc--lead { font-size: 18px; }
  .side .main-cta { display: none; }
  .side .facts span { font-size: 16px; }
}


/* ---- зелёно-розовая тема: страница посёлков ---- */
html.gp .vs:nth-child(even) { background: var(--paper); }
html.gp .vs:nth-child(3n) { background: var(--pink-l); }
html.gp .story__copy { background: var(--pink-l); }
html.gp .main-cta:hover, html.gp .vcta__act a:hover, html.gp .vcta__act button:hover { background: var(--green-m); }
html.gp .back:hover { border-color: var(--pink); color: var(--pink-d); }
html.gp .vstats b small, html.gp .infra em { color: var(--pink-d); }
html.gp .hc__b span, html.gp .source-link { color: var(--pink-d); border-color: var(--pink-d); }
html.gp .route__line { background: var(--pink); }
html.gp .route__lab.r2 { background: var(--pink-d); color: #fff; }
html.gp .mk.infra i { background: var(--ink); box-shadow: 0 0 0 4px rgba(242, 69, 127, .5); }
html.gp .mk i::after { background: #fff; }
html.gp .mk:hover i, html.gp .mk.is-active i { box-shadow: 0 0 0 6px rgba(242, 69, 127, .55); }
html.gp .scroll-hint i { border-color: var(--pink-d); color: var(--pink-d); }
html.gp .vpage .header { background: #fff; }
html.gp .big-map { filter: none; }
html.gp .village-map { filter: brightness(.82) contrast(1.05); }


/* ---- уровни 2 и 3 ---- */
html.g1 .main-cta, html.g1 .vcta__act a:not(.ghost), html.g1 .vcta__act button { background: var(--g); }
html.g1 .main-cta:hover, html.g1 .vcta__act a:not(.ghost):hover, html.g1 .vcta__act button:hover { background: var(--g-d); }
html.g1 .vcta__act a.ghost:hover { background: var(--g); border-color: var(--g); }
html.g1 .back:hover { border-color: var(--g); color: var(--g); }
html.g1 .hc__b span, html.g1 .source-link { color: var(--g); border-color: var(--g); }
html.g1 .vstats b small, html.g1 .infra em { color: var(--g); }
html.g1 .scroll-hint i { border-color: var(--g); color: var(--g); }
html.g1 .mk.infra i { background: var(--g); }
html.gp.soft .vs:nth-child(3n), html.gp.soft .story__copy { background: var(--paper); }
html.gp.soft .back:hover { border-color: var(--ink); color: var(--ink); }
html.gp.soft .vstats b small, html.gp.soft .infra em, html.gp.soft .hc__b span, html.gp.soft .source-link { color: var(--ink); border-color: var(--ink); }
html.gp.soft .route__lab.r2 { background: var(--ink); }
html.gp.soft .route__line { background: var(--ink); }
html.gp.soft .scroll-hint i { border-color: var(--ink); color: var(--ink); }
html.gp.soft .mk.infra i { background: var(--ink); box-shadow: 0 0 0 4px rgba(12, 75, 54, .35); }
html.gp.soft .mk:hover i, html.gp.soft .mk.is-active i { box-shadow: 0 0 0 6px rgba(12, 75, 54, .4); }

/* ---------- телефон: масштаб карты, плашка-подсказка, заголовок в одну строку ---------- */
.map-zoom, .map-hint { display: none; }
@media (max-width: 900px) {
  .map-area { touch-action: pan-y; }
  .map-area .mapbox { will-change: translate, scale; }
  .map-zoom { display: flex; position: absolute; right: 10px; bottom: 10px; z-index: 12; gap: 6px; align-items: center; }
  .map-zoom button { height: 40px; min-width: 40px; border-radius: 20px; background: rgba(255,255,255,.95); color: #111; font-size: 22px; font-weight: 400; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,.16); display: grid; place-items: center; padding: 0 12px; }
  .map-zoom .map-zoom__reset { font-size: 13px; font-weight: 600; }
  .map-zoom [hidden] { display: none; }
  .opened .map-zoom { display: none; }
  .map-hint { display: flex; align-items: center; gap: 10px; margin: 12px var(--gutter) 0; padding: 12px 18px; border-radius: 999px; background: var(--paper); color: var(--ink-2); font-size: 13.5px; font-weight: 500; line-height: 1.3; }
  .map-hint i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ink); animation: hintPulse 1.8s ease-in-out infinite; }
  @keyframes hintPulse { 50% { transform: scale(1.7); opacity: .5; } }
  .map-area.opened + .map-hint { display: none; }
  .side { padding-top: 22px; }
  .side h1 { font-size: 30px; margin-top: 6px; white-space: nowrap; }
  .side h1 br { display: none; }
  .side .info { display: none; }
}
