/* ==========================================================================
   OptiTech — Responsive Rules
   Mobile-first base is in style.css. Overrides scale up from here.
   ========================================================================== */

/* ---- Small phones (default, <=479px) ---- */
@media (max-width: 479px) {
  .container { padding: 0 var(--space-4); }
  .hero-actions .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
  .stats-band { grid-template-columns: 1fr; }
  .error-actions { flex-direction: column; width: 100%; }
  .error-actions .btn { width: 100%; }
  .portfolio-profile-card { padding: var(--space-5); }
  .profile-avatar-wrapper { width: 220px; }
  .profile-actions-row { flex-direction: column; width: 100%; align-items: stretch; }
  .profile-actions-row .btn { width: 100%; }
  .profile-socials-group { justify-content: center; }
  .profile-float-tag { display: none; }
  .preloader-stage { width: 300px; height: 300px; }
  .preloader-orbit-ring.ring-1 { width: 160px; height: 160px; }
  .preloader-orbit-ring.ring-2 { width: 230px; height: 230px; }
  .preloader-orbit-ring.ring-3 { width: 290px; height: 290px; }
  .preloader-node { width: 36px; height: 36px; font-size: 0.65rem; }
  .preloader-node svg { width: 16px; height: 16px; }
}

/* ---- Large phones / small tablets (480px+) ---- */
@media (min-width: 480px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .capabilities-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Tablets (768px+) ---- */
@media (min-width: 768px) {
  .stats-band { grid-template-columns: repeat(4, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-trust { gap: var(--space-8); }
  .about-visual-badge { gap: var(--space-8); }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-grid-layout { grid-template-columns: 320px 1fr; gap: var(--space-10); }
}

/* ---- Small laptops / large tablets (1024px+) ---- */
@media (min-width: 1024px) {
  .main-nav { display: block; }
  .hamburger { display: none; }
  .header-cta .btn-primary { display: inline-flex; }

  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: var(--space-12); }
  .hero-visual { height: 520px; }
  .hero-actions .btn, .header-cta .btn-primary { width: auto; }

  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
  .tech-grid { grid-template-columns: repeat(4, 1fr); }
  .capabilities-grid { grid-template-columns: repeat(4, 1fr); }

  .process-grid { grid-template-columns: repeat(4, 1fr); }
  .process-line { display: block; }

  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-grid.reverse { direction: rtl; }
  .about-grid.reverse > * { direction: ltr; }

  .two-col { grid-template-columns: 1.4fr .9fr; }
  .contact-grid { grid-template-columns: .8fr 1.1fr; }

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

  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; padding: var(--space-10) var(--space-10); }
  .cta-band > div:first-child { max-width: 60%; }
}

/* ---- Desktops (1280px+) ---- */
@media (min-width: 1280px) {
  .hero-visual { height: 580px; }
  .value-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Large desktops (1920px+) ---- */
@media (min-width: 1920px) {
  :root { --container: 1440px; }
}

/* ---- Hero Visual & Orbit Responsive Adjustments ---- */
@media (max-width: 991px) {
  .hero-visual { min-height: 420px; }
  .hero-orbit-guide.guide-1 { width: 440px; height: 440px; }
  .hero-orbit-guide.guide-2 { width: 340px; height: 340px; }
  .hero-orbit-node { width: 42px; height: 42px; margin-top: -21px; margin-left: -21px; border-radius: 12px; }
  .hero-orbit-node svg { width: 20px; height: 20px; }
  .hero-floating-pill { font-size: 0.72rem; padding: 0.4rem 0.8rem; }
}

@media (max-width: 640px) {
  .hero-visual { min-height: 360px; }
  .hero-visual-frame { width: min(100%, 340px); }
  .hero-orbit-guide.guide-1 { width: 330px; height: 330px; }
  .hero-orbit-guide.guide-2 { width: 260px; height: 260px; }
  .hero-orbit-node { width: 36px; height: 36px; margin-top: -18px; margin-left: -18px; border-radius: 10px; }
  .hero-orbit-node svg { width: 18px; height: 18px; }
  .hero-floating-pill { display: none; }
}

/* ---- Fine pointer only: hover-dependent effects ---- */
@media (hover: none), (pointer: coarse) {
  .cursor-glow, .custom-cursor, .cursor-dot, .cursor-ring { display: none !important; }
  .service-card .mouse-glow { display: none !important; }
  [data-magnetic] { transform: none !important; }
}

/* ---- Landscape phones: reduce hero padding ---- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding-top: calc(var(--header-h) + var(--space-6)); padding-bottom: var(--space-8); }
  .mobile-menu { padding-top: calc(var(--header-h) + var(--space-4)); }
  .mobile-nav a { font-size: 1.25rem; padding: .45rem 0; }
}

