/* ==========================================================================
   /download/crew and /download/business (views/pages/download.ejs): one screen per app.
   Object UI (docs/DESIGN-SYSTEM.md): the oat page, one slip luggage tag, no rules, one green action.

   .dl-top        the logo, the only way off the page
   .dl            fills the rest of the screen and centres the tag
   .dl-tag        the tag: upright with its hole at the top on phones, on its side with the hole on the left from
                  600px; the QR code (.dl-qr) joins it at the right end from 900px only
   .dl-icon       the app's mark: P2P Crew a moss tag on oat, P2P Business a sprout tag on moss-deep
   .dl-tag__alt   Android: the plain Download next to the version line, under "Open P2P Crew"
   .dl-tag__note  iPhone and iPad: the one line that the app is for Android, over "Use the website"
   .dl-web        Android, sent here from a crew or business page: "Use the website instead", small, under the tag
   Short screens (phones on their side) tighten the spacing so everything stays on one screen.
   ========================================================================== */

.is-download { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }

.dl-top { display: flex; align-items: center; min-height: 72px; padding: 8px var(--gutter) 0; }

.dl {
  flex: 1 0 auto; display: grid; place-items: center; align-content: center; row-gap: 18px;
  padding: 8px 16px clamp(32px, 7vh, 72px);
}

/* ---------- the tag: upright (phones) ---------- */
.dl-tag {
  --chamfer: 36px;
  position: relative; width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 76px 24px 32px;
  background: var(--slip); border-radius: var(--r-xl);
  clip-path: polygon(var(--chamfer) 0, calc(100% - var(--chamfer)) 0, 100% var(--chamfer), 100% 100%, 0 100%, 0 var(--chamfer));
}
.dl-tag__hole {
  position: absolute; top: 26px; left: 50%; width: 22px; height: 22px; margin-left: -11px;
  border-radius: 50%; background: var(--oat);
}

.dl-icon { display: block; flex: none; width: 76px; height: 76px; }
.dl-icon__tile { fill: var(--oat); }
.dl-icon__tag { fill: var(--moss); }
.dl-icon__hole { fill: var(--oat); }
.dl-tag--business .dl-icon__tile { fill: var(--moss-deep); }
.dl-tag--business .dl-icon__tag { fill: var(--sprout); }
.dl-tag--business .dl-icon__hole { fill: var(--moss-deep); }

.dl-tag__body { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; margin-top: 20px; }
.dl-tag__name {
  margin: 0; font-size: clamp(2rem, 9.5vw, 2.5rem); font-weight: 600; line-height: 1; letter-spacing: -.035em;
}
.dl-tag__for { margin: 10px 0 0; color: var(--ink-2); font-size: var(--body-size); line-height: 1.35; }

.dl-tag__get { display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: 28px; }
.dl-tag__btn { width: 100%; max-width: 320px; padding-inline: 20px; }
.dl-tag__meta { margin: 12px 0 0; color: var(--ink-2); font-size: var(--data-s); letter-spacing: 0; }
.dl-tag__alt {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 16px; margin: 6px 0 0;
}
.dl-tag__alt .dl-tag__meta { margin: 0; }
.dl-tag__note { margin: 0 0 16px; font-size: var(--body-size); font-weight: 500; line-height: 1.35; }

.dl-web { margin: 0; font-size: var(--small-size); line-height: 1.4; text-align: center; }
.dl-web a { display: inline-block; padding: 12px 4px; color: var(--ink-2); text-underline-offset: 4px; }
.dl-web a:hover { color: var(--ink); }

/* The QR code is only for someone on a computer: the APK has to reach a phone */
.dl-qr { display: none; }

/* ---------- on its side (600px and wider) ---------- */
@media (min-width: 600px) {
  .dl-tag {
    --chamfer: 42px;
    max-width: 640px;
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 28px;
    padding: 36px 40px 36px 104px; text-align: left;
    clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, var(--chamfer) 100%, 0 calc(100% - var(--chamfer)), 0 var(--chamfer));
  }
  .dl-tag__hole { top: 50%; left: 40px; width: 24px; height: 24px; margin: -12px 0 0; }
  .dl-icon { width: 96px; height: 96px; align-self: start; }
  .dl-tag__body { align-items: flex-start; margin-top: 0; }
  .dl-tag__name { font-size: 2.75rem; }
  .dl-tag__get { align-items: flex-start; margin-top: 24px; }
  .dl-tag__btn { width: auto; max-width: none; padding-inline: 28px; }
  .dl-tag__alt { justify-content: flex-start; }
}

/* ---------- the QR code joins the tag (900px and wider) ---------- */
@media (min-width: 900px) {
  .dl-tag { max-width: 820px; grid-template-columns: auto minmax(0, 1fr) auto; padding: 44px 44px 44px 112px; }
  .dl-tag__hole { left: 44px; }
  .dl-icon { width: 112px; height: 112px; }
  .dl-tag__name { font-size: 3.25rem; }
  .dl-qr {
    display: block; margin: 0; padding: 14px 14px 10px; width: 152px;
    border-radius: var(--r-l); background: var(--oat); text-align: center;
  }
  .dl-qr__code { display: block; width: 124px; height: 124px; margin: 0 auto; border-radius: 6px; }
  .dl-qr figcaption { margin-top: 8px; color: var(--ink-2); font-size: var(--xs-size); line-height: 1.3; }
}

/* ---------- short screens: a phone on its side ---------- */
@media (max-height: 520px) and (min-width: 600px) {
  .dl-top { min-height: 56px; padding-top: 4px; }
  .dl { padding-bottom: 20px; }
  .dl-tag { padding-top: 24px; padding-bottom: 24px; }
  .dl-icon { width: 80px; height: 80px; }
  .dl-tag__name { font-size: 2.25rem; }
  .dl-tag__get { margin-top: 16px; }
  .dl-tag__meta { margin-top: 8px; }
}
@media (max-height: 560px) and (max-width: 599px) {
  .dl-top { min-height: 56px; }
  .dl-tag { padding-top: 64px; padding-bottom: 24px; }
  .dl-tag__hole { top: 22px; }
  .dl-icon { width: 64px; height: 64px; }
  .dl-tag__body { margin-top: 14px; }
  .dl-tag__get { margin-top: 20px; }
}
