/* RoamXP /go/ — premium Apple-like download destination */

:root {
  --rx-bg: #f5f5f7;
  --rx-surface: #ffffff;
  --rx-ink: #1d1d1f;
  --rx-muted: #6e6e73;
  --rx-faint: #86868b;
  --rx-line: rgba(0, 0, 0, 0.06);
  --rx-accent: #8a6a3d;
  --rx-sans: "Avenir Next", "Helvetica Neue", Helvetica, "Segoe UI", sans-serif;
  --rx-shell: 36rem;
  --rx-pad: 1.5rem;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 2.75rem;
  --badge-h: 3.25rem; /* ~52px visible App Store badge height */
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--rx-bg);
  color: var(--rx-ink);
  font-family: var(--rx-sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--rx-ink);
  outline-offset: 3px;
  border-radius: 0.35rem;
}

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 20;
  transform: translateY(-140%);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--rx-ink);
  color: var(--rx-surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.skip-link:focus {
  transform: translateY(0.75rem);
}

/* One shared content shell for header / hero / footer */
.shell {
  width: 100%;
  max-width: var(--rx-shell);
  margin-inline: auto;
  padding-inline: var(--rx-pad);
}

main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.download {
  width: 100%;
  min-width: 0;
  padding: var(--space-5) 0 var(--space-5);
}

.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  min-width: 0;
}

.app-icon-link {
  display: block;
  line-height: 0;
  border-radius: 1.45rem;
  text-decoration: none;
}

.app-icon {
  width: 6.75rem;
  height: 6.75rem;
  border-radius: 1.45rem;
  flex-shrink: 0;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 14px 32px rgba(0, 0, 0, 0.1);
}

