@media (max-width: 1183px) {
  .nav-link {
    font-size: 1rem;
  }
  .hero-text h1 {
    font-size: 3.3rem;
  }
  .hero-photo img {
    width: 350px;
  }
}
@media (max-width: 1096px) {
  .hero-text h1 {
    font-size: 3.1rem;
  }
  .hero-photo img {
    width: 330px;
  }
}
@media (max-width: 1045px) {
  .nav-link {
    font-size: 1rem;
  }
  .hero-text h1 {
    font-size: 2.7rem;
  }
}


@media (max-width: 1000px) {
  .chat-message {
    font-size: 0.85rem;
    padding: 0.7rem 1.1rem;
  }
}

/* ── Tablet range: desktop nav still visible, but hero needs tightening ── */
@media (min-width: 769px) and (max-width: 1023px) {
  .hero {
    min-height: auto;
    padding: 2.5rem 1.5rem 2rem;
    gap: 1.5rem;
  }

  /* 5 columns is too cramped on small laptops — use 3 */
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) and (max-width: 1150px) {
  /* 5 columns still too tight at 1024–1150px — use 4 */
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1023px) {
  .hero-photo-img,
  .hero-photo img {
    object-position: center 40%; /* show more of face, less empty space at top */
  }
}

@media (max-width: 965px) {
  /* keep portrait ratio — was 300×300 (square, bad) */
  .hero-photo img {
    width: 330px;
  }
}

@media (max-width: 935px) {
  .nav-container {
    padding: 0.7rem 1rem;
    gap: 1.5rem;
  }

  .nav-links ul {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .hero-text p {
    font-size: 1.05rem;
  }

  /* keep portrait ratio — was 260×260 (square, bad) */
  .hero-photo img {
    width: 330px;
  }
}

@media (max-width: 855px) {
  .hero-text h1 {
    font-size: 2.3rem;
  }
}

@media (max-width: 821px) {
  .hero-text h1 {
    font-size: 2.1rem;
  }

  /* keep portrait ratio — was 240×240 (square, bad) */
  .hero-photo img {
    width: 330px;
  }
}

@media (max-width: 800px) {
  .chat-message {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }
}

@media (max-width: 768px) {
  /* Mobile View */
  .nav-links {
    display: none;
  }

  .lang-switcher-container {
    display: none; /* Скрываем контейнер с языками */
  }
  

    /* Специальные настройки для немецкого */
  [lang="de"] .hero-text h1 {
    font-size: 1.8rem;
  }
  
  [lang="de"] .hero-text p {
    font-size: 0.95rem;
    padding-right: 1rem;
  }
  
  .burger {
    display: flex;
  }
  
  /* hero */
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 1.5rem 1rem 2rem;   /* was 3rem top — too much dead space */
    text-align: center;
    gap: 1.5rem;                  /* was 2.5rem — tighter between photo and text */
  }
  .hero-text     { order: 2; }
  .hero-photo    { order: 1; justify-content: center; }
  .hero-badge    { margin-left: auto; margin-right: auto; }
  .hero-desc     { max-width: 100%; margin-left: auto; margin-right: auto; }
  .hero-stack    { justify-content: center; }
  .hero-ctas     { justify-content: center; }
  .hero-stats    { justify-content: center; }
  .hero-float    { display: none; }
  .hero-photo-img { width: 240px; height: 300px; } /* portrait ratio */
  .hero h1       { font-size: clamp(2.2rem, 8vw, 3rem); align-items: center; }

  /* navigation — compact for mobile */
  .nav-container {
    flex-direction: row;
    flex-wrap: nowrap;            /* was wrap — prevented layout jumping */
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 1rem;        /* was 0.5rem — reduces header height */
    position: relative;
  }

  .animated-logo {
    max-height: 40px;             /* was 54px — smaller on mobile */
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background-color: #0b0d10;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0;
    position: absolute;
    top: 60px;
    left: 0;
    z-index: 999;
    text-align: center;
  }
  .nav-link {
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* footer — mobile handled in footer.css */

  /* About */
  .about-body       { grid-template-columns: 1fr; gap: 2rem; }
  .about-expertise  { grid-template-columns: 1fr 1fr; }
  .about { padding: 4rem 1rem 3rem; }

  /* Skills */
  .cards { grid-template-columns: repeat(2, 1fr); }
  .capabilities { padding: 4rem 1rem 3rem; }

  /* Portfolio */
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio { padding: 4rem 1rem 3rem; }

  /* sections and forms */
  section {
    padding: 2rem 1rem;
  }
  form {
    width: 100%;
  }
  /* contact-form padding & form-container handled in contact_form.css */

  /* cards */
  .card {
    padding: 1.5rem;
  }

  /* chat */
  .chat-box {
    padding: 0.7rem;
  }
  .chat-message {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  /* about */
  .about-columns {
    padding: 0 1rem;
  }
  .about-benefits ul {
    padding-left: 1.2rem;
  }

  /* universal containers */
  .container {
    padding: 0 0.75rem;
  }

  /* usecases */
  .usecases-grid {
    flex-direction: column;
  }
  .usecases-grid .example {
    flex: 1 1 100%;
  }
}

@media (max-width: 600px) {
  .nav-container {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  .logo {
    flex: 1;
    display: flex;
    align-items: center;
  }

  .lang-switcher {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    flex: 1;
  }
    .lang {
    padding: 0.1rem;
    font-size: 0.8rem;
  }
  .nav-links {
    display: none;
  }
  
  .burger {
    display: flex;
  }
  .hero-photo-img {
    max-width: 300px;
  }
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .card {
    padding: 1.2rem;
  }
  .card-icon {
    width: 60px;
    height: 60px;
  }
  .chat-message {
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
    max-width: 90%;
  }
  .chat-message span {
    font-size: 0.75rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .section-desc {
    font-size: 1rem;
  }
  .caption {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  body.lang-de .section-title,
  body.lang-de .capabilities-title,
  body.lang-de h2 {
    font-size: 1.8rem; /* Подгони под нужный размер */
  }
  .nav-container {
    padding: 0.8rem;
  }

  .mobile-menu .nav-link {
    font-size: 1.7rem;
    padding: 0.8rem 1.2rem;
  }
  
  .mobile-menu ul {
    gap: 3rem;
  }
  
  .mobile-menu .nav-link {
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
  }
  /* Дополнительные правки для маленьких экранов */
  [lang="de"] .hero-text h1 {
    font-size: 1.6rem;
    line-height: 1.4;
  }
  
  [lang="de"] .hero-line {
    display: block;
  }
  .hero {
    padding-top: 1.5rem;
  }
  .hero-text h1 {
    font-size: 2rem;
    line-height: 1.3;
  }
  .hero-photo-img {
    width: 220px;
    height: 220px;
  }
  .chat-message {
    max-width: 90%;
    padding: 0.7rem;
    font-size: 0.85rem;
  }
  .chat-box {
    padding: 0.5rem;
  }
  .form-group input, 
  .form-group textarea {
    font-size: 16px; /* предотвращает зум в iOS */
  }
  .checkbox-group label {
    font-size: 0.85rem;
  }
}

@media (max-width: 425px) {
  .hero-text h1 {
    font-size: 2.5rem;
  }
  body,
  section,
  .hero,
  .card,
  .capabilities,
  .examples,
  .footer,
  .about,
  .about-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .hero {
    padding-top: 2rem;
    padding-bottom: 1.5rem;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  /* contact-form & form-container handled in contact_form.css */
  .card {
    padding: 1rem 0.75rem;
  }
  .section-title,
  .hero-text h1 {
    text-align: center;
  }
}