/* Responsive overrides; load last. */

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1080px) {
  .callouts {
    display: none;
  }

  .hero-visual {
    width: var(--device-w);
  }

  .tile-official,
  .tile-languages {
    grid-column: span 12;
  }

  .tile-purchase,
  .tile-explain {
    grid-column: span 6;
  }

  .tile-mistakes {
    grid-column: span 12;
  }
}

@media (max-width: 960px) {
  .demo-layout,
  .faq-layout {
    grid-template-columns: 1fr;
  }

  .tile-images {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .bank-country {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 48px;
  }
}

@media (max-width: 880px) {
  .main-nav {
    display: none;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    justify-items: start;
    min-height: 0;
    padding-block: 40px 72px;
  }

  .hero-visual {
    --device-w: 272px;
    justify-self: center;
  }
}

@media (max-width: 720px) {
  .tile-purchase,
  .tile-explain {
    grid-column: span 12;
  }

  .bank-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
  }

  .bank-row dt {
    grid-column: 1;
    grid-row: 1;
  }

  .bank-row .bank-count {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .bank-row .bank-rule {
    grid-column: 1;
    grid-row: 2;
  }

  /* Phones: the screenshots become a swipeable strip inside the shell. */
  .shots {
    grid-template-columns: none;
    grid-auto-columns: minmax(220px, 64%);
    grid-auto-flow: column;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
  }

  .shot {
    scroll-snap-align: start;
  }

  .shot-frame {
    margin-left: 0;
  }

  .language-stack li:nth-child(2),
  .language-stack li:nth-child(3) {
    margin-left: 0;
  }

  .sign-row li {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }

  .sign-row img {
    width: 56px;
    height: 56px;
  }

  .extras {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .header-actions .button-small {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .hero-actions .text-link {
    justify-content: center;
  }

  .hero-actions .purchase-note {
    text-align: center;
  }

  .store-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .store-button {
    min-width: 0;
    padding: 0 16px;
  }

  .store-button strong {
    font-size: 16px;
  }

  .hero-facts {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .hero-facts div {
    padding-inline: 14px;
  }

  .hero-facts dd {
    font-size: 26px;
  }

  .hero-facts dt {
    font-size: 12px;
  }

  .hero-visual {
    --device-w: 256px;
  }

  .tile {
    border-radius: 24px;
  }

  .source-list li {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
  }

  .source-list span {
    grid-column: 1;
    grid-row: 2;
    font-size: 14px;
  }

  .source-list em {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .faq-list summary {
    font-size: 17px;
  }

  .download-panel {
    border-radius: 28px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

:lang(zh-CN) .bank-rule {
  word-break: keep-all;
}

/* Chinese copy breaks at punctuation, never inside a word such as 错题诊断. */
:lang(zh-CN) .hero-lede,
:lang(zh-CN) .section-lede,
:lang(zh-CN) .tile-body {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
