/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* ---- Large desktop ---- */
@media screen and (max-width: 1400px) {
  .work-card.featured {
    grid-column: span 1;
  }

  .about-layout {
    grid-template-columns: 1fr 320px;
    gap: 3rem;
  }
}

/* ---- Tablet — switch to hamburger nav ---- */
@media screen and (max-width: 1200px) {
  #desktop-nav { display: none; }

  #hamburger-nav {
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    height: 65px;
  }

  section {
    padding: 4rem 5%;
  }

  #hero {
    flex-direction: column;
    text-align: center;
    min-height: auto;
    padding-top: 3rem;
    padding-bottom: 4rem;
    gap: 3rem;
  }

  .hero-title { font-size: 2.8rem; }

  .hero-meta, .btn-container, #socials-container {
    justify-content: center;
  }

  .hero-content { max-width: 100%; }

  .hero-badge {
    left: 50%;
    transform: translateX(-50%);
    bottom: -1.5rem;
    white-space: nowrap;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .work-card.featured {
    grid-column: span 1;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
  }

  .contact-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1 1 300px;
  }

  .github-contrib {
    flex: 1 1 300px;
  }

  .contact-item {
    flex: 1 1 calc(50% - 0.375rem);
  }

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

  .profile-pic-wrapper {
    transform: none !important;
  }
}

/* ---- Tablet portrait ---- */
@media screen and (max-width: 900px) {
  .work-grid {
    grid-template-columns: 1fr;
  }

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

  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* ---- Mobile ---- */
@media screen and (max-width: 768px) {
  section { padding: 3.5rem 5%; }

  .hero-title { font-size: 2.3rem; }

  .profile-pic-wrapper {
    width: 220px;
    height: 220px;
  }

  .hero-badge { display: none; }

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

  .projects-grid,
  .designs-grid {
    grid-template-columns: 1fr;
  }

  .contact-item {
    flex: 1 1 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-sidebar {
    flex-direction: column;
  }

  .contact-form {
    padding: 1.5rem;
  }

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

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

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* ---- Small mobile ---- */
@media screen and (max-width: 600px) {
  section { padding: 3rem 4%; }

  .hero-title { font-size: 1.95rem; letter-spacing: -0.5px; }

  .hero-meta { flex-direction: column; align-items: center; gap: 0.4rem; }

  .timeline { padding-left: 1.5rem; }

  .timeline-dot { left: -1.95rem; }

  .profile-pic-wrapper {
    width: 180px;
    height: 180px;
  }

  footer { padding: 2rem 1.5rem; }

  footer .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .work-grid,
  .projects-grid,
  .designs-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  #scroll-to-top {
    width: 40px;
    height: 40px;
    bottom: 1.25rem;
    right: 1.25rem;
  }
}

/* ---- Smallest ---- */
@media screen and (max-width: 400px) {
  section { padding: 2.5rem 3%; }
  .hero-title { font-size: 1.7rem; }
  .section-title { font-size: 1.75rem; }
  .btn { font-size: 0.85rem; padding: 0.75rem 1.25rem; }
}

/* ---- Touch device accessibility ---- */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; }
  .icon { height: 2.5rem; }
  .skill-tag { padding: 0.6rem 1rem; }
  .project-card:hover,
  .work-card:hover,
  .skill-category:hover { transform: none; }
}

@media screen and (max-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .project-img {
    max-height: 400px;
    object-fit: contain;
  }
  
  .skill-tags {
    justify-content: center;
  }
  
  .article-container {
    gap: 1.5rem;
  }
  
  article {
    width: 8rem;
  }
  
  .btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .details-container {
    padding: 1.5rem;
  }
  
  .contact-info-container {
    margin: 0.75rem 1rem;
    padding: 0.6rem 1rem;
  }
}

@media screen and (max-width: 600px) {
  #contact,
  footer {
    height: fit-content;
    min-height: 40vh;
  }
  
  #profile {
    height: 83vh;
    margin-bottom: 0;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-img {
    max-height: 350px;
  }
  
  article {
    font-size: 1rem;
    width: 100%;
    max-width: 10rem;
  }
  
  footer nav {
    height: fit-content;
    margin-bottom: 2rem;
  }
  
  .about-containers,
  .contact-info-upper-container,
  .btn-container {
    flex-wrap: wrap;
  }
  
  .contact-info-container {
    margin: 0.5rem 0;
    width: 100%;
    padding: 0.75rem;
  }
  
  .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: auto;
    height: 46vw;
    justify-content: center;
  }
  
  .section__text__p2 {
    font-size: 1.25rem;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .text-container {
    text-align: justify;
  }
  
  .btn {
    min-height: 44px;
    width: auto;
    min-width: 8rem;
    padding: 0.85rem 1.25rem;
  }
  
  .btn::before {
    display: none; /* Disable ripple effect on mobile */
  }
  
  .icon {
    height: 2.5rem;
  }
  
  .skill-category {
    padding: 1.5rem;
  }
  
  .skill-tag {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  
  .section__text__p1 {
    font-size: 0.9rem;
  }
  
  /* Simplify hover effects on mobile */
  .project-card:hover {
    transform: none;
  }
  
  .details-container:hover {
    transform: translateY(-3px);
  }
}

@media screen and (max-width: 400px) {
  section {
    margin: 0 3%;
  }
  
  .details-container {
    padding: 1.25rem;
  }
  
  .btn-container {
    gap: 0.75rem;
  }
  
  .btn {
    font-size: 0.9rem;
    padding: 0.8rem 1rem;
    min-width: 7rem;
  }
  
  .title {
    font-size: 1.75rem;
  }
  
  .section__text__p2 {
    font-size: 1.1rem;
  }
  
  .skill-category {
    padding: 1.25rem;
  }
  
  .contact-info-upper-container {
    padding: 1.5rem 1rem;
  }
  
  .project-title {
    font-size: 1.25rem;
  }
}

/* Touch device specific improvements */
@media (hover: none) and (pointer: coarse) {
  .icon {
    height: 2.5rem;
  }
  
  .btn {
    min-height: 44px;
  }
  
  .hamburger-icon {
    height: 30px;
    width: 36px;
  }
  
  .skill-tag {
    padding: 0.6rem 1.2rem;
  }
}