@media screen and (max-width: 1400px) {
  #profile {
    height: 83vh;
    margin-bottom: 6rem;
  }
  .about-containers {
    flex-wrap: wrap;
  }
  #contact,
  #projects {
    height: fit-content;
  }
}

/* Desktop-only About layout (keeps phone/tablet intact) */
@media screen and (min-width: 1201px) {
  #about .section-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 4rem;
  }
  #about .about-details-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media screen and (max-width: 1200px) {
  #desktop-nav {
    display: none;
  }
  #hamburger-nav {
    display: flex;
  }
  
  /* Ensure proper spacing for fixed header */
  #profile {
    padding-top: 2rem;
  }
  
  /* Adjust menu size for smaller screens */
  @media screen and (max-width: 480px) {
    .menu-links {
      width: 250px;
    }
    
    .menu-links a {
      width: 180px;
      font-size: 1.2rem;
      padding: 0.7rem 1.2rem;
    }
  }
  #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;
  }
  .about-containers {
    margin-top: 0;
  }
  #about {
    padding: 2rem 1rem;
  }
  .about-details-container {
    max-width: 90%;
  }
  
  /* Timeline single-column layout - same breakpoint as hamburger menu */
  .timeline-content {
    width: 100%;
    padding: 1.5rem;
    margin: 0 0.5rem;
  }
  .timeline-item:nth-child(odd) .timeline-content {
    margin-right: 0;
  }
  .timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
  }
  .timeline {
    max-width: 100%;
  }
  .timeline::before {
    left: 20px;
  }
  .timeline-marker {
    left: 20px;
  }
  .timeline-item {
    flex-direction: row !important;
    padding-left: 60px;
  }
  .timeline-content::after {
    display: none;
  }
}

@media screen and (max-width: 600px) {
  /* lock horizontal overflow on very small screens */
  html, body { overflow-x: hidden; }
  /* ensure sections stay centered and don't drift left */
  section {
    margin: 0 1rem;
  }
  .section-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
  /* allow Contact/Footer to grow so page doesn't get stuck */
  #contact,
  footer {
    height: auto;
    min-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;
  }
  /* Keep contact text comfortably large on phones */
  .contact-info-container p { font-size: larger; }
  /* But reduce nav link size in the mobile header */
  .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 {
    width: auto;
    height: 46vw;
    justify-content: center;
  }
  .section__text__p2 {
    font-size: 1.25rem;
  }
  .title {
    font-size: 2rem;
  }
  .text-container {
    text-align: justify;
  }
  #about {
    padding: 2rem 1rem;
  }
  .about-details-container {
    max-width: 100%;
    padding: 0 1rem;
  }
}

/* Language Switcher Responsive Design */
@media screen and (max-width: 1200px) {
  .language-switcher {
    margin-left: 0.5rem;
  }
  
  .language-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: 45px;
  }
  
  .language-menu {
    min-width: 100px;
  }
  
  .language-option {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
}

@media screen and (max-width: 600px) {
  .language-switcher-mobile {
    margin-top: 0.5rem;
    padding: 1.5rem 0;
    border-top: 2px solid rgba(0, 0, 0, 0.2);
  }
  
  .language-switcher-mobile .language-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    min-width: 60px;
  }
  
  .language-switcher-mobile .language-menu {
    min-width: 120px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  }
  
  .language-switcher-mobile .language-option {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
  }
}