/* ============================================
   FILE: responsive.css (FIXED VERSION)
   PURPOSE: ALL @media queries + overflow fixes
============================================ */
:root {
  --mobile-nav-active-bg: var(--bg-elevated);
}
/* GLOBAL SAFETY FIX (VERY IMPORTANT) */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

/* ════════════════════════════════════════════
   LARGE DESKTOP (≥ 1400px)
════════════════════════════════════════════ */
@media (min-width: 1400px) {
  :root { --container-width: 1300px; }

  .home-name { font-size: 3.8rem; }

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

  .about-stats {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ════════════════════════════════════════════
   TABLET / SMALL LAPTOP (≤ 1024px)
════════════════════════════════════════════ */
@media (max-width: 1024px) {

  :root {
    --section-padding: 80px;
  }

  .home-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
    padding: 100px 16px 0;
    max-width: 100%;
  }

  .home-content {
    align-items: center;
    order: 2;
    max-width: 100%;
  }

  .home-photo-wrapper {
    order: 1;
  }

  .home-greeting::after { display: none; }

  .home-bio {
    max-width: 100%;
    text-align: center;
  }

  .home-buttons,
  .home-meta {
    justify-content: center;
    flex-wrap: wrap;
  }

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

  .about-left {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
  }

  .footer-socials { justify-content: center; }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}
@media (max-width: 768px) {

  .nav-underline {
    display: none;
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-link.active {
  background: var(--mobile-nav-active-bg);
  color: var(--accent-primary);
  box-shadow: var(--glow);
}
}

/* ════════════════════════════════════════════
   MOBILE (≤ 768px)
════════════════════════════════════════════ */
@media (max-width: 768px) {

  :root {
    --section-padding: 70px;
  }

  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* HOME FIX (IMPORTANT 🔥) */
  .home-photo-ring {
    width: 220px;
    height: 220px;
    max-width: 100%;
  }

  .home-photo {
    width: 200px;
    height: 200px;
    max-width: 100%;
  }

  .home-photo-glow {
    width: 230px;
    height: 230px;
    max-width: 100%;
  }

  .home-container,
  .home-content {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100%;
  }

  .skills-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .skill-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

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

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

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

  .social-list {
    grid-template-columns: 1fr;
  }

  .resume-actions {
    flex-direction: column;
    align-items: center;
  }

  .resume-preview-box {
    width: 100%;
    max-width: 300px;
  }

  .timeline {
    padding-left: 24px;
  }
}

@media (max-width: 768px) {

  #navbar {
    padding: 10px 16px;
  }

  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-logo {
    flex: 1;
    text-align: left;
  }

  .hamburger {
    margin-left: auto;
  }
}

/* ════════════════════════════════════════════
   SMALL MOBILE (≤ 480px)
════════════════════════════════════════════ */
@media (max-width: 480px) {

  :root {
    --section-padding: 60px;
  }

  .section {
    padding: 60px 12px;
    max-width: 100%;
  }

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

  .home-photo-ring {
    width: 180px;
    height: 180px;
  }

  .home-photo {
    width: 160px;
    height: 160px;
  }

  .home-photo-glow {
    width: 190px;
    height: 190px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.75rem;
  }

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

  .stat-card { padding: 14px 8px; }
  .stat-number { font-size: 1.2rem; }

  .coding-profiles-grid {
    grid-template-columns: 1fr;
  }

  .home-meta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .contact-form-wrapper { padding: 18px; }

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

  .project-buttons a { width: 100%; }

  .modal-content { padding: 16px; }
}

/* ════════════════════════════════════════════
   REDUCED MOTION
════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .home-photo-ring,
  .scanline,
  .status-dot,
  #hacker-logs {
    animation: none !important;
  }
}