/* Breakpoints. The desktop composition is the default; everything here narrows it.
   Three stops: 1180px (small laptop — the two-column bands stack), 900px (nav collapses),
   620px (phone — single column throughout). */

@media (max-width: 1180px) {
  .hero__grid,
  .app__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-block: 56px 150px;
  }

  .hero__bg {
    width: 100%;
    opacity: 0.5;
  }

  .hero::after {
    background: linear-gradient(180deg, #eef6fc 0%, rgba(238, 246, 252, 0.86) 46%, rgba(238, 246, 252, 0.6) 100%);
  }

  .hero__sub {
    max-width: 60ch;
  }

  .hero__devices {
    max-width: 720px;
    margin-inline: auto;
  }

  .grid-4,
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step__arrow {
    display: none;
  }

  .stats__card {
    padding: var(--space-6) var(--space-4);
  }

  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app__phones {
    margin-top: var(--space-8);
  }
}

@media (max-width: 900px) {
  .site-nav,
  .lang,
  .site-header__actions .btn--ghost {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-drawer {
    position: fixed;
    z-index: 39;
    top: var(--header-h);
    right: 0;
    left: 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  html[data-nav-open] .nav-drawer {
    display: block;
  }

  .nav-drawer ul {
    padding: var(--space-2) var(--gutter) var(--space-4);
  }

  .nav-drawer a {
    display: block;
    padding: var(--space-3) var(--space-2);
    border-bottom: 1px solid var(--line);
    color: var(--ink-900);
    font-size: var(--fs-lead);
    font-weight: 500;
    text-decoration: none;
  }

  .nav-drawer .btn {
    display: flex;
    margin: var(--space-4) var(--gutter) var(--space-5);
  }

  .section {
    padding-block: 64px;
  }

  .section-head {
    margin-bottom: var(--space-8);
  }

  .section-head__row,
  .cta__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .stats {
    margin-top: -72px;
  }

  .stats__card {
    gap: var(--space-5);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat + .stat {
    border-left: 0;
  }

  .cta {
    padding: 34px 28px;
  }

  .cta-wrap {
    padding-block: 0 64px;
  }
}

@media (max-width: 620px) {
  :root {
    --gutter: 20px;
    --header-h: 60px;
  }

  .brand img {
    height: 30px;
  }

  .brand span {
    font-size: 1.1875rem;
  }

  .hero {
    padding-block: 40px 128px;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .hero__devices {
    padding-inline: 10px;
  }

  .hero__phone {
    bottom: -20px;
    left: 0;
    width: 30%;
  }

  /* The stacked chips would collide with the mockups at this width, so they become a plain row
     underneath instead of floating over the artwork. */
  .hero__chips {
    position: static;
    margin-top: var(--space-8);
    grid-template-columns: minmax(0, 1fr);
  }

  .float-chip {
    justify-content: flex-start;
    white-space: normal;
  }

  .stats {
    margin-top: -64px;
  }

  .stats__card,
  .grid-4,
  .grid-3,
  .grid-2,
  .steps,
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat {
    padding-inline: 0;
  }

  .section {
    padding-block: 52px;
  }

  .card,
  .step {
    padding: var(--space-5);
  }

  .app__phones {
    gap: var(--space-3);
  }

  .app__phones .phone {
    width: 48%;
  }

  .app__phones .phone--raised {
    margin-bottom: var(--space-8);
  }

  /* The card is narrow enough that the photo must cover it, so the overlay has to carry the
     legibility on its own. */
  .cta__bg {
    width: 100%;
  }

  .cta::after {
    background: linear-gradient(180deg, rgba(10, 74, 53, 0.97) 34%, rgba(10, 74, 53, 0.9));
  }

  .cta .btn {
    width: 100%;
  }

  .site-footer {
    padding-block: var(--space-12) var(--space-6);
  }

  .site-footer__bottom {
    margin-top: var(--space-8);
  }
}
