/* Etami: trang chủ. Chỉ áp dụng dưới body.home; trang Support/Privacy/Terms/mời dùng riêng styles.css.
   Ý tưởng: cả trang là một chuyến đi, từ câu hỏi "tới đâu rồi?" tới lúc "Đã đến". */
.home {
  --bubble: #E9EBF6;
  --soft: #EEF0FE;
  --la-bg: rgba(22, 23, 31, .86);
  --la-accent: #A3AEFF;
  --arrived: #34C759;
  --arrived-line: var(--ink); /* viền thẻ cuối: trùng nền khi sáng, hiện khi tối */
  --shadow: 0 24px 60px rgba(27, 31, 59, .16);
  --section: 72px;
}
/* Như styles.css: khối @media khi không có JS, khối data-theme khi người xem chọn riêng. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home { --bubble: #262B4D; --soft: #1F2446; --shadow: 0 24px 60px rgba(0, 0, 0, .45);
                                          --arrived-line: var(--line); }
}
:root[data-theme="dark"] .home { --bubble: #262B4D; --soft: #1F2446; --shadow: 0 24px 60px rgba(0, 0, 0, .45);
                                 --arrived-line: var(--line); }
@media (min-width: 900px) { .home { --section: 88px; } }

.home .wrap { max-width: 1120px; padding: 0 16px; }
@media (min-width: 900px) { .home .wrap { padding: 0 24px; } }
.home :focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }

.skip { position: absolute; left: 16px; top: -48px; padding: 8px 14px; border-radius: 10px;
        background: var(--ink); color: var(--mist); z-index: 10; }
.skip:focus { top: 12px; }

@media (max-width: 560px) { .home .top .nav-extra { display: none; } }

.home h2 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 700;
           margin: 0 0 12px; }
.home h3 { font-size: 19px; margin: 0 0 6px; letter-spacing: -0.01em; }
.section-sub { color: var(--muted); margin: 0 0 28px; }
.text-link { font-weight: 700; text-decoration: none; }
.text-link::after { content: " →"; }
.text-link:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
           white-space: nowrap; border: 0; }

/* Nền dải: xen kẽ khu thoáng và khu có nền để trang có nhịp. */
.band { background: var(--card); border-block: 1px solid var(--line); }
.home main > section { padding-block: var(--section); }
.home main > .intro { padding-block: 24px var(--section); }

