/* ============================================================
   RunOrJog — MOBILE LAYER (loads LAST)
   Comprehensive small-screen refinement + hamburger drawer.
   Desktop (>940px) is unaffected.
   ============================================================ */

/* ── Nav right cluster + burger (hidden on desktop) ── */
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-burger { display: none; }
.nav-drawer { display: none; }

@media (max-width: 940px) {
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; padding: 0 10px; border-radius: 11px; cursor: pointer;
    background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke-2, rgba(255,255,255,.16));
  }
  .nav-burger span { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform .28s ease, opacity .2s ease; }
  .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-drawer {
    display: grid; grid-template-rows: 0fr; overflow: hidden; max-height: 0;
    background: rgba(7, 8, 18, 0.96); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--stroke, rgba(255,255,255,.085));
    transition: grid-template-rows .34s cubic-bezier(.4,0,.2,1), max-height .34s cubic-bezier(.4,0,.2,1);
  }
  .nav-drawer.open { grid-template-rows: 1fr; max-height: 380px; }
  .nav-drawer > * { min-height: 0; }
  .nav-drawer a {
    display: block; padding: 15px 22px; color: var(--text-70, #c8c8d8); font-weight: 600; font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .nav-drawer.open { padding: 6px 0 10px; }
  .nav-drawer a:active { color: var(--cyan); background: rgba(255,255,255,.03); }
  .nav-inner { height: 62px; }
}

/* ── General rhythm tightening ── */
@media (max-width: 720px) {
  section { padding: 56px 0; }
  .container { padding: 0 18px; }
  .section-title { font-size: clamp(24px, 7vw, 32px); }
  .section-sub { font-size: 14.5px; margin-bottom: 32px; }
}

/* ── Hero ── */
@media (max-width: 820px) {
  .hero { padding: 40px 0 64px; }
  .hero-kicker { font-size: 10.5px; padding: 7px 13px; }
  .hero h1 { font-size: clamp(33px, 9vw, 50px); }
  .hero .sub { font-size: 15.5px; }
  .cta-row { gap: 11px; }
  .phone { width: 230px; }
}
@media (max-width: 540px) {
  /* full-width stacked store buttons */
  .hero .cta-row { flex-direction: column; align-items: stretch; }
  .hero .cta-row .btn { width: 100%; justify-content: center; }
  .store-btn { padding: 12px 18px 12px 14px; }
  .btn-ghost { order: 3; }
  .phone { width: 70vw; max-width: 260px; }
}

/* ── Stats: 2x2 on phones ── */
@media (max-width: 640px) {
  .stats .container { padding: 24px 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 22px 14px; }
  .stat .n { font-size: clamp(28px, 9vw, 40px); }
}

/* ── Features: single column ── */
@media (max-width: 760px) {
  .features { grid-template-columns: 1fr; gap: 14px; }
  .feature { padding: 22px; }
}

/* ── Live demo ── */
@media (max-width: 760px) {
  .demo-wrap { padding: 18px 16px 16px; border-radius: 20px; }
  .demo-grid { height: 280px; }
  .demo-hud { gap: 12px 16px; }
  .demo-stat { min-width: 0; flex: 1 1 26%; }
  .demo-stat .ds-n { font-size: 22px; }
  .demo-reset { margin-left: 0; flex: 1 1 100%; justify-content: center; order: 5; }
}
@media (max-width: 460px) {
  .demo-grid { height: 240px; }
  .demo-hint { top: 150px; }
}

/* ── Showcase devices: smaller, chips pulled in ── */
@media (max-width: 820px) {
  .device { width: 230px; max-width: 64vw; }
  .showcase-row { margin-bottom: 52px; }
  .showcase .lead { font-size: 15px; }
  .device-chip { font-size: 11px; }
}
@media (max-width: 460px) {
  .device { width: 60vw; }
  .device-chip.a { left: -2%; top: 3%; }
  .device-chip.b { right: -2%; bottom: 3%; }
}

/* ── Tiers / calc / FAQ already 1-col; tighten padding ── */
@media (max-width: 560px) {
  .tier { padding: 26px 22px; }
  .tier.featured { transform: none; }
  .calc { padding: 22px 18px; }
  .calc-results { grid-template-columns: 1fr; gap: 12px; }
  .faq-q { font-size: 15px; padding: 16px 18px; }
}

/* ── Pill marquee: smaller ── */
@media (max-width: 560px) {
  .pill { font-size: 13px; padding: 9px 15px; }
  .pill-marquee { padding: 20px 0; }
}

/* ── Steps: stack ── */
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; gap: 14px; }
}

/* ── Video frame ── */
@media (max-width: 560px) {
  .video-frame { border-radius: 16px; }
}

/* ── Final CTA ── */
@media (max-width: 540px) {
  .final-cta { padding: 64px 0; }
  .final-cta .cta-row { flex-direction: column; align-items: stretch; }
  .final-cta .cta-row .btn { width: 100%; justify-content: center; }
  .founder-proof { gap: 12px; }
  .fp-text { font-size: 13px; text-align: center; }
}

/* ── Footer ── */
@media (max-width: 560px) {
  .footer-cols { grid-template-columns: 1fr; gap: 26px; text-align: left; }
  .footer { padding: 44px 0 30px; }
}

/* ── Tweaks panel stays reachable but smaller on phones ── */
@media (max-width: 540px) {
  #tweaks-root .twk-panel, #tweaks-root [class*="panel"] { max-width: 92vw; }
}

/* honor iOS safe areas */
@supports (padding: max(0px)) {
  .nav-inner { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
}
