/* Puracam — stylesheet dùng chung cho cả 4 trang.
   Không phụ thuộc mạng ngoài: font hệ thống, không CDN, không webfont. */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f7f8;
  --text: #14201f;
  --text-dim: #5b6b6a;
  --line: #dfe6e5;
  --accent: #0f8b80;
  --accent-soft: #e6f4f2;
  --radius: 14px;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1413;
    --bg-soft: #141d1c;
    --text: #e8efee;
    --text-dim: #93a5a3;
    --line: #223231;
    --accent: #3ecfc0;
    --accent-soft: #14302d;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 60rem; margin: 0 auto; padding: 0 20px; }

/* ---------- header / footer dùng chung ---------- */

header.site {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
header.site .row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  font-weight: 700; font-size: 19px; letter-spacing: -0.01em;
  color: var(--text); display: inline-flex; align-items: center; gap: 9px;
}
.brand:hover { text-decoration: none; }
/* Dấu hiệu = app icon thật (icon.svg), bo góc kiểu iOS. Nền icon là #101113 nên nó là
   một ô tối trên cả 2 theme — chủ đích, giống cách icon xuất hiện trên home screen. */
.brand .mark {
  width: 28px; height: 28px; border-radius: 7px; display: block;
}
nav.site a { color: var(--text-dim); font-size: 15px; margin-left: 18px; }
nav.site a:hover { color: var(--accent); }

footer.site {
  border-top: 1px solid var(--line);
  margin-top: 72px; padding: 28px 0 44px;
  color: var(--text-dim); font-size: 14px;
}
footer.site .row {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  align-items: center; justify-content: space-between;
}
footer.site nav a { margin-right: 16px; }

/* ---------- landing ---------- */

.hero { padding: 76px 0 8px; text-align: center; }
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 3.6rem); line-height: 1.05;
  letter-spacing: -0.03em; margin: 0 0 14px;
}
.hero .tagline {
  font-size: clamp(1.05rem, 3vw, 1.3rem); color: var(--text-dim);
  margin: 0 auto 10px; max-width: 34rem;
}
.hero .sub { color: var(--text-dim); max-width: 34rem; margin: 0 auto 30px; }

.badge {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 16px;
}
.badge:hover { text-decoration: none; opacity: 0.9; }

.specs {
  margin: 56px 0 0; padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-soft);
  font-size: 15px; color: var(--text-dim);
}
.specs dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.specs dt { color: var(--text); font-weight: 600; }
.specs dd { margin: 0; }

/* ---------- trang văn bản (privacy / terms / support) ---------- */

article { padding: 44px 0 0; }
article h1 {
  font-size: clamp(1.9rem, 5vw, 2.4rem); letter-spacing: -0.025em;
  margin: 0 0 6px; line-height: 1.15;
}
article .updated { color: var(--text-dim); font-size: 15px; margin: 0 0 34px; }
article h2 {
  font-size: 1.22rem; letter-spacing: -0.015em; margin: 40px 0 10px;
  padding-top: 20px; border-top: 1px solid var(--line);
}
article h3 { font-size: 1.02rem; margin: 24px 0 6px; }
article p, article li { color: var(--text); }
article ul, article ol { padding-left: 22px; }
article li { margin: 6px 0; }
article .lead { font-size: 1.06rem; color: var(--text-dim); }

.callout {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 22px 0;
}
.callout p { margin: 0; }
.callout strong { color: var(--text); }

table.data {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px;
  display: block; overflow-x: auto;
}
table.data th, table.data td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th { color: var(--text); font-weight: 600; white-space: nowrap; }
table.data td { color: var(--text-dim); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em; background: var(--bg-soft); padding: 1px 5px;
  border-radius: 5px; border: 1px solid var(--line);
}

/* ---------- landing: "What's new" + "Everything else" (2026-10-02) ----------
   Thay lưới thẻ cũ (18 thẻ, rất dài trên điện thoại): "What's new" là một hàng 3 cột có số
   thứ tự, "Everything else" là danh sách gọn chia theo nhóm, 2 cột trên màn rộng. */

.whatsnew, .allfeatures { margin: 72px 0 0; }
.whatsnew h2, .allfeatures h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.1rem); letter-spacing: -0.025em;
  margin: 0 0 8px; line-height: 1.15;
}
.eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 3px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
}

