/* ==========================================================================
   DriveXos — mobile layer

   On a phone the site should behave like the application does, not like a
   shrunken desktop page: a fixed bottom tab bar instead of a hamburger,
   thumb-sized targets, safe-area awareness, and wide product figures you pan
   rather than squint at.

   Load this AFTER site.css and motion.css.
   ========================================================================== */

/* ---------- Touch behaviour (all sizes) ---------- */
*{ -webkit-tap-highlight-color:transparent; }
html{ overscroll-behavior-y:none; }
a, button, summary, .opt, label{ touch-action:manipulation; }

/* The tab bar is a phone-only idiom. */
.tabbar{ display:none; }

@media (max-width:760px){

  /* ======================================================================
     Header — reduced to identity plus the one action that matters.
     Navigation moves to the tab bar, so the hamburger goes away entirely.
     ====================================================================== */
  .site-header{
    padding-top:env(safe-area-inset-top);
    height:calc(var(--nav-h) + env(safe-area-inset-top));
    display:flex;
    align-items:center;
  }
  .nav{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    height:100% !important;
    width:100% !important;
  }
  .nav-toggle{ display:none !important; }
  .nav-links{ display:none !important; }
  .nav-cta{
    display:flex !important;
    align-items:center !important;
    margin-left:auto !important;
    gap:8px;
  }
  .nav-cta .btn--ghost{ display:none !important; }      /* Download lives in the tab bar */
  .nav-cta .btn,
  .nav-cta .btn--sm{
    min-height:0 !important;
    height:34px !important;
    padding:0 14px !important;
    font-size:13px !important;
    line-height:34px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    align-self:center !important;
    border-radius:980px !important;
  }
  .nav-cta .btn svg,
  .nav-cta .btn--sm svg{
    width:12px !important;
    height:12px !important;
    margin-right:2px;
  }
  .brand{
    font-size:1.2rem;
    display:inline-flex !important;
    align-items:center !important;
    align-self:center !important;
  }
  .brand img{
    width:32px;
    height:32px;
    border-radius:8px;
  }

  /* ======================================================================
     Bottom tab bar
     ====================================================================== */
  .tabbar{
    display:grid; grid-template-columns:repeat(5,1fr);
    position:fixed; left:0; right:0; bottom:0; z-index:70;
    background:rgba(10,15,28,.94);
    -webkit-backdrop-filter:saturate(180%) blur(18px);
    backdrop-filter:saturate(180%) blur(18px);
    border-top:1px solid rgba(255,255,255,.08);
    padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -8px 30px -12px rgba(0,0,0,.9);
  }
  .tabbar a{
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    min-height:56px; padding:9px 4px 8px;
    font-size:.66rem; font-weight:600; letter-spacing:.01em;
    color:var(--muted-2); text-decoration:none;
    transition:color .18s var(--ease);
    position:relative;
  }
  .tabbar a svg{ width:21px; height:21px; stroke-width:1.7; transition:transform .22s var(--ease); }
  .tabbar a:active{ color:var(--ink); }
  .tabbar a:active svg{ transform:scale(.9); }

  /* Current page: brand colour plus the little indicator bar on top. */
  .tabbar a.is-active{ color:#A9C1FF; }
  .tabbar a.is-active svg{ stroke-width:2; }
  .tabbar a.is-active::before{
    content:''; position:absolute; top:0; left:50%; transform:translateX(-50%);
    width:26px; height:2.5px; border-radius:0 0 3px 3px; background:var(--gradient);
  }

  /* Keep the footer clear of the bar. */
  body{ padding-bottom:calc(56px + env(safe-area-inset-bottom)); }

  /* ======================================================================
     Thumb-sized targets
     ====================================================================== */
  .site-footer li a{ display:inline-block; padding:10px 0; }
  .site-footer li{ margin-bottom:2px; }
  .footer-bottom{ gap:14px; }
  .faq summary{ padding:19px 54px 19px 20px; }
  .btn{ min-height:48px; }
  .btn--sm{ min-height:42px; }
  .dl-specs li{ padding:8px 0; }

  /* ======================================================================
     Product figures — pan them instead of shrinking them to mush.
     A 1200px app mockup at 327px wide is unreadable; a swipeable panel is
     both legible and the way a phone app would show it.
     ====================================================================== */
  .figure, .hero-shot{
    overflow-x:auto; overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
  }
  .figure::-webkit-scrollbar, .hero-shot::-webkit-scrollbar{ display:none; }
  .figure img, .hero-shot img{
    width:760px; max-width:none; scroll-snap-align:start;
  }
  .bento-figure{ overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  .bento-figure::-webkit-scrollbar{ display:none; }
  .bento-figure img{ width:700px; max-width:none; }

  /* Tell the reader it moves. */
  .figure-scroll-hint{
    display:flex; align-items:center; justify-content:center; gap:7px;
    margin-top:10px; font-size:.74rem; color:var(--muted-2);
  }

  /* Comparison table keeps its own momentum scroll. */
  .table-scroll{ -webkit-overflow-scrolling:touch; }

  /* ======================================================================
     Density — tighter rhythm so more fits on a phone screen
     ====================================================================== */
  .section{ padding:52px 0; }
  .section--tight{ padding:40px 0; }
  .wrap{ padding-inline:18px; }
  .section-head{ margin-bottom:32px; }
  .page-head{ padding:56px 0 44px; }
  .hero{ padding-top:52px; }
  .hero-stage{ margin-top:34px; }
  .hero-meta{ gap:8px 18px; font-size:.8rem; }
  .cta-band{ padding:40px 20px; }
  .plan, .dl-card, .panel{ border-radius:18px; }
  .steps{ gap:14px; }
  .grid{ gap:14px; }
  .bento{ gap:14px; }

  /* Buttons go full width — the native pattern. */
  .btn-row{ flex-direction:column; align-items:stretch; }
  .btn-row .btn{ width:100%; }
  .center .btn-row{ align-items:stretch; }

  /* Footer: 2 columns in 1 row on mobile, brand spans full width */
  .footer-grid{
    grid-template-columns:repeat(2, 1fr) !important;
    gap:32px 24px !important;
  }
  .footer-brand{
    grid-column:1 / -1 !important;
  }
  .site-footer{ padding:44px 0 22px; }
  .footer-bottom{ flex-direction:column; align-items:flex-start; margin-top:32px; }

  /* Hero: Exactly 3 lines (never 4 lines) */
  .a-hero h1{
    font-size:clamp(1.5rem, 5.6vw, 2.2rem) !important;
    max-width:100% !important;
    margin:0 auto 18px !important;
    line-height:1.16 !important;
  }
  .hero-title .hero-line{
    display:block !important;
  }
  .hero-title .hero-line-1{
    white-space:nowrap !important;
  }
  .hero-title .hero-line-3{
    white-space:nowrap !important;
  }

  /* ======================================================================
     Blog & Article mobile enhancements
     ====================================================================== */
  .blog-grid{ grid-template-columns:1fr !important; gap:18px !important; }
  .blog-grid > *, .blog-featured > *{ min-width:0 !important; }
  .blog-featured{ grid-template-columns:1fr !important; gap:20px !important; padding:18px !important; border-radius:18px; }
  .blog-featured .blog-thumb{ aspect-ratio:16/9; width:100%; }
  .blog-card{ border-radius:16px; min-width:0; }
  .blog-body{ padding:20px 16px; }
  .blog-title{ font-size:1.15rem; line-height:1.35; }
  .blog-excerpt{ font-size:.88rem; margin-bottom:16px; }
  .blog-meta{ gap:6px 8px; font-size:.76rem; }
  
  .article-wrap{ padding-inline:16px !important; max-width:100% !important; min-width:0 !important; overflow-x:hidden; }
  .article-head{ margin-bottom:24px; }
  .article-head h1{
    font-size:clamp(1.65rem, 1.25rem + 2vw, 2.3rem) !important;
    line-height:1.2 !important;
    margin:12px 0 16px;
    overflow-wrap:break-word;
    word-break:break-word;
  }
  .article-lead{ font-size:1.02rem; line-height:1.6; margin-bottom:18px; }
  .article-hero-img{ margin:20px 0 28px; border-radius:12px; }
  .article-content{ font-size:.98rem; line-height:1.7; min-width:0; }
  .article-content h2{ font-size:1.4rem; margin:36px 0 14px; overflow-wrap:break-word; }
  .article-content h3{ font-size:1.18rem; margin:26px 0 10px; overflow-wrap:break-word; }
  .article-callout{ padding:18px 16px; margin:24px 0; }
  .code-block{ margin:20px 0; max-width:100% !important; min-width:0 !important; overflow:hidden; }
  .code-block-head{ padding:8px 14px; font-size:.75rem; flex-wrap:wrap; gap:6px; }
  .code-block pre{ padding:14px; font-size:.82rem; max-width:100% !important; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .code-block pre code{ word-break:normal !important; white-space:pre !important; }
  p code, li code{ word-break:break-word; overflow-wrap:anywhere; }
  .article-table{ display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .table-scroll{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; margin:24px 0; border-radius:var(--r); border:1px solid var(--glass-line); }
  .table-scroll .article-table{ margin:0; border:0; min-width:540px; }
  .article-cta{ padding:28px 16px; margin:44px 0 24px; border-radius:18px; }
  .article-cta h3{ font-size:1.45rem; }
  .article-nav{ grid-template-columns:1fr; gap:20px; margin-top:40px; padding-top:24px; }
  .article-nav > div:last-child{ text-align:left; }
  .breadcrumb{ font-size:.78rem; gap:6px; margin-bottom:18px; }
}

/* Very small phones */
@media (max-width:380px){
  .tabbar a{ font-size:.6rem; }
  .tabbar a svg{ width:20px; height:20px; }
  .brand small{ display:none; }
  .brand{ font-size:1.1rem; }
}

/* Landscape phones: the bar would eat too much height, so it hides. */
@media (max-width:900px) and (max-height:460px) and (orientation:landscape){
  .tabbar{ display:none; }
  body{ padding-bottom:0; }
}

/* Installed as a PWA: the header already sits under the status bar. */
@media (display-mode:standalone){
  .site-header{ padding-top:max(env(safe-area-inset-top), 8px); }
}
