/*
 * Phone overlay for Russell's landing page (MG-103 bundle).
 *
 * Loaded after styles.css; the <link> is inserted by scripts/landing/patch-landing.js,
 * so a re-sent bundle (styles.css copied verbatim) keeps these fixes. Every rule
 * sits inside a max-width query: above 860px the page is his design, untouched.
 *
 * Measured faults this fixes (390/360px, 2026-10-09): ~250px blank band above the
 * hero headline (the plat image is faint linework), nav buttons wrapping to two
 * lines, horizontal scroll at 360px from the role board, 14px form inputs (iOS
 * zooms on focus below 16px), 24px FAQ tap targets, sub-12px labels.
 */

@media (max-width: 860px) {
  /* ── Nav: one line, a bar that leaves room for the page ───────────────── */
  :root { --nav-h: 60px; }
  .nav {
    height: var(--nav-h);
    gap: 0.5rem;
    padding-left: max(var(--pad), env(safe-area-inset-left));
    padding-right: max(var(--pad), env(safe-area-inset-right));
  }
  .nav .logo { height: 40px; }
  .nav .brand { flex: none; padding: 0; min-height: 44px; }
  .nav-end { gap: 0.4rem; }
  .nav-end .btn {
    white-space: nowrap;
    min-height: 44px;
    padding: 0 1rem;
    font-size: 0.875rem;
  }

  /* ── Hero: the plat becomes a backdrop behind the copy, not a block above it ── */
  .hero {
    overflow: hidden;
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
  }
  .hero-map {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
    margin: 0;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 92%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 92%);
  }
  .hero-copy h1 { text-shadow: 0 0 18px rgba(255, 255, 255, 0.88); }
  .hero-copy .lede,
  .live { text-shadow: 0 0 12px #fff, 0 1px 8px rgba(255, 255, 255, 0.8); }
  .live { flex-wrap: wrap; font-size: 0.8125rem; }
  .hero-actions > .btn,
  .hero-actions > .hero-demo {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 48px;
  }
  .stats dd { font-size: 0.8125rem; }

  /* ── Sub-12px labels → 12px floor ─────────────────────────────────────── */
  .stages span,
  .steps span { font-size: 0.75rem; }
  .estimate-panel header,
  .panel em,
  .role-card small,
  .role-research li,
  .role-facts dd,
  .cred-points small,
  .jobs-legend li,
  .cover-rail em,
  .cover-live em { font-size: 0.75rem; }
  .panel em { white-space: nowrap; }
  .split > *,
  .cta > * { min-width: 0; }

  /* ── Implementation steps: number beside the text, no empty gap ───────── */
  .onboard { gap: 0.75rem; margin-top: 1.4rem; }
  .onboard li {
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    align-items: baseline;
    padding: 1rem 1.1rem;
  }
  .onboard span { grid-row: span 2; margin: 0; }
  .onboard b { margin: 0; }
  .onboard p { grid-column: 2; margin-top: 0.15rem; }

  /* ── FAQ: full-row tap target with an open/close mark ─────────────────── */
  .faq details { padding: 0; }
  .faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.5rem;
    padding: 0.75rem 0;
  }
  .faq summary::after {
    content: "+";
    flex: none;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;
    color: var(--mint);
    transition: transform 0.2s ease;
  }
  .faq details[open] summary::after { transform: rotate(45deg); }
  .faq details p { margin: 0 0 1rem; }

  /* ── Access form: 16px inputs (no iOS focus zoom), 48px controls ───────── */
  .cta {
    margin: 0.5rem 0.75rem 2.5rem;
    padding: 1.75rem 1.1rem;
  }
  .cta-form { padding: 1.15rem 1rem 1.2rem; }
  label { font-size: 0.8125rem; }
  input, select { min-height: 48px; font-size: 16px; }
  textarea { font-size: 16px; }
  .cta-form .btn { min-height: 48px; font-size: 1rem; }
  .cta-signin {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 0.5rem;
  }

  /* ── Footer links: 44px targets ───────────────────────────────────────── */
  footer {
    padding-bottom: max(1.8rem, env(safe-area-inset-bottom));
  }
  footer p a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.35rem;
  }
}

@media (max-width: 520px) {
  /* ── Pipeline: number left, text right, one connected column ─────────── */
  .stages { gap: 0; margin-top: 1.5rem; }
  .stages li {
    display: grid;
    grid-template-columns: 30px 1fr;
    column-gap: 0.9rem;
    padding: 0.7rem 0;
  }
  .stages li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 14px;
    top: calc(0.7rem + 34px);
    bottom: calc(-0.7rem + 4px);
    width: 2px;
    border-radius: 2px;
    background: var(--mint-soft);
  }
  .stages span { grid-row: span 2; margin: 0; }
  .stages b { margin: 0.25rem 0 0.15rem; }
  .stages p { grid-column: 2; }

  /* ── Role board: a swipe row with the next card peeking in ────────────── */
  .role-board {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0.5rem calc(var(--pad) * -1) 0;
    padding: 0.25rem var(--pad) 1rem;
    scroll-padding-inline: var(--pad);
  }
  .role-board::-webkit-scrollbar { display: none; }
  .role-card {
    flex: 0 0 78%;
    min-height: 14rem;
    scroll-snap-align: start;
  }
}

@media (max-width: 400px) {
  /* Narrow phones: the ghost "Sign in" drops its border so both actions fit beside the logo. */
  .nav .logo { height: 34px; }
  .nav-end .btn { padding: 0 0.8rem; }
  .hero-copy h1 { font-size: clamp(2.1rem, 10.5vw, 2.7rem); }
  .nav-end .btn-ghost {
    border-color: transparent;
    padding: 0 0.5rem;
  }
}

@media (max-width: 340px) {
  /* 320px phones: the lockup crops to its cube mark. */
  .nav .brand { min-width: 44px; }
  .nav .logo {
    width: 34px;
    object-fit: cover;
    object-position: left center;
  }
}