.news {
  list-style: none; margin: 28px 0 0; padding: 0; counter-reset: news;
  display: grid; gap: 22px 32px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.news li { counter-increment: news; border-top: 2px solid var(--accent); padding-top: 14px; }
.news li::before {
  content: "0" counter(news); display: block; margin-bottom: 4px;
  color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
}
.news h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.news p { margin: 0; color: var(--text-dim); font-size: 15px; }

.groups {
  margin: 24px 0 0; display: grid; gap: 4px 48px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
}
.group { border-top: 1px solid var(--line); padding: 18px 0 10px; }
.group h3 {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
}
.group ul { list-style: none; margin: 0; padding: 0; }
.group li { margin: 0 0 9px; font-size: 15px; line-height: 1.55; color: var(--text-dim); }
.group li strong { color: var(--text); font-weight: 600; }
.footnote { margin: 14px 0 0; color: var(--text-dim); font-size: 15px; }

/* ---------- landing: card screenshot App Store (2026-09-25) ----------
   Dải cuộn ngang ngay trong hero, snap từng card như App Store. Card sinh bằng
   web/tools/make_web_screenshots.py từ bộ card store (đã có tiêu đề + khung máy + nền kem),
   nên CSS chỉ bo góc, không vẽ thêm khung. */
.store-cards {
  list-style: none; margin: 56px 0 0; padding: 0 0 14px; text-align: left;
  display: grid; grid-auto-flow: column; grid-auto-columns: 240px; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.store-cards li { scroll-snap-align: start; }
.store-cards img {
  display: block; width: 100%; height: auto; border-radius: 18px;
  border: 1px solid var(--line);
}
@media (max-width: 620px) {
  .store-cards { grid-auto-columns: 62vw; }
}

/* ---------- /guide/ — video hướng dẫn quét (2026-10-03) ----------
   Mỗi chế độ: video bên trái, danh sách bước bên phải (xếp chồng trên màn hẹp). Bước đang phát
   được tô (.active) và chú thích hiện đè lên đầu video — script ở cuối guide/index.html. */

.guide-head { padding: 44px 0 0; max-width: var(--measure); }
.guide-head h1 {
  font-size: clamp(1.9rem, 5vw, 2.4rem); letter-spacing: -0.025em;
  margin: 0 0 10px; line-height: 1.15;
}
.guide .lead { font-size: 1.06rem; color: var(--text-dim); margin: 0; }
.guide .lead strong { color: var(--text); font-weight: 600; }
.guide-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.guide-jump a {
  padding: 6px 15px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 15px; font-weight: 600;
}
.guide-jump a:hover { text-decoration: none; background: var(--accent-soft); border-color: var(--accent); }
nav.site a[aria-current="page"] { color: var(--text); }

.guide-clip, .guide-more {
  margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.guide-clip h2, .guide-more h2 {
  font-size: clamp(1.4rem, 4vw, 1.75rem); letter-spacing: -0.02em;
  margin: 0 0 6px; line-height: 1.2;
}
.guide-clip > .lead { max-width: var(--measure); }
.guide-layout {
  display: grid; gap: 20px 32px; margin: 22px 0 0; align-items: start;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
/* Màn rộng: video bám theo khi cuộn danh sách bước (Space có 8 bước, dài hơn video). */
@media (min-width: 821px) {
  .guide-video { position: sticky; top: 16px; }
}
@media (max-width: 820px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
}

.guide-video {
  position: relative; margin: 0; border-radius: var(--radius); overflow: hidden;
  background: #1b1c1e; border: 1px solid var(--line);
}
.guide-video video { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.guide-video .cue {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 6px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.62); color: #fff; text-align: center;
  font-size: clamp(13px, 2.4vw, 16px); font-weight: 600; line-height: 1.35;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.guide-video .cue.show { opacity: 1; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; margin: 0;
  padding: 9px 12px 10px 46px; border-radius: 10px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 12px; top: 10px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 13px; font-weight: 700;
}
.steps strong, .steps .step-jump {
  display: block; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text);
}
.steps .step-jump {
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font-family: inherit; text-align: left; cursor: pointer;
}
.steps .step-jump:hover { color: var(--accent); }
.steps .step-jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.steps span { display: block; font-size: 15px; line-height: 1.5; color: var(--text-dim); }
.steps li.active { background: var(--accent-soft); }
.steps li.active::before { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) {
  .steps li.active::before { color: #0d1413; }
}

.guide-note { margin: 16px 0 0; font-size: 15px; color: var(--text-dim); max-width: var(--measure); }
.guide-more ul { list-style: none; margin: 14px 0 0; padding: 0; max-width: var(--measure); }
.guide-more li { margin: 0 0 9px; font-size: 15px; line-height: 1.55; color: var(--text-dim); }
.guide-more li strong { color: var(--text); font-weight: 600; }
.guide-more p { font-size: 15px; color: var(--text-dim); }
