/* Главная: сцены «Выбери свою квартиру на карте района» и «Оцените «Максимум» лично».
   Без JS и при «уменьшить движение» — обычная статичная вёрстка. */

/* ---------- общая разметка кнопки и блоков (статично) ---------- */
.d3-stage { display: contents; }
.d3-head { display: flex; flex-direction: column; gap: 14px; }
.d3-act { display: flex; flex-direction: column; gap: 14px; }
.d3-teaser .d3-cta { position: relative; flex-direction: row; align-items: center; justify-content: center; gap: 14px; isolation: isolate; }
.d3-teaser .d3-cta-txt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; }
.d3-cta-ico { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: #0e1e2b; color: #f3aa43; }

/* слова заголовка выезжают из-под маски */
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .04em .03em .2em; margin: -.04em -.03em -.2em; }
[data-split] .w > span { display: inline-block; }
.mx-anim [data-split] .w > span { transform: translateY(108%); transition: transform .9s cubic-bezier(.23,1,.32,1); transition-delay: calc(var(--i, 0) * 70ms + var(--d0, 0ms)); }
.mx-anim [data-split].is-in .w > span { transform: none; }

/* пульс кнопки: два кольца расходятся от кнопки (только transform и opacity) */
.mx-pulse::before, .mx-pulse::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--ring, #f3aa43); opacity: 0; pointer-events: none; }
.mx-pulse.is-live::before { animation: mx-ring 2.4s cubic-bezier(.23,1,.32,1) infinite; }
.mx-pulse.is-live::after { animation: mx-ring 2.4s cubic-bezier(.23,1,.32,1) 1.2s infinite; }
@keyframes mx-ring { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.28, 1.6); } }
.mx-pulse.is-live .d3-cta-ico svg { animation: mx-cube 4.8s cubic-bezier(.77,0,.175,1) infinite; }
@keyframes mx-cube { 0%, 70% { transform: rotate(0); } 85%, 100% { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) { .mx-pulse.is-live:hover::before, .mx-pulse.is-live:hover::after { animation-play-state: paused; opacity: 0; } }

/* ---------- сцена квартала: закреплённый экран, анимация идёт за прокруткой ---------- */
.d3-teaser.is-scene { display: block; width: auto; max-width: none; min-height: 0; margin: 0; padding: 0; height: 250svh; }
.d3-teaser.is-scene .d3-stage {
  position: sticky; top: var(--header-h, 64px); box-sizing: border-box;
  height: calc(100svh - var(--header-h, 64px)); max-width: 1760px; margin: 0 auto;
  padding: clamp(18px, 4vh, 44px) 4.17% clamp(18px, 3.5vh, 40px);
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "head" "media"; gap: clamp(16px, 3vh, 32px);
  overflow: clip;
}
.d3-teaser.is-scene .d3-body { display: contents; }
.d3-teaser.is-scene .d3-head { grid-area: head; align-items: center; text-align: center; gap: 12px; }
.d3-teaser.is-scene .d3-head h2 { max-width: 24ch; font-size: clamp(2rem, .9rem + 2.5vw, 3.6rem); line-height: 1.04; text-wrap: balance; }
.d3-teaser.is-scene .d3-media { grid-area: media; height: auto; min-height: 0; aspect-ratio: auto; align-self: stretch; will-change: transform, opacity; transform-origin: 50% 0; }
.d3-teaser.is-scene .d3-badge { top: 18px; bottom: auto; }
.d3-teaser.is-scene .d3-chips { display: none; }
.d3-teaser.is-scene .d3-steps {
  grid-area: media; align-self: end; z-index: 3; margin: 0 22px 22px; pointer-events: none;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.d3-teaser.is-scene .d3-steps li {
  border: 1px solid #ffffff26; border-radius: 14px; padding: 12px 16px; background: #0c1a27e6;
}
.d3-teaser.is-scene .d3-steps li:before { color: #f3aa43; }
.d3-teaser.is-scene .d3-steps b { color: #fff; }
.d3-teaser.is-scene .d3-steps span { color: #c9d8e1; }
.d3-teaser.is-scene .d3-act { grid-area: media; place-self: center; z-index: 4; align-items: center; margin-bottom: 9%; }
.d3-teaser.is-scene .d3-cta { border-radius: 999px; padding: 12px 30px 12px 12px; box-shadow: 0 18px 50px #0006; }
.d3-teaser.is-scene .d3-list { align-self: center; color: #fff; padding: 6px 12px; border-radius: 999px; background: #0c1a27b3; }
/* внутри сцены картинка стоит, движение даёт только прокрутка */
.d3-teaser.is-scene .d3-poster { animation: none; transform: none; }

@media (max-width: 760px) {
  .d3-teaser.is-scene { height: 230svh; }
  .d3-teaser.is-scene .d3-stage { padding: 16px 10px 14px; gap: 14px; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "head" "media" "steps"; }
  .d3-teaser.is-scene .d3-head h2 { font-size: clamp(1.9rem, 1rem + 4.6vw, 2.6rem); max-width: 14ch; }
  .d3-teaser.is-scene .d3-kicker { font-size: 11px; }
  .d3-teaser.is-scene .d3-media { border-radius: 20px; }
  .d3-teaser.is-scene .d3-badge { top: 12px; left: 12px; padding: 8px 12px; font-size: 10px; }
  .d3-teaser.is-scene .d3-steps { grid-area: steps; margin: 0 4px; grid-template-columns: 1fr; gap: 0; }
  .d3-teaser.is-scene .d3-steps li { background: none; border: 0; border-top: 1px solid #0e1e2c1f; border-radius: 0; padding: 10px 0; -webkit-backdrop-filter: none; backdrop-filter: none; grid-template-columns: 36px 1fr; }
  .d3-teaser.is-scene .d3-steps li:before { color: #b56f10; }
  .d3-teaser.is-scene .d3-steps b { color: #0e1e2c; font-size: 15px; }
  .d3-teaser.is-scene .d3-steps span { color: #4d5f6c; font-size: 13px; }
  .d3-teaser.is-scene .d3-act { margin: 0; align-self: end; margin-bottom: 16px; }
  .d3-teaser.is-scene .d3-cta { font-size: 17px; padding: 8px 20px 8px 8px; gap: 10px; }
  .d3-teaser.is-scene .d3-cta small { font-size: 9px; }
  .d3-teaser.is-scene .d3-cta-ico { width: 38px; height: 38px; }
  .d3-teaser.is-scene .d3-list { font-size: 13px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .d3-teaser.is-scene .d3-steps span { display: none; }
}

/* ---------- лид-форма «Оцените «Максимум» лично» ---------- */
.mx-anim #contact .final-visit { clip-path: inset(9% 6% round 24px); transform: translateY(40px); opacity: .001;
  transition: clip-path 1.1s cubic-bezier(.77,0,.175,1), transform 1.1s cubic-bezier(.23,1,.32,1), opacity .5s ease; }
.mx-anim #contact.is-in .final-visit { clip-path: inset(0 round 24px); transform: none; opacity: 1; }
.mx-anim #contact [data-rise] { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .9s cubic-bezier(.23,1,.32,1); transition-delay: var(--d, 0ms); }
.mx-anim #contact.is-in [data-rise] { opacity: 1; transform: none; }
.mx-anim #contact .lead-form { transform: translateY(60px) scale(.96); opacity: 0; transition: opacity .7s ease .55s, transform 1s cubic-bezier(.23,1,.32,1) .55s; }
.mx-anim #contact.is-in .lead-form { transform: none; opacity: 1; }
#contact .lead-form [type="submit"] { position: relative; isolation: isolate; --ring: var(--bg, #8dd5e2); }
#contact .lead-form:focus-within [type="submit"]::before, #contact .lead-form:focus-within [type="submit"]::after { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .mx-pulse::before, .mx-pulse::after, .mx-pulse .d3-cta-ico svg { animation: none !important; }
}

.mx-anim .d3-head .d3-kicker { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .8s cubic-bezier(.23,1,.32,1); }
.mx-anim .d3-head.is-in .d3-kicker { opacity: 1; transform: none; }
/* широкая кнопка формы: кольцо расходится в основном по высоте, чтобы не вылезать за карточку */
#contact .mx-pulse.is-live::before { animation-name: mx-ring-wide; }
#contact .mx-pulse.is-live::after { animation-name: mx-ring-wide; }
@keyframes mx-ring-wide { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05, 1.55); } }

/* логотип МДК в кнопке 3D-района: не вращаем, светится только кольцо */
.d3-cta-logo svg { display: block; }
.mx-pulse.is-live .d3-cta-logo svg { animation: none; }