.app-name {
  margin: var(--space-4) 0 0;
  width: 100%;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-title {
  margin: var(--space-2) 0 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.14;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.hero-lede {
  margin: var(--space-3) 0 0;
  width: 100%;
  max-width: 22.5rem;
  min-width: 0;
  color: var(--rx-muted);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.45;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* iOS in-app (TikTok/Instagram/…) App Store handoff fallback */
.ios-inapp {
  margin-top: var(--space-5);
  width: 100%;
  max-width: 22.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}

.ios-inapp[hidden] {
  display: none !important;
}

.ios-inapp__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 20rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  background: var(--rx-ink);
  color: var(--rx-surface);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ios-inapp__cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.ios-inapp__lead {
  margin: 0;
  width: 100%;
  color: var(--rx-muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.4;
  text-wrap: pretty;
}

.ios-inapp__steps {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 20rem;
  list-style: none;
  counter-reset: ios-step;
  color: var(--rx-ink);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.45;
  text-align: left;
}

.ios-inapp__steps li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.85rem;
}

.ios-inapp__steps li::before {
  content: counter(ios-step);
  counter-increment: ios-step;
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--rx-ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

body.ios-inapp-active .store-actions {
  margin-top: var(--space-4);
}

.store-actions {
  margin-top: var(--space-5);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  text-decoration: none;
  line-height: 0;
  border-radius: 0.55rem;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.store-badge:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.store-badge--primary {
  order: -1;
}

.store-badge__img--apple {
  width: auto;
  max-width: 100%;
  height: var(--badge-h);
}

.store-badge__img--google {
  /* Official Play asset includes clear-space padding; scale so wordmark ≈ Apple */
  width: auto;
  max-width: min(100%, 12.75rem);
  height: auto;
  max-height: calc(var(--badge-h) * 1.58); /* ~+7% optical boost */
  margin-block: calc(var(--badge-h) * -0.22);
}

.desktop-qr {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  max-width: 100%;
}

.desktop-qr[hidden] {
  display: none !important;
}

.desktop-qr__mount {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 0.65rem;
  background: var(--rx-surface);
  border: 1px solid var(--rx-line);
  padding: 0.4rem;
  display: grid;
  place-items: center;
}

.desktop-qr__mount img,
.desktop-qr__mount canvas {
  width: 100% !important;
  height: 100% !important;
}

.desktop-qr__caption {
  margin: 0;
  max-width: 8.5rem;
  color: var(--rx-muted);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  text-align: left;
}

.offer-note {
  margin: var(--space-5) 0 0;
  width: 100%;
  max-width: 22rem;
  min-width: 0;
  color: var(--rx-faint);
  font-size: 0.78rem;
  line-height: 1.45;
  letter-spacing: -0.005em;
  overflow-wrap: break-word;
}

.noscript-note {
  margin: var(--space-3) 0 0;
  width: 100%;
  color: var(--rx-muted);
  font-size: 0.9rem;
}

.noscript-note a {
  color: var(--rx-ink);
  text-underline-offset: 0.12em;
}

.site-footer {
  width: 100%;
  padding: 0 0 var(--space-5);
  margin-top: var(--space-4);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  width: 100%;
  min-width: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--rx-line);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.15rem 0.55rem;
  max-width: 100%;
  color: var(--rx-muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.footer-nav a {
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.15rem;
}

.footer-nav a:hover {
  color: var(--rx-ink);
}

.footer-sep {
  color: var(--rx-faint);
  user-select: none;
}

.footer-copy {
  margin: 0;
  color: var(--rx-faint);
  font-size: 0.75rem;
  letter-spacing: -0.005em;
}

/* Very narrow phones: stack badges rather than shrinking excessively */
@media (max-width: 359px) {
  :root {
    --rx-pad: 1.15rem;
    --badge-h: 3.2rem;
  }

  .store-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.05rem;
  }

  .store-badge__img--google {
    margin-block: -0.45rem;
  }
}

/* Mid mobile: keep badges side-by-side at premium size */
@media (min-width: 360px) and (max-width: 719px) {
  :root {
    --rx-pad: 1.1rem;
    --badge-h: 3.15rem; /* ~50px */
  }

  .store-actions {
    flex-wrap: nowrap;
    gap: 0.3rem 0.4rem;
  }

  .store-badge__img--google {
    /* ~6–8% larger optical presence vs prior mid-mobile sizing */
    max-width: 11.75rem;
    max-height: 5rem;
  }
}

@media (max-width: 719px) {
  .desktop-qr {
    display: none !important;
  }

  .hero-title {
    max-width: min(100%, 13rem);
    font-size: clamp(1.7rem, 7.5vw, 2.05rem);
  }

  .hero-lede,
  .offer-note {
    max-width: 100%;
  }

  .download {
    padding: var(--space-4) 0 var(--space-3);
  }

  .offer-note {
    margin-top: var(--space-4);
  }

  /* Avoid a tall empty band between content and footer on long phones */
  main {
    flex: 0 0 auto;
    align-items: flex-start;
  }

  .site-footer {
    margin-top: var(--space-3);
    padding-bottom: var(--space-5);
  }
}

@media (min-width: 720px) {
  :root {
    --rx-pad: 1.75rem;
    --badge-h: 3.4rem; /* ~54px */
  }

  .download {
    padding: var(--space-5) 0 var(--space-6);
  }

  .app-icon {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 1.65rem;
  }

  .app-name {
    font-size: 1.28rem;
  }

  .hero-title {
    width: auto;
    max-width: min(100%, 34rem);
    font-size: clamp(2.2rem, 2.8vw, 2.55rem);
  }

  .hero-lede {
    max-width: 24rem;
    font-size: 1.06rem;
  }

  .store-actions {
    gap: var(--space-2) var(--space-4);
  }

  .store-badge__img--google {
    max-width: 12.75rem;
  }

  .offer-note {
    max-width: 26rem;
  }

  main {
    flex: 1 1 auto;
  }

  .site-footer {
    margin-top: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-badge,
  .ios-inapp__cta {
    transition: none;
  }
}
