/* ═══════════════════════════════════════════════════════════════
   Hangar Mobile, the section

   The same tokens as styles.css, so every theme of the swatches
   repaints it. The screens are captures of the phone app; the phone
   around them is drawn here, as an iPhone from the Home Screen: the
   captures leave its status bar and home indicator empty (47 and
   34 px of 844), and the frame puts the island and the bar there.
   ═══════════════════════════════════════════════════════════════ */

/* ── the phones ──────────────────────────────────────────────── */

.phones {
  margin-top: clamp(48px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px clamp(16px, 2.6vw, 32px);
}

.phones__item {
  --phone: min(100cqw, 264px);
  --bezel: 9px;
  container-type: inline-size;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  min-width: 0;
}

.phones__item figcaption {
  width: var(--phone);
  color: var(--fg-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* A phone is black whatever the page's theme; its rim takes the
   page's strongest border, so it reads on a dark page as on a light one.
   Its corners follow the screen's, 12.1% of its width, one bezel out. */
.phone {
  container-type: inline-size;
  width: var(--phone);
  padding: var(--bezel);
  border-radius: calc((var(--phone) - 2 * var(--bezel)) * 0.121 + var(--bezel));
  background: #0b0b0d;
  box-shadow: 0 0 0 1px var(--border-strong), inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 32px 64px -30px var(--shadow), 0 14px 30px -18px var(--shadow);
}

.phone__screen {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12.1cqw;
  background: #121316;
}

.phone__screen img {
  width: 100%;
}

/* The island, in the status bar the capture left empty. */
.phone__screen::before {
  content: "";
  position: absolute;
  top: 2.6cqw;
  left: 50%;
  z-index: 1;
  width: 31%;
  height: 8.6cqw;
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

/* The home indicator. */
.phone__screen::after {
  content: "";
  position: absolute;
  bottom: 2.1cqw;
  left: 50%;
  z-index: 1;
  width: 34%;
  height: 1.3cqw;
  min-height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%);
}

.phones__note {
  margin-top: 28px;
  color: var(--fg-muted);
  font-size: 13px;
  text-align: center;
}

/* ── how it reaches the PC ───────────────────────────────────── */

.reach {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(48px, 6vw, 72px);
}

.reach__card {
  padding: 22px 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--chrome);
}

.reach__card h3 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

.reach__card p {
  margin-top: 10px;
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.reach__card code {
  padding: 1px 5px;
  border-radius: var(--r-xs);
  background: var(--raised);
  color: var(--fg-hi);
  font-size: 13px;
  white-space: nowrap;
}

.reach__steps {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--fg-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.reach__steps li {
  position: relative;
  padding-left: 32px;
  counter-increment: step;
}

.reach__steps li::before {
  content: counter(step);
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--raised);
  color: var(--fg-hi);
  font-size: 12px;
  font-weight: 620;
  line-height: 1;
}

.reach__steps b {
  font-weight: 560;
}

/* ── narrower screens ────────────────────────────────────────── */

@media (max-width: 959px) {
  .phones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reach {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* On a phone, the four phones scroll sideways, edge to edge, one
   and a bit at a time, as the theme swatches do. */
@media (max-width: 599px) {
  .phones {
    display: flex;
    gap: 14px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .phones::-webkit-scrollbar {
    display: none;
  }

  .phones__item {
    --bezel: 8px;
    flex: none;
    width: 230px;
    gap: 12px;
    scroll-snap-align: start;
  }

  .phones__item figcaption {
    font-size: 13.5px;
  }

  .phones__note {
    margin-top: 14px;
    font-size: 12.5px;
    text-align: left;
  }

  .reach {
    gap: 12px;
    margin-top: 32px;
  }

  .reach__card {
    padding: 16px 16px 18px;
  }

  .reach__card p,
  .reach__steps {
    font-size: 14.5px;
  }
}
