/*
 * "Get the App" dialog (desktop), built by get-app.js.
 *
 * The shell is Figma's "QR - APP" (Flow dialogs 9096:11232, 8857:23974):
 * 480 wide, #141211, a 1px Primary-10 border, radius 24, padding 40, 24
 * between blocks. The shade is the paywall's (9096:12234), so the two
 * landing dialogs look alike. The store links reuse .btn / .btn--text from
 * landing.css, the same Style=Text button the design draws here.
 */

.get-app {
  --get-app-surface: #141211;
  --get-app-line: rgba(255, 195, 173, 0.1);
  --get-app-close: #f7f2ed;

  position: fixed;
  inset: 0;
  /* Above the sticky nav (20) and the boot screen (50). */
  z-index: 1000;
  display: flex;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.get-app[hidden] {
  display: none;
}

.get-app__shade {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.43);
  /* Figma's background blur of 8.8 is 4.4 in CSS. */
  -webkit-backdrop-filter: blur(4.4px);
  backdrop-filter: blur(4.4px);
  animation: get-app-fade 0.18s ease-out;
}

.get-app__dialog {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 480px;
  max-width: 100%;
  /* Centred, and still scrollable from the top in a short window. */
  margin: auto;
  /* Figma lays the 400 column out at x 40 but y 41: the 1px border counts
     against the vertical padding only. */
  padding: 40px 39px;
  border: 1px solid var(--get-app-line);
  border-radius: 24px;
  background: var(--get-app-surface);
  box-shadow: 0 24px 64px 0 rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.5px;
  -webkit-font-smoothing: antialiased;
  animation: get-app-in 0.18s ease-out;
}

/* Focus lands on the dialog itself so its title is read out; the ring
   belongs on the controls inside. */
.get-app__dialog:focus {
  outline: none;
}

/* The paywall's close: an 18 glyph 20 from the top and 21 from the right
   edge, with a 40 hit area around it. */
.get-app__close {
  position: absolute;
  top: 8px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--get-app-close);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.get-app__close:hover {
  opacity: 0.8;
}

.get-app__close svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Introduction: title and text, 12 apart, left-aligned in the 400 column. */
.get-app__intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  overflow-wrap: break-word;
}

/* Web Heading / Display 3 (semibold): 48 / 52.8, tracking -1.68. */
.get-app__title {
  margin: 0;
  color: #fff;
  font-size: 48px;
  font-weight: 590;
  line-height: 52.8px;
  letter-spacing: -1.68px;
}

/* Body 1 (regular): 16, White-70. */
.get-app__text {
  margin: 0;
  color: var(--text-70, rgba(255, 255, 255, 0.7));
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  letter-spacing: -0.5px;
}

/* The QR tile: 196 square on white, the code drawn in the surface colour. */
.get-app__qr {
  flex: none;
  width: 196px;
  height: 196px;
  background: #fff;
}

.get-app__qr-code {
  display: block;
  width: 100%;
  height: 100%;
}

.get-app__stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 32px;
}

/* Without the QR library there is nothing to scan. */
.get-app--no-qr .get-app__qr,
.get-app--no-qr .get-app__text {
  display: none;
}

@keyframes get-app-fade {
  from {
    opacity: 0;
  }
}

@keyframes get-app-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .get-app__shade,
  .get-app__dialog {
    animation: none;
  }
}

/* Only a narrow desktop window gets here; phones never open the dialog. */
@media (max-width: 520px) {
  .get-app__dialog {
    padding: 24px;
  }

  .get-app__title {
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: -1.26px;
  }
}
