/* 글로이드 지면 공통 모션 — 2026-11-12 지록 「글로이드 사이트 전체적으로 모션이 들어갔는지 확인해줘, 안들어갔으면 어울리는 모션 넣어주고」
   정본: 작업 레포 docs/모션-공통-기준.md (누름 120~160ms scale .97 · 등장 240~320ms 아래→위 8px · 항목당 30ms 최대 8개 · transform/opacity 만 · reduced-motion 은 페이드 120ms)
   쓰는 곳: 서가 밖 지면(글 · 전자책 안내 · 스타일 · BGM · 약관). 서가(library.css)와 책 쪽(page-book-reader.css 등)은 자기 모션이 이미 있어 안 붙인다.
   - 모든 규칙은 :where() 로 우선순위 0 — 지면 CSS 에 transition·transform 이 있으면 그쪽이 이긴다(스타일 그림 칸의 들림 등)
   - 등장은 animation-fill-mode:backwards — 끝난 뒤엔 아무 값도 안 남긴다(fixed 창의 기준 상자가 바뀌지 않게) */
:root{--gm-ease:cubic-bezier(.2,.8,.2,1)}
@keyframes gm-rise{from{opacity:0;transform:translateY(8px)}}
@keyframes gm-fade{from{opacity:0}}
@keyframes gm-open{from{opacity:0;transform:scale(.98)}}

/* 손에 닿는 것 — 색·테두리·밑줄·그림자가 툭 바뀌지 않고 부드럽게 */
:where(a,button,summary,select,[role=button]){transition:color .16s var(--gm-ease),background-color .16s var(--gm-ease),border-color .16s var(--gm-ease),text-decoration-color .16s var(--gm-ease),box-shadow .16s var(--gm-ease),opacity .16s var(--gm-ease),transform .14s var(--gm-ease)}
:where(.card,.guide-card) :where(h2,.read,img){transition:color .16s var(--gm-ease),opacity .2s var(--gm-ease)}

/* 누름 — 단추·칩은 .97, 큰 카드는 .985(폰에서 한 줄을 다 차지해 덜 줄인다). 글 속 링크는 줄이지 않는다 */
:where(button:not(:disabled),[role=button],.guide-cta,.chip,.tbtn,.dl,.more,.lb-btn,.sp-copy,.fam-tabs button,.header-actions a):active{transform:scale(.97);transition-duration:.08s}
:where(a.card,a.guide-card):active{transform:scale(.985);transition-duration:.08s}

/* 처음 그릴 때 한 번 — 머리글은 그대로, 본문 덩어리만 아래에서 살짝 올라온다 */
:where(main)>:where(:not(article,script,style,template)),
:where(main>article)>*{animation:gm-rise .3s var(--gm-ease) backwards}
:where(main,main>article)>:nth-child(2){animation-delay:30ms}
:where(main,main>article)>:nth-child(3){animation-delay:60ms}
:where(main,main>article)>:nth-child(4){animation-delay:90ms}
:where(main,main>article)>:nth-child(5){animation-delay:120ms}
:where(main,main>article)>:nth-child(6){animation-delay:150ms}
:where(main,main>article)>:nth-child(7){animation-delay:180ms}
:where(main,main>article)>:nth-child(8){animation-delay:210ms}
:where(main,main>article)>:nth-child(n+9){animation-delay:240ms}

/* 카드 목록(글 목록 · 전자책 목록) — 목록 상자는 가만히, 카드가 차례로(앞 여덟 장만 · 그 뒤는 같이) */
:where(main)>:where(.grid,.guide-grid){animation:none}
:where(.grid,.guide-grid)>*{animation:gm-rise .3s var(--gm-ease) backwards;animation-delay:300ms}
:where(.grid,.guide-grid)>:nth-child(1){animation-delay:60ms}
:where(.grid,.guide-grid)>:nth-child(2){animation-delay:90ms}
:where(.grid,.guide-grid)>:nth-child(3){animation-delay:120ms}
:where(.grid,.guide-grid)>:nth-child(4){animation-delay:150ms}
:where(.grid,.guide-grid)>:nth-child(5){animation-delay:180ms}
:where(.grid,.guide-grid)>:nth-child(6){animation-delay:210ms}
:where(.grid,.guide-grid)>:nth-child(7){animation-delay:240ms}
:where(.grid,.guide-grid)>:nth-child(8){animation-delay:270ms}

/* 펼치기 — 자주 묻는 것 등 details 를 열면 안의 글이 살짝 올라온다 */
:where(details[open])>:where(:not(summary)){animation:gm-rise .24s var(--gm-ease) backwards}

/* 창이 열릴 때 — 스타일 그림 크게 보기 · 잠금 안내 · BGM 받기 안내 */
:where(.lb:not([hidden])){animation:gm-fade .22s var(--gm-ease)}
:where(.lb:not([hidden])) :where(.lb-pic){animation:gm-open .28s var(--gm-ease) backwards}
:where(.lockbox:not([hidden])){animation:gm-fade .22s var(--gm-ease)}
:where(.lockbox:not([hidden])) :where(.lock-card){animation:gm-rise .3s var(--gm-ease) backwards;animation-delay:40ms}
:where(.lockmsg:not([hidden]),.unlock-msg:not(:empty)){animation:gm-rise .24s var(--gm-ease) backwards}

/* 움직임 줄이기 — 전부 페이드 120ms 만 · 누름 줄어듦 없음 */
@media (prefers-reduced-motion:reduce){
  :where(main)>*,:where(main>article)>*,:where(.grid,.guide-grid)>*,:where(details[open])>*,
  :where(.lb:not([hidden])),:where(.lb:not([hidden])) :where(.lb-pic),:where(.lockbox:not([hidden])),:where(.lockbox:not([hidden])) :where(.lock-card),:where(.lockmsg,.unlock-msg){animation-name:gm-fade!important;animation-duration:.12s!important;animation-delay:0s!important}
  :where(button,[role=button],a,.chip,.tbtn,.dl):active{transform:none!important}
}
