/* ---------- Font (giấy phép SIL OFL, lưu cùng trang) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-vietnamese-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  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: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("../fonts/be-vietnam-pro-vietnamese-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  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: "Be Vietnam Pro";
  src: url("../fonts/be-vietnam-pro-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("../fonts/be-vietnam-pro-vietnamese-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  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: "Be Vietnam Pro";
  src: url("../fonts/be-vietnam-pro-latin-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}

/* ---------- Biến thiết kế: đổi màu toàn trang tại đây ---------- */
:root {
  --emerald-deep: #0b2e26;
  --emerald: #145a43;
  --gold: #dfc58d;
  --gold-light: #f0dfb8;
  --ivory: #f7f3ea;
  --ink: #17251f;
  --ink-soft: #4a5a52;
  --on-dark-soft: #cfdcd4;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 20px;
  --gem: polygon(20% 0, 80% 0, 100% 16%, 100% 84%, 80% 100%, 20% 100%, 0 84%, 0 16%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--emerald-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ivory);
  font: 400 1rem/1.6 var(--body);
  background: radial-gradient(130% 620px at 50% 0, #1a6a50 0, var(--emerald) 28%, var(--emerald-deep) 100%) no-repeat var(--emerald-deep);
  overflow-wrap: break-word;
}

h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
#ket-noi:focus { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ivory);
  color: var(--ink);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.demo-bar {
  position: relative;
  z-index: 1;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--gold-light);
  font-size: .8125rem;
  line-height: 1.45;
  text-align: center;
}

/* ---------- Bố cục ---------- */
.page {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 20px 40px;
  flex: 1;
}

/* ---------- Phần đầu trang ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.share {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px 0 11px;
  border: 1px solid rgb(223 197 141 / .5);
  border-radius: 22px;
  background: rgb(11 46 38 / .35);
  font-size: .875rem;
  transition: background-color .2s;
}
.share svg, .cta-icon svg, .cta-arrow svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.share svg { width: 18px; height: 18px; }

/* Điện thoại hẹp: chỉ giữ biểu tượng để nút không đè lên khung chân dung */
@media (max-width: 400px) {
  .share { justify-content: center; width: 44px; padding: 0; }
  .share span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* Khung chân dung mang dáng viên ngọc giác tầng */
.gem { position: relative; width: 112px; margin-top: 6px; }
.gem.has-portrait { width: 132px; }
.gem-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 212%;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: var(--gold);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 55%, transparent 80%);
  mask-image: linear-gradient(#000 55%, transparent 80%);
}
.gem-rings path:nth-child(1) { opacity: .34; }
.gem-rings path:nth-child(2) { opacity: .18; }
.gem-rings path:nth-child(3) { opacity: .08; }
.gem-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 3px;
  clip-path: var(--gem);
  background: linear-gradient(150deg, #f6e9c9, var(--gold) 40%, #a98a4e 75%, #ecd8a8);
}
.gem-inner {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: var(--gem);
  background: var(--emerald);
}
.gem-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; }
.gem-monogram {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold-light);
  font: 600 2.125rem/1 var(--display);
}
.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}

/* NB là nhận diện phụ khi đã có ảnh chân dung */
.gem-badge { display: none; }
.has-portrait .gem-monogram { display: none; }
.has-portrait .gem-badge {
  position: absolute;
  right: -6%;
  bottom: -3%;
  display: block;
  width: 30%;
  aspect-ratio: 4 / 5;
  padding: 2px;
  clip-path: var(--gem);
  background: var(--gold);
}
.gem-badge span {
  display: grid;
  place-items: center;
  height: 100%;
  clip-path: var(--gem);
  background: var(--emerald-deep);
  color: var(--gold-light);
  font: 600 1rem/1 var(--display);
}

.brand {
  margin-top: 10px;
  color: var(--gold);
  font: 600 1.375rem/1.3 var(--display);
  letter-spacing: .14em;
  text-indent: .14em;
}
h1 {
  max-width: 11em;
  margin-top: 2px;
  font: 600 2.125rem/1.14 var(--display);
  text-wrap: balance;
}
.slogan {
  max-width: 24em;
  margin-top: 8px;
  color: var(--gold-light);
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.5;
  text-wrap: balance;
}
.intro {
  max-width: 27em;
  margin-top: 6px;
  color: var(--on-dark-soft);
  font-size: .9375rem;
  line-height: 1.5;
  text-wrap: balance;
}

