/* Mobile and tablet overrides shared by every page. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

/* The Why Perth image moves with the page instead of staying viewport-fixed. */
.why-perth .fb-bg,
.final-cta .fb-bg {
  background-attachment: scroll;
}

.burger {
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  margin-right: -11px;
  padding: 9px 11px;
  touch-action: manipulation;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.mobile-menu {
  visibility: hidden;
  pointer-events: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: calc(5.5rem + env(safe-area-inset-top));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  padding-left: max(1.25rem, env(safe-area-inset-left));
}

.mobile-menu.open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 48px;
  touch-action: manipulation;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .nav {
  z-index: 110;
}

body.menu-open .brand {
  color: var(--ivory);
}

body.menu-open .burger span {
  background: var(--ivory);
}

body.menu-open .burger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

body.menu-open .burger span:nth-child(2) {
  opacity: 0;
}

body.menu-open .burger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {
  .wrap,
  .wrap-wide {
    width: min(100% - 2rem, 42rem);
  }

  .grid2,
  .grid2[style] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: clamp(2rem, 8vw, 3.5rem) !important;
  }

  .grid2 > *,
  .split > *,
  .tips-grid > * {
    min-width: 0;
  }

  .tips-grid,
  .tips-grid[style] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero {
    min-height: 100dvh;
  }

  .hero .wrap {
    padding-top: clamp(6.5rem, 17vh, 8rem);
    padding-bottom: clamp(3rem, 8vh, 5rem);
  }

  .hero-bg {
    inset: 0;
    background-position: 58% center;
    will-change: auto;
  }

  .home-hero .hero-bg {
    background-position: 42% center;
  }

  .display {
    font-size: clamp(2.55rem, 12vw, 4.25rem);
  }

  .home-hero-title {
    font-size: clamp(2.2rem, 10vw, 2.8rem);
    line-height: 1.03;
    max-width: 15ch !important;
  }

  .home-hero-title .title-location {
    margin-top: .22em;
    font-size: .68em;
  }

  .page-hero {
    padding-top: clamp(7.5rem, 18vh, 9rem);
  }

  .eyebrow {
    flex-wrap: wrap;
    gap: .55rem;
    font-size: .68rem;
    letter-spacing: .17em;
    line-height: 1.55;
  }

  .eyebrow::before,
  .eyebrow.center::after {
    width: 1.75rem;
  }

  .split-media .float-card {
    max-width: min(15rem, 78%);
  }

  .chat-ui {
    width: 100%;
    max-width: 430px;
  }

  .compat-row {
    grid-template-columns: minmax(7rem, 1fr) minmax(3rem, 1.4fr) 2.75rem;
    gap: .65rem;
  }

  .fullbleed {
    min-height: 70dvh;
  }

  .carousel-head {
    align-items: flex-start;
  }

  .cta-band {
    border-radius: 24px;
  }

  .auth-panel {
    min-height: 100dvh;
    padding: 6.5rem 1rem 3rem;
  }

  .field input {
    min-height: 48px;
    font-size: 1rem;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .nav {
    padding: .85rem 0;
  }

  .nav.solid {
    padding: .55rem 0;
  }

  .brand {
    max-width: calc(100vw - 6.5rem);
    overflow: hidden;
    font-size: clamp(1.05rem, 5.3vw, 1.25rem);
    text-overflow: ellipsis;
  }

  .mobile-menu {
    justify-content: flex-start;
    gap: 0;
  }

  .mobile-menu a {
    font-size: clamp(1.35rem, 6.4vw, 1.85rem);
    padding: .35rem .15rem;
  }

  .pad {
    padding: clamp(3.75rem, 15vw, 5.25rem) 0;
  }

  .pad-sm {
    padding: clamp(2.75rem, 11vw, 4rem) 0;
  }

  .hero .lede {
    margin: 1.15rem 0 1.65rem;
    font-size: 1rem;
    line-height: 1.65;
  }

  .hero .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem .75rem;
    margin-top: 2rem;
  }

  .hero-meta div {
    min-width: 0;
    padding-left: .75rem;
  }

  .hero-meta b {
    font-size: 1.3rem;
  }

  .hero-meta span {
    font-size: .67rem;
    letter-spacing: .1em;
  }

  .scroll-hint {
    display: none;
  }

  .btn {
    min-height: 48px;
    max-width: 100%;
    padding: .9rem 1.35rem;
    white-space: normal;
    text-align: center;
    touch-action: manipulation;
  }

  .grid2 > a[style*="min-height"] {
    min-height: 390px !important;
    padding: 1.5rem !important;
  }

  .split-media .main-img {
    border-radius: 110px 110px 18px 18px;
  }

  .profiles {
    grid-auto-columns: min(82vw, 19rem);
    gap: 1rem;
  }

  .carousel-head {
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
  }

  .car-btn {
    width: 48px;
    height: 48px;
    touch-action: manipulation;
  }

  .area {
    min-height: 220px !important;
    padding: 1.25rem;
  }

  .chat-head,
  .chat-body {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .chat-input {
    padding: .85rem 1rem;
  }

  .bubble {
    max-width: 88%;
  }

  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1rem;
  }

  .cta-band {
    padding: 2.75rem 1.25rem;
    border-radius: 20px;
  }

  .foot-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .foot-grid ul {
    gap: 0;
  }

  .foot-grid ul a,
  .foot-bottom a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
    padding-right: .35rem;
    padding-left: .35rem;
  }

  .foot-bottom,
  .foot-bottom .legal {
    flex-direction: column;
    gap: .5rem;
  }

  .foot-bottom .legal {
    align-items: flex-start;
  }

  .faq-q {
    min-height: 64px;
    gap: 1rem;
    padding: 1.25rem 0;
  }

  .faq-q .plus {
    width: 44px;
    height: 44px;
  }

  .prose,
  .prose p,
  .prose li {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .wrap,
  .wrap-wide {
    width: calc(100% - 1.5rem);
  }

  .display {
    font-size: clamp(2.25rem, 12vw, 3rem);
  }

  .compat-row {
    grid-template-columns: minmax(6.5rem, 1fr) minmax(2rem, 1fr) 2.5rem;
    gap: .45rem;
    font-size: .8rem;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .mobile-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    column-gap: 1.25rem;
    padding-top: calc(4rem + env(safe-area-inset-top));
    padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
  }

  .mobile-menu a {
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 1.05rem;
  }

  .hero {
    min-height: 38rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }

  .rv {
    opacity: 1;
    transform: none;
  }
}
