/* Keep the sticky navigation from covering anchored sections. */
html {
  scroll-padding-top: 6rem;
}

body {
  overflow-x: clip;
}

:focus-visible {
  outline: 3px solid #006d37;
  outline-offset: 3px;
}

/* The mockup's desktop nav becomes a compact dropdown on small screens. */
.mobile-menu-toggle {
  display: none;
}

.store-badge-image {
  display: block;
  height: auto;
}

.store-badge {
  --badge-w: 9.5rem;
  --badge-radius: 0.5rem;
  padding: 0 !important;
  overflow: hidden;
  border-radius: var(--badge-radius) !important;
  /* Black fills Google's baked-in rounded corners so both badges share one radius. */
  background: #000 !important;
  box-shadow: none !important;
  transition: transform 160ms ease;
}

.store-badge:hover {
  transform: translateY(-2px);
}

footer .store-badge {
  --badge-w: 6.25rem;
  --badge-radius: 0.375rem;
}

/*
 * Google's PNG carries transparent padding, so at the same width it looks
 * smaller than Apple's. Scale it up (1.3225x) so the visible artwork matches
 * the App Store badge height, then crop the padding (7.24% of image width).
 */
.store-badge-image {
  width: var(--badge-w);
}

.store-badge--play .store-badge-image {
  width: calc(var(--badge-w) * 1.3225);
  margin: calc(var(--badge-w) * 1.3225 * -0.0724);
  max-width: none;
}

/* Desktop: center the nav on the page, independent of the logo's width. */
@media (min-width: 1024px) {
  header > div {
    position: relative;
  }

  .primary-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 1023px) {
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 0.75rem;
    color: #0b1c30;
    background: #eff4ff;
    cursor: pointer;
  }

  .mobile-menu-toggle:hover {
    background: #dce9ff;
  }

  .primary-nav.is-open {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 1rem;
    right: 1rem;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid #e5eeff;
    border-radius: 1rem;
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 12px 32px rgb(11 28 48 / 14%);
  }

  .primary-nav.is-open a {
    padding: 0.75rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
