/* Tablet and below (≤768px) */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }

  nav ul {
    display: flex !important;
    flex-direction: row;
    width: 100%;
    background: #1c1c1c;
    margin-top: 10px;
    padding: 10px 0;
    gap: 0px;
    overflow-x: auto;
    white-space: nowrap;
  }

  nav ul li a {
    display: block;
    padding: 12px 20px;
    border-bottom: none;
    text-align: center;
    color: #ccc;
  }

  nav ul li a:hover {
    background: #2a2a2a;
    color: var(--accent);
  }

  nav li {
    width: auto;
    text-align: center;
    margin: 0;
  }

  nav ul:not(.show) {
    display: flex !important;
  }
}

/* Mobile phones (≤480px) */
@media (max-width: 480px) {
  h2 {
    font-size: 1.5rem;
  }

  body {
    font-size: 0.9rem;
  }

  /* Keep navbar as it is */

  nav ul li a {
    padding: 10px 10px;
    font-size: 1rem;
  }

  /* About Section (Wrapper) */
  .about-section {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 50px 20px;
    box-sizing: border-box;
  }

  /* About Me Container */
  .about-me {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
    width: 102%;
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
  }

  /* About Text */
  .about-text {
    text-align: center;
    width: 100%;
    max-width: 800px; /* balance with card */
    margin: 0 auto;
  }

  /* Profile Card */
  .profile-card {
    width: 100%; /* responsive */
    max-width: 350px; /* prevent stretching */
    margin: 0 auto;
    padding: 15px;
    text-align: center;
    background: #111; /* dark card */
    border-radius: 12px; /* smooth corners */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); /* subtle shadow */
  }

  /* Profile Image */
  .profile-img {
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
    border-radius: 50%; /* circle */
    object-fit: cover;
  }

  /* About Text */
  .about-text {
    text-align: center;
    width: 100%;
    max-width: 700px; /* wider for balance */
    margin: 0 auto;
  }

  .about-text p {
    text-align: justify; /* better readability */
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .skill img {
    width: 45px; /* balanced icon size */
    display: block;
    margin: 0 auto;
  }

  .skill {
    text-align: center;
    padding: 10px 5px;
    background-color: #1a1a1a;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }

  .project-item {
    display: flex;
    flex-direction: column !important; /* ✅ force override */
    align-items: center;
    text-align: center;
    padding: 15px;
    gap: 15px;
    width: 100%; /* ✅ take full width */
    box-sizing: border-box;
  }

  .project-image {
    max-width: 100%; /* ✅ let image resize */
    height: auto;
    display: block;
    margin: 0 auto;
    margin-bottom: 10px;
  }

  .project-text {
    width: 100%; /* ✅ text fits container */
    max-width: 100%; /* ✅ prevents cutoff */
    padding: 10px 0;
    text-align: center;
  }

  .project-text h3 {
    font-size: 1.2rem;
  }

  .project-text p {
    font-size: 0.9rem;
  }

  .achievement-item {
    gap: 20px;
  }
}