/* =========================================================
   CLOUDY — Mobile-only enhancements (≤768px)
   Desktop styles remain untouched.
   ========================================================= */

@media (max-width: 768px) {
  :root {
    --header-h: 64px;
    --mobile-pad: 1.1rem;
    --tap: 48px;
  }

  .container {
    width: min(100% - 1.5rem, var(--max));
  }

  /* ---- Header / Nav ---- */
  .header {
    height: var(--header-h);
  }

  .header__inner {
    gap: 0.45rem;
  }

  .brand__name {
    font-size: 0.92rem;
  }

  .brand__tag {
    display: none !important;
  }

  .icon-btn,
  .burger {
    min-width: var(--tap);
    min-height: var(--tap);
    width: var(--tap);
    height: var(--tap);
    border-radius: 14px;
  }

  .burger {
    display: grid;
  }

  .header__cta {
    display: none !important;
  }

  .mobile-nav {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    top: var(--header-h);
    height: calc(100svh - var(--header-h));
    padding: 1.25rem 1.25rem 2rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    border-bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
    z-index: 60;
  }

  .mobile-nav.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-nav a {
    min-height: var(--tap);
    display: flex;
    align-items: center;
    font-size: 1.15rem;
    font-weight: 600;
    padding: 0.35rem 0.2rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    transition: color 0.2s, padding-inline-start 0.2s;
  }

  .mobile-nav a:active {
    color: var(--accent);
    padding-inline-start: 0.35rem;
  }

  .mobile-nav .btn {
    margin-top: 1rem;
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    border-bottom: 0 !important;
    justify-content: center;
  }

  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }

  /* ---- Hero ---- */
  .hero {
    min-height: auto;
    padding-top: 1.75rem;
    justify-content: flex-start;
  }

  .hero__grid {
    padding-bottom: 1.5rem;
  }

  .hero__brand {
    font-size: clamp(2.4rem, 14vw, 3.4rem);
    margin-bottom: 0.45rem;
  }

  .hero__line {
    font-size: clamp(1.2rem, 5.4vw, 1.55rem);
    max-width: 100%;
    line-height: 1.35;
  }

  .hero__lead {
    margin: 0.85rem 0 1.15rem;
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .hero__actions {
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
  }

  .hero__actions .btn {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
  }

  .hero__trust-strip {
    padding: 0.75rem 0;
  }

  .marquee {
    font-size: 0.7rem;
    gap: 1.5rem;
  }

  .page-hero {
    padding: 2rem 0 1.5rem;
  }

  .page-hero h1 {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
    max-width: 100%;
  }

  /* ---- Sections ---- */
  .section {
    padding: 3.25rem 0;
  }

  .section--tight {
    padding: 1.75rem 0 0.75rem;
  }

  .section-head {
    margin-bottom: 1.5rem;
  }

  .section-head h2,
  .split h2 {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .lead,
  .prose {
    font-size: 0.95rem;
  }

  /* ---- Stats: 2-col ---- */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1.1rem 0.9rem;
    min-height: 110px;
  }

  .stat-card__value {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .stat-card__label {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  /* ---- Services: swipe carousel ---- */
  .services-grid {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.25rem;
    padding-bottom: 0.5rem;
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    grid-template-columns: none;
  }

  .services-grid::-webkit-scrollbar {
    display: none;
  }

  .services-grid > .service-card {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
  }

  .service-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .service-card__icon svg {
    width: 26px;
    height: 26px;
  }

  .service-card h3 {
    font-size: 1.08rem;
  }

  .service-card p {
    flex: 1;
    font-size: 0.9rem;
  }

  .service-card__link {
    margin-top: auto;
    padding-top: 0.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ---- Tech: horizontal scroll ---- */
  .tech-grid {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.35rem;
    grid-template-columns: none;
  }

  .tech-grid::-webkit-scrollbar {
    display: none;
  }

  .tech-card {
    flex: 0 0 auto;
    min-width: 148px;
    scroll-snap-align: start;
    padding: 1rem 0.95rem;
  }

  /* ---- Portfolio / content grids ---- */
  .portfolio-grid,
  .content-grid.cols-2,
  .content-grid.cols-3,
  .principles-grid,
  .trust-grid,
  .ai-grid,
  .values-list {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .portfolio-card,
  .blog-card,
  .service-index-card {
    min-height: auto;
    padding: 1.15rem;
  }

  .portfolio-card a,
  .blog-card,
  .service-index-card {
    min-height: 44px;
  }

  /* ---- Case studies ---- */
  .case-card {
    padding: 1.15rem;
  }

  .case-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }

  .case-grid ul {
    gap: 0.45rem;
  }

  /* ---- Compare / timeline ---- */
  .compare {
    grid-template-columns: 1fr !important;
    padding: 1.15rem;
    gap: 1rem;
  }

  .timeline {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .timeline__item {
    padding: 1rem;
  }

  /* ---- Industries / chips ---- */
  .industries {
    gap: 0.5rem;
  }

  .industry,
  .chip,
  .filter-btn,
  .logo-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: 0.95rem;
  }

  .logo-rail {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
  }

  .logo-rail::-webkit-scrollbar {
    display: none;
  }

  .logo-pill {
    flex: 0 0 auto;
  }

  /* ---- Testimonials ---- */
  .testimonial {
    min-height: 240px;
    padding: 1.35rem;
  }

  .testimonial p {
    font-size: 1.02rem;
  }

  .carousel__controls .icon-btn {
    min-width: var(--tap);
    min-height: var(--tap);
  }

  /* ---- FAQ ---- */
  .faq-item {
    padding: 0.15rem 0.85rem 0.65rem;
  }

  .faq-item summary {
    min-height: var(--tap);
    display: flex;
    align-items: center;
    font-size: 0.98rem;
    padding: 0.75rem 0;
  }

  /* ---- Contact / CTA ---- */
  .contact-cards {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .contact-card,
  .contact__btn,
  .cta-panel__actions .btn,
  .cta-panel__actions a.btn {
    width: 100%;
    min-height: 52px;
  }

  .contact-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.1rem 1.15rem;
  }

  .cta-panel {
    padding: 1.35rem;
  }

  .cta-panel__actions {
    flex-direction: column;
    width: 100%;
  }

  .map-wrap,
  .map-wrap iframe {
    min-height: 240px;
  }

  /* ---- Footer ---- */
  .footer {
    padding: 2.5rem 0 6.5rem;
  }

  .footer__grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .footer a,
  .footer h3 {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* ---- Buttons / taps ---- */
  .btn {
    min-height: 48px;
    padding: 0.85rem 1.2rem;
  }

  .filters .chip,
  .internal-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* ---- Floating UX ---- */
  .float-wa {
    width: 56px;
    height: 56px;
    inset-inline-end: 0.9rem;
    bottom: 0.9rem;
  }

  .sticky-cta {
    inset-inline-end: 0.9rem;
    inset-inline-start: auto;
    bottom: 4.6rem;
  }

  .sticky-cta .btn {
    min-height: 48px;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    padding-inline: 1.1rem;
    font-size: 0.88rem;
  }

  .scroll-top {
    position: fixed;
    inset-inline-start: 0.9rem;
    bottom: 0.9rem;
    z-index: 70;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--bg-elev);
    backdrop-filter: blur(12px);
    color: var(--text);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }

  .scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .analytics-consent {
    inset-inline: 0.75rem;
    bottom: 5.2rem;
    max-width: none;
  }

  .analytics-consent__actions button {
    min-height: 44px;
    min-width: 88px;
  }

  /* ---- Media slider / project pages ---- */
  .media-slider__viewport {
    aspect-ratio: 4 / 3;
  }

  .media-slider__controls .icon-btn {
    min-width: var(--tap);
    min-height: var(--tap);
  }

  .benefit-cards li {
    padding: 1rem 1.05rem;
    font-size: 0.95rem;
  }

  /* ---- Split about ---- */
  .split {
    gap: 1.5rem;
  }

  .check-list li {
    min-height: 40px;
  }

  /* Touch feedback */
  .glass-card:active,
  .tech-card:active,
  .service-card:active,
  .portfolio-card:active {
    transform: scale(0.985);
  }

  /* Safe area for notched phones */
  .float-wa,
  .scroll-top,
  .sticky-cta {
    margin-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* Extra-small phones */
@media (max-width: 360px) {
  .hero__brand {
    font-size: 2.15rem;
  }

  .stats-grid {
    gap: 0.55rem;
  }

  .stat-card {
    padding: 0.9rem 0.7rem;
  }

  .services-grid > .service-card {
    flex-basis: 88vw;
  }
}

/* Prefer reduced motion on mobile too */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .mobile-nav,
  .scroll-top,
  .glass-card:active {
    transition: none !important;
    transform: none !important;
  }
}
