/* Bản thử hiệu ứng trang chủ (27/11/2026, anh #3393/#3396). Chỉ nạp khi ?fx=1.
 * Chỉ dùng opacity/transform/clip-path (không đổi bố cục → không CLS). Tắt hẳn khi người dùng chọn giảm chuyển động. */
@media (prefers-reduced-motion: no-preference) {

  /* 1. Khung "Công trình tiêu biểu": thẻ hiện dần so le + ảnh lớn phóng chậm, trôi nhẹ (Ken Burns) */
  .rot-grid .rt { animation: fxTileIn .9s cubic-bezier(.2,.7,.2,1) both; }
  .rot-grid .rot-rest .rt:nth-child(1) { animation-delay: .08s; }
  .rot-grid .rot-rest .rt:nth-child(2) { animation-delay: .16s; }
  .rot-grid .rot-rest .rt:nth-child(3) { animation-delay: .24s; }
  .rot-grid .rot-rest .rt:nth-child(4) { animation-delay: .32s; }
  .rot-grid .rot-rest .rt:nth-child(5) { animation-delay: .40s; }
  @keyframes fxTileIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

  .rt.big.on img { transform: none; animation: fxKB 7s ease-out both; }
  @keyframes fxKB { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.09) translate(-1.2%, -1%); } }

  /* 2. Rê chuột / chạm: ảnh phóng nhẹ, nền tối dần, chữ trượt lên, hiện "Xem dự án" */
  .rt img { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
  .rt:hover img, .rt:focus-visible img { transform: scale(1.07); }
  .rt.big.on:hover img { animation-play-state: paused; }
  .rt::after { transition: opacity .5s ease; }
  .rt:hover::after { opacity: .92; }
  .rt .t { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
  .rt:hover .t, .rt:focus-visible .t { transform: translateY(-6px); }
  .rt:not(.big) .more { display: inline-block; margin-top: 6px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid #fff; padding-bottom: 3px; opacity: 0; transform: translateY(6px); transition: opacity .4s ease, transform .4s ease; }
  .rt:not(.big):hover .more, .rt:not(.big):focus-visible .more { opacity: 1; transform: none; }
  .rt.big .more { transition: letter-spacing .4s ease; }
  .rt.big:hover .more { letter-spacing: .2em; }

  /* 3. Hiện dần khi cuộn: mượt và sâu hơn */
  .reveal { transform: translateY(34px); transition: opacity .95s cubic-bezier(.2,.7,.2,1), transform .95s cubic-bezier(.2,.7,.2,1); }
  .reveal.visible { transform: none; }

  /* 5. Cặp 3D / thực tế: 3D vào trước, ảnh thực tế "mở màn" từ trái sang phải */
  .pair.is-on .pair-img:first-child { animation: fxSlideIn .9s cubic-bezier(.2,.7,.2,1) both; }
  .pair.is-on .pair-img:last-child { animation: fxWipe 1.1s cubic-bezier(.6,.05,.2,1) .45s both; }
  .pair.is-on .pair-img:last-child span { animation: fxPop .5s ease 1.4s both; }
  .pair-img img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
  .pair-img:hover img { transform: scale(1.05); }
  @keyframes fxSlideIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
  @keyframes fxWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes fxPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

  /* Thẻ dịch vụ, bài viết: ảnh phóng nhẹ khi rê chuột */
  .service-page-image img { transition: transform .9s cubic-bezier(.2,.7,.2,1); }
  .service-card:hover .service-page-image img { transform: scale(1.05); }

  /* Dải con số: gạch chân chạy khi hiện */
  .fact { position: relative; }
  .fact::after { content: ''; position: absolute; left: 0; bottom: -10px; height: 2px; width: 36px; background: var(--green, #6a9a49); transform: scaleX(0); transform-origin: left; transition: transform 1s cubic-bezier(.2,.7,.2,1) .3s; }
  .fact.fx-in::after { transform: scaleX(1); }
}
