/* ==========================================================================
   AVENIQ SOLUTIONS — RESPONSIVE BREAKPOINTS & ACCESSIBILITY
   Mobile-first overrides applied top-down: 1100 → 960 → 760 → 560 → 400
   ========================================================================== */

/* ---------- Large tablet / small laptop ---------- */
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-groups { grid-template-columns: 1fr 1fr; }
  .bento__item--7, .bento__item--5, .bento__item--4, .bento__item--8 { grid-column: span 6; }
  .process { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process::before { display: none; }
  .process__body { height: auto; }
  .hv__card--ai { left: 0; }
  .hv__card--cloud { left: -2%; }
  .hv__card--mobile { right: 0; }
  .hv__card--product { right: 0; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  :root { --nav-h: 68px; }

  .navbar__links { display: none; }
  .navbar__actions .btn { display: none; }
  .hamburger { display: inline-flex; }
  .navbar__logo { height: 38px; }

  .hero { padding-top: 32px; }
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__content { max-width: 640px; margin-inline: auto; text-align: center; }
  .hero__lead { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .hero__points { justify-content: center; }
  .hero__visual { min-height: 0; order: 2; }
  .hv { max-width: 520px; }

  .sec-head--split { flex-direction: column; align-items: flex-start; }

  .svc-grid-lg { grid-template-columns: 1fr; }
  .engage-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }

  .story { grid-template-columns: 1fr; }
  .mv-grid { grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; }

  .cta__grid { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .cta p { margin-inline: auto; }
  .cta__actions { justify-content: center; }
  .cta__logo { display: none; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: span 2; }
  .footer-cta { flex-direction: column; align-items: flex-start; }
}

/* ---------- Large phones / small tablets ---------- */
@media (max-width: 760px) {
  :root { --gutter: 20px; }

  .tech-groups { grid-template-columns: 1fr; }
  .bento { grid-auto-rows: auto; }
  .bento__item--7, .bento__item--5, .bento__item--4, .bento__item--8, .bento__item--6 { grid-column: span 12; }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-grid, .portfolio-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; gap: 24px; }
  .showcase--flip .showcase__media { order: 1; }
  .showcase--flip .showcase__body  { order: 2; }
  .showcase:hover .showcase__frame, .showcase--flip:hover .showcase__frame { transform: none; }
  .showcase__logo { bottom: auto; top: 14px; left: 14px; width: 54px; height: 54px; }
  .lightbox__bar { flex-direction: column; align-items: flex-start; }
  .lightbox__actions { width: 100%; }
  .lightbox__actions .btn { flex: 1 1 auto; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .svc-lg { grid-template-columns: 1fr; gap: 16px; padding: 26px 22px; }
  .svc-lg h3 { padding-right: 0; }
  .svc-lg__num { position: static; margin-bottom: 8px; display: block; }
  .filter-nav { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; border-radius: 16px; scrollbar-width: none; }
  .filter-nav::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }
  .modal { max-height: 92vh; border-radius: var(--r-lg); }
  .modal__head, .modal__body, .modal__foot { padding-inline: 20px; }
  .modal__body { padding-block: 20px; }
  .timeline::before { left: 23px; }
  .timeline__item { grid-template-columns: 48px 1fr; gap: 16px; }
  .timeline__marker { width: 48px; height: 48px; }
  .mv-card .icon-tile { position: static; margin-bottom: 4px; }
}

/* ---------- Phones ---------- */
@media (max-width: 560px) {
  :root { --gutter: 16px; }

  .section { padding-block: 56px; }
  .hero { padding-bottom: 48px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .hero__points { gap: 8px 14px; }
  .hero__point { font-size: 0.84rem; }

  /* Hero composition compacts: hide two of the floating cards to avoid overlap */
  .hv { max-width: 100%; aspect-ratio: 1 / 1.02; }
  .hv__panel { width: 82%; }
  .hv__card { padding: 9px 12px 9px 9px; }
  .hv__card .ic { width: 32px; height: 32px; border-radius: 9px; }
  .hv__card .ic svg { width: 16px; height: 16px; }
  .hv__card .t { font-size: 0.74rem; }
  .hv__card .s { display: none; }
  .hv__card--ai { top: 0; left: 0; }
  .hv__card--product { bottom: 0; right: 0; }
  .hv__card--mobile, .hv__card--cloud { display: none; }
  .hv__pill { display: none; }
  .hv__orbit { width: 104%; }
  .hv__orbit--2 { display: none; }

  .services-grid { grid-template-columns: 1fr; }
  .process { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }

  .card--pad, .feature-card, .bento__item, .engage-card, .tech-group, .step, .info-card { padding: 24px 20px; }
  .product-card__body { padding: 28px 20px 20px; }
  .case-card__body { padding: 20px; }
  .brand-card { padding: 30px 24px; }
  .mv-card { padding: 30px 24px; }

  .cta { border-radius: var(--r-xl); }
  .cta__actions { flex-direction: column; align-items: stretch; }
  .cta__actions .btn { width: 100%; }

  .footer-top { grid-template-columns: 1fr; gap: 30px; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
  .page-hero__actions .btn { width: 100%; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { width: 100%; }
  .product-card__actions .btn { flex: 1 1 auto; }
  .showcase { padding: 18px 16px; border-radius: var(--r-xl); }
  .showcase__actions .btn { flex: 1 1 auto; }
  .check-list--grid { grid-template-columns: 1fr; }
  .product-cats { justify-content: flex-start; }
  .product-card__actions .link-arrow { margin-left: 0; width: 100%; justify-content: center; padding-top: 6px; }
}

/* ---------- Very small phones (320–400) ---------- */
@media (max-width: 400px) {
  html { font-size: 15px; }
  .navbar__logo { height: 34px; }
  .eyebrow { font-size: 0.68rem; padding: 5px 11px 5px 9px; letter-spacing: 0.08em; white-space: normal; text-align: left; }
  .marquee__item { padding: 8px 14px 8px 10px; font-size: 0.82rem; }
  .hv__panel { width: 88%; }
  .btn-lg { padding: 14px 22px; font-size: 0.96rem; }
  .case-card__meta-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Coarse pointers: no hover-only affordances ---------- */
@media (hover: none) {
  .card--glow::before { display: none; }
  .marquee:hover .marquee__track { animation-play-state: running; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal, .hero__content > *, .hero__visual, .page-hero__inner > *, .mobile-link {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  .mark::after { transform: scaleX(1) !important; }
  .hv__chart .line { stroke-dashoffset: 0 !important; }
  .hv__chart .area, .hv__chart .dot, .hv__chart .dot-halo { opacity: 1 !important; }
  .hv__panel, .hv__card, .hv__pill, .hv__orbit, .hero__blob, .brand-card__icon, .brand-card__orbit, .loader__icon { animation: none !important; }
  .marquee__track { animation: none !important; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee { mask-image: none; -webkit-mask-image: none; }
  body.is-entering main, body.is-entering .site-header { opacity: 1; transform: none; }
  #preloader { display: none !important; }
  #heroParticles { display: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .mobile-menu, .mobile-overlay, #preloader, .to-top, .scroll-progress, .cta, .site-footer .footer-cta { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  body { background: #fff; }
}
