/* ============================================================
   Tablet — <= 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .grid--services { grid-template-columns: repeat(2, 1fr); }
  .grid--stack { grid-template-columns: repeat(2, 1fr); }
  .grid--diff { grid-template-columns: repeat(2, 1fr); }
  .grid--specialties { grid-template-columns: repeat(2, 1fr); }
  .grid--projects { grid-template-columns: repeat(2, 1fr); }

  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { height: 280px; order: -1; }

  .section__inner--split,
  .section__inner--reverse {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about__photo-wrap { max-width: 320px; margin: 0 auto; }

  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-last-child(-n+2) { border-bottom: none; }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem 2.5rem; }
  .footer__col--brand { grid-column: 1 / -1; }
}

/* ============================================================
   Mobile navigation — <= 860px
   ============================================================ */
@media (max-width: 860px) {
  .navbar__toggle { display: flex; }

  .navbar__links {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: rgba(11, 15, 25, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
    transform: translateY(-140%);
    transition: transform 0.3s ease;
  }
  .navbar__links.is-open { transform: translateY(0); }
  .navbar__link {
    padding: 1rem 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
    font-size: 1rem;
  }
  .navbar__link--cta { border: 1px solid var(--border); margin-top: 0.75rem; text-align: center; }

  .navbar__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .navbar__toggle.is-open span:nth-child(2) { opacity: 0; }
  .navbar__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ============================================================
   Small tablet / large phone — <= 768px
   ============================================================ */
@media (max-width: 768px) {
  :root { --section-pad: 4.5rem; }

  .grid--services { grid-template-columns: 1fr; }
  .grid--stack { grid-template-columns: 1fr; }
  .grid--diff { grid-template-columns: 1fr; }
  .grid--specialties { grid-template-columns: repeat(2, 1fr); }
  .grid--projects { grid-template-columns: 1fr; }

  .hero { padding-top: 6.5rem; padding-bottom: 3rem; min-height: auto; }
  .hero__title { font-size: 1.85rem; }
  .hero__subtitle { font-size: 1.02rem; }
  .hero__actions { flex-direction: column; align-items: stretch; margin-bottom: 2rem; }
  .hero__actions .btn { text-align: center; justify-content: center; }
  .hero__badges { margin-bottom: 2rem; }
  .hero__visual { height: 220px; }

  .stats-bar-wrap { margin-top: -2rem; padding: 0 1.25rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }

  .section--specialties { padding-top: 4.5rem; }

  .about__photo-wrap { max-width: 260px; }
  .credentials { flex-wrap: wrap; gap: 0.75rem; }
  .credentials__divider { display: none; }
  .credentials__item { flex: 1 1 30%; }

  .timeline { padding-left: 1.75rem; }
  .timeline__item::before { left: -1.75rem; }

  .process__step { grid-template-columns: 48px 1fr; gap: 1rem; padding: 1.5rem 0; }
  .process__num { font-size: 1.15rem; }

  .contact-card { padding: 1.75rem 1.25rem; }
  .contact-card__row { flex-direction: column; gap: 0.3rem; }

  .footer { padding-top: 3.5rem; }
  .footer__grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .footer__col--brand { grid-column: auto; align-items: center; }
  .footer__tagline { max-width: none; }
  .footer__col { align-items: center; }
  .footer__col a, .footer__static { width: auto; }
}

/* ============================================================
   Phone — <= 600px
   ============================================================ */
@media (max-width: 600px) {
  .credentials { padding: 0.9rem 0.5rem; }
  .credentials__value { font-size: 0.92rem; }
  .credentials__label { font-size: 0.6rem; }
  .hero__badges { margin-top: 0; gap: 0.5rem; }
  .chip { font-size: 0.7rem; padding: 0.4rem 0.75rem 0.4rem 0.6rem; }

  .grid--specialties { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .stat { padding: 1.25rem 0.75rem; }
  .stat__value { font-size: 1.5rem; }
  .stat__label { font-size: 0.66rem; }
}

/* ============================================================
   Small phone — <= 480px
   ============================================================ */
@media (max-width: 480px) {
  html { font-size: 15px; }

  .navbar__inner { padding: 0.85rem 1rem; }
  .navbar__logo { font-size: 0.95rem; }

  .hero { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero__title { font-size: 1.6rem; }
  .hero__subtitle { font-size: 0.98rem; }
  .hero__terminal { max-width: 100%; }
  .terminal__body { font-size: 0.78rem; padding: 1rem 0.85rem; }

  .section { padding-left: 1.25rem; padding-right: 1.25rem; }
  .section__title { font-size: 1.5rem; }

  .about__photo-wrap { max-width: 220px; }
  .role-list li { font-size: 0.95rem; }

  .card__title { font-size: 1.02rem; }
  .diff-item, .spec-item { font-size: 0.88rem; padding: 0.9rem 1rem; }

  .stack-card__list li { font-size: 0.72rem; }

  .contact-card__email { font-size: 0.85rem; word-break: break-all; }

  .float-btn { width: 46px; height: 46px; right: 1.1rem; }
  .float-btn--whatsapp { bottom: 1.1rem; }
  .float-btn--top { bottom: 4.6rem; }
}

/* ============================================================
   Extra-small phone — <= 360px
   ============================================================ */
@media (max-width: 360px) {
  .hero__title { font-size: 1.4rem; }
  .stats-bar { grid-template-columns: 1fr; }
  .stat { border-bottom: 1px solid var(--border); }
  .stat:last-child { border-bottom: none; }
  .credentials__item { flex: 1 1 100%; }
}

/* ============================================================
   Touch target & tap comfort (any coarse pointer, not just narrow)
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .stack-card:hover,
  .diff-item:hover,
  .spec-item:hover,
  .project-card:hover .project-card__thumb img,
  .about__photo:hover img {
    transform: none;
  }
  .navbar__link, .footer__col a, .contact-card__email, .btn {
    min-height: 44px;
  }
}
