/* nx 움직임(nx1). 모션 담당만 고친다. 짝 = nx-motion.js. 기준 = 문서/개편_실반영_20261110/04_모션_설계.md
   1. 모든 규칙은 html[data-fx="on"] body[data-nx] 아래(줄인 움직임은 html[data-fx="reduce"]) · 641px 이상에서만. 폰은 아무것도 하지 않는다.
   2. 이름은 mv- 로 시작한다. 색은 ec.css 의 --ec-* 만 쓴다(새 색 없음). 움직이는 것은 transform · opacity 뿐.
   3. 달력 · 메모 화면 안쪽에는 닿지 않는다(바깥 틀의 메뉴 전환만 지나간다).
   4. 옛 움직임 파일에 같은 장면이 있으면 여기서 body[data-nx] 아래로 그 장면만 끈다(옛 파일은 고치지 않는다). 이 줄을 지우면 옛 장면이 그대로 돌아온다. */
@media (min-width: 641px) {
  /* ---- 길이 · 곡선(04 B) ---- */
  html[data-fx="on"] body[data-nx], html[data-fx="reduce"] body[data-nx] {
    --mv-t1: 120ms; --mv-t2: 240ms; --mv-t3: 420ms; --mv-t4: 700ms; --mv-t5: 1100ms; --mv-t6: 1800ms;
    --mv-out: cubic-bezier(0.16, 1, 0.3, 1);
    --mv-glide: cubic-bezier(0.65, 0, 0.35, 1);
    --mv-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
    --mv-spring2: cubic-bezier(0.34, 1.36, 0.64, 1);
    --mv-exit: cubic-bezier(0.4, 0, 1, 1);
  }
  @supports (animation-timing-function: linear(0, 1)) {
    html[data-fx="on"] body[data-nx] {
      --mv-spring2: linear(0, 0.101, 0.319, 0.561, 0.771, 0.926, 1.023, 1.071, 1.084, 1.075, 1.057, 1.037, 1.019, 1.006, 0.998, 0.994, 0.993, 0.994, 0.995, 0.997, 0.998, 0.999, 1);
    }
  }

  /* ---- 옛 장면 끄기(같은 장면을 nx-motion.js 가 대신 한다) ---- */
  /* 화면 나타남(motion.css fx-page · deskfx2.css dfx2-page · ec.css moxPageReveal). 달력 · 메모는 그대로 둔다 */
  html[data-fx="on"] body[data-nx] .main > .page.on:not(#page-calendar):not(#page-memo),
  html[data-fx="reduce"] body[data-nx] .main > .page.on:not(#page-calendar):not(#page-memo) { animation: none; }
  /* 옆 창 들어옴(ec.css moxPaneSlideIn) */
  html[data-fx="on"] body[data-nx] .ec .twrap.split .tbox.det,
  html[data-fx="reduce"] body[data-nx] .ec .twrap.split .tbox.det { animation: none; }
  /* 카드 차례로(ec.css moxCascadeIn) · 신호등 톡(ec.css moxStampPop 가운데 신호등만).
     옛 장면은 끝난 모양(translateY(0))을 붙든 채 남는다. 끝난 화면이 운영판과 점 하나까지 같도록 그 끝 모양만 그대로 붙든다(움직임은 없다) */
  @keyframes mv-still { from, to { opacity: 1; transform: translateY(0); } }
  html[data-fx="on"] body[data-nx] :is(.vz-kpi, .vz-box, .ec-ts-card, .tiles > div)[style*="--mox-i"],
  html[data-fx="reduce"] body[data-nx] :is(.vz-kpi, .vz-box, .ec-ts-card, .tiles > div)[style*="--mox-i"] { animation: mv-still 1ms both; animation-delay: 0s; }
  html[data-fx="on"] body[data-nx] .bd-sig, html[data-fx="reduce"] body[data-nx] .bd-sig { animation: none; }
  /* 단추 눌림(ec.css · motion.css 의 :active 0.97): 눌림과 튕겨 돌아옴을 nx-motion.js 가 한다. 운영판 눌림을 꺼 두지 않으면 둘이 겹쳐 0.97 x 0.97 = 0.9409 가 된다(실측).
     motion.css 의 눌림 규칙에는 :not(#page-analysis *) 가 들어 있어 무게가 높다: 여기도 같은 무게의 :not(#...) 로 이긴다.
     이쪽이 누르는 것 가운데 운영판 눌림이 걸리는 종류만 적는다(위쪽 메뉴 · 현황판 단추 · 범위 카드. 옆 메뉴 · 현황판 숫자 카드는 운영판 눌림이 없어 그대로 둔다).
     달력 · 메모 안쪽은 뺀다(nx-motion.js 가 그 안에서는 누름을 하지 않으므로 운영판 눌림이 그대로 남아야 한다). 실측: 지금 그 안에 맞는 요소는 0개 */
  html[data-fx="on"] body[data-nx] :is(.ec .btn, .ec .seg button, .xl-inline-ribbon .xl-btn, #nav > a[data-menu], .bd-ubtn, .bd-nbtn, .ar-scope-card, .vz-sec-row):active:not(:disabled):not(#page-calendar *, #page-memo *) { transform: none; }

  /* ---- 28 알림 · 확인 창(달력 · 메모 화면에서는 걸지 않는다) ---- */
  @keyframes mv-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
  @keyframes mv-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes mv-slide { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
  @keyframes mv-fade { from { opacity: 0; } to { opacity: 1; } }
  /* 통합검색 창은 운영판이 끝난 뒤에도 제자리 변형 값을 쥐고 있다. 끝 모습을 운영판과 같게 두려고 같은 끝값을 쥔다(안 쥐면 글자 가장자리가 다르게 그려진다, 11-10 실측) */
  @keyframes mv-pop-k { from { opacity: 0; transform: translateY(-6px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
  @keyframes mv-fade-k { from { opacity: 0; transform: translateY(0) scale(1); } to { opacity: 1; transform: translateY(0) scale(1); } }
  html[data-fx="on"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) .ff-drw-panel { animation: mv-slide var(--mv-t3) var(--mv-spring2) backwards; }
  html[data-fx="on"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) .ff-drw-backdrop { animation: mv-fade var(--mv-t2) var(--mv-out) backwards; }
  html[data-fx="on"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) .ff-cmdk-backdrop { animation: mv-fade var(--mv-t2) var(--mv-out) both; }
  html[data-fx="on"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) .ff-cmdk-dialog { animation: mv-pop-k var(--mv-t3) var(--mv-spring) both; }
  html[data-fx="on"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) dialog.ui-dialog[open]:not(#page-calendar *):not(#page-memo *):not(.au-host *) { animation: mv-pop var(--mv-t3) var(--mv-spring) backwards; }
  html[data-fx="on"] body[data-nx] .xl-inline-ribbon .xl-toast:not([hidden]) { animation: mv-rise var(--mv-t3) var(--mv-spring2) backwards; }
  /* 줄인 움직임: 투명도만 120ms */
  html[data-fx="reduce"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) :is(.ff-drw-panel, .ff-drw-backdrop),
  html[data-fx="reduce"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) dialog.ui-dialog[open]:not(#page-calendar *):not(#page-memo *):not(.au-host *),
  html[data-fx="reduce"] body[data-nx] .xl-inline-ribbon .xl-toast:not([hidden]) { animation: mv-fade var(--mv-t1) linear backwards; }
  html[data-fx="reduce"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) .ff-cmdk-backdrop { animation: mv-fade var(--mv-t1) linear both; }
  html[data-fx="reduce"] body[data-nx]:not([data-page="calendar"]):not([data-page="memo"]) .ff-cmdk-dialog { animation: mv-fade-k var(--mv-t1) linear both; }

  /* ---- 02 메뉴 전환 · 19 밝게 · 어둡게(화면 넘김 층. mv-vt- 표시는 nx-motion.js 가 넘기는 동안만 html 에 붙였다 뗀다) ---- */
  html.mv-vt-page[data-fx="on"] body[data-nx] .main { view-transition-name: mv-main; }
  html.mv-vt-page::view-transition, html.mv-vt-theme::view-transition { pointer-events: none; }
  html.mv-vt-page::view-transition-old(root), html.mv-vt-page::view-transition-new(root),
  html.mv-vt-theme::view-transition-old(root), html.mv-vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  html.mv-vt-theme::view-transition-new(root) { z-index: 2; }
  html.mv-vt-page::view-transition-group(mv-main) { animation: none; overflow: clip; }
  html.mv-vt-page::view-transition-image-pair(mv-main) { isolation: auto; }
  html.mv-vt-page::view-transition-old(mv-main), html.mv-vt-page::view-transition-new(mv-main) { animation: none; mix-blend-mode: normal; }

  /* ---- 잠깐 쓰고 지우는 조각(mv-ghost-). body 맨 끝에 놓였다가 장면이 끝나면 사라진다. 누름은 그대로 통과한다 ---- */
  html[data-fx="on"] body[data-nx] .mv-ghost, html[data-fx="reduce"] body[data-nx] .mv-ghost {
    position: fixed; z-index: 2147483000; margin: 0; padding: 0; border: 0; box-sizing: border-box; pointer-events: none; user-select: none; contain: layout style;
  }
  html[data-fx="on"] body[data-nx] .mv-ghost-line { height: 2px; background: var(--ec-brand); transform-origin: 0 50%; }
  html[data-fx="on"] body[data-nx] .mv-ghost-bar { width: 3px; background: var(--ec-brand); }
  html[data-fx="on"] body[data-nx] .mv-ghost-band { background: var(--ec-sel); }
  /* 27 줄 빛 띠: 운영판 줄 올림 색과 같은 색. 글자는 가리지 않고 바탕만 물든다(밝은 화면은 어둡게만, 어두운 화면은 밝게만 섞는다) */
  html[data-fx="on"] body[data-nx] .mv-ghost-hover { background: var(--ec-hover); mix-blend-mode: darken; }
  html[data-fx="on"][data-theme="dark"] body[data-nx] .mv-ghost-hover { mix-blend-mode: lighten; }
  html[data-fx="on"] body[data-nx] .mv-ghost-wipe { background: var(--ec-tint-info); transform-origin: 0 50%; }
  html[data-fx="on"] body[data-nx] .mv-ghost-edge { background: var(--ec-brand); }
  html[data-fx="on"] body[data-nx] .mv-ghost-tag,
  html[data-fx="reduce"] body[data-nx] .mv-ghost-tag {
    padding: 2px 8px; border: 1px solid var(--ec-good); border-radius: 4px; background: var(--ec-tint-good); color: var(--ec-fg); font-size: 12px; font-weight: 700; line-height: 16px; white-space: nowrap;
  }
  html[data-fx="on"] body[data-nx] .mv-ghost-text { display: flex; align-items: center; overflow: hidden; white-space: pre; font-variant-numeric: tabular-nums lining-nums; }
  html[data-fx="on"] body[data-nx] .mv-ghost-text :is(i, b, u) { font: inherit; font-style: normal; text-decoration: none; color: inherit; }
  html[data-fx="on"] body[data-nx] .mv-ghost-text > i { display: inline-block; position: relative; overflow: hidden; white-space: pre; }
  html[data-fx="on"] body[data-nx] .mv-ghost-text > i > b { display: inline-block; position: relative; }
  html[data-fx="on"] body[data-nx] .mv-ghost-text > i > b > u { position: absolute; left: 0; right: 0; text-align: center; }
  html[data-fx="on"] body[data-nx] .mv-ghost-title { white-space: nowrap; transform-origin: 0 0; }
  /* 20 불러오는 중(화면 칸이 통째로 비어 있을 때만): 줄 높이의 뼈대 + 한 번 지나가는 빛 */
  html[data-fx="on"] body[data-nx] .mv-ghost-skel, html[data-fx="reduce"] body[data-nx] .mv-ghost-skel { overflow: hidden; padding: 44px 0 0; }
  html[data-fx="on"] body[data-nx] .mv-ghost-skel > i, html[data-fx="reduce"] body[data-nx] .mv-ghost-skel > i {
    display: block; height: 12px; margin: 0 12px 16px; border-radius: 3px; background: var(--ec-hover);
  }
  html[data-fx="on"] body[data-nx] .mv-ghost-skel > b { position: absolute; top: 0; bottom: 0; left: 0; width: 36%; background: linear-gradient(90deg, transparent, var(--ec-sel), transparent); opacity: 0.7; }
}
/* 어두운 화면을 기기 설정으로 쓰는 경우(위 묶음과 같은 조건) */
@media (min-width: 641px) and (prefers-color-scheme: dark) {
  html[data-fx="on"]:not([data-theme="light"]) body[data-nx] .mv-ghost-hover { mix-blend-mode: lighten; }
}
