/* 누르는 느낌과 기다리는 동안의 신호. 값은 tokens.css 가, 규칙은 여기가 들고,
   여섯 화면(회계·일정·관리·허브·가입·로그인)이 함께 읽는다(2026-10-02 사용자 결정 —
   "정적인게 많은건 별로야").

   선택자를 좁게 잡지 않는 이유: 단추 하나가 새로 생길 때마다 빠지면 화면마다 반응이 달라진다.
   누를 수 있는 요소 전체에 걸고, 면적이 큰 카드만 더 얕게 준다.

   '동작 줄이기'를 켠 기기에서는 tokens.css 가 시간과 비율을 1ms · 1 로 바꿔 전부 멈춘다 —
   여기서 다시 media query 를 쓰지 않는다. 키프레임만 아래에서 따로 끈다. */

button,
summary,
[role="tab"] {
  transition:
    scale var(--motion-press),
    background-color var(--motion-ui),
    border-color var(--motion-ui),
    box-shadow var(--motion-ui),
    color var(--motion-ui);
}

button:active:not(:disabled),
summary:active,
[role="tab"]:active {
  scale: var(--press-scale);
}

/* 카드로 보이는 단추 — 홈 숫자 타일 · 결재 월 카드 · 허브 바로가기 · 구역 카드.
   그림자도 띄울 때 한 단계 든다(테두리 대신 그림자를 쓰는 2026-09-16 결정과 같은 결). */
.home-fig:active,
.am-cell:active,
.hub-card:active,
.zone-card:active,
.schedule-card-row:active {
  scale: var(--press-scale-card);
}

.home-fig:hover,
.am-cell:hover,
.hub-card:hover {
  box-shadow: 0 1px 2px rgb(19 26 42 / 6%), 0 12px 28px rgb(19 26 42 / 10%);
}

/* ---------- 기다리는 동안 ---------- */

/* 단추 안에서 도는 점(1~2초짜리 저장). 글자를 '저장 중…'으로 바꾸거나 점을 글자 옆에 세우면
   단추 폭이 튀어 옆 줄까지 밀린다 — 폭을 먼저 재서 고정하고 그 안에서 글자를 점으로 바꾼다
   (busy-button.js). 이름은 aria-label 로 남는다. */
.busy-dot {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  border-radius: var(--r-pill);
  border: 2px solid currentcolor;
  border-top-color: transparent;
  opacity: 0.85;
  animation: busy-turn 620ms linear infinite;
}

@keyframes busy-turn {
  to { rotate: 360deg; }
}

button.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

/* 자리가 정해진 기다림 — 곧 올 모양을 미리 세워 둔다. 빈 화면이 잠깐 보였다 한 번에
   바뀌는 것보다, 자리가 먼저 서고 내용이 들어오는 편이 덜 흔들린다. */
.bone {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--c-sunken, #f4f6fb);
}

.bone::after {
  content: "";
  position: absolute;
  inset: 0;
  translate: -100% 0;
  background: linear-gradient(90deg, rgb(255 255 255 / 0%), rgb(255 255 255 / 70%), rgb(255 255 255 / 0%));
  animation: bone-sheen 1.25s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes bone-sheen {
  to { translate: 100% 0; }
}

/* 새로 들어오는 줄 — 한 덩어리로 올라온다. 줄마다 차례로 띄우지는 않는다(스무 줄이면 읽기 방해). */
.enter-up {
  animation: enter-up var(--motion-enter) both;
}

@keyframes enter-up {
  from { translate: 0 10px; opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}

/* 끝난 순간의 신호 — 한 번 올라왔다 가라앉는다. */
.settle {
  animation: settle 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes settle {
  0% { translate: 0 6px; opacity: 0.4; }
  55% { translate: 0 -2px; opacity: 1; }
  100% { translate: 0 0; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .busy-dot,
  .bone::after,
  .enter-up,
  .settle {
    animation: none;
  }
}
