/* ============================================================
   RESPONSIVE.CSS — Breakpoint-Specific Overrides
   Breakpoints:
     sm  — 640px  (small phones and up)
     md  — 768px  (tablets and up)
     lg  — 1024px (small desktops and up)
     xl  — 1280px (large desktops)
   ============================================================ */


/* ============================================================
   LARGE DESKTOP ( > 1280px )
   ============================================================ */

@media (min-width: 1280px) {
  .about-card-stack {
    width: 400px;
  }
}


/* ============================================================
   DESKTOP ( > 1024px )
   All multi-column layouts are already set as default.
   This block handles fine-tuned desktop-only styles.
   ============================================================ */

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  /* Reposition nav-links (now outside <header>) to overlay the nav bar centered */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    justify-content: center;
    pointer-events: none;
    z-index: var(--z-sticky);
  }

  .nav-links .nav-link {
    pointer-events: auto;
  }
}


/* ============================================================
   TABLET & BELOW ( < 1024px )
   ============================================================ */

@media (max-width: 1023px) {

  /* Navigation: switch to mobile layout */
  .nav-toggle {
    display: flex;
  }

  .nav-actions .btn-primary {
    display: none;
  }

  /* Nav links: fly-out mobile panel */
  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    padding-block: var(--space-8);
    background: rgba(7, 9, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition:
      transform var(--transition-slow),
      opacity   var(--transition-slow);
    z-index: var(--z-overlay);
    border-top: 1px solid var(--color-border);
  }

  /* Auto-margin centering: items center when they fit, top-align when they overflow */
  .nav-links > li:first-child {
    margin-top: auto;
  }
  .nav-links > li:last-child {
    margin-bottom: auto;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    font-size: var(--font-size-xl);
    font-weight: 600;
    padding: var(--space-4) var(--space-8);
  }

  /* Services: 2 columns on tablet */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* About: stack on tablet */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-16);
  }

  .about-visual {
    order: -1;
  }

  /* Process: 2x2 grid on tablet */
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .process-grid::before {
    display: none;
  }

  /* Footer: 2 columns on tablet */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-10);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}


/* ============================================================
   SMALL TABLET ( < 768px )
   ============================================================ */

@media (max-width: 767px) {

  /* Hero: reduce padding */
  .hero-content {
    padding-block: var(--space-20) var(--space-16);
  }

  /* Hero stats: wrap and shrink */
  .hero-stats {
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
    flex-wrap: wrap;
    margin-inline: auto;
  }

  .hero-stat-divider {
    display: none;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: var(--space-5) var(--space-8);
  }

  /* Section title size */
  .section-title {
    font-size: var(--font-size-3xl);
  }

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

  /* About card stack: full width */
  .about-card-stack {
    width: 100%;
    max-width: 400px;
  }

  /* Process: single column */
  .process-grid {
    grid-template-columns: 1fr;
  }

  /* Form row: stack on small tablets */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Contact form: reduce padding */
  .contact-form {
    padding: var(--space-8) var(--space-6);
  }

  /* CTA section */
  .cta-content {
    text-align: center;
  }
}


/* ============================================================
   MOBILE ( < 640px )
   ============================================================ */

@media (max-width: 639px) {

  /* Hero */
  .hero-title {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer: single column */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  /* About response card: re-layout */
  .about-card--response {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Process step: limit description width */
  .process-description {
    max-width: 100%;
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {
  .nav-header,
  .hero-bg-grid,
  .hero-bg-glow,
  .nav-toggle {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
