/* 일정 움직임 — calendar-motion.js 가 body 에 clm(움직여도 됨) 을, 칸마다 clm-in · clm-open · clm-rows · clm-wave · clm-prev · clm-next · clm-day · clm-pick · clm-today · clm-up · clm-new 를 붙이고 뗀다.
   ① 세 칸 톡 · 종 딸랑 · 줄 차례로 · 7일 안 D 상자 뒤집힘  ② 오늘 생일 색종이 · 오늘 칸 숨쉬기  ③ 달 넘기기  ④ 달력 물결 · 줄 차례로
   ⑤ 날짜 톡 · 그날 일정 펼침  ⑥ 판 올라옴 · 새 일정 빛.  움직임 줄이기면 clm 이 붙지 않는다. 글자는 바꾸지 않는다. */
body { --clm-ease: cubic-bezier(.22, 1, .36, 1); --clm-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ① */
body.clm #tiles.clm-in .tile { animation: clm-pop .5s var(--clm-spring) both; animation-delay: calc(var(--i, 0) * .08s); }
body.clm #tiles.clm-in #tW7:not(.zero) .l svg { animation: clm-bell .9s ease-in-out both; animation-delay: .45s; transform-origin: 50% 10%; }
body.clm #body.clm-rows > .item { animation: clm-row .45s var(--clm-ease) both; animation-delay: calc(.15s + var(--i, 0) * .05s); }
body.clm #body.clm-rows > .grp { animation: clm-fade .4s ease-out both; animation-delay: calc(.1s + var(--i, 0) * .05s); }
body.clm #cal.clm-open #body .item.soon .dd, body.clm #cal.clm-open #body .item.today .dd { animation: clm-flip .7s var(--clm-ease) both; animation-delay: calc(.45s + var(--i, 0) * .05s); transform-origin: 50% 0; }
/* ② */
body.clm #body .item.clm-today, body.clm #body .cell.clm-today { animation: clm-breathe 1.4s ease-in-out 3; }
.clm-conf { position: absolute; z-index: 150; width: 0; height: 0; pointer-events: none; }
.clm-conf i { position: absolute; left: -3px; top: -4px; width: 6px; height: 9px; border-radius: 2px; background: var(--t-pink, var(--accent)); opacity: 0; animation: clm-confetti 1.2s cubic-bezier(.2, .7, .3, 1) both; }
.clm-conf i:nth-child(3n+1) { background: var(--t-amber, var(--accent)); }
.clm-conf i:nth-child(3n+2) { background: var(--t-blue, var(--accent)); }
.clm-conf i:nth-child(1) { --a: -80deg; --d: 54px; } .clm-conf i:nth-child(2) { --a: -50deg; --d: 62px; } .clm-conf i:nth-child(3) { --a: -20deg; --d: 48px; }
.clm-conf i:nth-child(4) { --a: 10deg; --d: 58px; } .clm-conf i:nth-child(5) { --a: 40deg; --d: 44px; } .clm-conf i:nth-child(6) { --a: 70deg; --d: 52px; }
.clm-conf i:nth-child(7) { --a: 100deg; --d: 60px; } .clm-conf i:nth-child(8) { --a: 130deg; --d: 46px; } .clm-conf i:nth-child(9) { --a: 160deg; --d: 56px; }
.clm-conf i:nth-child(10) { --a: 190deg; --d: 50px; } .clm-conf i:nth-child(11) { --a: 220deg; --d: 62px; } .clm-conf i:nth-child(12) { --a: 250deg; --d: 44px; }
/* ③ */
body.clm #body.clm-next, body.clm #body.clm-prev { overflow-x: clip; }   /* 밀려 들어오는 동안 가로 스크롤이 생기지 않게 */
body.clm #body.clm-next .grid, body.clm #body.clm-next .mhead b, body.clm #body.clm-next #mSum { animation: clm-in-r .45s var(--clm-ease) both; }
body.clm #body.clm-prev .grid, body.clm #body.clm-prev .mhead b, body.clm #body.clm-prev #mSum { animation: clm-in-l .45s var(--clm-ease) both; }
/* ④ */
body.clm #body.clm-wave .grid .cell:not(.blank) { animation: clm-cell .4s var(--clm-spring) both; animation-delay: calc(var(--w, 0) * .03s); }
body.clm #body.clm-wave .grid .cell.clm-today { animation: clm-cell .4s var(--clm-spring) both, clm-breathe 1.4s ease-in-out .5s 3; animation-delay: calc(var(--w, 0) * .03s), .5s; }
/* ⑤ */
body.clm #body .cell.clm-pick { animation: clm-tap .45s var(--clm-spring) both; }
body.clm #body.clm-day #dayHead { animation: clm-fade .3s ease-out both; }
body.clm #body.clm-day .grid ~ .item { animation: clm-drop .45s var(--clm-ease) both; animation-delay: calc(.08s + var(--i, 0) * .06s); }
/* ⑥ */
body.clm #sheet.clm-fade { animation: clm-fade .3s ease-out both; }
body.clm #sheet .sheet-in.clm-up { animation: clm-pop-s .4s var(--clm-spring) both; }
@media (max-width: 600px) { body.clm #sheet .sheet-in.clm-up { animation: clm-rise .42s var(--clm-ease) both; } }
body.clm #body .item.clm-new { animation: clm-drop .5s var(--clm-spring) both, clm-glow 1.5s ease-out both; }

@keyframes clm-pop { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; transform: scale(1.05); } 100% { opacity: 1; transform: none; } }
@keyframes clm-pop-s { 0% { opacity: 0; transform: scale(.92); } 100% { opacity: 1; transform: none; } }
@keyframes clm-bell { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-15deg); } 45% { transform: rotate(11deg); } 60% { transform: rotate(-7deg); } 75% { transform: rotate(3deg); } }
@keyframes clm-row { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes clm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes clm-flip { 0% { transform: perspective(300px) rotateX(0); } 45% { transform: perspective(300px) rotateX(-88deg); } 55% { transform: perspective(300px) rotateX(-88deg); } 100% { transform: perspective(300px) rotateX(0); } }
@keyframes clm-breathe { 0%, 100% { outline: 3px solid transparent; outline-offset: 0; } 50% { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 3px; } }   /* 칸 그림자는 화면이 !important 로 잡고 있어 테두리 밖 선으로 */
@keyframes clm-confetti { 0% { opacity: 1; transform: rotate(var(--a)) translateX(4px) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) translateY(18px) rotate(240deg); } }
@keyframes clm-in-r { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes clm-in-l { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes clm-cell { 0% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: none; } }
@keyframes clm-tap { 0% { transform: scale(1); } 40% { transform: scale(.9); } 100% { transform: none; } }
@keyframes clm-drop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes clm-rise { from { opacity: .4; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes clm-glow { 0% { outline: 3px solid var(--t-green, var(--accent)); outline-offset: 2px; } 100% { outline: 3px solid transparent; outline-offset: 8px; } }

@media (prefers-reduced-motion: reduce) {
  #tiles *, #tiles .tile, #body, #body *, #sheet, #sheet .sheet-in, .clm-conf i { animation: none !important; }
  .clm-conf { display: none; }
}
@media print { #tiles .tile, #body *, .clm-conf { animation: none !important; } .clm-conf { display: none; } }
