@media screen and (max-width: 1400px) {
    #profile {
      height: 83vh;
      margin-bottom: 6rem;
    }
    .about-containers {
      flex-wrap: wrap;
    }
    #contact,
    #projects {
      height: fit-content;
    }
  }
  
  @media screen and (max-width: 1200px) {
    #desktop-nav {
      display: none;
    }
    #hamburger-nav {
      display: flex;
    }
    #experience,
    .experience-details-container {
      margin-top: 2rem;
    }
    #profile,
    .section-container {
      display: block;
    }
    .arrow {
      display: none;
    }
    section,
    .section-container {
      height: fit-content;
    }
    section {
      margin: 0 5%;
    }
    .section__pic-container {
      width: 275px;
      height: 275px;
      margin: 0 auto 2rem;
    }
    /* Education adjustments to prevent overlap */
    #education .section__pic-container {
      width: 60%;
      height: auto;
      margin: 0 auto 1rem;
    }
    #education .details-container { width: 90%; margin: 0 auto 1rem; }
    .about-containers {
      margin-top: 0;
    }
    /* Medium breakpoint: force single-column experience cards */
    .about-containers { flex-direction: column !important; }
    .about-containers .details-container { width: 100% !important; max-width: 100% !important; }
  }
  
  @media screen and (max-width: 600px) {
    #contact,
    footer {
      height: 40vh;
    }
    #profile {
      height: 83vh;
      margin-bottom: 0;
    }
    article {
      font-size: 1rem;
    }
    footer nav {
      height: fit-content;
      margin-bottom: 2rem;
    }
    .about-containers,
    .contact-info-upper-container,
    .btn-container {
      flex-wrap: wrap;
    }
    .contact-info-container {
      margin: 0;
    }
    .contact-info-container p,
    .nav-links li a {
      font-size: 1rem;
    }
    .experience-sub-title {
      font-size: 1.25rem;
    }
    .logo {
      font-size: 1.5rem;
    }
    .nav-links {
      flex-direction: column;
      gap: 0.5rem;
      text-align: center;
    }
    .section__pic-container {
      /* stronger rule for medium screens to ensure single-column experience cards */
      @media (max-width: 1000px) {
        .about-containers { flex-direction: column !important; }
        .about-containers .details-container { width: 100% !important; max-width: 100% !important; }
      }
      width: auto;
      height: 46vw;
      justify-content: center;
    }
    /* ensure profile/about stacks nicely on small screens */
    #about { padding-top: 6rem; }
    #about .section__pic-container { width: 46vw; height: 46vw; margin-bottom: 1rem; }
    #about .section__text { padding: 0 1rem; }

    /* Experience: one card per row on mobile */
    .about-containers { flex-direction: column !important; }
    .about-containers .details-container { width: 100% !important; max-width: 100% !important; }

    /* Education: avoid overlap with card */
    #education .section__pic-container { width: 80%; height: auto; margin-bottom: 0.75rem; }
    #education .details-container { width: 96%; }
    .section__text__p2 {
      font-size: 1.25rem;
    }
    .title {
      font-size: 2rem;
    }
    .text-container {
      text-align: justify;
    }
  }