/* ---------- Mở đầu ---------- */
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.eyebrow { display: inline-block; margin: 0 0 20px; padding: 6px 14px; border-radius: 99px; background: var(--mark);
           color: var(--link); font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.intro h1 { font-size: clamp(46px, 7.4vw, 82px); line-height: 1.02; letter-spacing: -0.04em; font-weight: 800;
           margin: 0 0 20px; }
.intro h1 .dot { color: var(--brand); }
.intro .sub { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 30em; margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.cta .button { min-height: 48px; display: inline-flex; align-items: center; }

/* Minh họa màn hình khóa. Hình ε mờ phía sau nhắc logo. */
.demo { margin: 0; display: grid; justify-items: center; gap: 20px; position: relative; }
.demo::before {
  content: ""; position: absolute; z-index: -1; inset: -6% -10% 18%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='280 190 500 640'%3E%3Cpath d='M696.68 708.08 C600.92 808.4 347.84 785.6 347.84 635.12 C347.84 539.36 441.32 493.76 559.88 493.76 C450.44 493.76 375.2 455 375.2 366.08 C375.2 227 596.36 233.84 664.76 309.08' fill='none' stroke='%236E7CF5' stroke-width='100' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .08;
}
.phone {
  width: min(300px, 78vw); aspect-ratio: 9 / 19.5; border-radius: 46px; padding: 14px; position: relative;
  background:
    radial-gradient(120% 70% at 20% 0%, #5A66DC 0%, transparent 60%),
    radial-gradient(100% 60% at 100% 100%, #3B4486 0%, transparent 70%),
    linear-gradient(170deg, #5A66DC 0%, #4A56C8 45%, #1B1F3B 100%);
  box-shadow: 0 0 0 10px var(--ink), 0 0 0 11px #3A3F63, var(--shadow);
  color: #fff; display: flex; flex-direction: column; overflow: hidden;
}
.island { width: 34%; height: 26px; border-radius: 99px; background: #05060A; margin: 4px auto 0; flex: none; }
.lock-date, .lock-time { text-shadow: 0 1px 10px rgba(27, 31, 59, .3); }
.lock-date { margin: 26px 0 0; text-align: center; font-size: 15px; font-weight: 600; }
.lock-time { margin: -4px 0 0; text-align: center; font-size: 76px; font-weight: 700; letter-spacing: -0.03em;
             line-height: 1.05; font-variant-numeric: tabular-nums; }
.la, .mini-la {
  background: var(--la-bg); border-radius: 22px; padding: 12px 14px 10px; color: #fff; font-size: 13px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.la { margin-top: auto; margin-bottom: 18px; }
.la-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700;
          font-size: 14px; }
.la-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.la-icon { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--la-accent); flex: none; }
.la-eta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.la-bar { position: relative; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .18); margin: 10px 0 8px; }
.la-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--la-accent);
            transition: width .6s ease; }
.la-bar b { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--la-accent);
            border: 3px solid #fff; transform: translate(-50%, -50%); transition: left .6s ease; }
.la-msg { margin: 0 0 6px; font-weight: 600; }
.la-msg::before { content: "💬 "; }
.la-dest { display: flex; justify-content: space-between; gap: 8px; opacity: .78; font-size: 12px; }
.la[data-status="nearby"] .la-icon { border-color: #fff; background: var(--la-accent); }
.la[data-status="arrived"] { --la-accent: var(--arrived); }
.la[data-status="arrived"] .la-eta { color: var(--arrived); }

@media (max-width: 560px) {
  .hero-grid { gap: 32px; }
  .phone { width: 100%; aspect-ratio: auto; border-radius: 30px; padding: 14px 14px 0;
           box-shadow: 0 0 0 6px var(--ink), var(--shadow); }
  .island, .lock-date { display: none; }
  .lock-time { font-size: 52px; margin: 10px 0 18px; }
  .la { margin-top: 0; margin-bottom: 14px; }
}
.controls { width: min(360px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; }
.controls-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip, .step {
  font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 8px 16px; border-radius: 99px;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.chip { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.chip:hover { border-color: var(--brand); background: var(--soft); }
.chip:disabled { opacity: .45; cursor: default; background: var(--card); border-color: var(--line); }
.step { background: var(--accent); color: #fff; border: 0; padding-inline: 22px; }
.step span { font-weight: 400; opacity: .85; }
.step:hover { filter: brightness(1.06); }
.demo-who { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
            color: var(--muted); }
.waiter { margin: 0; padding: 8px 14px; border-radius: 18px; border-bottom-left-radius: 6px; background: var(--bubble);
          font-size: 15px; justify-self: start; text-align: left; }
.demo figcaption { font-size: 13px; color: var(--muted); }

/* ---------- Trước / sau ---------- */
.compare-grid { display: grid; gap: 20px; margin-top: 32px; }
@media (min-width: 760px) { .compare-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
.compare-card { border-radius: 28px; padding: 24px; border: 1px solid var(--line); background: var(--bg);
                display: flex; flex-direction: column; gap: 16px; }
.compare-tag { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
               color: var(--muted); }
.after .compare-tag { color: var(--link); }
.compare-note { margin: auto 0 0; color: var(--muted); font-size: 15px; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat li { max-width: 78%; padding: 9px 14px; border-radius: 18px; font-size: 15px; display: flex; gap: 10px;
           align-items: baseline; }
.chat time { font-size: 11px; color: var(--muted); margin-left: auto; }
.chat .out time { color: rgba(255, 255, 255, .9); }
.chat .in { background: var(--bubble); border-bottom-left-radius: 6px; }
.chat .out { justify-self: end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.mini-la { max-width: 360px; }
.reply { margin: 0; display: flex; justify-content: flex-end; }
.reply span { padding: 9px 14px; border-radius: 18px; border-bottom-right-radius: 6px; background: var(--accent);
              color: #fff; font-size: 15px; }

/* ---------- Cách hoạt động: con đường qua các trạm ---------- */
.route { list-style: none; margin: 40px 0 0; padding: 0; display: grid; gap: 32px; position: relative;
         --station: 40px; }
.route::before { /* đường nối các trạm */
  content: none;
}
.route li:not(:last-child)::before {
  content: ""; position: absolute; left: calc(var(--station) / 2 - 2px); top: calc(var(--station) - 2px); bottom: -30px;
  width: 4px; border-radius: 4px; opacity: .5;
  background: repeating-linear-gradient(to bottom, var(--brand) 0 14px, transparent 14px 24px);
}
.route li { position: relative; padding-left: calc(var(--station) + 20px); }
.route p { margin: 0; color: var(--muted); }
.station { position: absolute; left: 0; top: -6px; width: var(--station); height: var(--station); border-radius: 50%;
           display: grid; place-items: center; background: var(--card); border: 3px solid var(--brand);
           font-weight: 800; color: var(--link); }
.arrive .station { background: var(--arrived); border-color: var(--arrived); color: var(--ink); }
.arrive h3 { color: var(--text); }
@media (min-width: 900px) {
  .route { grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .route li:not(:last-child)::before { content: none; }
  .route::before {
    content: ""; position: absolute; border-radius: 4px; opacity: .5;
    left: 20px; right: 20%; top: calc(var(--station) / 2 - 2px); bottom: auto; width: auto; height: 4px;
    background: repeating-linear-gradient(to right, var(--brand) 0 14px, transparent 14px 24px);
  }
  .route li { padding: calc(var(--station) + 20px) 0 0; }
  .station { top: 0; }
}

/* ---------- Ảnh thật ---------- */
.gallery .wrap { margin-bottom: 0; }
.shots {
  list-style: none; margin: 0; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px max(16px, calc((100vw - 1120px) / 2 + 24px)) 24px; scroll-padding-inline: max(16px, calc((100vw - 1120px) / 2 + 24px));
  scrollbar-width: thin; overscroll-behavior-x: contain;
}
.shots li { flex: 0 0 clamp(220px, 23vw, 280px); scroll-snap-align: start; }
.shots figure { margin: 0; }
.shots img { width: 100%; height: auto; display: block; border-radius: 26px; border: 1px solid var(--line);
             box-shadow: 0 14px 34px rgba(27, 31, 59, .12); background: var(--soft); }
.shots figcaption { margin-top: 12px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- Quyền riêng tư ---------- */
.privacy-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .privacy-grid { grid-template-columns: 1.3fr .7fr; gap: 64px; } }
.promises { list-style: none; margin: 24px 0 28px; padding: 0; display: grid; gap: 16px; }
.promises li { position: relative; padding-left: 40px; color: var(--muted); }
.promises li strong { color: var(--text); }
.promises li::before, .promises li::after {
  content: ""; position: absolute; left: 0; top: 1px; width: 26px; height: 26px;
}
.promises li::before { border-radius: 50%; background: var(--mark); }
.promises li::after { /* dấu tích lấy màu --link nên tự đổi theo giao diện */
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l3.8 3.8L18 8' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background: var(--link); -webkit-mask: var(--check) center / 16px no-repeat; mask: var(--check) center / 16px no-repeat;
}
.privacy-shot { width: min(280px, 70vw); height: auto; justify-self: center; border-radius: 32px;
                border: 1px solid var(--line); box-shadow: var(--shadow); }

/* ---------- Kết: tới nơi ---------- */
.home main > .arrived { padding-top: 0; }
.arrived-card {
  border-radius: 36px; padding: clamp(36px, 6vw, 72px) 24px; text-align: center; color: var(--mist);
  background: var(--ink); border: 1px solid var(--arrived-line); position: relative; overflow: hidden; isolation: isolate;
}
.arrived-card::before { /* ε mờ, kết thúc câu chuyện bằng chính logo */
  content: ""; position: absolute; z-index: -1; width: 420px; height: 520px; right: -90px; bottom: -150px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='280 190 500 640'%3E%3Cpath d='M696.68 708.08 C600.92 808.4 347.84 785.6 347.84 635.12 C347.84 539.36 441.32 493.76 559.88 493.76 C450.44 493.76 375.2 455 375.2 366.08 C375.2 227 596.36 233.84 664.76 309.08' fill='none' stroke='%236E7CF5' stroke-width='100' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .22;
}
@media (max-width: 560px) { .arrived-card::before { width: 240px; height: 300px; right: -80px; bottom: -120px; } }
.arrived-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px; padding: 6px 14px;
                 border-radius: 99px; background: var(--arrived); color: #06210F; font-weight: 800; font-size: 14px; }
.arrived-card h2 { color: var(--mist); }
.arrived-card p { color: #C9CCE4; margin: 0 auto 24px; max-width: 30em; }
.arrived-card .arrived-badge { color: #06210F; margin: 0 0 18px; }
.arrived-card h2 { font-weight: 800; }

/* ---------- Tiếng Anh ---------- */
.home main > .english { padding-block: 0 var(--section); }
.english h2 { font-size: 20px; letter-spacing: -0.01em; }
.english p { color: var(--muted); max-width: 46em; margin: 0; }

/* ---------- Hiện dần (chỉ khi JS bật và không giảm chuyển động) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease-out, transform .5s ease-out; }
.reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .home *, .home *::before { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) { html:has(body.home) { scroll-behavior: smooth; } }
