/* =============================================
   LARGE SCREENS (max 1280px)
   ============================================= */
@media (max-width: 1280px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================
   MEDIUM SCREENS (max 1024px)
   ============================================= */
@media (max-width: 1024px) {
  /* Hero: collapse to column/centered on tablet */
  .hero-section {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 3rem;
    padding-top: calc(var(--nav-height) + 2rem);
  }
  .hero-content { padding-top: 0; max-width: 100%; }
  .hero-image-wrapper { padding-top: 0; order: -1; margin-right: 0; margin-top: 0; }
  /* Reset ring centering: wrapper has no padding-top in column mode so top:50% = image center */
  .hero-image-ring { top: 50%; }
  .hero-subtitle { justify-content: center; }
  .hero-description { margin: 0 auto 2rem; max-width: 580px; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }
  .scroll-indicator { display: none; }

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

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

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

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

/* =============================================
   TABLET PORTRAIT (max 768px)
   ============================================= */
@media (max-width: 768px) {
  /* Nav */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* Hero */
  .hero-section { gap: 2rem; }

  .hero-image {
    width: 260px;
    height: 260px;
  }

  .ring-1 {
    width: 290px;
    height: 290px;
    margin-left: -145px;
    margin-top: -145px;
  }

  .ring-2 {
    width: 330px;
    height: 330px;
    margin-left: -165px;
    margin-top: -165px;
  }

  .ring-3 {
    width: 370px;
    height: 370px;
    margin-left: -185px;
    margin-top: -185px;
  }

  .floating-badge { display: none; }

  /* Hide stat dividers on small screens to save space */
  .stat-divider { display: none; }
  .hero-stats { gap: 1.5rem; }

  /* About */
  .about-grid { grid-template-columns: 1fr; }

  /* Projects */
  .projects-grid { grid-template-columns: repeat(2, 1fr); }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  /* Footer */
  .footer-content { flex-direction: column; align-items: center; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* =============================================
   MOBILE (max 480px)
   ============================================= */
@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .section { padding: 4rem 0; }

  /* Hero: only override left/right padding to preserve padding-top from the 1024px rule */
  .hero-section { padding-left: 1.25rem; padding-right: 1.25rem; }
  .hero-title { font-size: 2rem; }
  .hero-description { font-size: 0.9rem; max-width: 100%; }
  .hero-stats { gap: 1rem; flex-wrap: wrap; }

  .hero-image {
    width: 220px;
    height: 220px;
  }

  .ring-1 {
    width: 245px;
    height: 245px;
    margin-left: -122px;
    margin-top: -122px;
  }
  .ring-2 {
    width: 278px;
    height: 278px;
    margin-left: -139px;
    margin-top: -139px;
  }
  .ring-3 { display: none; }

  /* Projects: 2 columns with tighter cards */
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .project-category-card { padding: 1rem; gap: 0.75rem; }
  .pcc-icon { width: 42px; height: 42px; }

  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  .section-title { font-size: 1.75rem; }
  .section-subtitle { font-size: 0.875rem; }

  .skills-column { padding: 1.5rem; }

  .about-card { padding: 1.5rem; }

  .contact-grid { max-width: 100%; }
  .contact-card { padding: 1.25rem; gap: 1rem; }

  .mobile-links a { font-size: 1.6rem; }

  .stat-number { font-size: 1.6rem; }

  .back-to-top { bottom: 1.5rem; right: 1.5rem; }

  .cert-card { width: 220px; }
  .cert-img-wrapper { height: 110px; }

  .footer { padding: 2.5rem 0 1.5rem; }
}

/* =============================================
   SMALL PHONES (max 360px)
   ============================================= */
@media (max-width: 360px) {
  .hero-section { gap: 1.5rem; }
  .hero-title { font-size: 1.75rem; }
  .section-title { font-size: 1.5rem; }

  .hero-image { width: 190px; height: 190px; }
  .ring-1 { width: 212px; height: 212px; margin-left: -106px; margin-top: -106px; }
  .ring-2 { width: 240px; height: 240px; margin-left: -120px; margin-top: -120px; }

  /* Stack stats vertically on tiny screens */
  .hero-stats { flex-direction: column; align-items: center; gap: 0.5rem; }

  /* Single column projects on tiny screens */
  .projects-grid { grid-template-columns: 1fr; }
}
