:root {
  --bg: #f6f5f9; --surface: #fff; --text: #1a192e; --muted: #5d5b73;
  --primary: #392ed1; --primary-fg: #fff; --border: #e3e1ee; --accent: #34c5bd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a192e; --surface: #25243d; --text: #f2f1fa; --muted: #aaa8c4;
    --primary: #7b72ff; --primary-fg: #12111f; --border: #3a3958;
  }
  .logo-light { display: none; }
  .logo-dark { display: inline; }
}
.logo-dark { display: none; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Links inside running text stay underlined so they are recognizable. */
.doc a, details a, #contact a { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
header.site {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
header.site .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
header.site img { height: 28px; width: auto; }
nav.main { display: flex; gap: 18px; margin-left: auto; align-items: center; flex-wrap: wrap; }
nav.main a { color: var(--text); text-decoration: none; font-size: .95rem; }
nav.main a:hover { color: var(--primary); }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 10px; font-weight: 600;
  text-decoration: none; background: var(--primary); color: var(--primary-fg) !important;
}
nav.main a.btn { color: var(--primary-fg); }
.btn.secondary { background: transparent; color: var(--text) !important; border: 1px solid var(--border); }
.btn.disabled { opacity: .6; pointer-events: none; }
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin: 0 0 16px; }
.hero p { max-width: 640px; margin: 0 auto 28px; color: var(--muted); font-size: 1.15rem; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
section { padding: 56px 0; }
section h2 { font-size: 1.8rem; margin: 0 0 24px; text-align: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
ol.steps { max-width: 640px; margin: 0 auto; padding-left: 1.4rem; }
ol.steps li { margin-bottom: 12px; }
details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 18px; margin: 0 auto 12px; max-width: 720px;
}
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }
.center { text-align: center; }
footer.site { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.doc { max-width: 760px; margin: 0 auto; padding: 40px 20px 72px; }
.doc h1 { font-size: 2rem; margin: 0 0 4px; }
.doc h2 { text-align: left; font-size: 1.3rem; margin: 32px 0 8px; }
.doc .meta { color: var(--muted); margin-bottom: 24px; }
@media (max-width: 640px) {
  .hero { padding-top: 40px; }
  .doc h1 { display: none; }
}
@media print {
  header.site, footer.site { display: none; }
  body { background: #fff; color: #000; }
}
.embedded header.site, .embedded footer.site { display: none; }
.embedded .doc { padding-top: 16px; }
.embedded .hero { padding-top: 24px; }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
[id] { scroll-margin-top: 80px; }
header.site { transition: box-shadow .2s; }
header.site.scrolled { box-shadow: 0 2px 16px rgba(26, 25, 46, .12); }
.js [data-reveal] { opacity: 0; transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0ms); }
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* Sections */
section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.hero { text-align: left; padding: 56px 0 72px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1.1fr .9fr; align-items: center; }
.hero p { margin-left: 0; }
.hero .cta { justify-content: flex-start; }
.hero-visual { position: relative; display: flex; justify-content: center; }
.blob { position: absolute; width: 360px; height: 360px; border-radius: 50%; top: 50%; left: 50%;
  transform: translate(-50%, -50%); background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: .22; filter: blur(20px); }
.chip { position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; font-weight: 600; font-size: .85rem; box-shadow: 0 8px 24px rgba(26, 25, 46, .15); }
.chip1 { top: 14%; left: 2%; animation: float 5s ease-in-out infinite; }
.chip2 { bottom: 16%; right: 0; animation: float 6s ease-in-out infinite .8s; }
@keyframes float { 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .chip { animation: none; } }
.ico-wrap { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); margin-bottom: 12px; }
.ico { width: 22px; height: 22px; }
.card { transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(26, 25, 46, .12); }
ol.steps { list-style: none; padding: 0; max-width: 1040px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
ol.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin: 0; }
ol.steps .num { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: var(--primary-fg); font-weight: 700; margin-bottom: 10px; }
ol.steps p { margin: 0; }
.cta-band { text-align: center; }
.cta-band .wrap { background: linear-gradient(135deg, var(--primary), #5b50ff); color: #fff; border-radius: 24px; padding: 48px 20px; }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { margin: 0 0 20px; opacity: .9; }
.cta-band .btn { background: #fff; color: #392ed1 !important; }
.cta-band .btn.secondary { background: transparent; color: #fff !important; border-color: rgba(255, 255, 255, .6); }

/* Showcase phones */
.shots { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); justify-items: center; }
figure { margin: 0; text-align: center; }
figcaption b { display: block; margin-top: 16px; }
figcaption span { color: var(--muted); font-size: .92rem; display: block; max-width: 240px; margin: 4px auto 0; }
.phone { width: 210px; aspect-ratio: 9 / 18.5; border: 8px solid #1a192e; border-radius: 34px; background: var(--bg);
  overflow: hidden; box-shadow: 0 24px 48px rgba(26, 25, 46, .25); position: relative; text-align: left; }
.phone .screen { padding: 14px 12px; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.bar-title { font-weight: 700; font-size: .85rem; }
.stats { display: flex; gap: 8px; }
.stats div { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; }
.stats b { display: block; font-size: 1.1rem; color: var(--primary); }
.stats span { font-size: .62rem; color: var(--muted); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 2px; background: var(--border); }
.heat .l1 { background: color-mix(in srgb, var(--primary) 25%, var(--border)); }
.heat .l2 { background: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.heat .l3 { background: color-mix(in srgb, var(--primary) 75%, var(--border)); }
.heat .l4 { background: var(--primary); }
.row-card { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; align-items: center; }
.row-card > div { flex: 1; display: grid; gap: 5px; }
.cover { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 4px; background: var(--primary); }
.row-card .cover { width: 28px; flex: none; }
.c1 { background: linear-gradient(160deg, #392ed1, #7b72ff); } .c2 { background: linear-gradient(160deg, #0f9d8f, #34c5bd); }
.c3 { background: linear-gradient(160deg, #e0663f, #f2a65a); } .c4 { background: linear-gradient(160deg, #7a3fb5, #c28cf0); }
.c5 { background: linear-gradient(160deg, #2a6fdb, #6cb4ff); } .c6 { background: linear-gradient(160deg, #c2415d, #f28aa0); }
u { display: block; height: 6px; border-radius: 3px; background: var(--border); text-decoration: none; }
u.s { width: 60%; }
em { display: block; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
em s { display: block; height: 100%; background: var(--primary); text-decoration: none; }
.books { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.book { display: grid; gap: 5px; }
.phone.sepia { background: #f4ecd8; }
.reader .page { flex: 1; display: grid; align-content: start; gap: 7px; padding: 6px 2px; }
.reader u { background: #cdbf9f; }
.reader-bar { display: flex; justify-content: space-between; align-items: center; height: 24px; }
.reader-bar span { width: 40%; height: 4px; border-radius: 2px; background: #cdbf9f; }
.reader-bar .bm { width: 10px; height: 14px; border-radius: 2px; background: var(--primary); }

/* Floating buttons */
.to-top { position: fixed; right: 20px; bottom: 88px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 6px 18px rgba(26, 25, 46, .22);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s; z-index: 20; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.to-top-track { fill: none; stroke: var(--border); stroke-width: 3; }
.to-top-bar { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; }
.to-top-icon { position: absolute; inset: 12px; width: 20px; height: 20px; }
.chat-fab { position: fixed; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 16px; border-radius: 999px; background: #0a7cff; color: #fff; text-decoration: none;
  font-weight: 600; box-shadow: 0 8px 24px rgba(10, 124, 255, .4); z-index: 20; transition: transform .2s; }
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab svg { width: 24px; height: 24px; }
@media (max-width: 640px) { .chat-fab-label { display: none; } .chat-fab { width: 52px; padding: 0; justify-content: center; } }
.embedded .to-top, .embedded .chat-fab { display: none; }
@media print { .to-top, .chat-fab { display: none; } }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .cta { justify-content: center; }
  .hero p { margin-left: auto; }
}

/* Header: language dropdown + mobile menu */
header.site .wrap { position: relative; }
.lang-menu { position: relative; background: none; border: 0; padding: 0; margin: 0; max-width: none; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 10px; font-weight: 400; }
.lang-menu summary::-webkit-details-marker { display: none; }
header.site .lang-menu img { display: block; width: 24px; height: 16px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.chev { width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.lang-menu[open] .chev { transform: rotate(-135deg) translateY(-2px); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  min-width: 168px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(26, 25, 46, .18); }
.lang-menu li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .95rem; }
.lang-menu li a:hover { background: var(--bg); }
.lang-menu li a[aria-current="true"] { font-weight: 700; color: var(--primary); }
.menu-btn { display: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 10px;
  background: transparent; color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn path { transform-origin: center; transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] .l1 { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .l2 { opacity: 0; }
.menu-btn[aria-expanded="true"] .l3 { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 800px) {
  header.site .wrap { gap: 10px; }
  .lang-menu { margin-left: auto; }
  .js .menu-btn { display: inline-flex; }
  .js nav.main { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 12px 20px 16px;
    flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 24px rgba(26, 25, 46, .14); }
  .js nav.main.open { display: flex; }
  .js nav.main a { padding: 12px 4px; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .js nav.main a.btn { margin-top: 14px; border: 0; text-align: center; padding: 12px 20px; }
  :root:not(.js) nav.main { order: 3; width: 100%; margin-left: 0; gap: 12px; }
  :root:not(.js) header.site .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
}
.btn:hover, .chat-fab:hover, nav.main a:hover, .lang-menu a:hover { text-decoration: none; }
.lang-menu .flag { display: flex; justify-content: center; width: 24px; flex: none; }

/* Store badges */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.store-badge { display: inline-flex; min-height: 44px; line-height: 0; }
.store-badge img { height: 54px; width: auto; display: block; }
.store-badge.is-soon { cursor: default; opacity: .92; }
.hero .store-badges { justify-content: flex-start; }
.cta-band .store-badges { justify-content: center; }
@media (max-width: 800px) { .hero .store-badges { justify-content: center; } }
@media (max-width: 480px) { .store-badge img { height: 46px; } }

/* Features: core row + the rest */
.core-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 16px; }
.more-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card.core { padding: 24px; border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface)); }
.card.core .ico-wrap { background: var(--primary); color: var(--primary-fg); }
.more-grid .card h3 { font-size: 1rem; }
.more-grid .card p { font-size: .92rem; }

/* Footer */
footer.site { padding: 44px 0 28px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px 40px; }
.foot-brand img { height: 28px; width: auto; }
.slogan { margin: 12px 0 16px; color: var(--text); font-weight: 600; }
.social { display: flex; gap: 10px; flex-wrap: wrap; }
.social a { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .2s, color .2s; }
.social a:hover { color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.social svg { width: 20px; height: 20px; }
.social .zalo { font-weight: 700; font-size: .85rem; }
.foot-col { display: flex; flex-direction: column; gap: 4px; }
.foot-col h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin: 0 0 8px; text-align: left; }
.foot-col a { color: var(--muted); padding: 6px 0; min-height: 32px; }
.foot-bottom { grid-column: 1 / -1; border-top: 1px solid var(--border); padding-top: 20px; }
.foot-bottom a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

/* WhatsApp floating button (stacked above Messenger, below scroll-to-top) */
.wa-fab { position: fixed; right: 20px; bottom: 84px; display: inline-flex; align-items: center; gap: 8px; height: 52px;
  padding: 0 16px; border-radius: 999px; background: #25d366; color: #0b3d1f; text-decoration: none; font-weight: 600;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .4); z-index: 20; transition: transform .2s; }
.wa-fab:hover { transform: translateY(-2px); text-decoration: none; }
.wa-fab svg { width: 26px; height: 26px; }
.to-top { bottom: 148px; }
@media (max-width: 640px) { .wa-fab { width: 52px; padding: 0; justify-content: center; } .wa-fab .chat-fab-label { display: none; } }
.embedded .wa-fab { display: none; }
@media print { .wa-fab { display: none; } }
.hero .store-badge img { height: 44px; }
.hero .store-badges { gap: 10px; }
@media (min-width: 980px) { .more-grid { grid-template-columns: repeat(5, 1fr); } .more-grid .card { padding: 16px; } }

/* Real app screenshots inside the phone frame */
.phone.shot { aspect-ratio: auto; background: #1a192e; }
.phone.shot img { display: block; width: 100%; height: auto; }
.shots { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* UX polish */
section { padding: 48px 0; }
.hero .phone.shot { width: 250px; }
.store-badge.is-soon { cursor: pointer; }
.store-badge:hover img { transform: translateY(-2px); }
.store-badge img { transition: transform .2s; }
#contact .mail-btn { display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; padding: 12px 22px; }
#contact .mail-btn svg { width: 20px; height: 20px; }
#contact { text-align: center; }
#contact p { margin: 0 0 16px; color: var(--muted); }
@media (min-width: 980px) {
  ol.steps li:not(:last-child)::after { content: ""; position: absolute; top: 37px; left: 64px; right: -30px;
    border-top: 2px dashed color-mix(in srgb, var(--primary) 35%, var(--border)); }
  ol.steps li { position: relative; }
}
@media (max-width: 800px) {
  section { padding: 40px 0; }
  .hero .phone.shot { width: 220px; }
  ol.steps { grid-template-columns: 1fr; gap: 10px; }
  ol.steps li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
  ol.steps .num { margin: 0; flex: none; }
  .more-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .more-grid .card { padding: 14px; }
  .more-grid .card h3 { font-size: .95rem; }
  .more-grid .card p { font-size: .85rem; line-height: 1.5; }
}
@media (max-width: 700px) {
  .shots { display: flex; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px;
    margin: 0 -20px; padding: 4px 20px 24px; -webkit-overflow-scrolling: touch; }
  .shots figure { flex: 0 0 220px; scroll-snap-align: center; }
  .shots .phone { width: 200px; }
}
#contact a.mail-btn { text-decoration: none; }

/* Header "calling" button: expanding ring + brief ring-tone wiggle */
.btn.call { position: relative; isolation: isolate; animation: call-wiggle 3.2s ease-in-out infinite; transform-origin: 50% 60%; }
.btn.call::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--primary); animation: call-ring 1.8s ease-out infinite; }
.btn.call:hover, .btn.call:focus-visible { animation-play-state: paused; }
.btn.call:hover::before, .btn.call:focus-visible::before { animation-play-state: paused; opacity: 0; }
@keyframes call-ring { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(1.3, 1.7); opacity: 0; } }
@keyframes call-wiggle {
  0%, 18%, 100% { transform: rotate(0); }
  3%, 9%, 15% { transform: rotate(-3deg); }
  6%, 12% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) { .btn.call, .btn.call::before { animation: none; } .btn.call::before { display: none; } }
@keyframes call-ring-m { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(1.05, 1.6); opacity: 0; } }
@media (max-width: 800px) { .btn.call::before { animation-name: call-ring-m; } }

/* Features: one uniform 3x3 grid of horizontal cards; core features keep a filled icon + soft tint */
.feat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat-grid .card { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; row-gap: 4px; align-content: start;
  padding: 20px; margin: 0; }
.feat-grid .card .ico-wrap { grid-row: 1 / span 2; width: 48px; height: 48px; margin: 0; }
.feat-grid .card h3 { margin: 0; font-size: 1.05rem; align-self: end; }
.feat-grid .card p { margin: 0; font-size: .93rem; line-height: 1.5; align-self: start; }
.feat-grid .card.core { padding: 20px; }
@media (max-width: 900px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .feat-grid { grid-template-columns: 1fr; gap: 10px; }
  .feat-grid .card, .feat-grid .card.core { padding: 14px 16px; grid-template-columns: 44px 1fr; column-gap: 14px; }
  .feat-grid .card .ico-wrap { width: 44px; height: 44px; }
}
@media (min-width: 641px) and (max-width: 900px) { .feat-grid .card:last-child { grid-column: 1 / -1; } }
