/* Шлифовка по методу Эмиля Ковальски (решение владельца 06.11.2026).
   Смысл: чем чаще действие, тем меньше движения; отвечает сразу, закрывается
   быстрее, чем открывается. Заменяет выезды из ui-feel.css (просьба 02.11).
   Слой отдельный: откат — убрать этот файл, web/feel.js и строки в index.html. */
:root{
  --e-out:cubic-bezier(.23,1,.32,1);
  --e-drawer:cubic-bezier(.32,.72,0,1);
}

/* ---- Нажатие ---- */
button,a,.tab,[data-act]{touch-action:manipulation;-webkit-touch-callout:none}
button,.tab,.chip{-webkit-user-select:none;user-select:none}
button:not(.tab):not(.fx-title):not(.fs-tick):not(#med-unmute),a.btn,.btn{
  transition:transform 140ms var(--e-out),background-color 140ms ease,color 140ms ease,box-shadow 140ms ease,opacity 140ms ease,border-color 140ms ease}
button:not([disabled]):not(.fx-title):not(.fs-tick):not(#med-unmute):active,a.btn:active,.tab:active{transform:scale(.97)}

/* Строка задачи: подсветка не при прокрутке, с задержкой 70 мс. */
.item .swipe-face{transition:background-color 180ms ease,left 200ms var(--e-out)}
.item:active .swipe-face{background-color:color-mix(in srgb,var(--fg) 5%,transparent);transition-delay:70ms}
.swiping .swipe-face{transition:none !important}

/* ---- Смена раздела: десятки раз в день, поэтому без анимации ----
   Проявление от 55% мигало всем экраном при каждом нажатии (владелец 06.11). */
#app.page-in > :not(.composer){animation:none}

/* Первый экран при запуске — редкое событие: короткая лесенка. */
html.feel-first #app .group,html.feel-first #app .fx-card,html.feel-first #app .goalcard{animation:feel-rise 300ms var(--e-out) both}
html.feel-first #app .group:nth-of-type(2){animation-delay:40ms}
html.feel-first #app .group:nth-of-type(3){animation-delay:80ms}
html.feel-first #app .group:nth-of-type(4){animation-delay:120ms}
html.feel-first #app .group:nth-of-type(n+5){animation-delay:160ms}
@keyframes feel-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---- Окно ---- */
.modal.on{animation:modal-dim 180ms ease both}
.modal-in{animation:feel-modal 220ms var(--e-out) both}
@keyframes feel-modal{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
.modal.modal-ghost{animation:modal-dim-out 150ms ease both}
.modal.modal-ghost .modal-in{animation:feel-modal-out 150ms var(--e-out) both}
@keyframes feel-modal-out{to{opacity:0;transform:scale(.97)}}
/* ---- Меню ---- */
@media (hover:hover) and (pointer:fine){
  #tabbar .tab:not(.nav-lifted){transition:background-color 120ms ease,color 120ms ease}
  #tabbar .tab .ic{transition:color 120ms ease}
  html:not(.ld-dragging) #tabbar .tab:not(.nav-lifted):hover{transform:none;box-shadow:none;
    background:color-mix(in srgb,var(--fg) 6%,transparent);color:var(--fg)}
  html:not(.ld-dragging) #tabbar .tab:not(.nav-lifted):hover .ic{transform:none;color:inherit !important}
  html:not(.ld-dragging) #tabbar .tab[aria-current="page"]:not(.nav-lifted):hover{background:var(--accent);color:var(--on-accent);box-shadow:var(--glow)}
  html:not(.ld-dragging) #tabbar .tab[aria-current="page"]:hover .ic{color:var(--on-accent) !important}
  html:not(.ld-dragging) #tabbar .tab:not(.nav-lifted):active{transform:none}
}
/* Открытый пункт появляется сразу. Переезд плашки и плавная смена цвета давали
   мерцание: плашка гасла и загоралась заново (владелец 06.11). Сжатия тут тоже нет:
   меню перерисовывается по нажатию, и кнопка скачком возвращала размер. */
#tabbar .tab[aria-current="page"],#tabbar .tab[aria-current="page"] .ic{transition:none}
#tabbar .tab:active{transform:none}

/* Меню профиля: растёт от карточки, без лесенки; закрывается быстрее. */
#tabbar .rail-pop.pop-in{animation:feel-pop 200ms var(--e-out) both}
#tabbar .rail-pop.pop-in > *{animation:none}
#tabbar .rail-pop.pop-out{animation:feel-pop-out 140ms var(--e-out) both}
@keyframes feel-pop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
@keyframes feel-pop-out{to{opacity:0;transform:scale(.97)}}
#tabbar .rail-more svg{transition:transform 200ms var(--e-out)}

/* ---- Раскрытие ---- */
.tasklist-wrap,.detail-wrap,.goalbody-wrap{transition:height 200ms var(--e-out),opacity 140ms ease}
.fx-chev,.goalcard-h .car,.group-h .car{transition:transform 180ms var(--e-out)}

/* ---- Смена темы ---- */
.daynight{transition:background 240ms ease}
.dn-knob{transition:transform 260ms var(--e-out),background 220ms ease,box-shadow 220ms ease}
.dn-knob::after{transition:transform 260ms var(--e-out)}
.dn-cloud{transition:transform 220ms var(--e-out),opacity 180ms ease}
::view-transition-old(root),::view-transition-new(root),
html.vt-look::view-transition-old(root),html.vt-look::view-transition-new(root){animation-duration:200ms}

/* ---- Картинки: без выезда, короткое проявление ---- */
.ne-cover,.att-mosaic,.att-item{animation:none}
.ne-cover img,.ne-body figure.ne-img img{transition:opacity 180ms ease}
.att-tile img,.att-pic img,.att-view-b img.att-fade{transform:none;transition:opacity 180ms ease}

/* ---- Профиль: вечное движение фона убрано ---- */
.pf-hero,.pf-orb,.pf-orb2,.pf-shine,.pf-ava .avatar.lg,.pf-streak b::before{animation:none}
.pf-fresh .pf-grid > .pf-card{animation-duration:300ms;animation-timing-function:var(--e-out)}
.pf-fresh .pf-bar i{animation-duration:400ms;animation-delay:0s;animation-timing-function:var(--e-out)}

/* ---- Ассистент: цвет движется, только когда слушает, думает или говорит ---- */
.syn-cap .cap-flow i{animation-play-state:paused}
html[data-syn="listening"] .syn-cap .cap-flow i,html[data-syn="thinking"] .syn-cap .cap-flow i,
html[data-syn="working"] .syn-cap .cap-flow i,html[data-syn="speaking"] .syn-cap .cap-flow i{animation-play-state:running}
.syn-cap{transition:transform 140ms var(--e-out),box-shadow 160ms ease}
.syn-cap:hover{transform:none}

/* ---- Плашка внизу ---- */
.toast{animation:feel-toast 220ms var(--e-out) both}
@keyframes feel-toast{from{opacity:0;transform:translateX(-50%) translateY(8px) scale(.97)}to{opacity:1;transform:translateX(-50%)}}

/* ---- Цифры одной ширины, ровные заголовки ---- */
#app{font-variant-numeric:tabular-nums}
#app h1,#app h2,#app h3{text-wrap:balance}
#app p{text-wrap:pretty}

@media (prefers-reduced-motion:reduce){
  html.feel-first #app .group,html.feel-first #app .fx-card,html.feel-first #app .goalcard,
  .modal.on,.modal-in,.modal.modal-ghost,.modal.modal-ghost .modal-in,#tabbar .rail-pop.pop-in,#tabbar .rail-pop.pop-out,.toast{animation:none}
  button:not(.tab):active,a.btn:active,.tab:active{transform:none}
}
