/* Responsive Design - Mobile First Approach */

/* Mobile devices (up to 768px) */
@media (max-width: 768px) {
  :root {
    --section-padding: var(--space-2xl) var(--space-md);
    --space-4xl: 2rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  /* Navigation */
  nav-header .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background-primary);
    flex-direction: column;
    padding: var(--space-lg);
    box-shadow: var(--shadow-medium);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
  }

  nav-header .nav-links.active {
    display: flex;
  }

  nav-header .nav-links .nav-link {
    padding: var(--space-md);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--space-xs);
  }

  nav-header .nav-links .nav-link:hover,
  nav-header .nav-links .nav-link.active {
    background-color: var(--primary-blue);
    color: white;
  }

  nav-header .mobile-menu-btn {
    display: block;
  }

  /* Hero Section */
  hero-section .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2xl);
    padding: var(--space-xl) var(--space-md);
  }

  hero-section .hero-content h1 {
    font-size: var(--font-size-3xl);
  }

  hero-section .hero-content .subtitle {
    font-size: var(--font-size-lg);
  }

  hero-section .hero-content .description {
    font-size: var(--font-size-base);
  }

  hero-section .hero-image {
    width: 250px;
    height: 250px;
    font-size: var(--font-size-3xl);
  }

  hero-section .hero-actions {
    justify-content: center;
    gap: var(--space-md);
  }

  /* About Section */
  about-section .about-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2xl);
  }

  about-section .about-image {
    max-width: 200px;
    margin: 0 auto;
  }

  about-section .about-content h2 {
    font-size: var(--font-size-2xl);
  }

  about-section .about-content p {
    font-size: var(--font-size-base);
  }

  /* About stats responsive grid */
  .about-stats {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-top: var(--space-xl);
  }

  .stat-item {
    padding: var(--space-md);
  }

  /* Projects Section */
  projects-section .projects-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  projects-section .section-header h2 {
    font-size: var(--font-size-2xl);
  }

  projects-section .project-card {
    padding: var(--space-lg);
  }

  /* Skills Section */
  skills-section .skills-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Contact Section */
  contact-section h2 {
    font-size: var(--font-size-2xl);
  }

  contact-section .social-links {
    gap: var(--space-lg);
  }

  contact-section .social-link {
    padding: var(--space-md);
  }

  /* Grid utilities for mobile */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Button adjustments */
  .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
  }
}

/* Tablet devices (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Hero Section */
  hero-section .hero-container {
    gap: var(--space-3xl);
  }

  hero-section .hero-content h1 {
    font-size: var(--font-size-4xl);
  }

  hero-section .hero-image {
    width: 350px;
    height: 350px;
  }

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

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

  /* About stats for tablet */
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .stat-item:last-child {
    grid-column: 1 / -1;
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Large screens (1025px and up) */
@media (min-width: 1025px) {
  /* Projects */
  projects-section .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Skills */
  skills-section .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Ultra-wide screens (1400px and up) */
@media (min-width: 1400px) {
  :root {
    --container-max-width: 1400px;
  }

  hero-section .hero-content h1 {
    font-size: var(--font-size-6xl);
  }

  hero-section .hero-image {
    width: 450px;
    height: 450px;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.6);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.7);
    --border-color: #000000;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .card,
  .nav-link,
  .social-link {
    min-height: 44px; /* Minimum touch target size */
  }

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .btn-primary:hover {
    transform: none;
  }

  .btn-secondary:hover {
    transform: none;
  }
}