.social { display: flex; gap: 12px; margin-top: 12px; }
.social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(223 197 141 / .5);
  border-radius: 50%;
  color: var(--gold-light);
  transition: background-color .2s, color .2s;
}
.social span { display: grid; }
.social svg { width: 22px; height: 22px; fill: currentColor; font-family: var(--body); }

/* ---------- Nút kết nối ---------- */
.connect { margin-top: 18px; }
.cta-list { display: grid; gap: 14px; }
.cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--ink);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, background-color .2s;
}
.cta-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--emerald);
  color: var(--gold-light);
}
.cta-icon svg { width: 24px; height: 24px; }
.cta-body { flex: 1; min-width: 0; }
.cta-title, .cta-text { display: block; text-wrap: balance; }
.cta-title { font-weight: 600; font-size: .9375rem; line-height: 1.4; }
.cta-text { margin-top: 2px; color: var(--ink-soft); font-size: .875rem; line-height: 1.45; }
.cta-arrow { flex: none; display: grid; opacity: .7; transition: transform .2s; }
.cta-arrow svg { width: 20px; height: 20px; }

.cta-primary {
  min-height: 96px;
  padding: 18px 16px;
  background: linear-gradient(135deg, #f4e5c0, var(--gold) 60%, #d3b473);
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / .55);
}
.cta-primary .cta-icon { width: 52px; height: 52px; background: var(--emerald-deep); }
.cta-primary .cta-title { font-size: 1.0625rem; }
.cta-primary .cta-text { color: #3a4238; }

.cta-assistant {
  border-color: var(--gold);
  background: #0f4032;
  color: var(--ivory);
}
.cta-assistant .cta-icon { background: var(--gold); color: var(--emerald-deep); }
.cta-assistant .cta-text { color: var(--on-dark-soft); }

/* Điện thoại: nút gọn lại để tên nút chính nằm trên một dòng từ 390px */
@media (max-width: 429px) {
  .cta { gap: 10px; padding-inline: 14px; }
  .cta-arrow svg { width: 16px; height: 16px; }
  .cta-primary { min-height: 90px; padding-block: 16px; }
  .cta-primary .cta-icon { width: 44px; height: 44px; }
  .cta-primary .cta-title { font-size: 1rem; }
}

/* Màn hình 360px: đủ chỗ để "KẾT NỐI TRỢ LÝ NGỌC BÍCH" nằm trên một dòng */
@media (max-width: 380px) {
  .cta:not(.cta-primary) .cta-title { font-size: .875rem; }
}

.cta-badge {
  position: absolute;
  top: -9px;
  right: 16px;
  padding: 2px 10px;
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--ink);
  color: var(--gold-light);
  font-size: .75rem;
  line-height: 1.4;
}
.is-pending { cursor: not-allowed; }

.notice {
  padding: 20px;
  border: 1px solid rgb(223 197 141 / .4);
  border-radius: var(--radius);
  color: var(--on-dark-soft);
  text-align: center;
}

/* Mã QR chỉ có ích trên máy tính, điện thoại bấm nút là đủ */
.qr { display: none; }

@media (hover: hover) {
  a.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgb(0 0 0 / .7); }
  a.cta:hover .cta-arrow { transform: translateX(3px); }
  .share:hover { background: rgb(11 46 38 / .8); }
  .social a:hover { background: var(--gold); color: var(--emerald-deep); }
}
a.cta:active { transform: scale(.985); }

/* ---------- Video ---------- */
.video { margin-top: 40px; text-align: center; }
.video h2, .about h2 { font: 600 1.75rem/1.25 var(--display); text-wrap: balance; }
.video-text { margin-top: 6px; color: var(--on-dark-soft); font-size: .9375rem; }
.video-box {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: 16px auto 0;
  overflow: hidden;
  border: 1px solid rgb(223 197 141 / .5);
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--emerald), #082119);
}
.video-box.is-vertical { aspect-ratio: 9 / 16; max-width: 340px; }
.video-box > *, .video-play img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-play { display: grid; place-items: center; padding: 0; background: none; }
.video-play:focus-visible { outline-offset: -6px; }
.video-play img { object-fit: cover; }
.video-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--emerald-deep);
}
.video-icon svg { width: 32px; height: 32px; fill: currentColor; }

