/* Движение всего сайта (переработка 26.10 по правкам Максима: прежние анимации «ужасны»; навык emil-design-eng).
   Подключается в base.html после стилей блоков и перебивает их прежние анимации.
   Правила: отклик на действие 120–250 мс, ease-out; появление при прокрутке одно на блок, 0,6 с, подъём 12 px, без цепочек
   и «загораний по очереди»; ничего не бегает за курсором, не мерцает и не заливается. Лента главной статична (polotno.css).
   «Уменьшить движение» — всё сразу на месте (base.css). */
:root {
  --ease-ui: cubic-bezier(.23, 1, .32, 1);     /* сильный ease-out: вход, отклик */
  --ease-soft: cubic-bezier(.25, .6, .2, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

@media (prefers-reduced-motion: no-preference) {
  /* Появление при прокрутке */
  .rv { transform: translateY(12px); }
  .rv.is-in { transition: opacity .6s var(--ease-ui) calc(var(--i, 0) * 60ms), transform .6s var(--ease-ui) calc(var(--i, 0) * 60ms); }
  /* Первый экран не ждёт скрипт появления (блок 2.4, LCP ≤ 2,5 с): тот же вход — 0,6 с, подъём 12 px, та же очередь —
     но с первой отрисовки, а не после загрузки модулей. Раньше фото модели и обложка совета были невидимы до скрипта */
  @keyframes rvIn { from { opacity: 0; transform: translateY(12px); } }
  .hero:not(.hero--photo) .rv, .sp-hero .rv, .art-head .rv, .art-cover.rv { opacity: 1; transform: none; animation: rvIn .6s var(--ease-ui) calc(var(--i, 0) * 60ms) both; }

  /* Кнопки: нажатие ощущается, блик по наведению убран */
  .btn { transition: background-color .2s var(--ease-std), border-color .2s var(--ease-std), color .2s var(--ease-std), transform .16s var(--ease-ui), box-shadow .25s var(--ease-ui); }
  .btn:not(:disabled):active { transform: scale(.97); }
  .btn .ico, .link .ico { transition: transform .25s var(--ease-ui); }
  .btn--main::after { display: none; }
  .btn--main.btn--lg, [data-magnet] { translate: none !important; }

  /* Первый экран: один мягкий вход текста, картинки и карточки, без построчного появления заголовка */
  .hero-h1 .hl, .hero--photo .hero-h1 .hl { animation: none; }
  .hero--photo .hero-ph-txt { animation: heroIn .8s var(--ease-ui) both; }
  .hero--photo .hero-pic img { animation: heroPic .9s var(--ease-ui) both; }
  .hero-light { animation: none; }
  .hero-light::after { display: none; }
  .hx-card { animation: heroIn .7s var(--ease-ui) .35s both; }
  .hx-facts div { animation: none; }
  @keyframes heroIn { from { opacity: 0; transform: translateY(10px); } }
  @keyframes heroPic { from { opacity: 0; } }
  .hero--photo .hero-ph-txt.rv, .hero--photo .hero-ph-txt .rv { opacity: 1; transform: none; transition: none; }

  /* Калькулятор: смена вопроса сдвигом 14 px за 0,3 с, уход 0,18 с; варианты поднимаются на 6 px */
  @keyframes cqIn { from { opacity: 0; transform: translateX(14px); } }
  @keyframes cqBack { from { opacity: 0; transform: translateX(-14px); } }
  @keyframes cqOut { to { opacity: 0; transform: translateX(-8px); } }
  @keyframes cqOutBack { to { opacity: 0; transform: translateX(8px); } }
  @keyframes optIn { from { opacity: 0; transform: translateY(6px); } }
  .cq.is-in, .cq.is-back { animation-duration: .3s; animation-timing-function: var(--ease-ui); }
  .cq.is-out, .cq.is-out-back { animation-duration: .18s; }
  .opt { animation-duration: .3s; animation-delay: calc(40ms + var(--i, 0) * 35ms); }
  .model { animation-duration: .35s; animation-delay: calc(60ms + var(--i, 0) * 60ms); }
  /* Путь по вопросам слева: пройденный и текущий шаг переключаются плавно (разметка больше не пересоздаётся) */
  .calc-map li { transition: background-color .3s var(--ease-std), color .3s var(--ease-std), box-shadow .3s var(--ease-std); }
  .calc-map li::before { transition: background-color .3s var(--ease-std), border-color .3s var(--ease-std), color .3s var(--ease-std), border-width .3s var(--ease-std); }
  .calc-map li small { animation: optIn .3s var(--ease-ui) both; }
  .calc-bar i { transition: transform .5s var(--ease-io); }

  /* Услуги и вопросы: смена за 0,3 с, ease-out */
  @keyframes itemIn { from { opacity: 0; transform: translateX(-6px); } }
  .svc-pane { transition: opacity .2s var(--ease-std), transform .3s var(--ease-ui), visibility 0s linear .2s; }
  .svc-pane.is-on { transition: opacity .3s var(--ease-std) .05s, transform .35s var(--ease-ui) .05s, visibility 0s; }
  .svc-pane.is-on .svc-items li { animation-duration: .3s; animation-delay: calc(80ms + var(--i) * 40ms); }
  .svc-ind { transition: transform .3s var(--ease-ui), width .3s var(--ease-ui); }
  .qa-a { transition: grid-template-rows .3s var(--ease-ui); }
  .qa-pm { transition: background-color .2s var(--ease-std), color .2s var(--ease-std), transform .3s var(--ease-ui); }
  .qa:not(.is-open) .qa-a > div { transition: visibility 0s .3s; }

  /* Шаги заказа: показываются сразу, линия сплошная, без «загорания» по очереди */
  .steps:not(.is-go) .step > div { opacity: 1; }
  .step > div { transition: none; }
  .steps-line i { transform: none; transition: none; }
  .steps.is-go .step-n, .steps.is-go .step > div { transition-delay: 0s; }

  /* Календарь абонемента: месяцы видны сразу, живёт только наведение */
  .month, .abon.is-go .month { opacity: 1; transform: none; transition: background-color .25s var(--ease-std), box-shadow .25s var(--ease-std), transform .25s var(--ease-ui), opacity .25s var(--ease-std); }
  .month i { transform: none; transition: none; }
  .month.is-visit i { animation: none; }
  .abon.is-go .month.is-hot { transition-delay: 0s; }

  /* Карта районов: одно появление целиком, без очереди районов, подписей и приближения */
  .dz-body:not(.is-go) .dz-d { transform: none; }
  .dz-body:not(.is-go) .dz-pin { transform: none; }
  .dz-body:not(.is-go) .dz-card { transform: none; }
  .dz-body:not(.is-go) .dz-outline { stroke-dashoffset: 0; }
  .dz-body.is-go:not(.is-ready) .dz-d, .dz-body.is-go:not(.is-ready) .dz-pin, .dz-body.is-go:not(.is-ready) .dz-card { transition-delay: 0s; }
  .dz-d { transition: opacity .6s var(--ease-std), transform .3s var(--ease-ui), fill .25s var(--ease-std); }
  .dz-pin { transition-duration: .25s; }
  .dz-card { transition: opacity .6s var(--ease-std), transform .3s var(--ease-ui); }
  .dz-pin[aria-pressed="true"]::before { animation: none; }
  .dz-layer { animation: none !important; }

  /* Карусель работ и карточки: короткий отклик */
  .work { transition: transform .3s var(--ease-ui), box-shadow .3s var(--ease-ui); }
  .work-img img { transition: transform .6s var(--ease-ui); }
  .car-progress i { transition: transform .12s linear; }

  /* Внутренние страницы: плавающие карточки не качаются */
  .hero-card, .sp-chip, .sp-badge { animation: none; }
  .svc-h1 { animation: none; }
  .svc-card { animation: heroIn .7s var(--ease-ui) .2s both; }
}

/* 3. Калькулятор: путь по вопросам без номеров (Максим 26.10). Точки на тонкой линии: пройденный — синяя с галочкой,
   текущий — синее кольцо и белая плашка строки, впереди — пустое кольцо. Порядок задаёт сама линия. */
.calc-map { position: relative; }
.calc-map li { position: relative; grid-template-columns: 20px minmax(0, 1fr); gap: 14px; padding-left: 12px; }
.calc-map li::before { content: ''; width: 20px; height: 20px; border: 1.5px solid #B9CCE0; border-radius: 50%; background: #fff; box-sizing: border-box; }
.calc-map li:not(:last-child)::after { content: ''; position: absolute; left: 21.25px; top: calc(50% + 12px); height: calc(100% - 20px); width: 1.5px; background: #CFDDEB; transition: background-color .3s var(--ease-std); }
.calc-map li.is-done::before { content: ''; border-color: var(--brand); background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.5L12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.calc-map li.is-done:not(:last-child)::after { background: var(--brand); }
.calc-map li.is-now::before { border: 6px solid var(--brand); background: #fff; }
