/* The download site's one stylesheet: direction A, "Đêm bạc", picked on the
   design canvas (site/README.md). The app's own screens keep DESIGN.md's light
   field system; this page wears the app icon instead: silver on near-black,
   lit from behind the way the Liquid Glass icon is. */

@font-face {
  font-family: "Be Vietnam Pro";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/be-vietnam-pro-400.woff2") format("woff2");
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/be-vietnam-pro-500.woff2") format("woff2");
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/be-vietnam-pro-600.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --ground: #0a0a0b;
  --ink: #f2f2f3;
  --body: #a6a8ad;
  --muted: #8b8e94;
  --silver: #c9cdd2;
  --hairline: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.11);
  --edge: rgba(255, 255, 255, 0.16);
  --focus: #7aa2ff;
  --gutter: clamp(20px, 5vw, 48px);
  --measure: 1120px;
  --press: 120ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p,
ol,
ul,
figure {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 4px;
}

a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* The page clips what deliberately runs off it: the ripples, the back phone.
   `clip` where it can, because `hidden` makes the page a scroll container of
   its own, and the tour's phone would then never stick (tour.js checks). */
.page {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

@supports (overflow: clip) {
  .page {
    overflow: clip;
  }
}

/* One column of content, inset from the screen's edges and its notch. */
.bar,
.hero,
.showcase,
.tour,
.after,
.doc,
.footer {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---- Top bar ------------------------------------------------------------ */

.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: 20px;
}

.brand,
.bar-link,
.back {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  text-decoration: none;
}

.brand {
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand img {
  width: 28px;
  height: 28px;
  display: block;
}

.bar-nav {
  display: flex;
  gap: 20px;
}

/* Below 360 the brand and two links no longer share a line; the tour starts
   just under the phones anyway, so its link goes first. */
@media (max-width: 359px) {
  .bar-link-tour {
    display: none;
  }
}

.bar-link,
.back {
  min-width: 48px;
  white-space: nowrap;
  color: var(--body);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--press);
}

.bar-link:hover,
.back:hover {
  color: var(--ink);
}

.back {
  gap: 6px;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(24px, 5vw, 64px);
}

.hero-icon {
  position: relative;
  isolation: isolate;
  width: clamp(112px, 13vw, 168px);
  aspect-ratio: 1;
}

.hero-icon img {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.65));
}

/* The light behind the icon, then a pond's rings spreading from it. */
.hero-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 980px;
  height: 980px;
  transform: translate(-50%, -50%);
  z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03) 45%, rgba(255, 255, 255, 0));
  pointer-events: none;
}

.ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, var(--ring-alpha));
  width: var(--ring);
  height: var(--ring);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ripple:nth-child(1) {
  --ring: 250%;
  --ring-alpha: 0.1;
}
.ripple:nth-child(2) {
  --ring: 400%;
  --ring-alpha: 0.07;
}
.ripple:nth-child(3) {
  --ring: 580%;
  --ring-alpha: 0.05;
}
.ripple:nth-child(4) {
  --ring: 800%;
  --ring-alpha: 0.035;
}

.hero-title {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 16ch;
  font-size: clamp(36px, 7vw, 92px);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-wrap: balance;
  color: var(--ink);
  /* Room inside the box for what hangs past the line: the dot under ạ, the
     tails of g and y, the marks over ế. A text-clipped background paints only
     inside the box, so at this tight leading they would vanish ("trai" for
     "trại"); the negative margin gives the room back to the layout. */
  padding: 0.1em 0 0.24em;
  margin-bottom: -0.24em;
}

/* Silver, top-lit like the icon; plain ink where clipping text is unknown. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-title {
    background: linear-gradient(180deg, #ffffff 0%, #dadde0 55%, #9aa0a7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.nowrap {
  white-space: nowrap;
}

.hero-lead {
  margin-top: 20px;
  max-width: 40ch;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  color: var(--body);
  text-wrap: pretty;
}

/* ---- The two store badges ------------------------------------------------ */

/* The stores' own artwork, never redrawn or recoloured (index.html): the App
   Store's first, both 48 px tall (Apple asks for at least 40, Google for no
   smaller than the badges beside it), a quarter of that apart at least. */