/* ---------- Giới thiệu cộng đồng ---------- */
.about { margin-top: 40px; padding-top: 32px; border-top: 1px solid rgb(223 197 141 / .3); }
.about p { margin-top: 8px; color: var(--on-dark-soft); font-size: .9375rem; text-wrap: pretty; }
.about ul { display: grid; gap: 10px; margin-top: 18px; font-size: .9375rem; }
.about li { position: relative; padding-left: 26px; text-wrap: balance; }
.about li::before {
  content: "";
  position: absolute;
  top: .42em;
  left: 2px;
  width: 10px;
  height: 12px;
  clip-path: var(--gem);
  background: var(--gold);
}

/* ---------- Chân trang ---------- */
.footer {
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  color: var(--on-dark-soft);
  font-size: .875rem;
  text-align: center;
  text-wrap: balance;
}
.footer-logo { display: block; width: auto; height: 44px; max-width: 200px; margin: 0 auto 12px; object-fit: contain; }
.footer-assistant a { display: inline-block; padding: 12px 0; color: var(--gold-light); font-weight: 600; text-underline-offset: 3px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 8px; }
.footer-links li { display: flex; align-items: center; min-height: 44px; }
.footer-links a, .footer-links button {
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Thông báo, hộp thoại ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 10;
  padding: 10px 20px;
  border-radius: 22px;
  background: var(--ivory);
  color: var(--ink);
  font-size: .9375rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.consent {
  position: sticky;
  bottom: 0;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--ivory);
  color: var(--ink);
  font-size: .875rem;
}
.consent p { max-width: 34em; }
.consent div { display: flex; gap: 10px; }
.consent button, .share-dialog button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--emerald);
  border-radius: 22px;
  background: transparent;
  color: var(--emerald);
  font-weight: 600;
}

.share-dialog {
  width: min(400px, calc(100% - 40px));
  padding: 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--ink);
}
.share-dialog::backdrop { background: rgb(5 20 16 / .7); }
.share-dialog h2 { font: 600 1.625rem/1.3 var(--display); }
.share-dialog input {
  width: 100%;
  margin: 14px 0;
  padding: 11px 12px;
  border: 1px solid #8a978f;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.consent :focus-visible, .share-dialog :focus-visible { outline-color: var(--emerald); }

/* ---------- Màn hình lớn ---------- */
@media (min-width: 600px) {
  .page { padding-top: 32px; }
  .gem { width: 168px; margin-top: 24px; }
  .gem.has-portrait { width: 200px; }
  .gem-badge span { font-size: 1.5rem; }
  .slogan { margin-top: 10px; }
  .intro { margin-top: 8px; line-height: 1.6; }
  .social { margin-top: 16px; }
  .gem-monogram { font-size: 3.25rem; }
  .brand { margin-top: 28px; }
  h1 { font-size: 2.75rem; }
  .connect { margin-top: 32px; }
}

@media (min-width: 1000px) {
  body { background-size: 100% 100%; }
  .page {
    display: grid;
    grid-template-columns: 1fr 1.14fr;
    gap: 56px 72px;
    align-content: center;
    align-items: center;
    max-width: 1120px;
    padding: 56px 40px;
  }
  .share { position: static; order: 1; margin-top: 24px; }
  .gem { width: 196px; margin-top: 24px; }
  .gem.has-portrait { width: 244px; }
  .gem-badge span { font-size: 1.875rem; }
  .gem-monogram { font-size: 4rem; }
  .brand { margin-top: 44px; font-size: 1.5rem; }
  h1 { font-size: 3.25rem; }
  .slogan, .intro { font-size: 1rem; }
  .connect { margin-top: 0; }
  .cta { padding-inline: 18px; }
  .video { grid-column: 1 / -1; width: 100%; max-width: 760px; margin: 0 auto; }
  .qr { display: flex; align-items: center; gap: 18px; margin-top: 22px; color: var(--on-dark-soft); font-size: .9375rem; }
  .qr img { flex: none; border-radius: 12px; background: #fff; }
  .qr p { max-width: 17em; }
  .about {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.14fr;
    gap: 72px;
    align-items: center;
    margin-top: 0;
    padding-top: 48px;
  }
  .about p, .about ul { font-size: 1rem; }
  .about ul { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  a.cta:hover, a.cta:active, a.cta:hover .cta-arrow { transform: none; }
}
