/* 알림 움직임 — notify-motion.js 가 body 에 nfm(움직여도 됨) · nfm-in 을, 칸마다 nfm-on · nfm-off · nfm-pop · nfm-dim · nfm-lit · nfm-bump · nfm-rows · nfm-type · nfm-fly · nfm-hit · nfm-new · nfm-ok · nfm-flash 를 붙이고 뗀다.
   ① 세 칸 톡 · 연결 점 맥박 · 묶음 카드 차례로 · 막대 자람 · 띠 물결 · 기록 줄  ② 스위치 튕김 · 빛 고리 · 묶음은 차례로  ③ 입력 중 점 → 말풍선
   ④ 띠 바뀐 칸만  ⑤ 종이비행기 · 오늘 보냄 톡 · 새 기록 빛  ⑥ 저장 초록 · 알약 반짝.  움직임 줄이기면 nfm 이 붙지 않는다. 글자는 바꾸지 않는다. */
body { --nfm-ease: cubic-bezier(.22, 1, .36, 1); --nfm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.nfm.nfm-in #now .nt { animation: nfm-pop-in .5s var(--nfm-spring) both; animation-delay: calc(var(--i, 0) * .08s); }
body.nfm.nfm-in #ready .conn.ok svg { animation: nfm-beat 1s ease-in-out 3; animation-delay: .4s; }
body.nfm.nfm-in #groups > .card { animation: nfm-rise .5s var(--nfm-ease) both; animation-delay: calc(.2s + var(--i, 0) * .07s); }
body.nfm.nfm-in #bars7 .st { transform-origin: 50% 100%; animation: nfm-grow .6s var(--nfm-spring) both; animation-delay: calc(.35s + var(--i, 0) * .06s); }
body.nfm.nfm-in #bars7 .n { animation: nfm-fade .4s ease-out both; animation-delay: calc(.6s + var(--i, 0) * .06s); }
body.nfm.nfm-in #strip i { animation: nfm-wave .5s var(--nfm-spring) both; animation-delay: calc(.3s + var(--d, 0) * .035s); }
body.nfm #log.nfm-rows > * { animation: nfm-row .4s var(--nfm-ease) both; animation-delay: calc(var(--r, 0) * .04s); }
body.nfm.nfm-in #log.nfm-rows > * { animation-delay: calc(.5s + var(--r, 0) * .04s); }
/* ② 스위치: 손잡이가 옛 자리에서 튕기며 넘어간다 (묶음 안은 --k 만큼 늦게) */
body.nfm .sw.nfm-on::after { animation: nfm-knob-on .45s var(--nfm-spring) both; animation-delay: calc(var(--k, 0) * .09s); }
body.nfm .sw.nfm-off::after { animation: nfm-knob-off .4s var(--nfm-spring) both; animation-delay: calc(var(--k, 0) * .09s); }
body.nfm .sw.nfm-on { animation: nfm-bg-on .3s ease-out both, nfm-ring .8s ease-out both; animation-delay: calc(var(--k, 0) * .09s), calc(.15s + var(--k, 0) * .09s); }
body.nfm .sw.nfm-off { animation: nfm-bg-off .3s ease-out both; animation-delay: calc(var(--k, 0) * .09s); }
body.nfm .sw.nfm-pop { animation: nfm-bump .45s var(--nfm-spring) both; }
body.nfm #save.nfm-bump { animation: nfm-bump .5s var(--nfm-spring) both; }
/* ③ */
body.nfm .chat { position: relative; }
body.nfm .chat.nfm-type { animation: nfm-fade .25s ease-out both; }
body.nfm .chat.nfm-type .bub { transform-origin: 0 100%; animation: nfm-bubble .45s var(--nfm-spring) both; animation-delay: .75s; }
.nfm-dots { position: absolute; left: 10px; top: 42px; display: inline-flex; gap: 4px; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: var(--tg-bubble); animation: nfm-dots-out .2s ease-in .7s both; pointer-events: none; }
.nfm-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--tg-bubble-ink); opacity: .5; animation: nfm-typing .9s ease-in-out infinite; }
.nfm-dots i:nth-child(2) { animation-delay: .15s; } .nfm-dots i:nth-child(3) { animation-delay: .3s; }
/* ④ */
body.nfm #strip i.nfm-dim { animation: nfm-dim .5s ease-out both; animation-delay: calc(var(--d, 0) * .07s); }
body.nfm #strip i.nfm-lit { animation: nfm-lit .5s var(--nfm-spring) both; animation-delay: calc(var(--d, 0) * .07s); }
/* ⑤ */
body.nfm #test.nfm-fly svg { animation: nfm-fly .8s var(--nfm-ease) both; }
body.nfm #nowSent.nfm-hit .v { display: inline-block; animation: nfm-bump .5s var(--nfm-spring) both; }
body.nfm #nowSent.nfm-hit { animation: nfm-glow 1.2s ease-out both; }
body.nfm #log .lg.nfm-new { animation: nfm-drop .45s var(--nfm-spring) both, nfm-glow 1.5s ease-out both; }
/* ⑥ */
body.nfm #save.nfm-ok { animation: nfm-ok 1s ease-out both; }
body.nfm #groups .gcnt.nfm-flash { animation: nfm-flash .9s ease-out both; animation-delay: calc(var(--i, 0) * .07s); }

@keyframes nfm-pop-in { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; transform: scale(1.05); } 100% { opacity: 1; transform: none; } }
@keyframes nfm-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nfm-grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes nfm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nfm-wave { 0% { opacity: 0; transform: scaleY(.2); } 100% { opacity: 1; transform: none; } }
@keyframes nfm-row { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes nfm-beat { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.35); } 60% { transform: scale(.95); } }
@keyframes nfm-knob-on { 0% { left: 3px; } 70% { left: 28px; } 100% { left: 25px; } }
@keyframes nfm-knob-off { 0% { left: 25px; } 70% { left: 1px; } 100% { left: 3px; } }
@keyframes nfm-bg-on { from { background: var(--surface-3, var(--line)); } }
@keyframes nfm-bg-off { from { background: var(--accent); } }
@keyframes nfm-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes nfm-bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: none; } }
@keyframes nfm-bubble { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: none; } }
@keyframes nfm-typing { 0%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes nfm-dots-out { to { opacity: 0; transform: scale(.8); } }
@keyframes nfm-dim { 0% { background: color-mix(in srgb, var(--accent) 55%, var(--bg)); transform: scaleY(1); } 50% { transform: scaleY(.6); } 100% { transform: none; } }
@keyframes nfm-lit { 0% { background: var(--bg); transform: scaleY(.4); } 100% { transform: none; } }
@keyframes nfm-fly { 0% { transform: none; opacity: 1; } 45% { transform: translate(26px, -22px) rotate(12deg); opacity: 0; } 46% { transform: translate(-14px, 10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes nfm-glow { 0% { outline: 3px solid var(--good, var(--accent)); outline-offset: 1px; } 100% { outline: 3px solid transparent; outline-offset: 7px; } }
@keyframes nfm-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes nfm-ok { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good, var(--accent)) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes nfm-flash { 0% { filter: brightness(1); transform: scale(1); } 35% { filter: brightness(1.5); transform: scale(1.08); } 100% { filter: none; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  #now .nt, #ready *, #groups > .card, #groups *, #groups .sw::after, #bars7 *, #strip i, #log > *, #test svg, #nowSent, #save, .nfm-dots, .nfm-dots i { animation: none !important; }
  .nfm-dots { display: none; }
}
@media print { #now .nt, #groups > .card, #bars7 *, #strip i, #log > * { animation: none !important; } .nfm-dots { display: none; } }
