/* >=1440 */
@media screen and (min-width: 1440px) {
  section { margin: 0 15rem; }
  .article-containers { gap: 3rem; }
  .section__pic-container { width: 450px; height: 450px; }
}

/* >=1920 */
@media screen and (min-width: 1920px) {
  body { max-width: 1920px; margin: 0 auto; }
  section { margin: 0 20rem; }
  .article-containers { gap: 4rem; }
  .section__pic-container { width: 500px; height: 500px; }
  .title { font-size: 3.5rem; }
  .section__text__p1, .section__text__p2 { font-size: 2rem; }
  .icon { height: 3rem; width: 3rem; }
}

/* <=1200 switch to mobile nav */
@media screen and (max-width: 1200px) {
  #desktop-nav { display: none; }
  #hamburger-nav { display: block; }
  main { padding-top: 58px; }
  section, .section-container { min-height: fit-content; }
  section { margin: 0 5%; }
  #profile .section__pic-container { width: 275px; height: 275px; margin: 60px auto 1.5rem; }
  .about-containers { flex-wrap: wrap; }
  .arrow { display: none; }

  /* Better mobile nav spacing */
  .nav-inner {
    padding: 0 2rem;
  }
}

/* <=992 */
@media screen and (max-width: 992px) {
  section { margin: 0 4%; padding-top: 3vh; }
  #profile { min-height: auto; padding-bottom: 3rem; }
  .section__pic-container { width: 300px; height: 300px; }
  .article-containers { gap: 2rem; }
  .about-containers { gap: 1.5rem; }

  /* Stack about section on smaller screens */
  #about .section-container {
    display: block;
    text-align: center;
  }

  #about .section__pic-container {
    margin: 0 auto 2rem auto;
  }
}

/* <=767 MOBILE FIXES */
@media screen and (max-width: 767px) {
  #profile {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding: 2rem 0;
    min-height: 83vh;
  }

  #profile .section__pic-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 1rem auto;
    order: 1;
  }

  .section__text {
    order: 2;
    width: 100%;
    margin: 0 auto;
  }

  /* Fix text alignment issues */
  .section__text__p1,
  .title,
  .section__text__p2 {
    text-align: center;
    margin-left: 0;
    margin-right: 0;
  }

  .title { font-size: 2rem; }
  .section__text__p2 { font-size: 1.25rem; }
  .logo { font-size: 1.5rem; }

  /* Center buttons properly */
  .btn-container {
    justify-content: center;
    width: 100%;
    margin: 0 auto;
  }

  /* Center social icons */
  #socials-container {
    justify-content: center;
    width: 100%;
    margin: 1.5rem auto 0 auto;
  }

  .article-containers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    padding: 0 10px;
  }

  article {
    width: auto;
    min-width: 8rem;
    margin-bottom: .75rem;
  }

  .projects-row {
    flex-direction: column;
    align-items: center;
  }

  .details-container.color-container {
    max-width: 92vw;
  }

  .menu-links {
    width: min(90vw, 340px);
  }

  /* Better mobile spacing */
  section {
    margin: 0 1rem;
    padding-top: 2rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.8rem 1.2rem;
    width: auto;
    min-width: 140px;
  }

  .btn-container {
    gap: 0.8rem;
    flex-wrap: wrap;
  }

  .icon {
    min-width: 44px;
    min-height: 44px;
  }

  /* Stack about containers on mobile */
  .about-containers {
    display: block;
  }

  .about-containers .details-container {
    margin-bottom: 1.5rem;
  }

  .about-containers .details-container:last-child {
    margin-bottom: 0;
  }

  /* Contact section mobile fixes */
  .contact-info-upper-container {
    padding: 0 1rem;
    margin: 2rem auto;
    max-width: 100%;
  }

  .contact-info-container {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: left;
  }

  .contact-info-container:last-child {
    margin-bottom: 0;
  }

  .contact-info-container p {
    margin: 0;
    flex: 1;
    min-width: 0;
  }

  .contact-info-container a {
    font-size: 0.85rem;
    font-weight: 500;
    word-break: break-all;
  }
}

/* <=600 */
@media screen and (max-width: 600px) {
  #contact { min-height: 40vh; }
  footer { padding: 1rem 0; }
  footer .nav-links { flex-wrap: wrap; gap: .5rem; }
  footer .nav-links a { font-size: .95rem; }
  .section__pic-container { width: auto; height: 46vw; justify-content: center; }

  /* Remove text justification on mobile */
  .text-container { text-align: left; }

  /* Better project descriptions on mobile */
  .project-description {
    font-size: 0.9rem;
    margin: 0 0.5rem 1rem 0.5rem;
  }
}

/* <=480 Additional mobile improvements */
@media screen and (max-width: 480px) {
  #profile .section__pic-container {
    width: 180px;
    height: 180px;
  }

  .menu-links {
    width: 95vw;
  }

  .contact-info-container a {
    font-size: 0.8rem;
  }
}

/* Very small phones */
@media screen and (max-width: 380px) {
  .logo { font-size: 1.25rem; }
  .btn { padding: .75rem; font-size: .9rem; }
  .menu-links { top: 58px; width: min(90vw, 280px); }

  section {
    margin: 0 0.5rem;
  }

  .project-description {
    font-size: 0.85rem;
  }
}

/* iPad landscape/short heights */
@media screen and (max-height: 500px) and (orientation: landscape) {
  #profile {
    min-height: 100vh;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
  }

  .section__pic-container {
    width: 200px;
    height: 200px;
    margin: auto 0;
  }

  section { padding-top: 2vh; }
  .menu-links { position: fixed; top: 58px; right: 10px; }
}
