/**
 * ============================================================================
 * RESPONSIVE LAYOUT MATRIX & MEDIA QUERIES - RESPONSIVE.CSS
 * Project: Malik Tayyab Jamil - Portfolio Architecture
 * Target Environment: Mobile, Tablet, Laptop, Ultra-wide Desktops
 * ============================================================================
 */

/* ==========================================================================
 * 1. LARGE DESKTOP & ULTRA-WIDE BREAKPOINT (> 1280px)
 * ========================================================================== */
@media (min-width: 1280px) {
  :root {
    --container-padding: var(--space-8);
  }
}

/* ==========================================================================
 * 2. TABLET & LAPTOP RESPONSIVE BREAKPOINT (< 1024px)
 * ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --font-size-5xl: 2.5rem;    /* 40px */
    --font-size-6xl: 3rem;      /* 48px */
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero-section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-12);
    overflow: hidden;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero-portrait-wrapper {
    order: 2;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .portrait-frame {
    max-width: 360px;
  }

  .portrait-badge-overlay {
    right: 12px;
  }

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

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

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

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

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

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

  .blueprint-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
 * 3. MOBILE RESPONSIVE BREAKPOINT (< 640px)
 * ========================================================================== */
@media (max-width: 640px) {
  :root {
    --container-padding: var(--space-4);
    --font-size-5xl: 2rem;      /* 32px */
    --font-size-4xl: 1.75rem;   /* 28px */
    --font-size-3xl: 1.5rem;    /* 24px */
    --font-size-2xl: 1.25rem;   /* 20px */
  }

  /* Hero Mobile Adaptations */
  .hero-section {
    padding-top: var(--space-6);
    padding-bottom: var(--space-8);
    overflow: hidden;
  }

  .hero-grid {
    gap: var(--space-6);
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-badge-group {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .hero-badge-group .badge {
    font-size: 11px;
    padding: 3px 10px;
    white-space: normal;
    text-align: center;
  }

  .hero-heading {
    font-size: clamp(1.75rem, 7.5vw, 2.35rem);
    line-height: 1.2;
    text-align: center;
    margin-bottom: var(--space-2);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .hero-subtitle {
    font-size: clamp(1.05rem, 4.2vw, 1.3rem);
    line-height: 1.35;
    text-align: center;
    min-height: 2.8em;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    text-align: center;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: var(--space-6);
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
  }

  .hero-cta-group .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .social-icon-group {
    width: 100%;
    justify-content: center;
    margin-top: var(--space-2);
    gap: var(--space-4);
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    width: 100%;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
  }

  .stat-card {
    padding: var(--space-3) var(--space-2);
  }

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

  .stat-label {
    font-size: 11px;
    line-height: 1.2;
  }

  .hero-portrait-wrapper {
    margin-top: var(--space-2);
  }

  .portrait-frame {
    max-width: 290px;
    padding: var(--space-2);
    border-radius: var(--radius-lg);
  }

  .hero-portrait-img {
    border-radius: var(--radius-md);
  }

  .portrait-badge-overlay {
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    font-size: 10.5px;
    padding: 3px 10px;
    max-width: 92%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .quick-facts-grid,
  .skills-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

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

  .portrait-spec-box {
    padding: var(--space-4);
  }

  .spec-table th, .spec-table td {
    padding: var(--space-2);
    font-size: var(--font-size-xs);
  }
}

/* ==========================================================================
 * 3B. SMALL MOBILE BREAKPOINT (< 380px)
 * ========================================================================== */
@media (max-width: 380px) {
  .hero-heading {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.98rem;
    min-height: 3.2em;
  }

  .portrait-frame {
    max-width: 250px;
  }

  .hero-stats-grid {
    gap: var(--space-2);
  }

  .stat-card {
    padding: var(--space-2) var(--space-1);
  }

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

  .stat-label {
    font-size: 10px;
  }
}

/* ==========================================================================
 * 4. PRINT STYLES (RECRUITER & PDF COMPATIBILITY)
 * ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .btn, .badge-aws, .wcag-badge {
    display: none !important;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 80%;
  }
}
