/* English headline and responsive hero refinements */
.hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 32px;
}

.hero h1 {
  max-width: 690px;
  font-size: clamp(48px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.hero h1 span {
  display: block;
}

.hero-text {
  text-wrap: pretty;
}

.mac-notice {
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 650;
  text-align: center;
  text-wrap: pretty;
}

.platform-card .guide-link {
  grid-column: 1 / -1;
  width: max-content;
  margin: -4px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease;
}

.platform-card .guide-link:hover {
  color: var(--ink);
}

.platform-card .guide-link:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgb(22 138 91 / .28);
  outline-offset: 2px;
}

.platform-card {
  position: relative;
  scroll-margin-top: 100px;
}

.device-note {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
}

.qr-control {
  position: absolute;
  right: 18px;
  bottom: 17px;
  z-index: 5;
}

.qr-trigger {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
}

.qr-trigger:hover,
.qr-trigger:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.qr-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-popover {
  position: absolute;
  top: auto;
  bottom: calc(100% + 10px);
  right: 0;
  width: 154px;
  max-width: calc(100vw - 32px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 20px rgb(21 49 38 / .18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.qr-popover::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 100%;
  bottom: auto;
  border: 7px solid transparent;
  border-top-color: white;
}

.qr-popover strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}

.qr-popover img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.qr-control:hover .qr-popover,
.qr-control:focus-within .qr-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.guide-dialog {
  width: min(980px, calc(100% - 40px));
  max-width: none;
  height: min(92dvh, 980px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: white;
  color: var(--ink);
  box-shadow: 0 12px 32px rgb(21 49 38 / .2);
}

.guide-dialog::backdrop {
  background: rgb(8 25 18 / .68);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 68px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.dialog-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.dialog-close {
  min-width: 64px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.dialog-content {
  height: calc(100% - 68px);
  padding: 18px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f3f7f4;
}

.dialog-content img {
  width: min(100%, 900px);
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  background: white;
}

body.dialog-open {
  overflow: hidden;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
    padding-bottom: 42px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero h1 {
    font-size: clamp(46px, 7vw, 58px);
  }

  .hero-art {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
  }
}

@media (max-width: 800px) {
  .download-overview {
    padding-bottom: 150px;
  }

  .platform-card {
    scroll-margin-top: 140px;
  }

  .site-header nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }

  .site-header nav a {
    min-width: 0;
    justify-content: center;
    gap: 5px;
    padding: 7px 4px;
    font-size: 13px;
    white-space: nowrap;
  }

  .site-header .nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }

  .hero {
    padding: 48px 20px 34px;
  }

  .hero h1 {
    font-size: clamp(38px, 8.5vw, 52px);
  }

  .guide-dialog {
    width: calc(100% - 20px);
    height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .dialog-header {
    height: 60px;
    padding: 0 14px;
  }

  .dialog-header h2 {
    font-size: 18px;
  }

  .dialog-content {
    height: calc(100% - 60px);
    padding: 8px;
  }

  .qr-control {
    right: 14px;
    bottom: 15px;
  }

  .qr-popover {
    width: min(140px, calc(100vw - 32px));
    padding: 8px;
  }

  .qr-popover strong {
    margin-bottom: 5px;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .site-header nav a {
    gap: 4px;
    padding-inline: 2px;
    font-size: 12px;
  }

  .hero h1 {
    max-width: 11.5em;
    font-size: clamp(31px, 9vw, 40px);
    line-height: 1.08;
    letter-spacing: -.035em;
  }

  .hero h1 span:first-child {
    max-width: 10em;
  }

  .hero-text {
    margin: 20px 0 24px;
  }

  .mac-notice {
    max-width: 28ch;
    margin-top: 24px;
    font-size: 17px;
  }
}

/* Keep the landing page within one viewport. Guide dialogs scroll independently. */
html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
}

.site-header {
  position: relative;
  height: 78px;
  min-height: 0;
}

main {
  display: grid;
  grid-template-rows: minmax(0, 52%) minmax(0, 48%);
  height: 100%;
  min-height: 0;
}

.hero {
  width: 100%;
  min-height: 0;
  padding-top: clamp(22px, 4vh, 52px);
  padding-bottom: clamp(22px, 4vh, 52px);
}

.hero-art {
  min-height: min(40vh, 390px);
}

.download-overview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding-top: clamp(18px, 3vh, 38px);
  padding-bottom: clamp(16px, 2.5vh, 32px);
}

.section-heading {
  margin-bottom: clamp(14px, 2vh, 24px);
}

.section-heading .kicker {
  margin-bottom: 6px;
}

.section-heading h2 {
  font-size: clamp(30px, 3.2vw, 42px);
}

.section-heading > p:last-child {
  margin: 8px 0 0;
}

.platform-card {
  gap: 12px 16px;
  padding: clamp(16px, 2vh, 22px);
}

.platform-card > a:not(.guide-link) {
  padding-top: 10px;
  padding-bottom: 10px;
}

.mac-notice {
  margin-top: clamp(12px, 2vh, 22px);
}

@media (max-height: 760px) and (min-width: 801px) {
  main {
    grid-template-rows: 49% 51%;
  }

  .hero h1 {
    font-size: clamp(42px, 4vw, 52px);
  }

  .hero-text {
    margin: 16px 0;
    font-size: 16px;
  }

  .hero-art {
    min-height: 300px;
    transform: scale(.88);
  }

  .platform-logo {
    width: 44px;
    height: 44px;
  }

  .mac-notice {
    font-size: 17px;
  }
}

@media (max-width: 800px) {
  body {
    grid-template-rows: 62px minmax(0, 1fr);
  }

  .site-header {
    height: 62px;
    padding: 10px 16px;
  }

  main {
    grid-template-rows: minmax(0, 42%) minmax(0, 58%);
  }

  .hero {
    display: flex;
    align-items: center;
    padding: 14px 20px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-art {
    display: none;
  }

  .hero .kicker {
    margin-bottom: 7px;
    font-size: 11px;
  }

  .hero h1 {
    font-size: clamp(29px, 8.4vw, 38px);
    line-height: 1.04;
  }

  .hero-text {
    max-width: 44ch;
    margin: 12px 0 14px;
    font-size: 14px;
    line-height: 1.45;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .button {
    min-height: 42px;
    padding-inline: 14px;
    font-size: 13px;
  }

  .download-overview {
    justify-content: flex-start;
    padding: 14px 12px 12px;
  }

  .section-heading {
    margin-bottom: 10px;
  }

  .section-heading .kicker {
    display: none;
  }

  .section-heading h2 {
    font-size: clamp(22px, 6.4vw, 28px);
  }

  .section-heading > p:last-child {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
  }

  .platform-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .platform-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
    padding: 10px 7px 36px;
    border-radius: 14px;
  }

  .platform-logo {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border-radius: 10px;
    font-size: 15px;
  }

  .platform-card > div:nth-child(2) {
    min-width: 0;
    text-align: center;
  }

  .platform-card h3 {
    font-size: 14px;
    line-height: 1.15;
  }

  .platform-card p {
    min-height: 28px;
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.25;
  }

  .device-note {
    display: block;
    margin: 2px 0 0;
    font-size: 8px;
    line-height: 1.1;
  }

  .platform-card > a:not(.guide-link) {
    width: 100%;
    padding: 8px 7px;
    font-size: 11px;
  }

  .platform-card .guide-link {
    position: absolute;
    left: 7px;
    bottom: 10px;
    margin: 0;
    padding: 2px;
    font-size: 10px;
  }

  .qr-control {
    right: 7px;
    bottom: 7px;
  }

  .qr-trigger {
    width: 28px;
    height: 28px;
    padding: 3px;
    border-radius: 8px;
  }

  .qr-popover {
    width: min(132px, calc(100vw - 24px));
    padding: 7px;
  }

  #android-card .qr-popover {
    right: -18px;
  }

  .mac-notice {
    max-width: none;
    margin-top: 9px;
    font-size: 12px;
    line-height: 1.3;
  }
}

@media (max-width: 360px), (max-height: 700px) {
  main {
    grid-template-rows: minmax(0, 39%) minmax(0, 61%);
  }

  .hero {
    padding-block: 8px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-text {
    margin: 8px 0 10px;
    font-size: 12px;
  }

  .hero-actions .button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .download-overview {
    padding-top: 9px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .section-heading > p:last-child {
    display: none;
  }

  .platform-card {
    padding-inline: 5px;
  }

  .mac-notice {
    font-size: 11px;
  }
}
