@charset "utf-8";

/* ================================================================
   공통 인터랙션 — html.motion 일 때만 (기기의 '동작 줄이기'가 켜져 있으면 reset_head.php 가 붙이지 않는다)
   - [data-split]  제목: 글자(chars)·단어(words)가 차례로 떠오른다. 제목 안 <em>(캐치!)은 마지막에 위로 톡
                   (흐림·회전은 쓰지 않는다 — 옆 글자들이 서로 다른 흐림 단계로 겹쳐 지글거리고, 기운 글자는 테두리가 깨진다)
   - [data-reveal] 블록: 아래에서 살짝 올라오며 나타난다 (화면 밖이면 스크롤로 들어올 때). ="pop" 은 커지며
   - .m-item       결과 카드: 차례로 (js/result.js 가 붙인다)
   - .m-tap        칩·사업자구분 카드를 고르면 톡
   - 페이지 이동    헤더는 그대로, 본문만 교차 페이드 (View Transitions — 지원 브라우저만, 나머지는 그냥 이동)
   JS 는 js/motion.js. 애니메이션은 backwards 로만 채운다 — 끝나면 원래 스타일로 돌아가야
   남은 translate 가 쌓임 맥락을 만들어 드롭다운 목록이 아래 버튼 밑으로 깔리지 않는다.
   ================================================================ */
:root {
  --m-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 처음 상태: 숨김 (motion.js 가 차례로 보인다) ---------- */
.motion [data-split]:not(.is-split),
.motion [data-reveal]:not(.is-in) {
  opacity: 0;
}

/* motion.js 가 돌지 못하면 2.5초 뒤 그냥 보인다 (스크롤 대기 중인 .is-wait 는 제외) */
.motion [data-split]:not(.is-split),
.motion [data-reveal]:not(.is-in):not(.is-wait) {
  animation: m-show 0s linear 2.5s forwards;
}

/* ---------- 제목: 글자·단어 ---------- */
.motion .m-word {
  display: inline-block;   /* 단어 안에서 줄이 갈리지 않게 */
}

.motion .m-unit {
  display: inline-block;
  animation: m-rise 0.5s var(--m-ease) backwards;
}

.motion .m-accent {
  display: inline-block;
  animation: m-accent 0.6s ease-out backwards;
}

/* ---------- 블록 ---------- */
.motion [data-reveal].is-in,
.motion .m-item {
  animation: m-up 0.7s var(--m-ease) backwards;
}

.motion [data-reveal="pop"].is-in {
  animation-name: m-pop;
}

/* ---------- 고를 때 · 누를 때 ---------- */
.motion .m-tap {
  animation: m-tap 0.3s var(--m-ease);
}

.motion .biz__box.m-tap .biz__check {
  animation: m-check 0.4s var(--m-ease);
}

.motion .btn-primary {
  transition: background-color var(--transition), scale 0.15s var(--m-ease);
}

.motion .btn-primary:active {
  scale: 0.98;
}

.motion .dropdown__list:not([hidden]) {
  animation: m-drop 0.2s ease-out backwards;
}
/* 결과 화면 조건 박스(MO)는 js/result.js 가 높이·투명도를 열 때·닫을 때 모두 움직인다 */

.motion .dropdown.is-up .dropdown__list:not([hidden]) {
  animation-name: m-drop-up;   /* 위로 열 때는 아래(버튼 쪽)에서 올라온다 */
}

/* ---------- 키프레임 (transform 대신 translate·scale 을 써서 다른 transform 과 겹치지 않게) ---------- */
@keyframes m-show {
  to { opacity: 1; }
}

@keyframes m-rise {
  from { opacity: 0; translate: 0 0.35em; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes m-accent {
  0%   { translate: 0 0; }
  35%  { translate: 0 -0.16em; }
  65%  { translate: 0 0.03em; }
  100% { translate: 0 0; }
}

@keyframes m-up {
  from { opacity: 0; translate: 0 20px; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes m-pop {
  0%   { opacity: 0; scale: 0.6; }
  60%  { opacity: 1; scale: 1.06; }
  100% { opacity: 1; scale: 1; }
}

@keyframes m-tap {
  from { scale: 0.94; }
  to   { scale: 1; }
}

@keyframes m-check {
  0%   { scale: 0; }
  60%  { scale: 1.25; }
  100% { scale: 1; }
}

@keyframes m-drop {
  from { opacity: 0; translate: 0 -6px; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes m-drop-up {
  from { opacity: 0; translate: 0 6px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ---------- 페이지 사이 이동 ---------- */
@view-transition {
  navigation: auto;
}

.site-header {
  view-transition-name: site-header;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
