:root {
  --violet: #6741d9;
  --violet-d: #5530c2;
  --violet-soft: #efe9ff;
  --ink: #26233a;
  --muted: #625d78;
  --line: #ebe6f6;
  --bg: #fffdf7;
  --tint: #f6f2ff;
  --card: #ffffff;
  --radius: 22px;
  --head: "Baloo 2", "Nunito", "Segoe UI", "Yu Gothic UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", "Yu Gothic UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font: 17px/1.65 var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
h3 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 1em; }
i { font-style: normal; font-family: var(--emoji); }
.wrap { width: min(1160px, 100% - 40px); margin: 0 auto; }
.narrow { width: min(820px, 100% - 40px); }
.center { text-align: center; }

/* ---------- nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 11px 20px; font: 800 15.5px var(--body); text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #fab005; outline-offset: 3px; }
.btn-lg { padding: 15px 26px; font-size: 17px; }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 8px 20px rgba(103, 65, 217, .3); }
.btn-primary:hover { background: var(--violet-d); box-shadow: 0 12px 26px rgba(103, 65, 217, .38); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9bcf5; }
.btn-dark { background: #26233a; color: #fff; }
.btn-dark:hover { background: #3a3555; }
.btn-white { background: #fff; color: var(--violet); box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }

/* ---------- thanh điều hướng ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255, 253, 247, .86); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; padding-top: env(safe-area-inset-top); }
.nav-in { display: flex; align-items: center; gap: 18px; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 24px var(--head); color: var(--violet); }
.brand.small { font-size: 18px; gap: 8px; }
.links { display: flex; gap: 4px; margin-left: auto; }
.links a { text-decoration: none; font-weight: 700; font-size: 15px; color: var(--muted); padding: 8px 12px; border-radius: 999px; }
.links a:hover { color: var(--violet); background: var(--violet-soft); }
.lang { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 15px; }
.lang select { border: 0; background: transparent; font: 700 14.5px var(--body); color: var(--ink); padding: 4px 2px; cursor: pointer; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 56px 0 72px; background-image: radial-gradient(#ebe2cf 1.5px, transparent 1.5px); background-size: 26px 26px; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.badge { display: inline-block; background: #fff3bf; color: #8a5a00; font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
h1 { font-size: clamp(38px, 5.6vw, 62px); font-weight: 800; margin-bottom: 18px; }
h1 em { font-style: normal; color: var(--violet); background: linear-gradient(transparent 62%, #ffe066 62%, #ffe066 90%, transparent 90%); padding: 0 .08em; }
.lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 16px; }
.note { font-size: 14.5px; color: var(--muted); font-weight: 600; }

.hero-art { position: relative; }
.map { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 30px rgba(60, 40, 120, .12)); }
.map text { font: 700 17px var(--body); fill: #fff; text-anchor: middle; }
.map text.big { font-size: 21px; font-weight: 800; }
.map text.emo { font-size: 16px; font-family: var(--emoji); }
.map .branches path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1s ease-out forwards; }
.map .branches path:nth-child(2) { animation-delay: .15s; }
.map .branches path:nth-child(3) { animation-delay: .3s; }
.map .branches path:nth-child(4) { animation-delay: .45s; }
.map .branches .twig { stroke-dasharray: 90; stroke-dashoffset: 90; animation-delay: 1.2s !important; }
.map .node, .map .leaf { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.map .center { animation-delay: 0s; }
.map .n1 { animation-delay: .7s; } .map .n2 { animation-delay: .85s; } .map .n3 { animation-delay: 1s; } .map .n4 { animation-delay: 1.15s; }
.map .leaf { animation-delay: 1.5s; }
.map .l2 { animation-delay: 1.6s; } .map .l3 { animation-delay: 1.7s; } .map .l4 { animation-delay: 1.8s; }
.hero-art svg { animation: float 6s ease-in-out 2s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- các phần ---------- */
.section { padding: 88px 0; }
.tinted { background: var(--tint); }
.kicker { display: inline-block; font-weight: 800; font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--violet); background: var(--violet-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.tinted .kicker { background: #fff; }
.head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.sub { color: var(--muted); font-size: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.two-col p { color: var(--muted); font-size: 18px; }

.steps { background: var(--card); border-radius: var(--radius); padding: 30px 30px 18px; box-shadow: 0 12px 40px rgba(60, 40, 120, .08); border: 1px solid var(--line); }
.steps ol { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 20px 60px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--c); color: #fff; font: 800 20px/42px var(--head); text-align: center; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 46px; bottom: 4px; width: 2px; background: var(--line); }
.steps li b { display: block; font-size: 17.5px; }
.steps li span { color: var(--muted); font-size: 15.5px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--card); border-radius: var(--radius); padding: 28px 26px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(60, 40, 120, .06); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(60, 40, 120, .12); }
.card i { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; font-size: 30px; background: color-mix(in srgb, var(--c) 14%, white); margin-bottom: 16px; }
.card h3 { color: var(--c); }
.card p { color: var(--muted); font-size: 16px; margin: 0; }
.who-title { text-align: center; margin: 56px 0 20px; font-size: 26px; }
.who { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.who div { background: #fff; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); }
.who i { font-size: 30px; margin-bottom: 6px; }
.who b { font-size: 16.5px; }
.who span { font-size: 14.5px; color: var(--muted); }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feat { padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.feat i { font-size: 32px; display: block; margin-bottom: 8px; }
.feat h3 { font-size: 18px; margin-bottom: .3em; }
.feat p { font-size: 15px; color: var(--muted); margin: 0; }

.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 980px; margin: 0 auto; }
.dl-card { background: var(--card); border-radius: 26px; padding: 34px 32px; border: 2px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; }
.dl-card.web { border-color: #c9bcf5; box-shadow: 0 16px 40px rgba(103, 65, 217, .14); }
.dl-icon { font-size: 40px; font-family: var(--emoji); width: 72px; height: 72px; display: grid; place-items: center; border-radius: 20px; background: var(--violet-soft); margin-bottom: 16px; }
.dl-card.win .dl-icon { background: #e7f5ff; }
.dl-card h3 { font-size: 26px; }
.dl-card p { color: var(--muted); }
.dl-card ul { list-style: none; padding: 0; margin: 0 0 24px; }
.dl-card li { padding-left: 30px; position: relative; margin-bottom: 6px; font-weight: 600; }
.dl-card li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: #d3f9d8; color: #2b8a3e; font: 800 12px/20px var(--body); text-align: center; }
.dl-card .btn { margin-top: auto; }
.fine { font-size: 13px; margin: 12px 0 0; }
.mobile-tip { display: none; text-align: center; margin: 22px auto 0; max-width: 520px; background: #fff3bf; border-radius: 16px; padding: 12px 16px; font-weight: 700; font-size: 15px; }

.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; font: 700 18px var(--head); padding: 18px 30px 18px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--violet-soft); color: var(--violet); font: 800 20px/28px var(--body); text-align: center; transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); font-size: 16px; }

.final { padding: 20px 0 90px; }
.final-in { background: linear-gradient(135deg, #6741d9, #9c36b5 60%, #e64980); color: #fff; border-radius: 32px; padding: 60px 30px; text-align: center; position: relative; overflow: hidden; }
.final-in::before, .final-in::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.final-in::before { width: 260px; height: 260px; left: -80px; top: -90px; }
.final-in::after { width: 200px; height: 200px; right: -50px; bottom: -80px; }
.final-in h2 { position: relative; }
.final-in p { position: relative; opacity: .9; font-size: 18px; }
.final-in .btn { position: relative; margin-top: 8px; }

.footer { border-top: 1px solid var(--line); padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); font-size: 14.5px; color: var(--muted); }
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.mobile-cta { display: none; }

/* hiện dần khi cuộn */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .map *, .hero-art svg { animation: none !important; stroke-dashoffset: 0 !important; }
}

/* ---------- máy tính bảng ---------- */
@media (max-width: 1020px) {
  .links { display: none; }
  .lang { margin-left: auto; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .who { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- điện thoại: gọn, một cột, nút dùng ngay luôn ở dưới ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .wrap { width: calc(100% - 32px); }
  .nav-in { height: 60px; gap: 10px; }
  .brand { font-size: 21px; }
  .brand img { width: 34px; height: 34px; }
  .lang { padding: 3px 4px 3px 10px; }
  .lang select { font-size: 14px; max-width: 108px; }
  .nav-cta { display: none; }
  .hero { padding: 26px 0 40px; }
  .hero-in { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .hero-art { order: -1; max-width: 400px; margin: 0 auto; width: 100%; }
  .lead { font-size: 17px; margin: 0 auto; }
  .cta-row { flex-direction: column; margin: 22px 0 12px; }
  .cta-row .btn { width: 100%; }
  .section { padding: 56px 0; }
  .head { margin-bottom: 28px; }
  .two-col { grid-template-columns: 1fr; gap: 26px; }
  .two-col p, .sub { font-size: 16.5px; }
  .steps { padding: 22px 18px 8px; }
  .grid3, .grid4 { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 20px; display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: start; }
  .card i { width: 52px; height: 52px; font-size: 26px; margin: 0; grid-row: span 2; }
  .card h3 { font-size: 18px; margin-bottom: .2em; }
  .card p { font-size: 15px; }
  .feat { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 16px; }
  .feat i { grid-row: span 2; font-size: 28px; margin: 0; }
  .who { grid-template-columns: 1fr 1fr; gap: 10px; }
  .who div { padding: 14px; }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-card { padding: 24px 20px; }
  .dl-card .btn { width: 100%; }
  .faq details { padding: 0 16px; }
  .faq summary { font-size: 16.5px; }
  .final { padding-bottom: 40px; }
  .final-in { padding: 40px 20px; border-radius: 24px; }
  .final-in .btn { width: 100%; }
  .footer-in { flex-direction: column; text-align: center; }

  .mobile-cta { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 253, 247, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .mobile-cta .btn { width: 100%; }
}

/* Trên điện thoại cảm ứng: ưu tiên bản web, bản Windows xếp sau */
body.is-mobile .win-only { display: none; }
body.is-mobile .dl-card.win { order: 2; opacity: .85; }
body.is-mobile .mobile-tip { display: block; }

/* ---------- tải bản Windows ---------- */
.dl-meta { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; min-height: 1.4em; }
.dl-alt { font-size: 14.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.dl-alt:hover { color: var(--violet); }
.dl-card .fine { display: flex; gap: 6px; align-items: flex-start; }

/* hộp hướng dẫn sau khi bấm tải */
#dl-guide { width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 32px); border: 0; border-radius: 26px; padding: 28px 28px 22px; color: var(--ink); background: #fff; box-shadow: 0 30px 80px rgba(30, 20, 70, .35); overflow: auto; }
#dl-guide::backdrop { background: rgba(35, 25, 70, .5); backdrop-filter: blur(3px); }
#dl-guide[open] { animation: g-in .22s ease-out; }
@keyframes g-in { from { transform: translateY(14px) scale(.97); opacity: 0; } }
.g-close-x { position: absolute; right: 14px; top: 14px; margin: 0; }
.g-close-x button { border: 0; background: var(--tint); width: 36px; height: 36px; border-radius: 50%; font-size: 15px; cursor: pointer; color: var(--muted); }
.g-close-x button:hover { background: #ffe3e3; color: #c92a2a; }
.g-head { display: flex; align-items: center; gap: 14px; margin: 0 40px 10px 0; }
.g-head h3 { margin: 0; font-size: 22px; }
.g-spin { width: 50px; height: 50px; flex: none; border-radius: 16px; background: var(--violet-soft); display: grid; place-items: center; font: 24px var(--emoji); animation: g-bob 1.2s ease-in-out infinite; }
@keyframes g-bob { 50% { transform: translateY(4px); } }
.g-why { color: var(--muted); font-size: 15.5px; }
.g-steps { list-style: none; counter-reset: g; padding: 0; margin: 0 0 12px; }
.g-steps li { counter-increment: g; position: relative; padding: 10px 12px 10px 52px; margin-bottom: 8px; background: var(--tint); border-radius: 14px; font-size: 15.5px; line-height: 1.5; }
.g-steps li::before { content: counter(g); position: absolute; left: 12px; top: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--violet); color: #fff; font: 800 15px/28px var(--head); text-align: center; }
.g-steps b { color: var(--violet-d); }
.g-retry { font-size: 14px; margin: 0 0 10px; }
.g-retry a { color: var(--violet); font-weight: 700; }
.g-hash { border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; margin-bottom: 14px; font-size: 14px; }
.g-hash summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.g-hash-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.g-hash code { flex: 1; min-width: 0; font: 12px/1.4 Consolas, "Courier New", monospace; word-break: break-all; background: #f8f7fc; padding: 8px 10px; border-radius: 10px; user-select: all; }
.g-hash .btn { padding: 8px 14px; font-size: 13.5px; }
.g-hash .fine { margin-top: 8px; }
.g-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.g-foot form { margin: 0; }
.g-web { font-weight: 700; font-size: 14.5px; color: var(--muted); text-decoration: none; }
.g-web:hover { color: var(--violet); }
@media (max-width: 760px) {
  #dl-guide { padding: 22px 18px 18px; border-radius: 22px; }
  .g-head h3 { font-size: 19px; }
  .g-foot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .g-foot .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .g-spin, #dl-guide[open] { animation: none; } }
