/* Shared mobile nav drawer + compact header (max-width: 639px) */

.nav-mobile-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: color-mix(in srgb, #58cc02 14%, #ffffff);
  color: #1a1f1a;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-mobile-toggle:focus-visible {
  outline: 2px solid #7ddb2f;
  outline-offset: 2px;
}

.nav-mobile-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-mobile-toggle[aria-expanded="true"] .nav-mobile-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-mobile-toggle[aria-expanded="true"] .nav-mobile-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-mobile-toggle[aria-expanded="true"] .nav-mobile-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: color-mix(in srgb, #1a1f1a 42%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 850;
  width: min(20rem, calc(100vw - 2.25rem));
  max-width: 100%;
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1.15rem 1.25rem
    max(1rem, env(safe-area-inset-right, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-left: 1px solid color-mix(in srgb, #58cc02 18%, #ffffff);
  box-shadow: -10px 0 36px rgba(26, 31, 26, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.site-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-drawer__list + .site-drawer__list {
  margin-top: 0.35rem;
}

.site-drawer__list a {
  display: block;
  padding: 0.65rem 0.55rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: #1a1f1a;
  text-decoration: none;
}

.site-drawer__list a:hover {
  background: color-mix(in srgb, #58cc02 10%, #ffffff);
}

.site-drawer__list a[aria-current="page"] {
  color: #58cc02;
  background: color-mix(in srgb, #58cc02 12%, #ffffff);
}

.site-drawer__cta {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, #58cc02 12%, rgba(255, 255, 255, 0.9));
}

.site-drawer__cta .app-store-badge img {
  height: 44px;
  width: auto;
}

html.nav-drawer-open,
html.nav-drawer-open body {
  overflow: hidden;
}

/* Home locks viewport height; release when menu is open so the drawer is not clipped */
html.nav-drawer-open:has(body.page-home) {
  max-height: none;
  height: auto;
  overflow: visible;
}

@media (max-width: 639px) {
  .site-header-shell {
    z-index: 750;
  }

  .site-header__inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.58rem 0.95rem 0.62rem 1rem;
  }

  .nav-mobile-toggle {
    display: inline-flex;
  }

  .site-nav--desktop {
    display: none !important;
  }

  .app-store-badge--nav-desktop {
    display: none !important;
  }

  /* Footer: copyright-only strip (matches home) on all pages */
  .site-footer__nav,
  .site-footer__download {
    display: none !important;
  }

  .site-footer__row {
    justify-content: center;
    min-height: 0;
  }

  .site-footer-shell {
    margin-top: 0.5rem;
  }
}

/* ——— Home mobile: App Store in hero + hide below-fold blocks ——— */
@media (max-width: 639px) {
  body.page-home .mobile-landing-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
  }

  body.page-home .mobile-landing-cta .app-store-badge img {
    height: 48px;
    width: auto;
  }
}

/* ——— Sponsors page: 3-up pillars with icon on mobile ——— */
@media (max-width: 639px) {
  body.sponsors-page .sponsors-pitch__pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 0.45rem;
    align-items: start;
  }

  body.sponsors-page .sponsors-pitch__pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 0.55rem 0.2rem;
    border: none;
    border-bottom: none;
  }

  body.sponsors-page .sponsors-pitch__pillar-text {
    display: none;
  }

  body.sponsors-page .sponsors-pitch__pillar-title {
    font-size: 0.8125rem;
    line-height: 1.22;
    margin: 0;
    white-space: normal;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  body.sponsors-page .sponsors-pitch__pillar-icon {
    flex-shrink: 0;
  }

  body.sponsors-page .sponsors-pitch__pillar-icon img {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
  }
}

/* Desktop: hide mobile-only CTA strip */
.mobile-landing-cta {
  display: none;
}
