/* The Brain Project — trang giới thiệu
   Đơn sắc, đúng tinh thần ứng dụng: chỉ đen, trắng và các mức xám. */

/* Inter tự host. Trước đây font kéo từ Google Fonts với display=swap: gần một giây
   đầu trang vẽ bằng Segoe UI rồi Inter đến và cả hero nhảy một cái — đo được CLS 0,1834,
   toàn bộ dịch chuyển rơi vào chữ (H1, .lede, .cta-meta, .topnav) ở mốc 807ms và 857ms.

   display: optional mới là thứ chữa dứt điểm. Nó cho font đúng 100ms; kịp thì dùng,
   không kịp thì trang giữ nguyên font dự phòng tới hết vòng đời — không bao giờ tráo
   giữa chừng, nên không thể có dịch chuyển. Lần ghé sau font đã nằm trong cache và về
   kịp. Ba thứ giúp nó thắng cuộc đua 100ms: font cùng tên miền, được preload ngay trong
   <head>, và một file biến thiên 400–800 thay cho năm file tĩnh (140KB → 58KB).

   Subset latin-ext chỉ tải khi trang thật sự có ký tự riêng của nó; hiện không trang nào
   dùng nên nó nằm yên, giữ đó cho chữ viết về sau. Xem ghi chú thứ tự ngay dưới đây. */
/* Thứ tự có ý nghĩa: khi nhiều @font-face cùng phủ một ký tự, khối khai SAU thắng.
   Dải latin-ext U+0100-02BA nuốt trọn toàn bộ chữ Việt riêng (ă đ ĩ ũ ơ ư), và
   U+20A0-20AB nuốt cả dấu ₫. Để latin-ext sau vietnamese như Google Fonts vẫn làm là
   mọi trang tiếng Việt đều kéo về file 85KB thay cho file 10KB — đo trên bản deploy
   đầu tiên: 140KB font cho một trang không dùng ký tự latin-ext nào.
   Xếp latin-ext lên trước thì vietnamese giành lại phần của nó, và latin-ext chỉ
   được tải khi trang thật sự có ỳ ỷ ỹ ỵ hay các ký tự chỉ riêng nó mới có. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url(fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url(fonts/inter-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Hai mặt chữ dự phòng, chỉnh metric cho khớp Inter. Không phải để chống dịch chuyển
   nữa — display: optional đã lo việc đó — mà để cái trang ở lần tải nguội trông gần
   đúng như ý đồ chứ không giãn ra một cách lạ mắt.
   Đo bằng chính câu tiếng Việt trên trang, ở 100px, cỡ chữ thường 400:
   Inter 4415,4px — Segoe UI 4109,4px (×1,0745), Arial 4151,3px (×1,0636).
   ascent/descent lấy từ chính Inter (1984/2048 và 494/2048) rồi chia lại cho size-adjust.
   Máy nào không có Segoe UI thì src local() hỏng, cả mặt chữ bị bỏ qua và trình duyệt
   rơi xuống mặt kế tiếp. */
@font-face {
  font-family: "Inter dự phòng";
  src: local("Segoe UI");
  size-adjust: 107.45%;
  ascent-override: 90.16%;
  descent-override: 22.45%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter dự phòng 2";
  src: local("Arial"), local("Helvetica");
  size-adjust: 106.36%;
  ascent-override: 91.08%;
  descent-override: 22.68%;
  line-gap-override: 0%;
}

:root {
  --bg: #ffffff;
  --fg: #0b0b0b;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --line: #e6e6e6;
  --line-soft: #f0f0f0;
  --surface: #fafafa;
  --inverse-bg: #0b0b0b;
  --inverse-fg: #f2f2f2;
  --inverse-muted: #9e9e9e;
  --inverse-line: #262626;
  --mark-filter: none;
  --shot-shade: none;

  --pad: clamp(20px, 5vw, 72px);
  --gap-section: clamp(88px, 12vw, 152px);
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --faint: #6f6f6f;
    --line: #242424;
    --line-soft: #1a1a1a;
    --surface: #131313;
    --inverse-bg: #f6f6f6;
    --inverse-fg: #0b0b0b;
    --inverse-muted: #5f5f5f;
    --inverse-line: #dcdcdc;
    --mark-filter: invert(1);
    --shot-shade: brightness(.92);
  }
}

