/* ============================================================
   fx.css — lớp trình bày cho js/fx.js (xem chú thích API ở đầu fx.js)
   Chỉ dùng translate/scale/rotate/opacity/filter; không đụng layout.
   ============================================================ */

/* ---------- trái tim vàng dùng chung (phong bì, màn kết) ----------
   Hình: 2 cung tròn + mũi nhọn. --fx-heart-foil = vàng lá đặc, --fx-heart-line = viền vàng mảnh. */
:root {
  --fx-heart-foil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 0 34 30'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%238A6224'/%3E%3Cstop offset='.42' stop-color='%23D9B66E'/%3E%3Cstop offset='.58' stop-color='%23F3DEA4'/%3E%3Cstop offset='.78' stop-color='%23C99A4B'/%3E%3Cstop offset='1' stop-color='%238A6224'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 28L2.64 15.94A8 8 0 1 1 16 10A8 8 0 1 1 29.36 15.94Z' fill='url(%23g)' stroke='%238A6224' stroke-opacity='.45' stroke-width='.6' stroke-linejoin='round'/%3E%3C/svg%3E");
  --fx-heart-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 0 34 30'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%238A6224'/%3E%3Cstop offset='.45' stop-color='%23D9B66E'/%3E%3Cstop offset='.6' stop-color='%23E9CF8E'/%3E%3Cstop offset='1' stop-color='%23A27B3E'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M16 28L2.64 15.94A8 8 0 1 1 16 10A8 8 0 1 1 29.36 15.94Z' fill='none' stroke='url(%23g)' stroke-width='1.9' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- lớp toàn cục ---------- */
.fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 40;               /* dưới thanh điều hướng/nhạc (50–55), trên nội dung */
  pointer-events: none;
}
.fx-glow {
  position: fixed; left: 0; top: 0; z-index: 39;
  width: 440px; height: 440px; margin: -220px 0 0 -220px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side,
    rgba(243, 222, 164, .55) 0%,
    rgba(239, 227, 204, .35) 32%,
    rgba(217, 182, 110, .10) 62%,
    rgba(217, 182, 110, 0) 100%);
  /* QA2: quầng nằm TRÊN nội dung → dùng soft-light để làm ấm, không phủ mờ chữ */
  mix-blend-mode: soft-light;
  opacity: 0; transition: opacity .7s ease;
  will-change: transform;
}
.fx-glow.is-on { opacity: 1; }

/* ---------- data-fx="rise" — "nổi lên" ---------- */
/* !important: đè trạng thái của .reveal hay CSS section khi 2 cơ chế chồng nhau; gỡ ngay khi xong */
html.fx-on .fx-rise {
  opacity: 0 !important;
  translate: 0 40px !important;
  scale: .96 !important;
  filter: blur(8px) !important;
  will-change: opacity, translate, filter;
}
html.fx-on .fx-rise.fx-in {
  opacity: 1 !important;
  translate: none !important;
  scale: none !important;
  filter: none !important;
}
html.fx-reduce .fx-rise,
html.fx-reduce .fx-rise.fx-in { translate: none !important; scale: none !important; filter: none !important; }

/* vệt ánh kim cho chữ không phải gold-text */
.fx-shine {
  position: absolute; inset: -.1em -.2em; overflow: hidden;
  pointer-events: none; border-radius: 4px;
}
.fx-shine i {
  position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, rgba(255,250,236,0) 0%, rgba(255,247,226,.75) 45%, rgba(239,214,160,.45) 55%, rgba(255,250,236,0) 100%);
  transform: translate3d(-120%, 0, 0) skewX(-12deg);
  animation: fx-band 1.3s cubic-bezier(.45, 0, .2, 1) forwards;
}
@keyframes fx-band { to { transform: translate3d(330%, 0, 0) skewX(-12deg); } }

/* ---------- data-fx="tilt" — thẻ nghiêng 3D ---------- */
.fx-tilt { will-change: rotate, translate; backface-visibility: hidden; }
.fx-tshadow {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 22px 44px -18px rgba(138, 98, 36, .42), 0 6px 16px -6px rgba(59, 51, 43, .14);
  opacity: 0; transition: opacity .45s cubic-bezier(.22, 1, .36, 1);
}
.fx-glare {
  position: absolute; inset: 0; z-index: 6; border-radius: inherit; overflow: hidden;
  pointer-events: none; opacity: 0; transition: opacity .45s ease;
}
.fx-glare i {
  position: absolute; left: 0; top: 0; width: 200%; height: 200%;
  background: radial-gradient(circle at 50% 50%,
    rgba(255, 250, 232, .26) 0%,
    rgba(243, 222, 164, .16) 14%,
    rgba(217, 182, 110, .06) 28%,
    rgba(217, 182, 110, 0) 42%);
  mix-blend-mode: soft-light; /* QA2: vệt sáng không còn rửa trôi chữ vàng trên thẻ */
  will-change: transform;
}
.fx-tilting > .fx-tshadow,
.fx-tilting > .fx-glare { opacity: 1; }

/* ---------- giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-canvas, .fx-glow, .fx-glare, .fx-tshadow, .fx-shine { display: none !important; }
}
