/* -------------------- 1400px Breakpoint -------------------- */
@media screen and (max-width: 1400px) {
  section {
    margin: 0 6rem;
    height: auto;
  }

  #profile {
    height: auto;
    margin-bottom: 3rem;
    padding: 2rem 2rem;
  }

  #projects,
  #contact {
    height: auto;
  }
}

/* -------------------- 1200px Breakpoint (Medium Devices) -------------------- */
@media screen and (max-width: 1200px) {
  #desktop-nav {
    display: none;
  }

  #hamburger-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 12vh;
    padding: 0 2rem;
  }

  section {
    margin: 0 2rem;
    height: auto;
    padding: 1.5rem 0;
  }

  /* Profile */
  #profile {
    flex-direction: column;
    align-items: center;
    height: auto;
    gap: 2rem;
    padding: 1.5rem 0;
    margin-bottom: 2.5rem;
  }

  .section__pic-container {
    width: 260px;
    height: 260px;
    margin: 0 auto;
  }

  .section__pic-container img {
    width: 100%;
    height: 100%;
    border-radius: 30%;
    object-fit: cover;
  }

  .section__text {
    width: 100%;
    max-width: 720px;
    padding: 0 1rem;
  }

  .title {
    font-size: 2.2rem;
  }

  .section__text__p2 {
    font-size: 1.25rem;
  }

  /* About */
  .about-containers {
    padding: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
    margin: 1.5rem 0;
  }

  .details-container {
    width: 48%;
    min-width: 280px;
    max-width: 420px;
    padding: 1.2rem;
    min-height: auto;
  }

  .text-container {
    max-width: 860px;
    padding: 1.2rem;
    margin: 0 auto;
    line-height: 1.7;
    font-size: 1rem;
    text-align: justify;
  }

  /* Experience */
  .article-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
  }

  article {
    width: 46%;
    min-width: 240px;
    justify-content: flex-start;
  }

  /* Projects grid */
  #projects .about-containers {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.2rem;
  }

  #projects .details-container {
    width: 48%;
    min-width: 280px;
    max-width: 460px;
  }

  /* Contact */
  #contact {
    height: auto;
    padding: 2rem 0 1rem;
  }

  .contact-info-upper-container {
    width: 100%;
    max-width: 720px;
    padding: 1rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .contact-info-container {
    margin: 0.6rem 0.7rem;
  }

  /* reduce desktop padding that is too large */
  .about-containers,
  .about-details-container {
    padding: 0 !important;
  }

  .arrow {
    right: -1.2rem !important;
    bottom: 1.5rem !important;
  }

  .article-container {
    gap: 1.2rem !important;
  }
}

/* -------------------- 768px Breakpoint (Small) -------------------- */
@media screen and (max-width: 768px) {
  section {
    margin: 0 1rem;
    padding: 1.2rem 0;
    height: auto;
    padding-top: 1.5rem !important;
  }

  #profile {
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .section__pic-container {
    width: 175px;
    height: 175px;
  }

  .section__text {
    padding: 0 0.4rem;
  }

  .title {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .section__text__p2 {
    font-size: 1.05rem;
  }

  .btn-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
  }

  .btn {
    width: auto;
    min-width: 9rem;
    padding: 0.7rem 1rem;
  }

  /* About stacking */
  .about-containers {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0 !important;
  }

  .details-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
    min-height: auto !important;
  }

  .text-container {
    width: 100%;
    max-width: 520px;
    padding: 0.9rem 0.8rem !important;
    line-height: 1.75;
    font-size: 0.98rem;
    text-align: justify;
    margin: 0 auto;
  }

  .arrow {
    display: none !important;
  }

  /* Experience: keep grid */
  .article-container {
    gap: 0.9rem !important;
    justify-content: space-between;
  }

  article {
    width: 48% !important;
    min-width: 160px;
    justify-content: flex-start;
  }

  /* Projects 1 column */
  #projects .details-container {
    width: 100%;
    max-width: 420px;
  }

  .project-img {
    height: 190px;
  }

  /* Contact */
  #contact {
    height: auto;
    padding: 2rem 0 1rem;
  }

  .contact-info-upper-container {
    width: 95%;
    max-width: 420px;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1rem;
    gap: 0.8rem;
  }

  
  .contact-info-container {
    width: 100%;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.6rem !important;
  }

  .contact-info-container p {
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  
  footer .nav-links-container .nav-links {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.8rem 2rem !important;
    justify-items: center !important;
    align-items: center !important;
    padding: 0.8rem 0 !important;
  }

  footer .nav-links-container .nav-links li {
    width: 100%;
    text-align: center;
  }

  footer .nav-links-container .nav-links a {
    display: inline-block;
    width: 100%;
  }

  footer {
    height: auto;
    padding: 1rem 0;
  }

  footer p {
    font-size: 0.82rem;
  }
}

/* -------------------- 480px Breakpoint -------------------- */
@media screen and (max-width: 480px) {
  section {
    margin: 0 0.7rem !important;
  }
  
  .logo {
    font-size: 1.2rem;
  }

  .title {
    font-size: 1.55rem;
  }

  .section__text__p2 {
    font-size: 1rem;
  }

  .btn {
    min-width: 8.5rem;
    padding: 0.65rem 0.9rem;
  }

  .project-img {
    height: 165px !important;
  }

  /* Experience grid even on small phones */
  .article-container {
    justify-content: space-between !important;
    gap: 0.8rem !important;
  }

  article {
    width: 48% !important;
    min-width: 140px;
  }
  .p{
    margin-bottom: 5px;
  }
  .text-container {
    max-width: 100%;
    padding: 0.8rem 0.7rem !important;
    line-height: 1.75;
  }

  .contact-info-upper-container {
    width: 98%;
    padding: 0.9rem 0.9rem;
  }

  .contact-info-container p {
    font-size: 0.9rem !important;
    white-space: nowrap !important;
  }


  footer .nav-links-container .nav-links {
    gap: 0.7rem 1.4rem !important;
  }

  footer p {
    font-size: 0.82rem;
  }
}


