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

@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%;
    padding: 60px 5%;
  }
  .section__pic-container {
    width: 275px;
    height: 275px;
    margin: 0 auto 2rem;
  }
  .about-containers {
    margin-top: 0;
  }
}

@media screen and (max-width: 900px) {
  .about-containers,
  .contact-info-upper-container {
    flex-direction: column;
    align-items: center;
  }
  .contact-info-container {
    width: 80%;
    margin: 1rem 0;
  }
  .details-container {
    width: 100%;
    max-width: 400px;
  }
  article {
    width: 100%;
    max-width: 300px;
  }
}

@media screen and (max-width: 600px) {
  #contact,
  footer {
    height: auto;
    min-height: 40vh;
    padding: 2rem 0;
  }
  #profile {
    height: auto;
    margin-bottom: 0;
    padding-top: 100px;
  }
  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;
    padding: 1rem;
  }
  .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 {
    width: 100%;
    height: auto;
    max-width: 280px;
    aspect-ratio: 1/1;
    margin: 0 auto 2rem;
  }
  .section__text__p2 {
    font-size: 1.25rem;
  }
  .title {
    font-size: 2rem;
  }
  .text-container {
    text-align: justify;
    padding: 0 1rem;
  }
  
  .menu-links {
    width: 100%;
    left: 0;
    padding: 1rem 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
  .menu-links a {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.8rem 1.5rem;
    min-width: 120px;
    font-size: 0.9rem;
  }
  
  .section-container {
    gap: 2rem;
  }
  
  .about-containers {
    gap: 1.5rem;
  }
}

@media screen and (max-width: 400px) {
  section {
    margin: 0;
    padding: 60px 1rem;
  }
  
  .btn-container {
    flex-direction: column;
    align-items: center;
  }
  
  .title {
    font-size: 1.75rem;
  }
  
  .section__text__p2 {
    font-size: 1.1rem;
  }
}

/* Tablet and smaller desktop */
@media screen and (max-width: 1024px) {
  .container {
    padding: 0 3rem;
  }

  .hero-content {
    padding-right: 0;
  }

  .hero-image img {
    max-width: 300px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet */
@media screen and (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  h1 {
    font-size: 2.5rem;
  }

  .container {
    padding: 0 2rem;
  }

  /* Navigation */
  .nav-links {
    display: none;
  }

  .menu-btn {
    display: block;
    cursor: pointer;
  }

  .menu-btn__burger {
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 5px;
    transition: var(--transition);
    position: relative;
  }

  .menu-btn__burger::before,
  .menu-btn__burger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--primary);
    border-radius: 5px;
    transition: var(--transition);
  }

  .menu-btn__burger::before {
    transform: translateY(-8px);
  }

  .menu-btn__burger::after {
    transform: translateY(8px);
  }

  /* Mobile Menu Open */
  .menu-btn.open .menu-btn__burger {
    transform: translateX(-50px);
    background: transparent;
  }

  .menu-btn.open .menu-btn__burger::before {
    transform: rotate(45deg) translate(35px, -35px);
  }

  .menu-btn.open .menu-btn__burger::after {
    transform: rotate(-45deg) translate(35px, 35px);
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--background);
    padding: 2rem;
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
  }

  /* Sections */
  section {
    padding: 4rem 0;
  }

  #home {
    padding-top: calc(var(--header-height) + 2rem);
  }

  .hero-content {
    text-align: center;
  }

  .cta-buttons,
  .social-links {
    justify-content: center;
  }

  .about-content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .about-image {
    order: -1;
  }

  .about-image img {
    max-width: 300px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Mobile */
@media screen and (max-width: 480px) {
  .container {
    padding: 0 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .hero-image img {
    max-width: 250px;
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 2rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .project-card {
    max-width: 100%;
  }

  .project-links {
    flex-direction: column;
  }

  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}

/* Height-based media queries */
@media screen and (max-height: 700px) {
  #home {
    min-height: auto;
    padding: calc(var(--header-height) + 2rem) 0;
  }
}
