/* ==========================================================================
   JuanDavid.dev — Responsive Styles (Mobile First)
   ========================================================================== */

/* --- Tablets and below (768px) --- */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
    --section-padding: 4rem 0;
  }

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

  /* Navbar Mobile */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(var(--header-height) + var(--space-8)) var(--space-6) var(--space-8);
    gap: var(--space-2);
    transition: right 0.4s var(--ease-out);
    z-index: var(--z-overlay);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

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

  .nav-link {
    padding: var(--space-4);
    font-size: var(--fs-base);
    border-radius: var(--radius-md);
  }

  .mobile-toggle {
    display: flex;
  }

  /* Mobile Menu Overlay */
  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-overlay) - 1);
    backdrop-filter: blur(4px);
  }

  .mobile-overlay.active {
    display: block;
  }

  /* Hero Mobile */
  .hero {
    min-height: auto;
    padding: calc(var(--header-height) + 3rem) var(--space-4) var(--space-12);
  }

  .hero-avatar {
    width: 110px;
    height: 110px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-6);
  }

  .hero-stats .hero-stat {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    text-align: left;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn {
    justify-content: center;
  }

  /* About Mobile */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

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

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

  /* Services Mobile */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Tech Grid Mobile */
  .tech-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: var(--space-3);
  }

  .tech-item {
    padding: var(--space-3) var(--space-2);
  }

  .tech-item i {
    font-size: 1.5rem;
  }

  .tech-categories {
    gap: var(--space-2);
  }

  /* Timeline Mobile */
  .timeline {
    padding-left: var(--space-8);
  }

  .timeline-dot {
    left: calc(-1 * var(--space-8) + 8px);
  }

  /* Projects Mobile */
  .projects-grid {
    grid-template-columns: 1fr;
  }

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

  /* Blog Mobile */
  .blog-grid {
    grid-template-columns: 1fr;
  }

  /* GitHub Mobile */
  .github-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Contact Mobile */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  /* Footer Mobile */
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  /* Section Header */
  .section-header {
    margin-bottom: var(--space-10);
  }

  /* Modal Mobile */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-height: 90vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .modal-header,
  .modal-body {
    padding: var(--space-5);
  }

  /* Back to top */
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }

  /* Cursor - hide on touch devices */
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* --- Small phones (480px) --- */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-role {
    font-size: 0.85rem;
  }

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

  .github-stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card .stat-number {
    font-size: var(--fs-2xl);
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

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

/* --- Laptops (1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* --- Large screens (1280px+) --- */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* --- Ultra wide (1536px+) --- */
@media (min-width: 1536px) {
  :root {
    --max-width: 1400px;
  }
}

/* --- Print Styles --- */
@media print {
  .navbar,
  .aurora-bg,
  .cursor-dot,
  .cursor-ring,
  .reading-progress,
  .back-to-top,
  .loader-screen,
  canvas,
  .mobile-overlay {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .glass-panel {
    background: #f5f5f5;
    border: 1px solid #ddd;
    backdrop-filter: none;
  }
}
