/* Mobile homepage hero: immersive full-bleed phone composition. Desktop is untouched. */

.lbd-brand-mobile-nav { display: none; }

@media (max-width: 640px) {
  html, body { overflow-x: hidden; }

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

  .lbd-brand-mobile-nav {
    /* Hugs the top like an app bar (Matt: the old 52px offset felt
       mis-spaced); safe-area keeps it clear of the notch on device. */
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    pointer-events: auto;
  }
  /* The topbar renders the shared <Logo living> lockup (globals.css
     .lbd-logo rules). Standard ink lockup on light pages; the --dark
     modifier (dark heroes — immersive Home) flips it to the locked
     reversed palette (docs/brand-logo-v2.md).
     Legibility over the bright artwork is carried by light, not by a
     container: a feathered corner vignette (reads as lens shading —
     no perceivable edge, so it belongs to the photograph) plus fine
     drop shadows that seat the type into the scene. */
  .lbd-brand-mobile-nav--dark::before {
    content: "";
    position: absolute;
    top: calc(-12px - env(safe-area-inset-top));
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(130% 155% at 16% 0%, rgba(19, 42, 37, .40) 0%, rgba(19, 42, 37, .18) 44%, rgba(19, 42, 37, 0) 71%);
    pointer-events: none;
    z-index: -1;
  }
  /* Mark-only on the dark home hero: sized to the burger's 44px box so
     the pair reads as one bar, and large enough for the engraved ring
     and orbit to carry the corner alone. */
  .lbd-brand-mobile-nav--dark .lbd-logo--mark .lbd-logo__mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
  .lbd-brand-mobile-nav--dark .lbd-logo__word,
  .lbd-brand-mobile-nav--dark .lbd-logo__tagline {
    text-shadow: 0 1px 2px rgba(19, 42, 37, .42), 0 4px 18px rgba(19, 42, 37, .55);
  }
  .lbd-brand-mobile-nav--dark .lbd-logo__mark svg {
    filter: drop-shadow(0 1px 1.5px rgba(19, 42, 37, .38)) drop-shadow(0 4px 14px rgba(19, 42, 37, .5));
  }
  /* Approved exception (Matt, 2026-07-30, brand-logo-v2.md): over the
     dark hero the By takes the warm orange node color for legibility —
     it rhymes with the node, the eyebrow dot, and the CTA. Everywhere
     else the By stays sage. The extra selector outweighs the inverted
     sage rule in globals.css, which loads later. */
  .lbd-brand-mobile-nav--dark .lbd-logo--inverted .lbd-logo__by {
    color: #F2A86B;
  }
  .lbd-brand-mobile-burger {
    width: 44px;
    height: 44px;
    border: 1px solid var(--paper-line-strong, rgba(31, 46, 42, .16));
    border-radius: 12px;
    background: var(--cream-elevated, #FFFCF3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    padding: 0;
  }
  .lbd-brand-mobile-burger i {
    width: 16px;
    height: 1.6px;
    border-radius: 2px;
    background: var(--ink, #1F2E2A);
    display: block;
  }
  .lbd-brand-mobile-nav--dark .lbd-brand-mobile-burger {
    border: 1px solid rgba(250, 245, 232, .18);
    background: rgba(250, 245, 232, .14);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .lbd-brand-mobile-nav--dark .lbd-brand-mobile-burger i {
    background: var(--cream-el, #FFFCF3);
  }

  .lbd-home .lbd-hero-stage {
    min-height: 100svh !important;
    height: 100svh !important;
    padding: 0 !important;
    background-color: var(--sage-night, #132a25) !important;
    background-size: cover !important;
    background-position: 56% 40% !important;
    display: block !important;
    overflow: hidden !important;
  }

  /* Repurpose the existing decorative hero layers into the mobile mockup layers. */
  .lbd-home .lbd-hero-stage > div:nth-child(1) {
    position: absolute !important;
    top: 16% !important;
    right: -40px !important;
    left: auto !important;
    bottom: auto !important;
    width: 300px !important;
    height: 170px !important;
    border: 1.5px solid rgba(240, 215, 184, .5) !important;
    border-radius: 50% !important;
    background: transparent !important;
    transform: rotate(-18deg) !important;
    opacity: .9 !important;
    z-index: 2 !important;
  }
  .lbd-home .lbd-hero-stage > div:nth-child(1)::after {
    content: "";
    position: absolute;
    top: 32px;
    right: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--orange, #D4734A);
    box-shadow: 0 0 0 6px rgba(212, 115, 74, .3);
  }
  .lbd-home .lbd-hero-stage > div:nth-child(2) {
    position: absolute !important;
    top: -6% !important;
    left: 50% !important;
    width: 420px !important;
    height: 420px !important;
    border-radius: 50% !important;
    transform: translateX(-50%) !important;
    background: radial-gradient(circle, rgba(246, 206, 150, .72) 0%, rgba(246, 206, 150, .22) 44%, transparent 68%) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }
  .lbd-home .lbd-hero-stage > div:nth-child(3) {
    position: absolute !important;
    inset: 0 !important;
    height: auto !important;
    background: linear-gradient(180deg, rgba(30, 46, 42, .30) 0%, rgba(30, 46, 42, 0) 26%, rgba(19, 42, 37, .36) 52%, rgba(19, 42, 37, .87) 78%, var(--sage-night, #132a25) 100%) !important;
    pointer-events: none !important;
    z-index: 3 !important;
  }
  .lbd-home .lbd-hero-stage::before,
  .lbd-home .lbd-hero-stage::after { display: none !important; }

  .lbd-home .lbd-hero-stage .reveal {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 6 !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 24px 30px !important;
    text-align: left !important;
    display: block !important;
  }

  .lbd-home .lbd-hero-stage .eyebrow {
    margin: 0 0 14px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--sand, #F0D7B8) !important;
    font-size: 13.5px !important;
    letter-spacing: .18em !important;
  }
  .lbd-home .lbd-hero-stage .eyebrow .dot { background: var(--orange, #D4734A) !important; }

  .lbd-home .lbd-hero-stage .hz-hero-h1 {
    display: block !important;
    max-width: 340px !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 1.02 !important;
    letter-spacing: -0.02em !important;
    text-shadow: none !important;
  }
  .lbd-home .lbd-hero-stage .hz-hero-h1::before {
    content: "Your mortgage, in " !important;
    position: static !important;
    display: inline !important;
    background: none !important;
    border-radius: 0 !important;
    font-family: "Newsreader", Georgia, serif !important;
    font-weight: 600 !important;
    font-size: clamp(36px, 11.5vw, 45px) !important;
    line-height: 1.02 !important;
    color: var(--cream-el, #FFFCF3) !important;
  }
  .lbd-home .lbd-hero-stage .hz-hero-h1 .lbd-italic {
    display: inline !important;
    font-size: clamp(36px, 11.5vw, 45px) !important;
    line-height: 1.02 !important;
    color: #F2B98C !important;
    font-weight: 500 !important;
  }

  .lbd-home .lbd-hero-stage p.lbd-body.hz-hero-lede-extra {
    display: block !important;
    max-width: 340px !important;
    margin: 16px 0 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .lbd-home .lbd-hero-stage p.lbd-body.hz-hero-lede-extra::before { display: none !important; }
  .lbd-home .lbd-hero-stage p.lbd-body.hz-hero-lede-extra::after {
    content: "Your money works smarter. Your home can pay off faster. And your lifestyle stays exactly the same.";
    display: block;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(250, 245, 232, .87);
    font-weight: 400;
  }

  .lbd-home .lbd-hero-stage .lbd-hero-cta-primary {
    width: 100% !important;
    min-height: 52px !important;
    justify-content: center !important;
    margin-top: 22px !important;
    padding: 17px !important;
    border-radius: 16px !important;
    font-size: 17px !important;
    box-shadow: 0 14px 30px -8px rgba(212, 115, 74, .6) !important;
  }
  .lbd-home .lbd-hero-stage .lbd-hero-cta-primary::after { content: " →"; }

  .lbd-home .lbd-hero-stage .lbd-hero-cta-primary + * {
    margin-top: 12px !important;
    text-align: center !important;
    font-size: 0 !important;
    text-shadow: none !important;
  }
  .lbd-home .lbd-hero-stage .lbd-hero-cta-primary + *::after {
    content: "Free · private · about a minute" !important;
    font-family: "JetBrains Mono", monospace !important;
    font-size: 13.5px !important;
    letter-spacing: .04em !important;
    color: rgba(250, 245, 232, .6) !important;
  }
  .lbd-home .lbd-hero-stage .reveal::after {
    content: "⌄";
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    font-size: 20px;
    color: rgba(250, 245, 232, .5);
  }

  @media (prefers-reduced-motion: no-preference) {
    .lbd-home .lbd-hero-stage { animation: lbd-mobile-photo 18s ease-out forwards; }
    .lbd-home .lbd-hero-stage > div:nth-child(2) { animation: lbd-mobile-rise 1.8s cubic-bezier(.2,.8,.2,1) .1s both; }
    .lbd-home .lbd-hero-stage > div:nth-child(1) { animation: lbd-mobile-fade 1.4s ease-out .9s both; }
    .lbd-home .lbd-hero-stage > div:nth-child(1)::after { animation: lbd-mobile-drift 6s ease-in-out 2.4s infinite alternate; transform-origin: -120px 50px; }
    .lbd-home .lbd-hero-stage .eyebrow,
    .lbd-home .lbd-hero-stage .hz-hero-h1,
    .lbd-home .lbd-hero-stage p.lbd-body.hz-hero-lede-extra,
    .lbd-home .lbd-hero-stage .lbd-hero-cta-primary,
    .lbd-home .lbd-hero-stage .lbd-hero-cta-primary + * {
      opacity: 0;
      transform: translateY(14px);
      animation: lbd-mobile-up .7s cubic-bezier(.2,.8,.2,1) forwards;
    }
    .lbd-home .lbd-hero-stage .eyebrow { animation-delay: .5s; }
    .lbd-home .lbd-hero-stage .hz-hero-h1 { animation-delay: .66s; }
    .lbd-home .lbd-hero-stage p.lbd-body.hz-hero-lede-extra { animation-delay: .82s; }
    .lbd-home .lbd-hero-stage .lbd-hero-cta-primary { animation-delay: .98s; }
    .lbd-home .lbd-hero-stage .lbd-hero-cta-primary + * { animation-delay: 1.12s; }
    .lbd-home .lbd-hero-stage .reveal::after { animation: lbd-mobile-bob 2.4s ease-in-out 1.6s infinite; }
  }
}

@keyframes lbd-mobile-photo { from { background-size: auto 112%; } to { background-size: auto 100%; } }
@keyframes lbd-mobile-rise { from { opacity: 0; transform: translateX(-50%) translateY(24px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes lbd-mobile-fade { from { opacity: 0; } to { opacity: .9; } }
@keyframes lbd-mobile-drift { to { transform: rotate(6deg); } }
@keyframes lbd-mobile-up { to { opacity: 1; transform: translateY(0); } }
@keyframes lbd-mobile-bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(5px); } }

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  /* Topbar rule targets direct children only: a blanket `*` would set
     transform: none on the logo SVG's internals and strip the engraved
     ring's locked -18° tilt (CSS transform overrides the attribute). */
  .lbd-home .lbd-hero-stage,
  .lbd-home .lbd-hero-stage *,
  .lbd-brand-mobile-nav,
  .lbd-brand-mobile-nav > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .lbd-home .lbd-hero-stage > div:nth-child(2) { transform: translateX(-50%) !important; }
}