:root[data-theme="dark"] {
  --bg: #0b0b0b;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
  --faint: #6f6f6f;
  --line: #242424;
  --line-soft: #1a1a1a;
  --surface: #131313;
  --inverse-bg: #f6f6f6;
  --inverse-fg: #0b0b0b;
  --inverse-muted: #5f5f5f;
  --inverse-line: #dcdcdc;
  --mark-filter: invert(1);
  --shot-shade: brightness(.92);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, "Inter dự phòng", "Inter dự phòng 2", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" 1, "ss01" 1;
}

img { max-width: 100%; height: auto; display: block; }
code { font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

/* ── Thanh trên ─────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -.01em; text-decoration: none;
  margin-right: auto;
  /* Đệm dọc chỉ để nới vùng chạm lên 44px theo khuyến nghị của di động;
     không có nền nên nhìn không khác gì. */
  padding: 8px 0;
}
.brand-mark { filter: var(--mark-filter); border-radius: 6px; }

.topnav { display: flex; gap: 26px; }
.topnav a {
  color: var(--muted); text-decoration: none; font-size: 14.5px;
  transition: color .16s var(--ease);
}
.topnav a:hover { color: var(--fg); }
@media (max-width: 860px) { .topnav { display: none; } }

/* Công tắc sáng/tối, dáng iOS: rãnh bo tròn hết cỡ, núm trượt ngang.
   Chỉ hai trạng thái. Chưa ai gạt thì trang đi theo hệ thống và công tắc
   phản ánh đúng thứ đang hiển thị; gạt một lần là lựa chọn đó được nhớ. */
.theme-switch {
  appearance: none; border: 0; background: none; padding: 4px; cursor: pointer;
  display: inline-flex; align-items: center; border-radius: 999px;
}
.theme-track {
  position: relative; display: block; width: 46px; height: 27px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: background .22s var(--ease), border-color .22s var(--ease);
}
.theme-knob {
  position: absolute; top: 2px; left: 2px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .22s var(--ease), background .22s var(--ease);
}
.theme-switch[aria-checked="true"] .theme-track { background: var(--fg); border-color: var(--fg); }
.theme-switch[aria-checked="true"] .theme-knob { transform: translateX(19px); background: var(--bg); }
.theme-switch:hover .theme-track { border-color: var(--muted); }
.theme-switch:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
@media (max-width: 560px) {
  .theme-track { width: 42px; height: 25px; }
  .theme-knob { width: 19px; height: 19px; }
  .theme-switch[aria-checked="true"] .theme-knob { transform: translateX(17px); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-track, .theme-knob { transition: none; }
  .theme-switch:active, .btn:active, .calc-tab:active, .gallery-tab:active { transform: none; }
}

/* ── Khung chung ────────────────────────────────────────── */

main { display: block; }

.hero, .section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.section { padding-top: var(--gap-section); }
.section:last-of-type { padding-bottom: var(--gap-section); }

/* Tiêu đề: rất nặng, tracking siết chặt, dòng sát nhau — đúng ngôn ngữ của
   Digital Minimalist và Easlo. Cỡ chữ càng lớn thì tracking càng phải âm sâu. */
/* line-height phải rộng hơn bản gốc tiếng Anh: tiếng Việt có dấu chồng hai tầng
   (ậ, ể, ữ) nên 1.05 như Digital Minimalist dùng sẽ làm dấu chạm dòng trên. */
h1, h2, h3 { line-height: 1.16; margin: 0; text-wrap: balance; font-weight: 800; }

h2 { font-size: clamp(28px, 4.4vw, 46px); letter-spacing: -.032em; line-height: 1.18; margin-bottom: 18px; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }

/* Nửa sau của tiêu đề chuyển xám. Chính là cú "Latest. Read what's new, right now."
   — một câu, hai sắc độ: vế được nhấn đứng trước, phần còn lại lùi ra sau. */
.dim { color: var(--faint); }

.kicker {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 16px; font-weight: 600;
}

.section-lede {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--muted); max-width: 62ch; margin: 0 0 44px;
  text-wrap: pretty;
}
.section-lede strong { color: var(--fg); font-weight: 600; }

