/* TOEX "Giấy kem" – hệ chuyển động dùng chung (20/11/2026, chặng D). Chỉ translate / scale / opacity.
   Nội dung mặc định LUÔN hiện: trạng thái đầu chỉ nằm trong keyframes (backwards), không có opacity:0 sẵn.
   Tắt khi prefers-reduced-motion hoặc html.tc-nhe (chế độ nhẹ). Bật bằng tc-motion.js (gắn data-tc-in lúc chạy). */
:root{--tc-fast:120ms;--tc-base:180ms;--tc-enter:240ms;--tc-out:cubic-bezier(.2,.75,.25,1);--tc-shift:8px;--tc-press:1px;--tc-step:36ms}
[data-tc-in]{--tc-i:0}

@keyframes tc-paper{from{translate:0 var(--tc-shift);opacity:.75}}
@keyframes tc-fade{from{opacity:.75}}
@keyframes tc-rule{from{scale:0 1}}
@keyframes tc-fade-in{from{opacity:0}to{opacity:1}}
@keyframes tc-fade-out{from{opacity:1}to{opacity:0}}

/* Nhấn: dịch (1px,1px) – dùng thuộc tính translate nên không đụng transform/hover sẵn có */
:is(.tc-touch,.btn,.sp-btn,.nut,.al-nut,.duo-btn,.hero-lich,.btn-hero,.cm-btn,.t-btn,.skill-card,.tri,.al-game,.lib-row,.lib-all,.topic,.tile,.v-card,.test-card,.gt-kh,.gt-eco,.el-tab,.soc-btn,.pl-btn,.join,.side-promo,button.submit,button.google):active{translate:var(--tc-press) var(--tc-press)}
@media (hover:hover){:is(.tc-touch,.btn,.sp-btn,.nut,.al-nut,.duo-btn,.hero-lich,.btn-hero,.cm-btn,.t-btn,.skill-card,.tri,.al-game,.lib-row,.lib-all,.topic,.tile,.v-card,.test-card,.gt-kh,.gt-eco,.el-tab,.soc-btn,.pl-btn,.join,.side-promo,button.submit,button.google):active{translate:calc(var(--tc-press)*2) calc(var(--tc-press)*2)}}

@media (prefers-reduced-motion:no-preference){
  /* Đặt giấy + so le (chỉ số --tc-i 0–3, tối đa 108ms) */
  html:not(.tc-nhe) .tc-in{animation:tc-paper var(--tc-enter) var(--tc-out) calc(var(--tc-i,0)*var(--tc-step)) backwards}
  /* Gạch mực dưới tiêu đề điểm nhấn */
  html:not(.tc-nhe) .tc-ink{position:relative}
  html:not(.tc-nhe) .tc-ink::after{content:"";position:absolute;left:0;bottom:-8px;width:min(100%,160px);height:3px;background:#121212;transform-origin:left;scale:0 1}
  html:not(.tc-nhe) .tc-in .tc-ink::after{scale:1;animation:tc-rule var(--tc-enter) var(--tc-out) 120ms backwards}
  /* Đổi nội dung / chọn */
  html:not(.tc-nhe) .tc-swap{animation:tc-fade var(--tc-fast) var(--tc-out)}
  /* Mở giấy: hộp thoại, xếp mở, FAQ */
  html:not(.tc-nhe) dialog.tc-dialog[open]{animation:tc-paper var(--tc-base) var(--tc-out)}
  html:not(.tc-nhe) details.tc-fold[open]>:not(summary){animation:tc-paper var(--tc-base) var(--tc-out) backwards}
  html:not(.tc-nhe) .hd.mo .tl>div{animation:tc-paper var(--tc-base) var(--tc-out) backwards}
  /* Chuyển trang cùng origin: mờ 120ms, không chuyển động nhóm */
  @view-transition{navigation:auto}
  ::view-transition-group(root){animation:none}
  ::view-transition-old(root){animation:tc-fade-out 120ms both}
  ::view-transition-new(root){animation:tc-fade-in 120ms both}
  html.tc-nhe::view-transition-old(root),html.tc-nhe::view-transition-new(root){animation:none}
}
