/* =========================================================
   SUN ENGINEERING WORKS — RESPONSIVE STYLESHEET
   ---------------------------------------------------------
   Breakpoints
   - Large desktop : default (1200px container)
   - Laptop        : max 1024px
   - Tablet        : max 768px
   - Mobile        : max 560px
   ========================================================= */

/* ===== LAPTOP (max 1024px) ===== */
@media (max-width: 1024px) {
  .services-grid,
  .products-grid,
  .forms-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .section { padding: var(--space-6) 0; }
}

/* ===== TABLET (max 768px) ===== */
@media (max-width: 768px) {
  /* Mobile navigation */
  .menu-toggle { display: flex; }

   .hero-helix{
    width:260px;
    right:-80px;
    opacity:0.2;
   }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    max-width: 80vw;
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--space-2);
    padding: 90px var(--space-3) var(--space-3);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--t);
    z-index: 90;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { font-size: 1.1rem; }

  /* Stacked grids */
  .rolled-grid,
  .capabilities-content,
  .about-grid,
  .contact-grid,
  .detail-item,
  .detail-item.reverse {
    grid-template-columns: 1fr;
  }
  .detail-item.reverse .detail-media,
  .detail-item.reverse .detail-body { order: unset; }
  .detail-desc { max-width: 100%; }

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

  .hero { min-height: 90vh; }

  .footer-inner { flex-direction: column; text-align: center; }
}

/* ===== MOBILE (max 560px) ===== */
@media (max-width: 540px) {
  .services-grid,
  .products-grid,
  .forms-grid {
    grid-template-columns: 1fr;
  }
   .hero-helix{
    display:none;
   }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }

  .section-title { font-size: 1.6rem; }
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1rem; }

  .container { padding: 0 var(--space-1); }
  .section { padding: var(--space-5) 0; }
  .product-body,
  .form-card { padding: var(--space-2); }
  .detail-item { padding: var(--space-3) 0; }

  .contact-form { padding: var(--space-2); }
}

/* ===== REDUCED MOTION ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   PHONE LAYOUT POLISH (max 540px)
   One place for the phone tidy-ups. Loaded last, so these win.
   ========================================================= */
@media (max-width: 540px) {
  /* Comfortable side margins on every page (was 8px) */
  .container { padding: 0 20px; }
  .section-services,
  .rolled-threads,
  .section-capabilities { padding-left: 0; padding-right: 0; }

  /* Home hero: text block centred in the screen, full-width buttons */
  .hero { padding: 88px 0 72px; }
  .hero-actions { max-width: none; }
  .hero-subtitle { line-height: 1.55; }

  /* Simple page headers (About, Gallery, Contact, Quote):
     centred, equal space above and below, like Thread Forms */
  .page-header { padding: calc(61px + 40px) 0 40px; text-align: center; }
  .page-header .page-intro { margin-left: auto; margin-right: auto; }

  /* Thread Forms: diagrams at their natural height (no empty bands) */
  .detail-media1 { aspect-ratio: auto; }
  .detail-media1 img { display: block; width: 100%; height: auto; }
  .forms-intro p { margin-bottom: 10px; }

  /* Home "Know our capabilities": 2 x 2 buttons instead of a tall stack */
  .capability-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: none;
  }
  .capability-buttons .btn { max-width: none; padding: 14px 10px; }

  /* CTA banner button: full width like the hero buttons */
  .cta-content { gap: 20px; }
  .cta-content .btn { max-width: none; }

  /* Product / form rows: a little less air between rows */
  .detail-item, .detail-item1 { padding: 24px 0; }
}
@media (max-width: 540px) {
  .capability-buttons .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  /* Quote wizard: Back / Next share the full width */
  .qw-nav { gap: 12px; }
  .qw-nav .btn { flex: 1; }
}