/* ── Hero ───────────────────────────────────────────────── */

.hero { padding-top: clamp(56px, 9vw, 108px); text-align: center; }

.eyebrow {
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 24px; font-weight: 600;
}

h1 {
  font-size: clamp(34px, 5.6vw, 62px);
  letter-spacing: -.04em;
  line-height: 1.14;
  margin: 0 auto 28px;
  max-width: 24ch;
}

.lede {
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--muted);
  max-width: 60ch; margin: 0 auto 38px;
  text-wrap: pretty;
}
.lede strong { color: var(--fg); font-weight: 600; }

.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 30px; border-radius: 999px;
  font-size: 15.5px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease), opacity .16s var(--ease);
}
.btn:active { transform: translateY(1px); }
/* Mọi thứ bấm được đều phải nhúc nhích ngay lúc nhấn, không chỉ hai nút lớn. */
.calc-tab:active, .gallery-tab:active, .theme-switch:active { transform: scale(0.97); }
.calc-tab, .gallery-tab { transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease), transform .1s ease-out; }
.theme-switch { transition: transform .1s ease-out; }

.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { opacity: .84; transform: translateY(-1px); }

.btn-ghost { border-color: var(--line); color: var(--fg); background: var(--bg); }
.btn-ghost:hover { border-color: var(--fg); transform: translateY(-1px); }

.cta-meta {
  font-size: 13.5px; color: var(--faint); margin: 18px 0 0;
  max-width: 56ch; margin-inline: auto;
}
.cta-meta a { color: var(--muted); }

/* ── Ảnh chụp ───────────────────────────────────────────── */

/* Ảnh nằm trong một tấm xám bo góc lớn, có đệm quanh — cách Digital Minimalist
   và Easlo trình bày ảnh sản phẩm. Bản thân ảnh cũng bo góc nhẹ để không cấn góc. */
.shot {
  margin: 0;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface);
  padding: clamp(14px, 2.4vw, 30px);
}
/* height:auto là bắt buộc, không phải cho đẹp: thiếu nó thì trình duyệt bỏ qua
   tỉ lệ suy ra từ thuộc tính width/height, và khung ảnh giữ nguyên tỉ lệ của ảnh
   cũ cho tới khi ảnh mới tải xong — đúng lúc bố cục bị xô. */
.shot img { filter: var(--shot-shade); width: 100%; height: auto; border-radius: 12px; display: block; }
/* Ảnh cửa sổ hẹp chỉ rộng 780 CSS px thật, kéo ra cho đầy ô 916px là tự làm nó mờ — nên
   app.js đặt max-width riêng cho từng ảnh và ảnh đứng giữa ô.
   Vẫn phải giữ width: 100%: đặt width: auto thì trước khi ảnh (lazy) tải xong, CSS này
   đè mất thuộc tính width="932" của thẻ và khung co về 0 — đo được đúng 0px trên cả bốn
   cỡ điện thoại — rồi bung ra khi ảnh về, tức là đúng thứ dịch chuyển mà aspect-ratio
   trong app.js sinh ra để chặn. */
#gallery-img { width: 100%; max-width: 932px; margin-inline: auto; }

