/* === Tablet === */
@media (max-width: 992px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-inner::before {
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: min(100vw, 440px);
    height: min(50vh, 400px);
  }

  .hero-content .subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-note {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-content {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-visual-wrap {
    margin-left: 0;
    margin-right: 0;
    justify-content: center;
  }

  .hero-visual {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }

  .hero-visual-wrap::before {
    left: 50%;
  }

  #hero .hero-image {
    object-position: center;
    max-height: min(520px, 56vh);
  }

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

  .about-outcomes {
    grid-template-columns: 1fr;
  }

  .process-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-aside {
    order: -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    padding-top: 0;
  }

  .hero-visual {
    min-height: 200px;
    width: min(760px, 100%);
  }

  #hero .hero-image {
    max-height: min(520px, 52vh);
  }

  .cases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-card-image {
    height: clamp(220px, 42vw, 300px);
  }

  .trust-item:not(:last-child)::after {
    display: none;
  }

  .trust-row {
    gap: 0.35rem 0.15rem;
  }

  .trust-item {
    padding: 0.3rem 0.85rem;
  }

  .trust-name {
    white-space: normal;
  }
}

/* === Mobile: burger menu === */
@media (max-width: 768px) {
  section {
    padding: clamp(2.25rem, 8vw, 3.25rem) 0;
  }

  .site-header {
    padding: 0.5rem 0;
  }

  .site-header .container {
    justify-content: space-between;
    gap: 0.75rem;
  }

  .site-header nav {
    flex: 0;
  }

  .logo-img {
    height: clamp(34px, 10vw, 44px);
    max-width: min(190px, 48vw);
  }

  .nav-cta {
    display: none;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 1px solid var(--border-subtle);
    z-index: 100;
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.35);
  }

  .nav-menu.is-open {
    transform: translateX(0);
  }

  .burger {
    display: flex;
  }

  #hero {
    min-height: auto;
    align-items: flex-start;
    padding-top: clamp(4.75rem, 14vw, 5.75rem);
    padding-bottom: clamp(1.75rem, 6vw, 2.5rem);
  }

  .hero-inner {
    gap: 1.5rem;
  }

  .hero-content h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
    text-wrap: balance;
  }

  .hero-content .subtitle {
    font-size: 1rem;
    max-width: 34rem;
  }

  .hero-visual-wrap {
    padding-bottom: 0;
    margin-top: 0.5rem;
  }

  .hero-visual {
    min-height: 160px;
  }

  #hero .hero-image {
    max-height: min(360px, 38vh);
  }

  .burger.is-open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .burger.is-open span:nth-child(2) {
    opacity: 0;
  }

  .burger.is-open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

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

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

  .cases-carousel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "viewport"
      "meta";
    gap: 0.85rem;
  }

  .cases-nav {
    position: absolute;
    top: 42%;
    z-index: 2;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  }

  .cases-nav-prev { left: 0.25rem; }
  .cases-nav-next { right: 0.25rem; }

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

  .case-card-image {
    height: clamp(210px, 56vw, 280px);
  }

  .cases-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-aside {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-content h1 {
    font-size: clamp(1.85rem, 10vw, 2.35rem);
  }

  .hero-note {
    font-size: 0.88rem;
  }

  .btn-cta {
    width: 100%;
  }
}

/*
 * Вертикальный монитор / узкий и высокий экран: не центрировать hero в пустом 100vh
 * (иначе сверху и снизу огромные поля). Контент сразу под шапкой, блок по высоте контента.
 */
@media (max-aspect-ratio: 10/16) and (min-height: 720px) {
  #hero {
    align-items: flex-start;
    min-height: unset;
    padding-top: clamp(4.75rem, 9vh, 5.75rem);
    padding-bottom: clamp(1.75rem, 5vh, 2.75rem);
  }
}
