@media (max-width: 1320px) {
  .container-lg {
    max-width: 1200px;
  }

  .hero-content {
    padding: 0;
  }

  .header-nav {
    padding: 0;
  }
}

@media (max-width: 1200px) {
  .title {
    font-size: 40px;
  }

  .about-content {
    padding-right: 0;
  }

  .services-row {
    justify-content: center;
  }

  .project-box {
    max-width: 454px;
  }

  .about,
  .projects,
  .contact {
    padding: 80px 0;
  }
}

@media (max-width: 977px) {
  .title {
    font-size: 36px;
  }

  .hero-row {
    flex-direction: column;
    row-gap: 40px;
  }
  .hero-content {
    text-align: center;
  }

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

  .about-social-list {
    display: block;
  }

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

  .about-row {
    row-gap: 50px;
    margin-bottom: 50px;
  }

  .nav-list {
    display: none;
  }

  .nav-btn {
    display: block;
  }

  .nav.open .nav-list {
    position: fixed;
    inset: 0;
    background-color: #fff;
    z-index: 1;
    padding: 46px 30px;
    display: flex;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    row-gap: 24px;
    font-size: 48px;
    font-weight: 500;
  }

  .nav-link {
    color: #565a5b;
  }

  .nav-link.active {
    color: #0c1618;
  }

  .nav-btn {
    position: absolute;
    z-index: 9;
    top: 36px;
    right: 30px;
  }

  .nav.open .nav-btn {
    position: fixed;
  }

  .header-nav {
    margin-bottom: 0;
  }

  .hero {
    padding-top: 160px;
  }

  .social-links-row {
    column-gap: 17px;
    margin: 30px 0 30px;
  }

  .btn {
    font-size: 11px;
    padding: 0 20px;
  }
  .skill {
    max-width: 460px;
    margin-inline: auto;
  }
  .services-row {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    row-gap: 50px;
  }

  .service-card-img {
    height: 40px;
  }

  .project-box {
    max-width: 327px;
  }

  .about,
  .projects,
  .contact {
    padding: 5rem 0;
  }

  .title {
    margin-bottom: 30px;
  }
}

@media (max-width: 720px) {
  .project-box {
    max-width: 100%;
  }

  /* Projects row: 1 column on small screens */
  .projects-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Container padding reduced */
  .container {
    padding: 0 20px;
  }

  /* Hide decorative vertical titles on mobile */
  #about .title,
  #services .title,
  #skills .title,
  #projects .title,
  #talks .title,
  #contact .title {
    display: none;
  }

  /* Hero */
  .hero-img {
    margin-right: 0;
  }

  .hero-img img {
    width: 220px;
  }

  /* Service card padding reduced */
  .service-card {
    max-width: 100%;
    padding: 40px 30px;
  }

  /* Skills cards: 3 per row */
  .skills-cards {
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 12px;
  }

  .skill-card {
    width: auto;
    height: 100px;
  }

  .skill-card img {
    max-width: 64px;
    max-height: 64px;
  }

  /* Tab nav stacked */
  .tabs-nav,
  .tabs-nav-2 {
    flex-direction: column;
    width: auto;
    margin: 0 0 2rem 0;
  }

  .tab-button {
    width: 100%;
    min-width: unset;
    font-size: 15px;
    padding: 10px 16px;
    margin-bottom: 4px;
  }

  /* Talks cards: vertical stack */
  .talks-cards {
    flex-direction: column;
    flex-wrap: wrap;
    overflow-x: visible;
    align-items: center;
  }

  .talk-card {
    max-width: 100%;
    width: 100%;
  }

  /* Projects row: 1 column */
  .projects-row {
    grid-template-columns: 1fr;
  }

  /* Section padding */
  .about,
  .services,
  .skills,
  .projects,
  .talks,
  .contact {
    padding: 4rem 0;
  }

  /* About/skills/talks cards full width */
  .about-skills,
  .about-talks,
  .about-projects {
    padding: 1.5rem;
    margin: 20px auto;
  }
}

@media (max-width: 480px) {
  /* Skills cards: 2 per row on very small screens */
  .skills-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .skill-card {
    height: 90px;
  }

  .skill-card img {
    max-width: 52px;
    max-height: 52px;
  }

  /* Buttons stack */
  .btn {
    display: block;
    width: 100%;
    margin: 0 0 10px 0;
    text-align: center;
  }

  /* Hero greeting + social inline-flex */
  .about-social-list {
    justify-content: center;
  }

  .hero-heading {
    font-size: 1.9rem;
  }
}

@media (max-width: 406px) {
  .hero-img {
    flex: 1 1 100%;
  }
}