/* Đoạn phim ở hero. Nó nằm đúng chỗ ảnh cũ và chiếm đúng chỗ đó ngay từ đầu nhờ
   width/height trên thẻ, nên không có cú dịch chuyển nào khi phim tải xong. */
.shot video { filter: var(--shot-shade); width: 100%; height: auto; border-radius: 12px; display: block; background: var(--surface); }
.video-wrap { position: relative; }

/* Đoạn phim tự chạy và lặp mãi, nên bắt buộc phải có cách dừng nó lại (WCAG 2.2.2).
   Nút chỉ hiện khi JS bật được phim — không có JS thì phim đứng yên ở poster, chẳng
   có gì cần dừng. */
.video-toggle {
  position: absolute; right: 14px; bottom: 14px;
  appearance: none; cursor: pointer;
  background: var(--inverse-bg); color: var(--inverse-fg);
  border: 0; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 500; padding: 8px 16px;
  opacity: .72; transition: opacity .16s var(--ease), transform .1s ease-out;
}
.video-toggle:hover { opacity: 1; }
.video-toggle:active { transform: scale(.97); }
.video-wrap:focus-within .video-toggle { opacity: 1; }
/* Trên màn cảm ứng nút phải đủ to cho ngón tay: đo trên iPhone SE bản trước là 60×37px.
   Apple đòi tối thiểu 44×44. */
@media (pointer: coarse) {
  .video-toggle {
    min-height: 44px; min-width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 18px; font-size: 14px; opacity: .9;
  }
}
.shot-hero { margin-top: clamp(56px, 8vw, 96px); }

.shot figcaption {
  padding: 16px 4px 2px;
  font-size: 13.5px; color: var(--muted); text-align: left;
}
/* Hero căn giữa, nên dòng chú thích dưới đoạn phim cũng phải căn giữa theo. */
.shot-hero figcaption { text-align: center; }

.section-flush .shot { margin-top: 0; }

