/*
 * SYSTEM ARCHITECTURE: RESPONSIVE OVERRIDES
 * Handles layouts for desktop scaling, tablet views, and mobile adaptations.
 */

/* ==========================================================================
   01. HIGH-DPI / ULTRA-WIDE DESKTOPS (> 1600px)
   ========================================================================== */
@media (min-width: 1600px) {
  .hero-name {
    font-size: 5rem;
  }
  .ascii-art-portrait {
    font-size: 7.5px;
  }
}

/* ==========================================================================
   02. LAPTOP / SMALL DESKTOPS (< 1440px)
   ========================================================================== */
@media (max-width: 1440px) {
  .hero-section {
    grid-template-columns: 38% 37% 25%;
    gap: 15px;
    min-height: auto;
  }
  .hero-name {
    font-size: 3.2rem;
  }
  .ascii-art-portrait {
    font-size: 5.5px;
  }
  .main-content {
    padding: 15px 20px;
  }
  .header-nav {
    margin: 15px 20px;
  }
}

/* ==========================================================================
   03. LARGE TABLETS & SMALL DESKTOPS (< 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .hero-section {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  
  .hero-left {
    grid-column: span 1;
  }
  
  .hero-center {
    grid-column: span 1;
  }
  
  .hero-right-stats {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
  
  .stat-widget {
    border-bottom: none;
    border-right: 1px dashed var(--color-border);
    padding-bottom: 0;
    padding-right: 15px;
  }
  
  .stat-widget:last-of-type, .stat-widget:nth-of-type(3) {
    border-right: none;
  }
  
  .stat-sys-log {
    grid-column: span 3;
  }
  
  .cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .ascii-art-portrait {
    font-size: 6.5px;
  }
}

/* ==========================================================================
   04. TABLETS (< 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .header-nav {
    flex-direction: column;
    gap: 15px;
    padding: 1rem;
    align-items: stretch;
    text-align: center;
  }
  
  .nav-brand {
    justify-content: center;
  }
  
  .nav-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .nav-metrics {
    justify-content: center;
  }
  
  .hero-section {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 20px;
  }
  
  .hero-left, .hero-center, .hero-right-stats {
    grid-column: span 1;
  }
  
  .hero-right-stats {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-widget {
    border-right: none;
    border-bottom: 1px dashed var(--color-border);
    padding-right: 0;
    padding-bottom: 15px;
  }
  
  .stat-widget:nth-of-type(2) {
    border-bottom: none;
  }
  
  .stat-sys-log {
    grid-column: span 2;
  }
  
  .ascii-art-portrait {
    font-size: 8px; /* Bigger viewport width now, scale to fit 1-column container */
  }
  
  .newsletter-wrapper {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
  
  .intel-action-buttons {
    width: 100%;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
  }
  
  .footer-diagnostic-logs {
    align-items: center;
  }
  
  .footer-actions {
    justify-content: center;
  }
}

/* ==========================================================================
   05. PORTRAIT TABLETS & LARGE MOBILE (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .hero-name {
    font-size: 3rem;
  }
  
  .cols-3, .cols-2 {
    grid-template-columns: 1fr;
  }
  
  .writing-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .writing-date {
    width: auto;
  }
  
  .writing-action-link {
    align-self: flex-end;
  }
  
  .status-grid {
    grid-template-columns: 1fr;
  }
  
  .social-networks-grid {
    grid-template-columns: 1fr;
  }
  
  .ascii-art-portrait {
    font-size: 6.5px;
  }
  
  .cube-matrix-display {
    font-size: 7.2px;
    letter-spacing: 0.15em;
  }
}

/* ==========================================================================
   06. MOBILE DEVICES (< 480px & 375px)
   ========================================================================== */
@media (max-width: 480px) {
  .hero-name {
    font-size: 2.2rem;
  }
  
  .header-nav {
    margin: 10px;
  }
  
  .main-content {
    padding: 10px;
    gap: 35px;
  }
  
  .ascii-art-portrait {
    font-size: 4px; /* Essential downscale to prevent horizontal line wrapping */
  }
  
  .cube-matrix-display {
    font-size: 5.2px;
    letter-spacing: 0.10em;
  }
  
  .terminal-panel {
    padding: 1.2rem;
  }
  
  .hero-right-stats {
    grid-template-columns: 1fr;
  }
  
  .stat-sys-log {
    grid-column: span 1;
  }
  
  .cta-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .tech-tag {
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 375px) {
  .hero-name {
    font-size: 1.9rem;
  }
  
  .ascii-art-portrait {
    font-size: 3.5px; /* Maximum squeeze for narrow display panels */
  }
}
