/* ══════════════════════════════════════════════════════════════════════════
   DARK OBSIDIAN - HOMEPAGE, PHONE
   ══════════════════════════════════════════════════════════════════════════
   A composed mobile page rather than the desktop columns stacked. Wide
   grids that would become long vertical runs turn into swipeable rows with
   indicators; the module grid drops to two columns; the product mockups are
   cropped and enlarged instead of shrunk to illegibility.

   Loaded last and confined to (max-width:768px), so the desktop homepage is
   untouched. Every section, link and CTA is the existing one - this file
   changes arrangement, never content.
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  :root { --hm-pad: 16px; }

  html, body { overflow-x: hidden; max-width: 100%; }

  .container { width: 100%; padding-inline: var(--hm-pad); }

  /* Sections carry their own rhythm rather than the desktop's wide gutters. */
  .section { padding: 44px 0; }
  .section-sm { padding: 34px 0; }

  .section-tag {
    font-size: 10.5px; letter-spacing: .18em;
  }

  /* ── Type scale ───────────────────────────────────────────────────── */

  .hero h1, .hero-title {
    font-size: clamp(38px, 11.5vw, 50px);
    line-height: 1.03;
    letter-spacing: -.04em;
    text-wrap: balance;
  }
  .hero-title .ht-line { display: block; }
  .hero-kicker { font-size: 11px; letter-spacing: .2em; }
  .hero-lede { font-size: 15px; line-height: 1.62; max-width: 32ch; margin-inline: auto; }
  .hero-note { font-size: 12px; }
  .section h2, .ft-cta-title {
    font-size: clamp(26px, 7.6vw, 33px);
    line-height: 1.12;
    letter-spacing: -.032em;
    text-wrap: balance;
  }
  .section p, .hero p { font-size: 15px; line-height: 1.62; }

  /* ── Buttons: full width, thumb-sized ─────────────────────────────── */

  .btn { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
  .btn-lg { min-height: 52px; font-size: 15.5px; }
  .btn-sm { min-height: 38px; font-size: 13px; }
  .hero .btn, .cta-strip .btn, .ft-cta-primary, .ft-cta-quiet,
  .hcta-primary, .hcta-quiet { width: 100%; justify-content: center; }
  .hero-cta { display: flex; flex-direction: column; gap: 10px; width: 100%; }
  .hcta-primary, .hcta-quiet { min-height: 50px; border-radius: 12px; font-size: 15px; }

  /* ══ HERO ═════════════════════════════════════════════════════════ */

  .hero { padding: 26px 0 34px; text-align: center; }
  .hero p { max-width: 30ch; margin-inline: auto; }

  /* The dashboard mockup is cropped and scaled up rather than shrunk to
     nothing - it reads as a product shot instead of a thumbnail. */
  .hero-product, .hero-stage {
    margin-inline: calc(var(--hm-pad) * -1);
    padding-inline: 0;
    max-width: none;
  }
  /* Clip here rather than leaning on body{overflow-x:hidden}: the crop is
     then a deliberate local effect and cannot leak a scrollbar onto the
     page if the panel's width ever changes. */
  .hero-product { overflow: hidden; }
  /* Crop rather than shrink: the panel keeps its real proportions and the
     right-hand column simply runs past the edge, which reads as a product
     shot instead of an unreadable thumbnail. */
  .app-shell {
    width: 128%;
    margin-left: -14%;
    border-radius: 16px;
    box-shadow: 0 26px 70px -26px rgba(139, 92, 246, .55),
                0 0 0 1px rgba(255, 255, 255, .06);
  }
  .app-search, .app-user-name, .app-user-role, .app-top-right { display: none; }
  .app-page-title { font-size: 12px; }
  /* Second column of the mockup is noise at this width. */
  .app-grid { grid-template-columns: 1fr !important; }
  .app-grid-line:nth-child(n+3) { display: none; }
  .app-kpis { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .app-nav { display: none; }

  /* ══ SWIPE ROWS ═══════════════════════════════════════════════════ */
  /* One shared treatment: bleed to the screen edges so the row visibly
     continues past the fold, snap to each card, hide the scrollbar. */

  .sync-bento,
  .platform-grid,
  .m-swipe {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 12px;
    margin-inline: calc(var(--hm-pad) * -1);
    padding: 4px var(--hm-pad) 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sync-bento::-webkit-scrollbar,
  .platform-grid::-webkit-scrollbar,
  .m-swipe::-webkit-scrollbar { display: none; }

  .sync-bento > *,
  .platform-grid > *,
  .m-swipe > * {
    flex: 0 0 clamp(240px, 78vw, 300px);
    scroll-snap-align: center;
    min-width: 0;
  }

  /* Dots injected by home.mobile.js. */
  .m-dots { display: flex; justify-content: center; gap: 7px; margin-top: 4px; }
  .m-dot {
    width: 6px; height: 6px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .18); cursor: pointer;
    transition: width .25s cubic-bezier(.16, 1, .3, 1), background .25s ease;
  }
  .m-dot.is-on { width: 18px; border-radius: 3px; background: #8B5CF6; }

  /* ══ EVERYTHING CONNECTED ═════════════════════════════════════════ */

  .sync-tabs {
    display: flex; gap: 6px;
    margin-inline: calc(var(--hm-pad) * -1);
    padding-inline: var(--hm-pad);
    overflow-x: auto; scrollbar-width: none;
  }
  .sync-tabs::-webkit-scrollbar { display: none; }
  .sync-tab { flex: 0 0 auto; font-size: 13px; padding: 8px 14px; }
  .marquee-wrap { margin-inline: calc(var(--hm-pad) * -1); }

  /* ══ MODULES GRID (2 up) ══════════════════════════════════════════ */

  .features-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .feature-card { padding: 15px 13px; border-radius: 14px; }
  .feature-icon { width: 34px; height: 34px; margin-bottom: 10px; }
  .feature-icon svg { width: 16px; height: 16px; }
  .feature-card h3 { font-size: 14px; letter-spacing: -.012em; }
  .feature-card p { font-size: 12px; line-height: 1.5; }
  /* The per-card link is redundant when the whole card is tappable. */
  .feature-link { font-size: 12px; margin-top: 8px; }

  /* ── Stats strip: four compact columns ────────────────────────────── */

  .stats-strip {
    display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 6px;
    padding: 16px 4px; border-radius: 14px;
  }
  .stat-item { text-align: center; }
  .stat-num { font-size: 19px; letter-spacing: -.03em; }
  .stat-label { font-size: 9.5px; letter-spacing: .07em; line-height: 1.3; }

  /* ══ SET UP YOUR BUSINESS ═════════════════════════════════════════ */

  .ai-inner { display: block; }
  .check-list { margin: 18px 0 22px; }
  .check-list li { font-size: 14px; padding-left: 26px; margin-bottom: 11px; }
  .check-icon { width: 17px; height: 17px; }
  /* The chat/brain composition is atmospheric here, not the subject. */
  .ai-stage { margin-inline: calc(var(--hm-pad) * -1); }
  .brain-field { opacity: .5; }
  .chat-box { border-radius: 16px; }
  .chat-chips { flex-wrap: wrap; }

  /* ══ BUILT FOR REAL OPERATIONS ════════════════════════════════════ */

  .tab-nav {
    display: flex; gap: 4px;
    margin-inline: calc(var(--hm-pad) * -1);
    padding: 0 var(--hm-pad) 14px;
    overflow-x: auto; scrollbar-width: none;
  }
  .tab-nav::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; font-size: 13px; padding: 8px 14px; white-space: nowrap; }
  .tab-mockup { border-radius: 14px; overflow: hidden; }
  .tab-mockup img { width: 100%; height: auto; display: block; }

  /* ══ PLATFORMS ════════════════════════════════════════════════════ */

  .platform-card { padding: 22px 18px; border-radius: 16px; text-align: center; }
  .platform-os-icon { margin-inline: auto; }
  .store-row { flex-direction: column; gap: 8px; }
  .store-btn { width: 100%; justify-content: center; }

  /* ══ PRICING ══════════════════════════════════════════════════════ */

  /* Three billing options for one plan, not three products - so there is
     too little per card to justify swiping. The recommended option leads at
     full width; the other two sit under it as a compact pair, which is the
     whole comparison on one screen with no interaction required. */
  .price-preview-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
  }

  .price-preview-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 14px; border-radius: 14px;
    text-align: center;
  }
  .price-preview-card .btn { margin-top: auto; width: 100%; }

  /* Featured: full width, leads the group, and is the only one that glows. */
  .price-preview-card.featured {
    grid-column: 1 / -1;
    order: -1;
    transform: none;
    padding: 22px 18px 20px;
    border-color: rgba(139, 92, 246, .34);
    background:
      radial-gradient(120% 90% at 50% 0%, rgba(139, 92, 246, .17), transparent 68%),
      rgba(255, 255, 255, .035);
    box-shadow: 0 18px 46px -22px rgba(139, 92, 246, .75);
  }

  .ppc-amount { font-size: 26px; letter-spacing: -.035em; line-height: 1.1; }
  .price-preview-card.featured .ppc-amount { font-size: 42px; letter-spacing: -.045em; }

  .ppc-region { font-size: 11.5px; }
  .price-preview-card.featured .ppc-region { font-size: 13px; }

  /* The eyebrow above each amount is inline-styled in the markup, so the
     override has to outrank it. */
  .price-preview-card > div:first-child {
    font-size: 9.5px !important;
    letter-spacing: .13em !important;
    line-height: 1.35;
  }
  .price-preview-card.featured > div:first-child { font-size: 10.5px !important; }

  /* Compact pair: the summary reads at a glance, the detail lives on the
     pricing page, so these keep a small secondary button. */
  .price-preview-card:not(.featured) .btn { min-height: 38px; font-size: 12.5px; }

  /* Closing line is a bullet-separated run that wraps badly at this width. */
  #pricing-preview .container > p:last-child {
    margin-top: 18px !important;
    font-size: 12px !important;
    line-height: 1.7;
    max-width: 34ch;
    margin-inline: auto;
  }

  /* ══ FAQ ══════════════════════════════════════════════════════════ */

  .faq-list { margin-top: 18px; }
  .faq-item { border-radius: 12px; margin-bottom: 9px; }
  .faq-q {
    min-height: 54px; padding: 13px 15px;
    font-size: 14.5px; line-height: 1.4; text-align: left; gap: 12px;
  }
  .faq-icon { flex-shrink: 0; }
  .faq-a-inner { padding: 0 15px 15px; font-size: 13.5px; line-height: 1.65; }

  /* ══ DEVELOPERS / CODE ════════════════════════════════════════════ */

  .code-card { border-radius: 14px; }
  .code-tabs {
    display: flex; gap: 4px;
    overflow-x: auto; scrollbar-width: none;
  }
  .code-tabs::-webkit-scrollbar { display: none; }
  .code-tab { flex: 0 0 auto; font-size: 12px; padding: 7px 12px; }
  .code-panel pre, .code-card pre {
    font-size: 11px; line-height: 1.65; padding: 14px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }

  /* ══ FINAL CTA ════════════════════════════════════════════════════ */

  .cta-strip { position: relative; overflow: hidden; text-align: center; }
  .cta-strip::before {
    content: ''; position: absolute; left: 50%; top: 40%;
    width: 420px; height: 320px; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 0;
    background: radial-gradient(closest-side, rgba(139, 92, 246, .22), transparent 72%);
  }
  .cta-strip > * { position: relative; z-index: 1; }

  /* ══ FOOTER ═══════════════════════════════════════════════════════ */
  /* The desktop footer is five columns of links; on a phone that is a very
     long tail, so each column collapses behind its own heading. */

  .ft-cta { padding: 40px var(--hm-pad); text-align: center; }
  .ft-cta-row { flex-direction: column; gap: 10px; }
  .ft-main { display: block; padding-inline: var(--hm-pad); }
  .ft-brand { margin-bottom: 22px; text-align: left; }
  .ft-facts { justify-content: flex-start; }

  .ft-col { border-top: 1px solid rgba(255, 255, 255, .07); }
  .ft-col:last-of-type { border-bottom: 1px solid rgba(255, 255, 255, .07); }
  .ft-col-title {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; margin: 0; padding: 15px 2px;
    background: none; border: 0; font: inherit; text-align: left;
    color: rgba(236, 235, 245, .82); cursor: pointer;
  }
  .ft-col-title::after {
    content: ''; flex-shrink: 0;
    width: 8px; height: 8px; margin-right: 4px;
    border-right: 1.5px solid rgba(236, 235, 245, .4);
    border-bottom: 1.5px solid rgba(236, 235, 245, .4);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .25s cubic-bezier(.16, 1, .3, 1);
  }
  .ft-col.is-open .ft-col-title::after { transform: rotate(225deg) translate(-2px, -2px); }
  .ft-col ul { display: none; padding: 0 2px 14px; }
  .ft-col.is-open ul { display: block; }
  .ft-col li { margin-bottom: 11px; }
  .ft-col a { font-size: 14px; }

  .ft-social { justify-content: flex-start; margin-top: 20px; }
  .ft-bottom { flex-direction: column; align-items: flex-start; gap: 12px; padding-inline: var(--hm-pad); }
  .ft-legal { flex-wrap: wrap; gap: 14px; }

  /* ══ MISC ═════════════════════════════════════════════════════════ */

  /* Below-the-fold artwork should never widen the page. */
  img, svg, canvas, video, pre, table { max-width: 100%; }
  .glass { border-radius: 14px; }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 34px; }
  .features-grid { gap: 8px; }
  .feature-card { padding: 13px 11px; }
  .stat-num { font-size: 17px; }
  .stat-label { font-size: 9px; }
  .ppc-amount { font-size: 33px; }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .m-dot { transition: none; }
  .sync-bento, .platform-grid, .price-preview-grid, .m-swipe { scroll-behavior: auto; }
}
