/* ============================================================
   Mobile layer — loaded last, only media-query overrides.
   Breakpoints: 860px (nav) · 760px (hero, board, modal)
   ============================================================ */

/* ---------- burger (hidden on desktop) ---------- */
.nav-burger { display: none; }
/* mobile menu exists only under the nav breakpoint */
.mobile-menu { display: none; }

@media (max-width: 1180px) {
  .mobile-menu { display: block; }
  .nav-burger {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    margin-right: -8px;
    background: none; border: none; cursor: pointer;
    color: var(--ink);
  }
  .nav-burger .nb-box { display: grid; gap: 5px; width: 20px; }
  .nav-burger .nb-box i {
    display: block; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
  }
  body.mm-open .nav-burger .nb-box i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.mm-open .nav-burger .nb-box i:nth-child(2) { opacity: 0; }
  body.mm-open .nav-burger .nb-box i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---------- full-screen menu ---------- */
  .mobile-menu {
    position: fixed; left: 0; right: 0; top: 67px; bottom: 0;
    z-index: 80;
    background: var(--paper);
    padding: 18px 24px 36px;
    overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .26s ease, transform .26s ease, visibility .26s;
  }
  body.mm-open .mobile-menu { opacity: 1; visibility: visible; transform: none; }
  body.mm-open { overflow: hidden; }

  .mm-group {
    font-family: var(--ff-mono); font-size: 11px; letter-spacing: .14em;
    text-transform: uppercase; color: var(--muted);
    margin: 26px 0 6px;
  }
  .mm-group:first-child { margin-top: 8px; }
  .mobile-menu a {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 48px;
    padding: 10px 2px;
    text-decoration: none; color: var(--ink);
    font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
    border-bottom: 1px solid var(--line);
  }
  .mobile-menu a::after { content: "→"; color: var(--faint); font-size: 15px; }
  .mobile-menu a small {
    font-family: var(--ff-mono); font-size: 10.5px; font-weight: 500;
    color: var(--muted); letter-spacing: .02em;
  }
  .mobile-menu .mm-cta {
    margin-top: 28px;
    justify-content: center; gap: 10px;
    background: var(--ink); color: var(--paper);
    border: none; border-radius: 12px;
    min-height: 52px; font-size: 16.5px;
  }
  .mobile-menu .mm-cta::after { content: none; }
  .mm-contact {
    margin-top: 18px; text-align: center;
    font-family: var(--ff-mono); font-size: 12px; color: var(--muted);
  }
  .mm-contact a { display: inline; border: none; padding: 0; min-height: 0; font-size: 12px; font-family: var(--ff-mono); color: var(--ink-2); }
  .mm-contact a::after { content: none; }

  /* rich rows: brand logos + icons + subtitles (matches desktop mega) */
  .mobile-menu a.mm-rich { padding: 11px 2px; }
  .mm-l { display: flex; align-items: center; gap: 13px; min-width: 0; }
  .mm-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
  .mm-ic svg { width: 25px; height: 25px; }
  .mm-ic.ico svg { width: 22px; height: 22px; color: var(--muted); }
  .mm-tx { display: flex; flex-direction: column; font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
  .mm-tx small { display: block; font-family: var(--ff-mono); font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }
  .mm-soonrow { display: flex; align-items: center; min-height: 48px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
  .mm-soonrow .mm-tx { color: var(--faint); }
  .mm-soonrow .mm-ic.ico svg { color: var(--line-2); }
  .mm-soonbadge { font-family: var(--ff-mono); font-size: 9px; font-weight: 600; letter-spacing: .08em; color: var(--faint); margin-left: 7px; vertical-align: 1px; }
}

/* ============================================================
   HERO — tablets & phones: the stage must stretch, otherwise
   the laptop (width:100% of it) collapses to 0 when the hero
   switches to 1 column with justify-items:center.
   ============================================================ */
@media (max-width: 920px) {
  .hero-apple.hero-dark .ha-stage { width: 100%; justify-self: stretch; }
}

/* ============================================================
   HERO — phones: same laptop, scaled down; tighter spacing.
   ============================================================ */
@media (max-width: 760px) {
  .hero-apple.hero-dark {
    min-height: auto;
    gap: 26px;
    padding: 48px 20px 34px;
  }
  .hero-apple.hero-dark h1 { font-size: clamp(34px, 9.4vw, 44px); }
  .hero-apple.hero-dark .ha-eyebrow { font-size: 11px; }

  /* cue flows under the laptop (clear of the deck + sound chip) */
  .hero-apple.hero-dark .ha-cue {
    position: static; transform: none;
    justify-self: center; margin-top: 56px;
  }
}

/* ============================================================
   SECRET BOARD — flat vertical funnel on phones
   ============================================================ */
@media (max-width: 760px) {
  /* the bear peeks over the top-left corner of the board */
  .sb-bear {
    display: block;
    position: absolute;
    left: 6px;
    top: 0;
    width: clamp(96px, 26vw, 130px);
    transform: translateY(-46%);
    z-index: 1;                /* board (z2) hides his lower body */
    filter: drop-shadow(0 6px 14px oklch(0 0 0 / .5));
  }
  .sb-scene { padding-top: clamp(64px, 17vw, 92px); }
  .sb-board {
    margin-left: 0;
    transform: none;
    padding: 22px 16px 46px;
  }
  .sb-grid { margin-left: 0; margin-right: 0; }
  .sb-bottom { flex-wrap: wrap; row-gap: 10px; }
  .sb-bottom2 { margin-bottom: 8px; }

  /* retention loop becomes a plain handwritten note under the funnel */
  .sb-loop-note {
    display: block; position: static;
    transform: none !important;
    text-align: center; margin: 12px auto 0;
  }
  .sb-loop-note::after { content: " ↺"; }
  .sb-hint { left: 0; right: 0; transform: none; text-align: center; white-space: nowrap; }
}

/* stage heads: big-media variant must also collapse to one column */
@media (max-width: 760px) {
  .stage-head.has-visual.big-media,
  .stage-head.has-visual.big-media.flip { grid-template-columns: 1fr; }
  .stage-head.has-visual.big-media .sh-copy { grid-template-columns: auto 1fr; }
}

/* ============================================================
   FUNNEL MODAL — bottom sheet on phones
   ============================================================ */
@media (max-width: 760px) {
  .fm-overlay {
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 0;
  }
  .fm-card {
    width: 100%; max-width: none;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    transform: translateY(100%);
  }
  .fm-overlay.is-open .fm-card { transform: none; }

  /* funnel becomes a horizontal stage-switcher strip */
  .fm-funnel { padding: 12px 16px 12px; }
  .fm-funnel::before {
    content: ""; display: block;
    width: 44px; height: 4px; border-radius: 999px;
    background: var(--line-2);
    margin: 0 auto 12px;
  }
  .fm-funnel .cap { margin-bottom: 10px; }
  .fm-funnel .out { display: none; }
  .fm-bands { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .fm-bands::-webkit-scrollbar { display: none; }
  .fm-band { width: auto !important; flex: 0 0 auto; padding: 10px 14px; min-height: 44px; }

  .fm-body { padding: 20px 18px 30px; }
  .fm-close { top: 12px; right: 12px; width: 40px; height: 40px; }
}
