/* chuyencuabach.com — hinh minh hoa & hieu ung chuyen dong */

/* ---------- hero 2 cot + man hinh ung dung ---------- */
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-art { position: relative; height: 440px; perspective: 1000px; }
h1 em { white-space: nowrap; }
.hero-art .layer { transition: transform .25s ease-out; will-change: transform; }
.hero-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-lines path {
  fill: none; stroke: var(--accent); stroke-width: 2; opacity: .35;
  stroke-dasharray: 6 10; animation: dash 18s linear infinite;
}
.hero-lines path + path { stroke: var(--muted); opacity: .25; animation-duration: 24s; }
@keyframes dash { to { stroke-dashoffset: -400; } }

.app {
  position: absolute; left: 8%; top: 40px; width: 78%;
  background: var(--bg); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .25);
  overflow: hidden;
}
.app-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.app-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.app-bar i:first-child { background: var(--accent); }
.app-bar span { margin-left: 10px; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.app-bar span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; margin-right: 6px; }
.app-body { padding: 20px 18px 26px; display: grid; gap: 12px; min-height: 250px; align-content: start; }
.msg {
  max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45;
  opacity: 0; transform: translateY(8px); animation: chat 12s infinite;
}
.msg.bot { background: var(--bg-soft); border: 1px solid var(--line); border-bottom-left-radius: 4px; justify-self: start; }
.msg.me { background: var(--accent); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.m1 { animation-delay: 0s; } .m2 { animation-delay: .9s; } .m3 { animation-delay: 1.8s; } .m4 { animation-delay: 2.7s; }
@keyframes chat {
  0% { opacity: 0; transform: translateY(8px); }
  5%, 85% { opacity: 1; transform: none; }
  95%, 100% { opacity: 0; transform: translateY(-4px); }
}
.typing { display: flex; gap: 5px; padding: 14px; width: max-content; }
.typing b { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing b:nth-child(2) { animation-delay: .15s; }
.typing b:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.chip {
  position: absolute; background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .3); font-size: 13px;
}
.chip-lead { right: 0; top: 6px; display: flex; gap: 10px; align-items: center; animation: float 6s ease-in-out infinite; }
.chip-lead strong { display: block; font-size: 13px; line-height: 1.3; }
.chip-lead small { color: #16a34a; font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.chip-chart { right: 2%; bottom: 40px; width: 170px; animation: float 7s ease-in-out infinite reverse; }
.chip-chart small { color: var(--muted); font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin-top: 8px; }
.bars i { flex: 1; border-radius: 4px 4px 0 0; background: var(--line); height: var(--h); transform-origin: bottom; animation: grow 3s ease-in-out infinite alternate; }
.bars i:last-child { background: var(--accent); }
.bars i:nth-child(2) { animation-delay: .2s; }
.bars i:nth-child(3) { animation-delay: .4s; }
.bars i:nth-child(4) { animation-delay: .6s; }
@keyframes grow { from { transform: scaleY(.55); } to { transform: scaleY(1); } }
.chip-auto { left: 0; bottom: 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); animation: float 8s ease-in-out infinite; }
.spin { display: inline-block; color: var(--accent); animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* ---------- dai cong nghe chay ngang ---------- */
.marquee {
  overflow: hidden; border-block: 1px solid var(--line); padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 44px; width: max-content; animation: marquee 40s linear infinite; }
.marquee span { font-family: var(--mono); font-size: 14px; color: var(--muted); white-space: nowrap; }
.marquee span::before { content: "◆"; color: var(--accent); margin-right: 10px; font-size: 10px; vertical-align: 2px; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- the dich vu: den soi theo chuot ---------- */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.card:hover::before { opacity: 1; }
.card .ico { transition: transform .3s; }
.card:hover .ico { transform: rotate(-8deg) scale(1.1); }

/* ---------- hien dan khi cuon ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.card.reveal.in:hover { transform: translateY(-2px); transition-delay: 0s; }
.step { position: relative; }
.step::after {
  content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 0; background: var(--accent);
  transition: width 1s ease; transition-delay: calc(var(--d, 0s) + .3s);
}
.step.in::after { width: 100%; }

/* ---------- hinh minh hoa SVG ---------- */
.ill-box {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 22px; max-width: 340px; transition: transform .3s ease;
}
.ill { width: 100%; height: auto; display: block; overflow: visible; }
.ill .fr { fill: var(--bg); stroke: var(--line); stroke-width: 2; }
.ill .frA { fill: var(--accent); }
.ill .sf { fill: var(--bg-soft); stroke: var(--line); stroke-width: 1.5; }
.ill .ac { fill: var(--accent); }
.ill .acs { stroke: var(--accent); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ill .mu { fill: var(--muted); opacity: .35; }
.ill .ln { stroke: var(--muted); stroke-opacity: .45; stroke-width: 2; fill: none; }
.ill .dash { stroke-dasharray: 5 6; }
.ill .hl { stroke: var(--accent); }
.ill .cursor { fill: var(--text); stroke: var(--bg); stroke-width: 1.2; }
.ill .seq { opacity: 0; animation: seq 6s infinite; }
.ill .s2 { animation-delay: .8s; }
.ill .s3 { animation-delay: 1.6s; }
.ill .s4 { animation-delay: 2.4s; }
@keyframes seq { 0% { opacity: 0; transform: translateY(6px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.ill .dot { transform-box: fill-box; animation: bounce 1.2s infinite; }
.ill .d2 { animation-delay: .15s; }
.ill .d3 { animation-delay: .3s; }
.ill .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.ill .slide { animation: slide 5s ease-in-out infinite; }
@keyframes slide {
  0%, 20% { transform: none; opacity: 1; }
  45%, 70% { transform: translate(74px, -32px); opacity: 1; }
  95%, 100% { transform: translate(148px, 0); opacity: 0; }
}
.ill .flow { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 6 8; animation: dash 6s linear infinite; }
.ill .bar { transform-box: fill-box; transform-origin: bottom; animation: grow 2.4s ease-in-out infinite alternate; }
.ill .b2 { animation-delay: .2s; }
.ill .b3 { animation-delay: .4s; }
.ill .b4 { animation-delay: .6s; }
.ill .b5 { animation-delay: .8s; }
.ill .draw {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 4s ease-in-out infinite;
}
@keyframes draw { 0% { stroke-dashoffset: 220; } 50%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -220; } }
.contact-ill { margin: 10px 0 0; max-width: 300px; display: block !important; }

/* ---------- responsive / giam chuyen dong ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { height: 400px; max-width: 520px; width: 100%; }
}
@media (max-width: 640px) {
  .hero-art { height: 430px; }
  .app { left: 0; width: 94%; top: 30px; }
  .chip-lead { right: 0; top: -14px; }
  .chip-chart { width: 130px; right: 0; bottom: 0; }
  .chip-auto { display: none; }
  .ill-box { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .msg, .ill .seq, .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- cum nut lien he noi: Zalo / Facebook / Goi ---------- */
.float-contacts {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.fc { display: flex; align-items: center; gap: 10px; }
.fc-btn {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  position: relative; transition: transform .2s; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45);
}
.fc-btn svg { width: 26px; height: 26px; }
.fc-btn b { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.fc:hover .fc-btn { transform: scale(1.08); }
.fc-zalo .fc-btn { background: #0068ff; }
.fc-fb .fc-btn { background: linear-gradient(135deg, #00b2ff, #006aff 45%, #a033ff 80%, #ff5c87); }
.fc-call .fc-btn { background: #16a34a; }
.fc-call .fc-btn svg { fill: none; animation: shake 2.4s ease-in-out infinite; }
@keyframes shake {
  0%, 60%, 100% { transform: rotate(0); }
  65%, 75%, 85% { transform: rotate(-14deg); }
  70%, 80%, 90% { transform: rotate(14deg); }
}
/* vong song lan toa */
.fc-btn::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor;
  animation: ring 2.2s ease-out infinite; pointer-events: none;
}
.fc-zalo .fc-btn::after { color: #0068ff; }
.fc-fb .fc-btn::after { color: #006aff; animation-delay: .7s; }
.fc-call .fc-btn::after { color: #16a34a; animation-delay: 1.4s; }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
/* nhan chu hien khi re chuot */
.fc-label {
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; white-space: nowrap;
  padding: 6px 12px; border-radius: 8px; opacity: 0; transform: translateX(8px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.fc:hover .fc-label, .fc:focus-visible .fc-label { opacity: 1; transform: none; }
@media (max-width: 640px) {
  .float-contacts { right: 14px; bottom: 14px; gap: 10px; }
  .fc-btn { width: 48px; height: 48px; }
  .fc-btn svg { width: 22px; height: 22px; }
  .fc-label { display: none; }
}

/* ---------- khoi goi dien truc tiep (trang Lien he) ---------- */
.call-panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--navy); color: #fff; border-radius: 20px; padding: 40px;
  display: grid; gap: 18px; align-content: start;
}
.call-panel::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(200deg, #000, transparent 70%);
}
.call-panel::after {
  content: ""; position: absolute; z-index: -1; width: 360px; height: 360px; right: -120px; top: -140px;
  border-radius: 50%; background: rgba(255, 77, 94, .35); filter: blur(70px);
}
.call-panel .eyebrow { color: #ff8a96; margin: 0; }
.call-panel h2 { margin: 0; color: #fff; }
.call-sub { color: #b9c2d6; max-width: 46ch; }
.call-big {
  display: flex; align-items: center; gap: 18px; width: max-content; max-width: 100%;
  background: #16a34a; color: #fff; padding: 16px 30px 16px 16px; border-radius: 999px;
  box-shadow: 0 16px 36px -12px rgba(22, 163, 74, .7); transition: transform .2s, box-shadow .2s;
}
.call-big:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 22px 44px -12px rgba(22, 163, 74, .8); }
.call-big small { display: block; font-size: 13px; opacity: .85; font-weight: 500; }
.call-big strong { display: block; font-size: clamp(26px, 4vw, 34px); letter-spacing: .02em; line-height: 1.15; }
.call-ico {
  width: 60px; height: 60px; border-radius: 50%; background: #fff; color: #16a34a;
  display: grid; place-items: center; position: relative; flex: none;
}
.call-ico svg { width: 28px; height: 28px; animation: shake 2.4s ease-in-out infinite; }
.call-ico::before, .call-ico::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff;
  animation: ring 2s ease-out infinite;
}
.call-ico::after { animation-delay: 1s; }
.call-alt { display: flex; gap: 10px; flex-wrap: wrap; }
.call-alt .btn { color: #fff; border-color: rgba(255,255,255,.22); padding: 10px 16px; font-size: 14px; }
.call-alt .btn:hover { background: rgba(255,255,255,.08); }
.call-alt .btn svg { width: 18px; height: 18px; }
.call-panel .note { color: #97a1b6; }
@media (max-width: 640px) {
  .call-panel { padding: 28px 22px; }
  .call-big { padding: 12px 22px 12px 12px; gap: 14px; }
  .call-ico { width: 50px; height: 50px; }
}

/* =====================================================================
   NEN CONG NGHE
   ===================================================================== */
.hero, .page-head { position: relative; isolation: isolate; overflow: hidden; }
.page-head { padding-bottom: 48px; }

/* luoi diem + mang hat (canvas do JS chen vao) */
.tech-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* quang sang mo troi cham */
.orb { position: absolute; z-index: -2; border-radius: 50%; filter: blur(70px); pointer-events: none; opacity: .55; }
.orb.o1 { width: 420px; height: 420px; right: -80px; top: -60px; background: color-mix(in srgb, var(--accent) 30%, transparent); animation: drift 16s ease-in-out infinite; }
.orb.o2 { width: 360px; height: 360px; left: 30%; bottom: -200px; background: rgba(59, 130, 246, .22); animation: drift 20s ease-in-out infinite reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-60px, 40px); } }

/* duong quet ngang (scan line) */
.scan {
  position: absolute; left: 0; right: 0; height: 120px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 7%, transparent), transparent);
  animation: scan 9s linear infinite;
}
@keyframes scan { from { top: -120px; } to { top: 100%; } }

/* hoa van mach dien cho khoi nen xam */
.section-soft { position: relative; isolation: isolate; overflow: hidden; }
.section-soft::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--accent); opacity: .1;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M0 40h40l20 20h40M100 60v40l20 20h40M20 160v-40l20-20h20M120 0v20l-20 20M60 60v-60'/%3E%3C/g%3E%3Cg fill='%23000'%3E%3Ccircle cx='100' cy='60' r='4'/%3E%3Ccircle cx='160' cy='120' r='4'/%3E%3Ccircle cx='60' cy='100' r='4'/%3E%3Ccircle cx='100' cy='40' r='3'/%3E%3Ccircle cx='60' cy='0' r='3'/%3E%3C/g%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M0 40h40l20 20h40M100 60v40l20 20h40M20 160v-40l20-20h20M120 0v20l-20 20M60 60v-60'/%3E%3C/g%3E%3Cg fill='%23000'%3E%3Ccircle cx='100' cy='60' r='4'/%3E%3Ccircle cx='160' cy='120' r='4'/%3E%3Ccircle cx='60' cy='100' r='4'/%3E%3Ccircle cx='100' cy='40' r='3'/%3E%3Ccircle cx='60' cy='0' r='3'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: 160px 160px; mask-size: 160px 160px;
}
.section-soft .card { background: color-mix(in srgb, var(--bg) 92%, transparent); }

/* khoi CTA: luoi + anh sang quet */
.cta { position: relative; overflow: hidden; isolation: isolate; }
.cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.cta::after {
  content: ""; position: absolute; z-index: -1; top: -50%; bottom: -50%; width: 220px; left: -240px;
  background: linear-gradient(90deg, transparent, rgba(255, 77, 94, .25), transparent);
  transform: rotate(18deg); animation: sweep 6s ease-in-out infinite;
}
@keyframes sweep { 0%, 30% { left: -240px; } 100% { left: 110%; } }

@media (prefers-reduced-motion: reduce) {
  .tech-canvas, .scan { display: none; }
}

/* chua cho nut Zalo khong che chan trang */
.site-footer { padding-bottom: 32px; }
.foot { padding-right: 80px; }

/* lam mo dan mep duoi phan dau trang de khong bi duong cat cung */
.hero::after, .page-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: -1; pointer-events: none;
  background: linear-gradient(transparent, var(--bg));
}

.call-panel { align-self: start; }
@media (max-width: 860px) {
  .contact .call-panel { order: -1; }   /* dien thoai: nut goi len dau */
  .contact-ill { display: none !important; }
}