.gallery-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.gallery-tabs button {
  appearance: none; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: 14px; font-weight: 500; padding: 8px 17px; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.gallery-tabs button:hover { color: var(--fg); border-color: var(--fg); }
.gallery-tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ── Dải quy đổi ────────────────────────────────────────── */

.calc { max-width: 720px; margin: 0 0 64px; }

.calc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.calc-tabs button {
  appearance: none; background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: 14.5px; font-weight: 500; padding: 9px 19px; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.calc-tabs button:hover { color: var(--fg); border-color: var(--fg); }
.calc-tabs button.is-on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.rule {
  display: flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.rule-cell {
  flex: 1 1 0; min-width: 0;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.rule-cell.is-out { background: var(--surface); }
.rule-label {
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
}
.rule-value { font-size: clamp(18px, 2.4vw, 24px); font-weight: 600; letter-spacing: -.02em; }
.rule-arrow {
  align-self: center; color: var(--faint); font-size: 15px; padding: 0 4px;
}

@media (max-width: 620px) {
  .rule { flex-direction: column; }
  .rule-arrow { transform: rotate(90deg); padding: 2px 0; }
  .rule-cell { padding: 13px 18px; }
}

.calc-note { font-size: 13.5px; color: var(--faint); margin: 14px 0 0; max-width: 58ch; }

/* ── Ba bước ────────────────────────────────────────────── */

.steps {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.steps article { background: var(--bg); padding: 28px 26px 30px; }
.step-num {
  display: block; font-size: 12px; letter-spacing: .1em; color: var(--faint);
  margin-bottom: 14px; font-variant-numeric: tabular-nums;
}
.steps h3 { margin-bottom: 8px; }
.steps p { margin: 0; color: var(--muted); font-size: 14.5px; }

.gift {
  margin: 28px 0 0; padding: 18px 22px;
  border-left: 2px solid var(--fg);
  color: var(--muted); font-size: 14.5px; max-width: 68ch;
}
.gift strong { color: var(--fg); }

/* ── Lưới thẻ ───────────────────────────────────────────── */

.grid {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card { background: var(--bg); padding: 30px 28px 32px; }
.card h3 { margin-bottom: 10px; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.card p:last-child { margin-bottom: 0; }
.card strong { color: var(--fg); font-weight: 600; }
.card-meta { color: var(--faint) !important; font-size: 13px !important; }

/* ── Khối đảo màu ───────────────────────────────────────── */

.section-invert {
  max-width: none;
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  padding: var(--gap-section) var(--pad);
  margin-top: var(--gap-section);
}
.section-invert > * { max-width: 1120px; margin-inline: auto; }
.section-invert .kicker { color: var(--inverse-muted); }
.section-invert .section-lede { color: var(--inverse-muted); }
.section-invert .section-lede strong { color: var(--inverse-fg); }

.limits { list-style: none; margin: 0; padding: 0; max-width: 78ch; }
.limits li {
  padding: 17px 0 17px 30px;
  border-top: 1px solid var(--inverse-line);
  color: var(--inverse-muted);
  font-size: 15px;
  position: relative;
}
.limits li:last-child { border-bottom: 1px solid var(--inverse-line); }
.limits li::before {
  content: "—"; position: absolute; left: 0; top: 17px; color: var(--inverse-muted);
}
.limits strong { color: var(--inverse-fg); font-weight: 600; }

/* ── Cài đặt ────────────────────────────────────────────── */

.install { list-style: none; counter-reset: s; margin: 0; padding: 0; max-width: 76ch; }
.install li {
  counter-increment: s;
  position: relative;
  padding: 0 0 30px 58px;
  border-left: 1px solid var(--line);
  margin-left: 15px;
}
.install li:last-child { border-left-color: transparent; padding-bottom: 0; }
.install li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: -15px; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.install h3 { margin-bottom: 6px; }
.install p { margin: 0; color: var(--muted); font-size: 14.5px; }
.install em { font-style: normal; color: var(--fg); }
.install code, .card code {
  background: var(--surface); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px;
}

.install-note {
  margin: 28px 0 0; padding: 18px 22px;
  border-left: 2px solid var(--fg);
  color: var(--muted); font-size: 14.5px; max-width: 68ch;
}
.install-note strong { color: var(--fg); }

.source { margin-top: 52px; padding-top: 32px; border-top: 1px solid var(--line); max-width: 76ch; }
.source h3 { margin-bottom: 14px; }
.source p { color: var(--faint); font-size: 13.5px; margin: 12px 0 0; }
.source pre {
  margin: 0; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow-x: auto; font-size: 13.5px; line-height: 1.8;
}

/* ── Email ──────────────────────────────────────────────── */

.wl { max-width: 620px; }
.wl h2 { margin-bottom: 16px; }

#wl-form { display: flex; gap: 10px; flex-wrap: wrap; }
#wl-form input {
  flex: 1 1 240px; min-width: 0;
  padding: 14px 16px; border-radius: var(--radius);
  /* --inverse-line quá mờ để làm viền ô nhập (1,15:1) — WCAG 1.4.11 đòi 3:1.
     #8c8c8c là mức xám đạt cả hai chiều: 3,11:1 trên nền sáng của khối đảo màu,
     5,85:1 trên nền tối. Một giá trị cố định thay vì token vì nó không đổi theo chủ đề. */
  border: 1px solid #8c8c8c;
  background: transparent; color: var(--inverse-fg);
  font: inherit; font-size: 15px;
}
#wl-form input::placeholder { color: var(--inverse-muted); }
/* Bẫy bot: ẩn khỏi mắt người và khỏi trình đọc màn hình, nhưng bot vẫn điền. */
#wl-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#wl-form input:focus-visible { outline-color: var(--inverse-fg); }
#wl-form .btn-primary { background: var(--inverse-fg); color: var(--inverse-bg); }

.wl-msg { min-height: 22px; margin: 14px 0 0; font-size: 14px; color: var(--inverse-muted); }
.wl-msg.is-err { color: var(--inverse-fg); }

/* ── Chân trang ─────────────────────────────────────────── */

.footer {
  max-width: 1120px; margin: 0 auto;
  padding: 44px var(--pad) 64px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between;
}
.foot-main { display: flex; gap: 14px; align-items: flex-start; max-width: 42ch; }
.foot-name { margin: 0; font-weight: 600; font-size: 15px; }
.foot-sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.foot-links { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a {
  font-size: 13.5px; color: var(--muted); text-decoration: none;
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.foot-links a:hover { color: var(--fg); border-color: var(--fg); }

.foot-meta { display: grid; gap: 14px; margin: 0; align-content: start; }
.foot-meta dt {
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 3px;
}
.foot-meta dd { margin: 0; font-size: 13.5px; color: var(--muted); }
.foot-meta code { word-break: break-all; font-size: 11.5px; }

/* ── Xuất hiện khi cuộn tới ─────────────────────────────── */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
}

/* ── Trang tài liệu (quyền riêng tư) ────────────────────── */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 88px) var(--pad) clamp(64px, 9vw, 104px);
}

.doc-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700; letter-spacing: -.032em; line-height: 1.14;
  margin: 0 0 18px; text-wrap: balance;
}

.doc-meta { margin: 0 0 32px; color: var(--faint); font-size: 14px; }
.doc-meta strong { color: var(--muted); font-weight: 600; }

.doc-lede {
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--muted); margin: 0 0 8px;
  padding: 22px 26px;
  border-left: 2px solid var(--fg);
  text-wrap: pretty;
}

.doc h2 {
  font-size: clamp(20px, 2.4vw, 25px);
  margin: 52px 0 14px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.doc h3 { font-size: 17px; margin: 34px 0 10px; }

.doc p { color: var(--muted); margin: 0 0 14px; text-wrap: pretty; }
.doc p strong, .doc li strong, .doc dd strong { color: var(--fg); font-weight: 600; }

.doc code {
  background: var(--surface); border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; word-break: break-word;
}

.doc-list { margin: 0 0 14px; padding: 0; list-style: none; }
.doc-list li {
  position: relative; padding: 7px 0 7px 22px;
  color: var(--muted); font-size: 15px;
}
.doc-list li::before {
  content: "—"; position: absolute; left: 0; color: var(--faint);
}

.doc-table { margin: 0 0 14px; display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.doc-table > div { background: var(--bg); padding: 15px 20px; }
.doc-table dt { font-size: 13.5px; margin-bottom: 4px; }
.doc-table dd { margin: 0; color: var(--muted); font-size: 14.5px; }

.doc-note {
  padding: 16px 20px; background: var(--surface);
  border-radius: var(--radius); font-size: 14.5px; margin: 18px 0 0;
}

.doc-rule { border: 0; border-top: 1px solid var(--line); margin: 72px 0 56px; }

.doc-en .doc-title-en {
  font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.03em;
  margin: 0 0 16px; padding: 0; border: 0;
}
.doc-en h3 { border: 0; padding: 0; }

/* ── Trang giá ──────────────────────────────────────────── */

.price-card{
  display:flex; flex-wrap:wrap; gap:24px; align-items:center; justify-content:space-between;
  border:1px solid var(--fg); border-radius:var(--radius);
  padding:28px 30px; margin:0 0 14px;
}
.price-name{margin:0; font-size:13px; letter-spacing:.1em; text-transform:uppercase; color:var(--faint)}
.price-amount{margin:8px 0 0; font-size:clamp(30px,4.4vw,42px); font-weight:700; letter-spacing:-.03em; color:var(--fg)}
.price-note{margin:6px 0 0; font-size:14px; color:var(--muted)}
.small-print{font-size:13px; color:var(--faint); margin:0 0 8px; line-height:1.75}

/* Bảng so sánh dùng lại .plans của ứng dụng nhưng cỡ chữ của trang web. */
.table-scroll{overflow-x:auto; margin:0 0 14px}
.plans-web{width:100%; min-width:420px; border-collapse:collapse; border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; font-size:15px}
.plans-web th,.plans-web td{padding:13px 18px; border-top:1px solid var(--line); text-align:left; font-weight:400; color:var(--muted)}
.plans-web thead th{border-top:0; font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--faint); font-weight:500}
.plans-web tbody th{color:var(--fg); width:52%}
.plans-web td{text-align:center; width:24%; font-variant-numeric:tabular-nums}
.plans-web .yes{color:var(--fg); font-weight:600}

/* Trên điện thoại, min-width:420px đẩy cột Pro ra ngoài màn hình. Vẫn cuộn ngang được
   nhưng không có dấu hiệu nào báo phải vuốt — mà đây đúng là trang so sánh Free/Pro,
   giấu mất cột Pro là hỏng đúng việc trang này sinh ra để làm. Siết đệm và cỡ chữ
   cho cả ba cột vừa màn hình thay vì bắt người dùng đoán. */
@media (max-width: 560px) {
  .plans-web{min-width:0; font-size:14px}
  .plans-web th,.plans-web td{padding:11px 9px}
  .plans-web thead th{font-size:10px; letter-spacing:.08em}
  .plans-web tbody th{width:46%}
  .plans-web td{width:27%}
}

/* Ảnh minh hoạ trong từng bước cài đặt. Viền mảnh để tách khỏi nền trắng của
   chính ảnh chụp, bo góc nhẹ cho khớp với khung ảnh lớn ở trên. */
.step-shot { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.step-shot img { width: 100%; height: auto; display: block; filter: var(--shot-shade); }
.step-shot.narrow { max-width: 320px; }

/* ── Thiết lập trợ năng của hệ điều hành ─────────────────
   Đặt ở CUỐI file có chủ đích: đây là lớp ghi đè, phải thắng mọi luật phía trên.
   Lần đầu tôi để chúng ở giữa file và shorthand `border` của .btn phía dưới đã
   ghi đè ngược lại, nên viền tương phản cao không có tác dụng. */

/* §14 — xin bớt trong suốt thì thanh đầu trang thành nền đặc, bỏ hẳn blur.
   Lớp kính chỉ là trang trí; chữ đọc được mới là điều kiện. */
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); backdrop-filter: none; }
}

/* §14 — tương phản cao: nền gần như đặc và viền rõ ràng thay vì nét mảnh gợi ý. */
@media (prefers-contrast: more) {
  :root { --line: #8a8a8a; --line-soft: #9d9d9d; --muted: #3f3f3f; --faint: #5a5a5a; }
  :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --line: #8a8a8a; --line-soft: #6e6e6e; --muted: #cfcfcf; --faint: #a8a8a8;
  }
  .topbar { background: var(--bg); backdrop-filter: none; }
  .btn-ghost, .calc-tab, .gallery-tab, .plans-web { border-width: 2px; }
  .dim { color: var(--muted); }
}

/* ── Trang kích hoạt ────────────────────────────────────── */
/* Chỉ người vừa mua mới thấy trang này, nhưng đó là ấn tượng đầu tiên sau khi họ
   trả tiền — nên nó vẫn phải gọn gàng như mọi trang khác. */

.kh-actions { margin: 26px 0 14px; }

.btn-small { padding: 10px 20px; font-size: 14px; }

/* Mã bản quyền: chữ đều nhau để đọc và đối chiếu từng ký tự không bị nhầm.
   Cho phép xuống dòng vì mã dài 36 ký tự, màn hình hẹp không đủ chỗ. */
.key-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 10px;
}
.key {
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px; letter-spacing: .02em;
  padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--fg);
  overflow-wrap: anywhere;
}
