/* ============================================================
   ТОПДОМ — окно построенного дома (всплывающее)
   Слева фото 16:9 с курсором-стрелкой и лентой превью других домов, справа белая колонка с информацией.
   ============================================================ */
.hv { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; opacity: 0; transition: opacity .4s var(--ease); }
.hv[hidden] { display: none; }
.hv.is-open { opacity: 1; }
.hv__bg { position: absolute; inset: 0; background: rgba(8, 8, 8, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
html.lite .hv__bg { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(8, 8, 8, .9); }
/* ширина фото подбирается так, чтобы кадр 16:9 вместе с лентой помещался по высоте экрана */
.hv__win { --ic: 410px; --sw: min(calc(96vw - var(--ic)), calc((92svh - 118px) * 16 / 9)); position: relative; width: calc(var(--sw) + var(--ic)); border-radius: 28px; overflow: hidden; background: #0e0e0e; display: grid; grid-template-columns: var(--sw) var(--ic); box-shadow: 0 40px 120px rgba(0, 0, 0, .5); transform: translateY(40px) scale(.97); transition: transform .6s var(--ease); }
.hv.is-open .hv__win { transform: none; }
.hv__main { min-width: 0; display: flex; flex-direction: column; }
.hv__stage { position: relative; overflow: hidden; background: #111; aspect-ratio: 16 / 9; width: 100%; flex: none; }

/* фото: смена со сдвигом в сторону листания */
.hv__slide { position: absolute; inset: 0; opacity: 0; transform: translateX(calc(var(--dir, 1) * 7%)) scale(1.05); transition: opacity .7s var(--ease), transform .9s var(--ease); overflow: hidden; }
.hv__slide.is-on { opacity: 1; transform: none; }
.hv__slide.is-off { opacity: 0; transform: translateX(calc(var(--dir, 1) * -7%)) scale(1.02); }
.hv__slide img { position: relative; width: 100%; height: 100%; object-fit: cover; }
/* не 16:9 — целиком, на размытой копии того же кадра: ничего не обрезается */
.hv__slide::before { content: ""; position: absolute; inset: -30px; background: var(--bg) center / cover; filter: blur(28px) brightness(.72); opacity: 0; transition: opacity .4s; }
.hv__slide.is-fit::before { opacity: 1; }
.hv__slide.is-fit img { object-fit: contain; }
.hv__slide.is-plan { background: #fff; }
.hv__slide.is-plan img { object-fit: contain; padding: clamp(14px, 2.4vw, 40px); }
.hv__half { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; background: none; }
.hv__half--prev { left: 0; }
.hv__half--next { right: 0; }
@media (hover: hover) and (pointer: fine) { .hv__stage, .hv__half { cursor: none; } }

/* курсор-стрелка вместо мыши */
.hv__cursor { position: absolute; left: 0; top: 0; z-index: 3; width: 88px; height: 88px; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ink); display: grid; place-items: center; pointer-events: none; opacity: 0; scale: .5; transition: opacity .3s, scale .4s var(--ease), background .3s; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
.hv__cursor svg { width: 30px; height: 30px; transition: transform .3s var(--ease); }
.hv__stage.has-cursor .hv__cursor { opacity: 1; scale: 1; }
.hv__cursor.is-flip svg { transform: scaleX(.6); }
.hv__stage.has-cursor .hv__cursor.is-press { scale: .86; background: #fff; }

.hv__count { position: absolute; left: 18px; bottom: 18px; z-index: 2; padding: 7px 14px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; font-weight: 600; pointer-events: none; }
.hv__dots { position: absolute; left: 50%; bottom: 24px; z-index: 2; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.hv__dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: width .4s var(--ease), background .3s; }
.hv__dots i.on { width: 26px; border-radius: 6px; background: #fff; }
.hv__dots i.p { border-radius: 2px; }

/* лента превью других домов */
.hv__strip { display: flex; gap: 8px; padding: 12px 14px; overflow-x: auto; scrollbar-width: none; background: #0e0e0e; flex: none; }
.hv__strip[hidden] { display: none; }
.hv__strip::-webkit-scrollbar { display: none; }
.hv__th { position: relative; flex: none; width: 124px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; opacity: .45; transition: opacity .3s, transform .4s var(--ease), box-shadow .3s; }
.hv__th img { width: 100%; height: 100%; object-fit: cover; }
.hv__th span { position: absolute; left: 7px; bottom: 6px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 600; }
.hv__th:hover { opacity: .85; transform: translateY(-2px); }
.hv__th.is-cur { opacity: 1; box-shadow: 0 0 0 2px #fff; }

/* белая колонка с информацией (её высота равна высоте кадра с лентой, лишнее прокручивается) */
.hv__info { background: #fff; color: var(--ink); padding: 34px 30px 26px; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; contain: size; min-height: 0; }
.hv__info > * { opacity: 0; transform: translateY(14px); }
.hv__info.is-in > * { animation: hvIn .6s var(--ease) forwards; }
.hv__info.is-in > *:nth-child(2) { animation-delay: .05s; }
.hv__info.is-in > *:nth-child(3) { animation-delay: .1s; }
.hv__info.is-in > *:nth-child(4) { animation-delay: .15s; }
.hv__info.is-in > *:nth-child(5) { animation-delay: .2s; }
.hv__info.is-in > *:nth-child(6) { animation-delay: .25s; }
@keyframes hvIn { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hv__info > * { opacity: 1; transform: none; } .hv__info.is-in > * { animation: none; } }
.hv__kick { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--acc-t); padding-right: 48px; }
.hv__info h3 { font-size: clamp(34px, 3vw, 48px); font-weight: 200; letter-spacing: -.045em; line-height: 1; margin-top: 10px; }
.hv__about { color: var(--ink-2); font-size: 14.5px; margin-top: 12px; }
.hv__list { margin: 20px 0 0; border-top: 1px solid var(--ink); }
.hv__list div { display: grid; grid-template-columns: 1fr 1.1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hv__list dt { color: var(--ink-3); }
.hv__list dd { margin: 0; font-weight: 500; }
.hv__list a { text-decoration: underline; text-underline-offset: 3px; }
.hv__plan { position: relative; display: block; width: 100%; margin-top: 18px; border-radius: 16px; overflow: hidden; background: var(--paper); text-align: left; flex: none; }
.hv__plan img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; padding: 10px; transition: transform .6s var(--ease); }
.hv__plan:hover img { transform: scale(1.04); }
.hv__plan span { position: absolute; left: 10px; bottom: 10px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; }
.hv__noplan { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--paper); font-size: 13.5px; color: var(--ink-2); }
.hv__act { display: grid; gap: 8px; margin-top: auto; padding-top: 20px; flex: none; }
.hv__act .btn { width: 100%; justify-content: space-between; }
.hv__act .btn--acc .btn__ic { background: #fff; color: var(--acc); }
.hv__x { position: absolute; top: 16px; right: 16px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 24px; line-height: 1; display: grid; place-items: center; transition: transform .3s var(--ease), background .3s; }
.hv__x:hover { transform: rotate(90deg); background: var(--line); }

@media (max-width: 1100px) { .hv__win { --ic: 340px; } }

/* телефон: полноэкранная карточка, фото 16:9 на всю ширину, свайп по фото */
@media (max-width: 900px) {
  .hv__win { --sw: 100vw; --ic: 100vw; width: 100vw; height: 100svh; border-radius: 0; display: block; overflow-y: auto; overscroll-behavior: contain; transform: translateY(60px); }
  .hv__main { display: block; }
  .hv__strip { padding: 10px 12px; }
  .hv__th { width: 96px; }
  .hv__info { overflow: visible; contain: none; padding: 22px var(--gutter) calc(28px + env(safe-area-inset-bottom)); }
  .hv__kick { padding-right: 0; }
  .hv__x { position: fixed; top: 12px; right: 12px; background: rgba(255, 255, 255, .92); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
  .hv__half::after { content: ""; position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; background: rgba(255, 255, 255, .9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px no-repeat; }
  .hv__half--next::after { right: 10px; }
  .hv__half--prev::after { left: 10px; transform: rotate(180deg); }
  .hv__dots { bottom: 12px; }
  .hv__count { left: 12px; bottom: 10px; font-size: 12px; padding: 5px 11px; }
}

/* кнопка «открыть на весь экран» */
.hv__zoom { position: absolute; right: 14px; bottom: 14px; z-index: 4; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); transition: transform .3s var(--ease); }
.hv__zoom svg { width: 19px; height: 19px; }
.hv__zoom:hover { transform: scale(1.08); }
@media (max-width: 900px) { .hv__zoom { right: 10px; bottom: 10px; width: 38px; height: 38px; } }
