/* ==========================================================================
   Mobile home — containment + alignment (≤720px)
   Goal: zero horizontal overflow, consistent gutters, stable claim panel.
   ========================================================================== */

@media (max-width: 720px) {
  html {
    overflow-x: clip;
  }

  body.page-home {
    overflow-x: clip;
    max-width: 100%;
  }

  /* Kill section side padding that stacks with .container and widens content */
  body.page-home section {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  body.page-home .container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }

  /* —— Hero — story first: eyebrow → headline → lede → claim → actions —— */
  .page-home .hero {
    height: auto;
    min-height: 100svh;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    max-width: 100%;
    padding:
      calc(5.5rem + env(safe-area-inset-top, 0px))
      max(1.5rem, env(safe-area-inset-right, 0px))
      max(2.5rem, env(safe-area-inset-bottom, 0px))
      max(1.5rem, env(safe-area-inset-left, 0px)) !important;
  }

  .page-home .hero-media,
  .page-home .hero-bg,
  .page-home .hero-bg-overlay {
    max-width: 100%;
  }

  .page-home .hero-bg {
    inset: 0;
    height: 100%;
    width: 100%;
  }

  .page-home .hero-poster,
  .page-home .hero-video-bg {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
  }

  .page-home .hero-bg-overlay {
    background:
      linear-gradient(
        180deg,
        rgba(7, 11, 20, 0.78) 0%,
        rgba(7, 11, 20, 0.62) 32%,
        rgba(7, 11, 20, 0.82) 68%,
        rgba(7, 11, 20, 0.96) 100%
      ),
      radial-gradient(ellipse at 50% 12%, rgba(47, 107, 255, 0.2), transparent 55%);
  }

  .page-home .hero-orbs {
    display: none;
  }

  .page-home .hero-layout.container,
  .page-home .hero-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0 !important;
    box-sizing: border-box;
  }

  /*
   * The copy block dissolves so its children and the claim panel can be
   * interleaved into one deliberate reading order.
   */
  .page-home .hero-copy {
    display: contents;
  }

  /* The navbar already carries the brand — no duplicate hero wordmark */
  .page-home .hero-brand {
    display: none;
  }

  .page-home .hero-copy .eyebrow {
    order: 1;
    align-self: flex-start;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 0.9rem;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    box-sizing: border-box;
  }

  .page-home .hero-copy h1 {
    order: 2;
    max-width: 100%;
    font-size: clamp(2.05rem, 9.2vw, 2.65rem);
    line-height: 1.07;
    letter-spacing: -0.035em;
    overflow-wrap: break-word;
  }

  .page-home .hero-copy .lede {
    order: 3;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0.9rem 0 0;
    max-width: 100%;
    color: rgba(248, 250, 252, 0.78);
    overflow-wrap: break-word;
  }

  .page-home .hero-panel {
    order: 4;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 1.5rem;
    border-radius: 1.25rem;
    padding: 1.1rem 1rem 1.15rem;
    background: linear-gradient(172deg, rgba(15, 22, 38, 0.94), rgba(7, 11, 20, 0.9));
    border: 1px solid rgba(155, 182, 255, 0.24);
    /* Opaque gradient replaces backdrop blur — cheaper on phone GPUs */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow:
      0 24px 48px -22px rgba(5, 7, 15, 0.75),
      inset 0 1px 0 rgba(255, 255, 255, 0.09);
    overflow: hidden;
  }

  .page-home .hero-copy .cta-row {
    order: 5;
    margin-top: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
  }

  .page-home .hero-copy .cta-row .btn-primary {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    justify-content: center;
    font-size: 1rem;
    box-sizing: border-box;
  }

  .page-home .hero-copy .cta-row .btn-ghost {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    justify-content: center;
    background: transparent;
    border-color: rgba(248, 250, 252, 0.16);
    color: rgba(248, 250, 252, 0.85);
    box-sizing: border-box;
  }

  .page-home .handle-label {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    margin-bottom: 0.6rem;
  }

  /* One composed field: name + domain read as a single identity */
  .page-home .handle-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.35rem 0.3rem 0.8rem;
    border-radius: 0.9rem;
    background: rgba(5, 7, 15, 0.72);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .page-home .handle-field input {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    font-size: 16px;
    padding: 0.6rem 0;
    box-sizing: border-box;
  }

  /* Domain is identity, not a button — quiet chip, never truncated */
  .page-home .handle-suffix {
    width: auto;
    max-width: 62%;
    flex: 0 0 auto;
    margin: 0;
    text-align: right;
    font-size: 0.78rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.65rem;
    background: rgba(155, 182, 255, 0.12);
    color: var(--bexo-accent-soft, #9bb6ff);
    box-shadow: none;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-home .handle-status {
    overflow-wrap: break-word;
    margin-top: 0.6rem;
    font-size: 0.78rem;
  }

  .page-home .handle-claim {
    min-height: 48px;
    justify-content: center;
  }

  .page-home .handle-perks {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    min-width: 0;
  }

  .page-home .handle-perks li {
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(248, 250, 252, 0.55);
    min-width: 0;
  }

  .page-home .handle-perks strong {
    display: inline;
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.78rem;
    margin-right: 0.35rem;
  }

  .page-home .handle-claim {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .page-home .hero-scroll {
    display: none;
  }

  html[data-bexo-hero-video="off"] .page-home .hero-video-bg {
    display: none !important;
  }

  /* —— Marquee: contain sideways scroll —— */
  .page-home .marquee {
    padding: 0.85rem 0;
    max-width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(
      90deg,
      transparent 0,
      #000 1.25rem,
      #000 calc(100% - 1.25rem),
      transparent 100%
    );
    mask-image: linear-gradient(
      90deg,
      transparent 0,
      #000 1.25rem,
      #000 calc(100% - 1.25rem),
      transparent 100%
    );
  }

  .page-home .marquee-track span {
    font-size: 0.72rem;
  }

  /* —— Proof / stats —— */
  .page-home .proof .container {
    padding-top: 1.75rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  .page-home .proof p {
    font-size: 1rem;
    line-height: 1.5;
    max-width: 100%;
    text-wrap: pretty;
  }

  .page-home .social-proof {
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  .page-home .social-proof .container {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }

  .page-home .proof-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 0.85rem;
    width: 100%;
    max-width: 100%;
  }

  .page-home .proof-stat {
    min-width: 0;
    max-width: 100%;
  }

  .page-home .proof-divider {
    display: none;
  }

  .page-home .proof-number {
    font-size: 1.75rem;
  }

  .page-home .proof-label {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-wrap: balance;
  }

  /* —— Feature / why / workflow / pricing —— */
  .page-home .feature-split .container,
  .page-home .workflow .container,
  .page-home .why .container,
  .page-home .pricing-strip .container,
  .page-home .shore .container,
  .page-home .final-cta .container {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .page-home .feature-split .container {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
  }

  .page-home .feature-split .media {
    order: -1;
    width: 100%;
    max-width: 100%;
    border-radius: 1rem;
    aspect-ratio: 16 / 10;
  }

  .page-home .feature-split .copy,
  .page-home .feature-split .copy h2,
  .page-home .feature-split .copy p {
    max-width: 100%;
  }

  .page-home .feature-split .copy h2 {
    font-size: clamp(1.55rem, 6.5vw, 1.9rem);
  }

  .page-home .benefits-grid,
  .page-home .steps,
  .page-home .pricing-strip .cards,
  .page-home .shore-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 0.75rem;
  }

  .page-home .benefit-card,
  .page-home .step-card,
  .page-home .plan-card,
  .page-home .shore-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .page-home .final-cta {
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0px));
  }

  .page-home .site-footer .container {
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }
}

/* Mid phones / large phones still in mobile layout zone */
@media (max-width: 720px) and (min-width: 400px) {
  .page-home .handle-perks {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
  }

  .page-home .handle-perks li {
    font-size: 0.68rem;
    text-align: center;
  }

  .page-home .handle-perks strong {
    display: block;
    margin-right: 0;
    margin-bottom: 0.15rem;
  }
}

/* Shore notes — shared */
.shore {
  position: relative;
  z-index: 2;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(47, 107, 255, 0.1), transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(14, 116, 144, 0.12), transparent 45%),
    var(--bexo-ink-elevated, #070b14);
  border-top: 1px solid rgba(47, 107, 255, 0.1);
  border-bottom: 1px solid rgba(47, 107, 255, 0.08);
}

.shore .container {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.shore h2 {
  max-width: 16ch;
}

.shore-intro {
  max-width: 36rem;
  margin-top: 0.75rem;
  color: rgba(248, 250, 252, 0.68);
  font-size: 1rem;
  line-height: 1.65;
}

.shore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.shore-card {
  border-radius: 1.15rem;
  border: 1px solid rgba(155, 182, 255, 0.16);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  padding: 1.35rem 1.25rem 1.4rem;
  position: relative;
  overflow: hidden;
}

.shore-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 107, 255, 0.4), transparent);
  opacity: 0.7;
}

.shore-card .shore-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9bb6ff;
  margin-bottom: 0.55rem;
}

.shore-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
  color: #f8fafc;
}

.shore-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.62);
}

@media (max-width: 900px) {
  .shore-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 721px) {
  .page-home .handle-perks {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.55rem;
  }

  .page-home .handle-perks li {
    font-size: 0.72rem;
    color: rgba(248, 250, 252, 0.5);
    line-height: 1.35;
  }

  .page-home .handle-perks strong {
    display: block;
    color: rgba(248, 250, 252, 0.88);
    font-size: 0.74rem;
    font-weight: 700;
  }
}

/* —— Touch feel + low-power motion (phones) —— */
@media (max-width: 720px) {
  body.page-home {
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
  }

  body.page-home a,
  body.page-home button,
  body.page-home .btn,
  body.page-home input,
  body.page-home [role="button"] {
    touch-action: manipulation;
  }

  body.page-home .btn,
  body.page-home button:not(.nav-toggle) {
    min-height: 44px;
  }

  body.page-home input,
  body.page-home textarea,
  body.page-home select {
    font-size: 16px !important; /* prevent iOS zoom-on-focus */
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  body.page-home *,
  body.page-home *::before,
  body.page-home *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
