/* ============================================================
   EFFECTS — canvases, reveal, animations, reduced motion
   ============================================================ */
/* canvas là phần tử thay thế: inset:0 KHÔNG kéo giãn nó, phải đặt rõ width/height —
   thiếu hai dòng này canvas chỉ rộng 300×150 nên lá rơi dồn một góc và bị cắt thành khung chữ nhật */
.fx-global{position:fixed; inset:0; width:100%; height:100%; z-index:1; pointer-events:none; opacity:.9}
.fireworks-wrap{position:fixed; inset:0; z-index:1500; pointer-events:none; opacity:0; transition:opacity .6s}
.fireworks-wrap.is-on{opacity:1}
.fireworks-wrap canvas{width:100%; height:100%}

/* reveal on scroll */
[data-reveal]{opacity:0; transform:translateY(34px); transition:opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay:var(--d,0ms)}
[data-reveal].is-in{opacity:1; transform:none}
[data-reveal="left"]{transform:translateX(-40px)}
[data-reveal="right"]{transform:translateX(40px)}
[data-reveal="zoom"]{transform:scale(.9)}
[data-reveal].is-in{transform:none}

/* shimmering gold text */
.shimmer{
  background:linear-gradient(100deg,#b8912f 0%,#f7e9be 20%,#fffaf0 30%,#e8c877 42%,#b8912f 60%);
  background-size:250% 100%; -webkit-background-clip:text; background-clip:text;
  color:transparent; -webkit-text-fill-color:transparent; animation:shimmer 6s linear infinite;
}
@keyframes shimmer{to{background-position:-250% 0}}

/* glowing pulse */
@keyframes floaty{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}
@keyframes floaty-slow{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes pulse{0%,100%{opacity:.5; transform:scale(1)}50%{opacity:1; transform:scale(1.08)}}
@keyframes flicker{0%,100%{opacity:.85}40%{opacity:1}60%{opacity:.7}80%{opacity:.95}}
@keyframes riseFade{from{opacity:0; transform:translateY(24px)}to{opacity:1; transform:none}}
@keyframes scaleIn{from{opacity:0; transform:scale(.9)}to{opacity:1; transform:none}}
@keyframes heroEnter{from{opacity:0; transform:translateY(40px) scale(.97); filter:blur(8px)}to{opacity:1; transform:none; filter:none}}

body.is-open .hero__frame > *{animation:heroEnter 1.2s var(--ease-out) both}
body.is-open .hero__frame > *:nth-child(1){animation-delay:.1s}
body.is-open .hero__frame > *:nth-child(2){animation-delay:.2s}
body.is-open .hero__frame > *:nth-child(3){animation-delay:.3s}
body.is-open .hero__frame > *:nth-child(4){animation-delay:.42s}
body.is-open .hero__frame > *:nth-child(5){animation-delay:.54s}
body.is-open .hero__frame > *:nth-child(6){animation-delay:.66s}
body.is-open .hero__frame > *:nth-child(7){animation-delay:.78s}
body.is-open .hero__frame > *:nth-child(8){animation-delay:.9s}
body.is-open .hero__frame > *:nth-child(9){animation-delay:1s}

/* countdown flip tick */
.cd__num.is-tick{animation:tick .5s var(--ease)}
@keyframes tick{0%{transform:translateY(0); opacity:1}45%{transform:translateY(-42%); opacity:0}50%{transform:translateY(42%); opacity:0}100%{transform:translateY(0); opacity:1}}

/* wish card pop-in */
.wish{animation:scaleIn .6s var(--ease-out) both}

/* gold dust vignette */
.hero__glow{
  position:absolute; inset:0; pointer-events:none; z-index:2;
  background:radial-gradient(46% 40% at 50% 45%, rgba(24,3,3,.62), rgba(24,3,3,.22) 62%, transparent 78%),
             radial-gradient(120% 80% at 50% 118%, rgba(0,0,0,.78), transparent 62%),
             linear-gradient(180deg, rgba(24,3,3,.55), transparent 26%, transparent 62%, rgba(0,0,0,.6));
}

/* selection ring for choice */
.choice__opt input:checked + span{border-color:var(--gold-300); background:rgba(212,175,55,.16); color:var(--gold-100); box-shadow:0 0 0 1px rgba(232,200,119,.4) inset}

/* gallery tilt layers */
.gallery__item{will-change:transform}

/* chế độ xem nhanh khi phát triển (?bare=1) */
.is-bare .cover,.is-bare .preloader{display:none!important}
.is-bare [data-reveal]{opacity:1!important; transform:none!important}

/* reduced motion */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; scroll-behavior:auto!important}
  [data-reveal]{opacity:1!important; transform:none!important}
}

/* Trên màn hình hẹp, reveal theo chiều dọc để không đẩy nội dung tràn ngang */
@media (max-width:760px){
  [data-reveal="left"], [data-reveal="right"]{transform:translateY(26px)}
}
