/* =====================================================================
   MIRYALAN DYNASTY — SITE-WIDE RESPONSIVE LAYER
   Fills gaps left by the per-component media queries so every page
   (not just the homepage) behaves on tablet, mobile, and ultra-wide.
   ===================================================================== */

html{-webkit-text-size-adjust:100%;}
img,video{max-width:100%;height:auto;}
.wrap{width:100%;}

/* Ultra-wide desktops */
@media (min-width:1800px){
  :root{--wrap-max:1560px;}
  body{font-size:17.5px;}
}

/* Small laptops / large tablets */
@media (max-width:1199px){
  .nav1{width:180px;}
  .nav4{width:120px;}
}

/* Tablets */
@media (max-width:1024px){
  .nav-outer{flex-wrap:wrap;}
  .home-hero-grid, .pillar-grid{gap:20px;}
}

/* Nav collapses to a hamburger below this width, matching the existing
   .nav-toggle / .mobile-nav wired up in main.js */
@media (max-width:900px){
  .nav-mid{display:none;}
  .nav1{width:auto;border-right:none;padding:14px 20px;}
  .nav4{display:none;}
  .nav-toggle{display:flex;}
  .nav-outer{position:relative;}
  main{padding-top:72px;}

  .foot-grid{grid-template-columns:repeat(2,1fr);gap:24px;}
  .stats-strip{flex-direction:column;gap:20px;}
  .build-grid{grid-template-columns:repeat(3,1fr);}
  section{padding:48px 0;}
}

/* Phones */
@media (max-width:640px){
  .wrap{padding:0 18px;}
  .home-hero{padding:96px 0 40px;}
  .home-hero h1{font-size:clamp(28px,8vw,38px);}
  .home-hero-ctas{flex-direction:column;}
  .home-hero-ctas .btn{width:100%;justify-content:center;}
  .foot-grid{grid-template-columns:1fr;text-align:left;}
  .foot-bottom{flex-direction:column;gap:10px;align-items:flex-start;}
  .build-grid{grid-template-columns:repeat(2,1fr);}
  .division-grid{grid-template-columns:repeat(2,1fr);}
  .pillar-grid{grid-template-columns:1fr;}
  table{display:block;overflow-x:auto;white-space:nowrap;}
}

/* Very small phones */
@media (max-width:380px){
  .home-hero-meta{flex-direction:column;gap:10px;}
  .build-grid,.division-grid{grid-template-columns:repeat(2,1fr);}
}

/* Respect motion preference sitewide, not just the 3D effects layer */
@media (prefers-reduced-motion: reduce){
  *{animation-duration:0.001ms !important;animation-iteration-count:1 !important;transition-duration:0.001ms !important;scroll-behavior:auto !important;}
}
