img,
video {
  max-width: 100%;
}

@media (max-width: 900px) {
  .cases-grid,
  .legal-hero-grid,
  .legal-layout {
    min-width: 0;
  }

  .container {
    max-width: calc(100% - 48px);
  }

  .header-inner {
    min-width: 0;
    flex-wrap: wrap;
  }

  .header-actions {
    min-width: 0;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .apply-button,
  .contact-button {
    min-width: 0;
    min-height: 44px;
    flex: 1 1 120px;
    justify-content: center;
  }

  .back {
    min-height: 44px;
    flex: 1 1 100%;
    text-align: center;
  }

  .back-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .case,
  .legal-document,
  .legal-operator,
  .legal-hero-grid > *,
  .legal-layout > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .legal-layout {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 40px;
  }

  .legal-hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
    gap: 36px;
  }
}

@media (max-width: 800px) {
  .container {
    width: min(calc(100% - 32px), 720px);
    max-width: none;
  }

  .nav {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
  }

  .logo,
  .brand {
    min-width: 0;
  }

  .nav__phone {
    display: none;
  }

  .nav__contact-links {
    margin-left: auto;
  }

  .contact-link,
  .contact-button,
  .apply-button {
    min-height: 44px;
  }

  .hero__grid,
  .form-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .hero__grid {
    min-height: 0;
    padding: 60px 0 72px;
  }

  .hero__visual,
  .hero__photo {
    min-width: 0;
    max-width: 100%;
  }

  .hero__photo {
    height: auto;
  }

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

  .stat {
    min-width: 0;
    padding: 20px 16px;
    overflow-wrap: anywhere;
  }

  .stat:not(:first-child) {
    padding-left: 16px;
  }

  .stat:nth-child(odd) {
    padding-left: 0;
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(n+3) {
    border-top: 1px solid rgba(255,255,255,.3);
  }

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

  .card,
  .step,
  .review-card,
  .section-head > *,
  .form-wrap > * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .step,
  .step:not(:last-child) {
    margin: 0;
    padding: 0 0 22px;
    border: 0;
    border-bottom: 1px solid #3b3b3b;
  }

  .step:last-child {
    margin: 0;
    padding-bottom: 0;
    border: 0;
  }

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

  .form-wrap {
    gap: 32px;
  }

  form,
  input,
  textarea,
  form .button {
    min-width: 0;
    max-width: 100%;
  }

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

  .footer__details {
    min-width: 0;
    max-width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .footer__contact-links {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .case__image {
    max-width: 100%;
  }

  .case img,
  .case video {
    height: auto;
    max-height: 180px;
    aspect-ratio: 16 / 9;
    object-fit: contain;
  }

  .site-header .header-inner {
    flex-wrap: wrap;
  }

  .legal-hero-grid,
  .legal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .legal-operator {
    position: static;
  }

  .legal-hero h1 {
    font-size: clamp(40px, 8vw, 64px);
    overflow-wrap: anywhere;
  }

  .legal-document,
  .legal-document section,
  .legal-footer .container {
    min-width: 0;
    overflow-wrap: anywhere;
  }

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

  section {
    padding-top: 72px;
    padding-bottom: 72px;
  }
}

@media (min-width: 560px) and (max-width: 800px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 559px) {
  .container {
    width: calc(100% - 32px);
  }

  .topbar {
    font-size: 10px;
  }

  .nav {
    row-gap: 4px;
  }

  .nav > .logo {
    flex: 1 1 100%;
  }

  .nav__contact-links {
    width: 100%;
    justify-content: flex-end;
    margin: 0;
  }

  .nav__contact-links .contact-link {
    min-height: 44px;
    padding: 8px 10px;
    font-size: 10px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 58px);
    line-height: .9;
    overflow-wrap: anywhere;
  }

  .hero__lead {
    font-size: 17px;
  }

  .section-title {
    font-size: clamp(32px, 9vw, 46px);
    line-height: 1;
    overflow-wrap: anywhere;
  }

  .hero__grid {
    padding: 48px 0 56px;
  }

  .hero__visual {
    min-height: 0;
  }

  .hero__photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .stats__grid,
  .cards,
  .cases__grid,
  .process__grid,
  .reviews-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat,
  .stat:not(:first-child),
  .stat:nth-child(odd) {
    min-height: 0;
    padding: 18px 0;
    border-right: 0;
  }

  .stat + .stat {
    border-top: 1px solid rgba(255,255,255,.3);
  }

  .stat strong {
    font-size: 32px;
  }

  .card {
    min-height: 230px;
    padding: 24px;
  }

  .card h3,
  .case__title,
  .step h3 {
    font-size: clamp(22px, 7vw, 28px);
    overflow-wrap: anywhere;
  }

  .card__line {
    left: 24px;
    bottom: 24px;
  }

  .case {
    padding: 24px;
  }

  .case__image {
    width: calc(100% + 48px);
    max-width: none;
    height: 110px;
    margin: -24px -24px 18px;
  }

  .case img,
  .case video {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
  }

  .review-card {
    min-height: 0;
    padding: 24px;
  }

  .reviews-channel,
  .cases__more,
  .telegram-button {
    max-width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    text-align: center;
    overflow-wrap: anywhere;
  }

  form {
    grid-template-columns: minmax(0, 1fr);
  }

  label:last-of-type,
  form .button {
    grid-column: auto;
  }

  input,
  textarea {
    min-height: 44px;
  }

  form .button {
    width: 100%;
  }

  .consent-check {
    align-items: flex-start;
  }

  footer {
    padding: 32px 0;
  }

  .site-header {
    padding: 14px 0;
  }

  .site-header .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .apply-button,
  .contact-button {
    flex: 1 1 120px;
    min-width: 0;
    justify-content: center;
    padding: 10px;
    white-space: normal;
    text-align: center;
  }

  .back {
    flex: 1 1 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  main {
    padding: 42px 0;
  }

  .cases-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .case h2 {
    font-size: clamp(24px, 7vw, 31px);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .case img,
  .case video {
    margin-bottom: 16px;
  }

  .case .meta,
  .case .desc,
  .legal-document,
  .legal-callout,
  .legal-footer {
    overflow-wrap: anywhere;
  }

  .legal-hero {
    padding: 36px 0 42px;
  }

  .legal-hero h1 {
    font-size: clamp(34px, 10.5vw, 48px);
    line-height: 1;
  }

  .legal-body {
    padding: 48px 0;
  }

  .legal-document section {
    padding-bottom: 28px;
    margin-bottom: 28px;
  }

  .legal-document h2 {
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.1;
  }

  .legal-document h3 {
    font-size: 21px;
    line-height: 1.15;
  }

  .legal-callout {
    padding: 16px;
  }

  .legal-partners {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-footer {
    padding: 24px 0;
  }
}
