@media screen and (max-width: 1400px) {
  section {
    max-width: 1000px;
    padding: 2rem 1rem;
  }
  #profile {
    min-height: 50vh;
    gap: 2rem;
  }
  .section__pic-container {
    height: 250px;
    width: 250px;
  }
  .projects-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
  }
  .project-image-container {
    height: 140px;
  }
  .experience-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
  }
  .about-cards-bottom {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
  }
  .about-image-wrapper {
    width: 100px;
    height: 100px;
  }
}

@media screen and (max-width: 1200px) {
  #hamburger-nav {
    top: 1.5rem;
    right: 1.5rem;
  }
  section {
    max-width: 900px;
    padding: 1.5rem 1rem;
  }
  #profile {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    min-height: auto;
  }
  .section__pic-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 1rem;
    overflow: hidden;
  }
  .arrow {
    display: none;
  }
  .projects-container {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
  }
  .project-image-container {
    height: 120px;
  }
  .experience-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .about-header-wrapper {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  .about-image-wrapper {
    width: 80px;
    height: 80px;
  }
  .about-cards-bottom {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* iPad and tablet landscape */
@media screen and (max-width: 1024px) and (orientation: landscape) {
  section {
    margin: 0 2rem;
  }
  .projects-container {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
  }
  .project-image-container {
    height: 150px;
  }
  .experience-container {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .about-header-wrapper {
    flex-direction: row;
    text-align: left;
  }
  .about-image-wrapper {
    width: 140px;
    height: 140px;
  }
}

/* iPad portrait */
@media screen and (max-width: 768px) {
  section {
    margin: 0 1.5rem;
  }
  .projects-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
  }
  .project-image-container {
    height: 130px;
  }
  .experience-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .about-header-wrapper {
    flex-direction: column;
    text-align: center;
  }
  /* Fix awkward justification on tablets */
  .about-paragraph,
  .text-container p,
  .paragraph {
    text-align: left;
    hyphens: auto;
    word-spacing: normal;
    letter-spacing: normal;
  }
  .about-image-wrapper {
    width: 120px;
    height: 120px;
  }
  .about-cards-bottom {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media screen and (max-width: 600px) {
  section {
    max-width: 100%;
    padding: 1rem 0.5rem;
  }
  #profile {
    padding: 1rem 0;
    gap: 1rem;
  }
  .section__pic-container {
    width: 150px;
    height: 150px;
    overflow: hidden;
  }
  .section__text__p2 {
    font-size: 1.1rem;
  }
  .title {
    font-size: 1.5rem;
  }
  .title1,
  .title2 {
    font-size: 1.5rem;
  }
  .projects-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .project-card {
    padding: 1rem;
  }
  .project-image-container {
    height: 100px;
  }
  .experience-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .experience-card {
    padding: 1rem;
  }
  .about-container {
    gap: 1rem;
  }
  .about-card {
    padding: 1rem;
  }
  /* Remove justification and avoid uneven spacing on phones */
  .about-paragraph,
  .text-container p,
  .paragraph {
    text-align: left;
    hyphens: auto;
    word-break: normal;
    overflow-wrap: anywhere;
    letter-spacing: normal;
    word-spacing: normal;
  }
  .about-image-wrapper {
    width: 60px;
    height: 60px;
  }
  .about-cards-bottom {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .contact-info-upper-container {
    padding: 0.75rem;
  }
  footer {
    padding: 1rem 0;
  }
}