.stores {
  list-style: none;
  padding: 0;
  margin-top: 32px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 16px 20px;
}

.stores > li {
  display: flex;
  justify-content: center;
}

.store {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity var(--press);
}

.store .badge {
  display: block;
  height: 48px;
  width: auto;
}

.store:hover {
  opacity: 0.85;
}

.store:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* A store link not given yet: an empty href in index.html. The badge stays as
   it is, is not a link, and says `Sắp có` under it. platform.js also takes it
   out of the tab order. */
.store-soon {
  display: none;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--muted);
}

.store[href=""],
.store:not([href]) {
  pointer-events: none;
}

.store[href=""] .store-soon,
.store:not([href]) .store-soon {
  display: block;
}

/* ---- After installing, and the desktop's QR code -------------------------- */

.after {
  position: relative;
  z-index: 3;
  margin-top: clamp(64px, 9vw, 120px);
}

.after h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.after-grid {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.card {
  padding: 28px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-number {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--silver);
}

.card-title {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-text {
  font-size: 15px;
  color: var(--body);
  text-wrap: pretty;
}

/* Only a desktop, which has a phone to scan it with, sees the code. */
.qr-card {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
}

.qr-code {
  flex: none;
  width: 136px;
  height: 136px;
  padding: 4px;
  border-radius: 16px;
  background: var(--ink);
}

.qr-code img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) and (hover: hover) and (pointer: fine) {
  .after-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .qr-card {
    display: flex;
  }
}

/* ---- Support and privacy pages ------------------------------------------ */

.doc {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding-top: clamp(8px, 3vw, 32px);
}

/* The page's name in English above its Vietnamese title, for a store reviewer
   who reads no Vietnamese (Google Play wants the policy plainly labelled). */
.doc-kicker {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.doc .lead {
  margin-top: 16px;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.6;
  color: var(--body);
  text-wrap: pretty;
}

.facts {
  margin: 28px 0 0;
  padding: 8px 24px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--hairline);
}

.facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 4px 0;
  font-size: 15px;
}

.facts > div + div {
  border-top: 1px solid var(--hairline);
}

.facts dt {
  color: var(--body);
}

.facts dd {
  margin: 0;
  text-align: right;
}

/* A phone number or an address to tap: 48 tall, DESIGN.md §5. */
.facts dd a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.section {
  margin-top: 40px;
}

.section h2 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section > p,
.section > ul {
  margin-top: 10px;
  color: var(--body);
  line-height: 1.65;
  text-wrap: pretty;
}

.section > p + p {
  margin-top: 10px;
}

.section > ul {
  padding-left: 20px;
}

.section > ul > li + li {
  margin-top: 6px;
}

.section a,
.section strong {
  color: var(--ink);
}

.section strong {
  font-weight: 600;
}

/* A blank the owner still has to fill (site/README.md). `make site-check
   RELEASE=1` refuses to pass while any is left. */
.fill {
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

/* ---- Footer -------------------------------------------------------------- */

.footer {
  position: relative;
  z-index: 3;
  margin-top: clamp(56px, 8vw, 96px);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  padding-top: 16px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
}

/* The stores' credit lines, under the links, on the page that shows their
   badges: small, quiet, and in English, as the stores word them. */
.footer .trademarks {
  margin: -12px 0 0;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 48px;
  color: var(--silver);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- Narrow phones, motion ------------------------------------------------ */

@media (max-width: 560px) {
  .stores > li {
    flex-basis: 100%;
  }
}

@media (max-width: 359px) {
  .facts {
    padding: 8px 16px;
  }

  .facts > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 0;
  }

  .facts dd {
    text-align: left;
  }
}

/* One entrance, once, and only for the decoration: the icon settles, then the
   app rises (screens.css). The words and the buttons are there from the first frame, so a
   page whose animation never runs (a background tab, a slow phone) is never
   missing its download buttons. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .hero-icon {
    animation: rise 760ms var(--ease-out) both;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
  }
}

/* Windows high contrast draws every border solid: the rings would cross the
   words and the buttons. They are decoration; drop them. */
@media (forced-colors: active) {
  .ripple,
  .hero-icon::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store,
  .bar-link,
  .back {
    transition: none;
  }
}
