/* Ảnh minh hoạ 3D đầu trang (js/core/hero-art.js). Ảnh được JS co vừa khung nên không bao giờ bị cắt. */
.hart{--eo:cubic-bezier(.23,1,.32,1);--spring:cubic-bezier(.34,1.56,.64,1);--mx:50%;--my:35%;
  position:relative;margin:0;flex:none;display:grid;place-items:center;width:var(--hart-w);height:var(--hart-h);
  perspective:1100px;transform-style:preserve-3d;container-type:size;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
.hart-lg{--hart-w:min(52%,640px);--hart-h:520px}
.hart-md{--hart-w:min(46%,440px);--hart-h:360px}
.hart-sm{--hart-w:280px;--hart-h:240px}
.hart > *{grid-area:1/1}

/* ----- các lớp ----- */
.hart-tilt{position:relative;display:grid;place-items:center;width:100%;height:100%;transform-style:preserve-3d;will-change:transform}
.hart-float,.hart-sway,.hart-breath{display:grid;place-items:center;transform-style:preserve-3d}
.hart-float{animation:hartFloat 5.6s ease-in-out infinite}
.hart-sway{animation:hartSway 7.3s ease-in-out infinite}
.hart-breath{transform-origin:50% 100%;animation:hartBreath 5.6s ease-in-out infinite}
.hart-pic{position:relative;display:grid;opacity:0}
.hart-pic > *{grid-area:1/1;width:100%;height:100%}
.hart-pic img{display:block;object-fit:contain;filter:drop-shadow(0 26px 30px rgba(0,0,0,.38));transition:transform .35s var(--eo)}
/* bóng màu khu phía sau ảnh: trượt ngược chiều nghiêng, tạo chiều sâu */
.hart-ghost{-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  background:var(--c,#3b82f6);filter:blur(26px);opacity:.55;transform:translateY(18px) scale(.96);pointer-events:none}

.hart-glow{width:72%;height:72%;border-radius:50%;pointer-events:none;align-self:center;justify-self:center;
  background:radial-gradient(closest-side,color-mix(in srgb,var(--c,#3b82f6) 70%,#fff 0%),transparent 72%);
  filter:blur(22px);opacity:.7;animation:hartGlow 6.5s ease-in-out infinite}
.hart-wave{width:60%;aspect-ratio:1;border-radius:50%;pointer-events:none;align-self:center;justify-self:center;
  border:2px solid color-mix(in srgb,var(--c,#3b82f6) 50%,#fff);opacity:0}
.hart-shadow{align-self:end;justify-self:center;width:50%;height:26px;margin-bottom:2%;border-radius:50%;pointer-events:none;
  background:radial-gradient(closest-side,rgba(0,0,0,.55),transparent);animation:hartShadow 5.6s ease-in-out infinite}

/* viên bi bay vòng quanh theo quỹ đạo 3D (nửa sau bị ảnh che) */
.hart-orbit{width:86%;aspect-ratio:1;align-self:center;justify-self:center;border-radius:50%;pointer-events:none;transform-style:preserve-3d;
  border:1.5px dashed color-mix(in srgb,var(--c,#3b82f6) 40%,rgba(255,255,255,.3));
  transform:rotateX(74deg) rotateZ(0);animation:hartOrbit 14s linear infinite}
.hart-orbit b{position:absolute;width:16px;height:16px;border-radius:50%;left:50%;top:50%;margin:-8px;
  background:radial-gradient(circle at 32% 30%,#fff 0 18%,color-mix(in srgb,var(--c,#3b82f6) 85%,#fff) 40%,color-mix(in srgb,var(--c,#3b82f6) 70%,#000) 100%);
  box-shadow:0 0 14px color-mix(in srgb,var(--c,#3b82f6) 70%,transparent);
  transform:rotateZ(calc(var(--k) * 120deg)) translateY(-43cqw) rotateZ(calc(var(--k) * -120deg)) rotateX(-74deg)}
.hart-orbit b:nth-child(2){width:11px;height:11px;margin:-5.5px;background:radial-gradient(circle at 32% 30%,#fff 0 20%,#ffd166 45%,#f59e0b 100%);box-shadow:0 0 12px #fbbf24aa}
.hart-orbit b:nth-child(3){width:9px;height:9px;margin:-4.5px;background:radial-gradient(circle at 32% 30%,#fff 0 20%,#f9a8d4 45%,#ec4899 100%);box-shadow:0 0 12px #f472b6aa}

/* tia lấp lánh 4 cánh */
.hart-spark{position:relative;width:16px;height:16px;pointer-events:none;opacity:0;background:#fff;
  clip-path:polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%);
  animation:hartTwinkle 3.4s ease-in-out infinite;animation-delay:calc(1.2s + var(--i) * .55s)}
.hart-spark:nth-of-type(1){align-self:start;justify-self:start;margin:12% 0 0 12%}
.hart-spark:nth-of-type(2){align-self:start;justify-self:end;margin:6% 16% 0 0;width:11px;height:11px}
.hart-spark:nth-of-type(3){align-self:end;justify-self:end;margin:0 8% 24% 0;width:18px;height:18px}
.hart-spark:nth-of-type(4){align-self:end;justify-self:start;margin:0 0 18% 8%;width:10px;height:10px}
.hart-spark:nth-of-type(5){align-self:center;justify-self:end;margin:0 1% 8% 0;width:9px;height:9px}
.hart-spark:nth-of-type(6){align-self:start;justify-self:center;margin:2% 0 0 -24%;width:12px;height:12px}

/* ----- xuất hiện (một lần) ----- */
.hart.ready .hart-pic{opacity:1;animation:hartPop 1s var(--spring) both}
.hart.ready .hart-glow{animation:hartFlare 1.1s var(--eo) both,hartGlow 6.5s ease-in-out 1.1s infinite}
.hart.ready .hart-wave{animation:hartWave 1.1s var(--eo) .15s both}
.hart.ready .hart-spark{animation:hartBurst .9s var(--eo) calc(.25s + var(--i) * .04s) both,hartTwinkle 3.4s ease-in-out calc(1.4s + var(--i) * .55s) infinite}
.hart.ready .hart-orbit{animation:hartOrbitIn 1.2s var(--eo) .2s both,hartOrbit 14s linear 1.4s infinite}

/* ----- tương tác ----- */
.hart.hot .hart-pic img{transform:scale(1.04)}
.hart.boing .hart-breath{animation:hartBoing .7s var(--spring),hartBreath 5.6s ease-in-out .7s infinite}

@keyframes hartPop{0%{opacity:0;transform:translateY(40px) scale(.55) rotate(-10deg);filter:blur(10px)}55%{opacity:1;filter:blur(0)}100%{opacity:1;transform:none;filter:blur(0)}}
@keyframes hartFlare{0%{transform:scale(.3);opacity:0}45%{transform:scale(1.25);opacity:1}100%{transform:scale(1);opacity:.7}}
@keyframes hartWave{0%{transform:scale(.4);opacity:.9}100%{transform:scale(1.6);opacity:0}}
@keyframes hartBurst{0%{opacity:0;transform:translate(calc((var(--i) - 2.5) * -18px),40px) scale(.2) rotate(-90deg)}60%{opacity:1}100%{opacity:0;transform:none}}
@keyframes hartOrbitIn{from{opacity:0;transform:rotateX(74deg) rotateZ(-160deg) scale(.5)}to{opacity:1;transform:rotateX(74deg) rotateZ(0) scale(1)}}
@keyframes hartFloat{0%,100%{transform:translateY(4px)}50%{transform:translateY(-16px)}}
@keyframes hartSway{0%,100%{transform:rotate(-2deg) rotateY(-5deg)}50%{transform:rotate(2deg) rotateY(5deg)}}
@keyframes hartBreath{0%,100%{transform:scale(1.015,.985)}50%{transform:scale(.995,1.01)}}
@keyframes hartShadow{0%,100%{transform:scale(1);opacity:.95}50%{transform:scale(.74);opacity:.5}}
@keyframes hartGlow{0%,100%{transform:scale(1);opacity:.6}50%{transform:scale(1.1);opacity:.9}}
@keyframes hartOrbit{from{transform:rotateX(74deg) rotateZ(0)}to{transform:rotateX(74deg) rotateZ(360deg)}}
@keyframes hartTwinkle{0%,100%{opacity:0;transform:scale(.3) rotate(0)}40%{opacity:1;transform:scale(1) rotate(45deg)}60%{opacity:.85;transform:scale(.9) rotate(70deg)}}
@keyframes hartBoing{0%{transform:scale(1)}20%{transform:scale(1.12,.86)}45%{transform:scale(.9,1.12)}70%{transform:scale(1.04,.97)}100%{transform:scale(1)}}

/* ----- bố cục ----- */
.ws-hero.ws-street:has(> .hart){min-height:580px;overflow:visible}
.ws-hero.ws-street > .hart{position:absolute;right:2%;top:50%;margin-top:calc(var(--hart-h) / -2);z-index:2;--hart-w:min(44%,620px);--hart-h:540px}
.art-head{position:relative;display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 18px;padding:10px 20px 10px 32px;min-height:380px;
  border-radius:26px;border:1px solid var(--gl-line,rgba(255,255,255,.1));
  background:radial-gradient(60% 110% at 80% 50%,color-mix(in srgb,var(--c,#3b82f6) 28%,transparent),transparent 70%),rgba(8,16,40,.45);backdrop-filter:blur(14px)}
.art-head .art-copy{min-width:0;max-width:620px}
.art-head .tool-title{margin:8px 0 8px}
.art-head .tool-desc{margin:0}
.art-head .crumb{margin:0}
.ws-hero.st-hero{display:flex;align-items:center;gap:20px;overflow:visible;padding-top:24px;padding-bottom:24px}
.st-hero > .hart{margin-left:auto}
.empty.nf{display:flex;flex-direction:column;align-items:center;gap:6px}

@media (max-width:980px){
  .ws-hero.ws-street:has(> .hart){min-height:0}
  .ws-hero.ws-street > .hart{position:relative;right:auto;top:auto;margin:0 auto -10px;--hart-w:min(94%,460px);--hart-h:380px}
  .art-head,.ws-hero.st-hero{flex-direction:column-reverse;align-items:stretch;min-height:0}
  .art-head > .hart,.st-hero > .hart{margin:0 auto;--hart-w:min(94%,360px);--hart-h:300px}
}

/* Cài đặt Chuyển động của app: "Tắt" thì đứng yên */
html[data-motion=off] .hart *{animation:none!important}
html[data-motion=off] .hart-pic{opacity:1}
html[data-motion=off] .hart-spark{opacity:.7}
/* app.css tắt mọi hiệu ứng khi Windows bật "giảm chuyển động"; ảnh đầu trang vẫn chạy (chỉ dừng khi chọn Tắt) */
html[data-motion=reduced] .hart-float{animation:hartFloat 5.6s ease-in-out infinite!important}
html[data-motion=reduced] .hart-sway{animation:hartSway 7.3s ease-in-out infinite!important}
html[data-motion=reduced] .hart-breath{animation:hartBreath 5.6s ease-in-out infinite!important}
html[data-motion=reduced] .hart.boing .hart-breath{animation:hartBoing .7s cubic-bezier(.34,1.56,.64,1),hartBreath 5.6s ease-in-out .7s infinite!important}
html[data-motion=reduced] .hart-shadow{animation:hartShadow 5.6s ease-in-out infinite!important}
html[data-motion=reduced] .hart.ready .hart-pic{animation:hartPop 1s cubic-bezier(.34,1.56,.64,1) both!important}
html[data-motion=reduced] .hart.ready .hart-glow{animation:hartFlare 1.1s cubic-bezier(.23,1,.32,1) both,hartGlow 6.5s ease-in-out 1.1s infinite!important}
html[data-motion=reduced] .hart.ready .hart-wave{animation:hartWave 1.1s cubic-bezier(.23,1,.32,1) .15s both!important}
html[data-motion=reduced] .hart.ready .hart-spark{animation:hartBurst .9s cubic-bezier(.23,1,.32,1) calc(.25s + var(--i) * .04s) both,hartTwinkle 3.4s ease-in-out calc(1.4s + var(--i) * .55s) infinite!important}
html[data-motion=reduced] .hart.ready .hart-orbit{animation:hartOrbitIn 1.2s cubic-bezier(.23,1,.32,1) .2s both,hartOrbit 14s linear 1.4s infinite!important}
html[data-motion=reduced] .hart-pic img{transition:transform .35s cubic-bezier(.23,1,.32,1)!important}
