/* ============================================================
   VN Cloud App — phone & tablet polish (1.9.6)
   Loaded last. Goals: no sideways panning, no iOS zoom on inputs,
   bigger tap targets, shorter pages, sticky call-to-action.
   ============================================================ */

/* ---------- Never pan sideways ---------- */
html { overflow-x: hidden; }               /* propagates to the viewport (keeps sticky header working) */
body { overflow-x: clip; position: relative; }
html, body { max-width: 100%; }
img, video, iframe, svg, canvas { max-width: 100%; }
.work-item { margin: 0; }                  /* <figure> had the 40px UA margin */
figure { margin-inline: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: rgba(31,79,216,.12); }

@media (max-width: 760px) {
  /* scroll-reveal: vertical only (sideways offsets used to widen the page) */
  [data-reveal], [data-reveal="left"], [data-reveal="right"] { transform: translate3d(0, 18px, 0); }
  [data-reveal].is-in { transform: none; }
  [data-reveal="pop"] { transform: translate3d(0, 18px, 0); }

  /* iOS zooms into any field under 16px → page then pans sideways. Keep 16px. */
  input, select, textarea, .field input, .field select, .field textarea, .chat input, .chat textarea { font-size: 16px !important; }

  /* rhythm */
  .container { padding-left: 16px; padding-right: 16px; }
  .section { padding-top: 3rem; padding-bottom: 3rem; }
  h2 { font-size: 1.5rem; }
  .lead { font-size: 1rem; }

  /* ---------- header + menu ---------- */
  .header-inner { height: 58px; padding: 0 12px 0 14px; }
  .site-header.is-scrolled .header-inner { height: 54px; }
  .brand-text { font-size: 1.05rem; }
  .header-aurora, .header-line, .header-inner::after { display: none; }
  .nav-toggle { width: 44px; height: 44px; justify-content: center; align-items: center; border-radius: 12px; }
  .nav-toggle:active { background: var(--cobalt-tint); }
  .nav { position: fixed; left: 10px; right: 10px; top: 66px; max-height: calc(100dvh - 80px); overflow-y: auto;
         background: #fff; backdrop-filter: none; border-radius: 20px; padding: .5rem; box-shadow: 0 30px 60px -20px rgba(11,31,58,.45); z-index: 60; }
  .nav > a { padding: .95rem 1.1rem; font-size: 1.02rem; border-radius: 14px; }
  .nav > a.is-active { background: var(--ink); }
  .nav > a::after { display: none; }
  .nav .lang-switch { margin: .5rem .4rem .3rem; }
  .lang-switch a { padding: .5rem .8rem .5rem .55rem; font-size: .85rem; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(11,31,58,.35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  /* ---------- hero (home) ---------- */
  .hero { padding-top: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn, .hero .btn { justify-content: center; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
  .app-window { margin-top: 1.5rem; }
  .app-tabs { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-right: 1rem; }
  .app-tabs button { scroll-snap-align: start; flex: none; }

  /* ---------- page banners ---------- */
  .page-hero { padding: 2rem 1.3rem; margin-bottom: 1.6rem; border-radius: 20px; }
  .page-hero h1 { font-size: 1.55rem; }
  .page-hero .lead { font-size: .95rem; }
  .page-hero .orb-1 { width: 220px; height: 220px; right: -90px; top: -100px; }
  .page-hero .filmstrip { display: none; }

  /* ---------- cards & grids ---------- */
  .tools-grid, .service-grid, .services-grid { gap: 1rem; }
  .tool-card { padding: 1.2rem; }
  .tool-cover { margin: -1.2rem -1.2rem .4rem; }
  .tool-card.is-featured { padding: 1.2rem; }
  .tool-card.is-featured .tool-cover { margin: -1.2rem -1.2rem .6rem; aspect-ratio: 16/9; }
  .tool-card.is-featured h3 { font-size: 1.3rem; }
  .tool-card.is-featured p { font-size: .98rem; }
  .tool-card.is-featured .tool-excerpt, .tool-card.is-featured .tool-audience { display: none; }
  .tool-card.is-featured .feature-list li:nth-child(n+4) { display: none; }
  .tool-facts { grid-template-columns: repeat(3, 1fr); gap: .4rem; }
  .tool-facts div { flex-direction: column; align-items: flex-start; gap: .3rem; padding: .55rem .6rem; }
  .tool-facts b { font-size: .8rem; }
  .tool-facts small { font-size: .68rem; }
  .tool-card-foot .link { padding: .4rem 0; }
  /* home: keep the page short — first 5 apps, then "All apps" button */
  .home-tools .tool-card:nth-child(n+6) { display: none; }

  /* portfolio: caption below the photo instead of covering it */
  .work-grid { gap: 1rem; }
  .work-filter { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; border-radius: 999px; scroll-snap-type: x proximity; }
  .work-filter::-webkit-scrollbar { display: none; }
  .work-filter button { flex: none; padding: .55rem .9rem; scroll-snap-align: start; }

  /* detail pages */
  .detail-grid { gap: 1.5rem; }
  .detail-aside { margin-bottom: 1rem; }
  .detail-aside .price { text-align: left; }
  .detail-body + .detail-aside, .detail-grid + h2 { margin-top: 2rem; }
  .crumbs { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* forms */
  .btn { min-height: 46px; }
  .form-card, .book-section .card { padding: 1.2rem; }
  .two, .three { grid-template-columns: 1fr !important; }

  /* footer: link columns side by side */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem 1rem; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-grid a { display: inline-block; padding: .25rem 0; }

  /* chat: round icon button, full-screen panel that fits the real viewport */
  .chat { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chat-launch { width: 54px; height: 54px; padding: 0; justify-content: center; }
  .chat-launch > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .chat-launch svg { width: 24px; height: 24px; }
  .chat-panel { width: calc(100vw - 16px); height: calc(100dvh - 16px); }
  .chat.is-open { right: 8px; bottom: 8px; }

  /* sticky call-to-action on detail pages */
  .mobile-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; gap: .6rem; align-items: center;
    padding: .65rem 12px calc(.65rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(11,31,58,.4); transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
  .mobile-cta.is-on { transform: none; }
  .mobile-cta .btn { flex: 1; justify-content: center; }
  .mobile-cta .mcta-info { font-size: .78rem; color: var(--mute); line-height: 1.2; max-width: 40%; }
  .mobile-cta .mcta-info b { display: block; color: var(--ink); font-size: .95rem; }
  body.has-mcta .chat { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.has-mcta .site-footer { padding-bottom: 6rem; }

  /* lighter effects on phones (smoother scrolling, less battery) */
  .aero-bg i { filter: blur(40px); animation-duration: 40s; }
  .aero-bg::after, .aero-shapes { display: none; }
  .tilt, .is-tilting { transform: none !important; }
}
@media (min-width: 761px) { .mobile-cta, .nav-backdrop { display: none; } }

/* small phones */
@media (max-width: 380px) {
  .tool-facts { grid-template-columns: 1fr; }
  .tool-facts div { flex-direction: row; align-items: center; }
  .hero h1, .hero-title { font-size: 2rem; }
}
/* caption text on dark band + small fixes */
@media (max-width: 760px) {
  .mobile-cta .price { text-align: left; }
}
.detail-aside .price small:first-child, .mobile-cta .price small:first-child { display: none; }
