/* =====================================================================
   MSTS v3 — responsive.css
   Layouts are re-composed for each size, not shrunk.
   ===================================================================== */

@media (min-width: 1600px) { :root { --wrap: 1400px; } }

@media (max-width: 1240px) {
  .header__cta { display: none; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sol { grid-template-columns: 44px 50px minmax(0, 1fr) 46px; }
  .sol__items { grid-column: 3 / 4; }
  .sol__go { grid-column: 4; grid-row: 1; }
  .comms__grid { gap: 1.4rem; }
}

/* Tablet landscape */
@media (max-width: 1080px) {
  .hero__scrim { background: linear-gradient(180deg, rgba(8,24,43,.9) 0%, rgba(8,24,43,.62) 45%, rgba(8,24,43,0) 72%), linear-gradient(0deg, var(--navy) 0%, rgba(8,24,43,0) 18%); }
  .hero { justify-content: flex-start; padding-top: calc(var(--header-h) + 4rem); }
  .hud-chip--b { display: none; }
  .hud-chip--c { right: var(--gutter); bottom: 6rem; }
  .about__grid { grid-template-columns: 1fr; align-items: start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3.5rem; }
  .eco__layout, .creds__layout, .contact__layout { grid-template-columns: 1fr; }
  .creds__head { position: static; }
  .eco__stage { max-width: 680px; width: 100%; margin-inline: auto; }
  .svc-intro__head { grid-template-columns: 1fr; }
  .svc-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter__layout, .chapter__layout--wide { grid-template-columns: 1fr; }
  .chapter__layout--flip .chapter__copy { order: 0; }
  .chapter__vis { max-width: 760px; }
  .chapter__vis--cctv { max-width: 680px; width: 100%; margin-inline: auto; }
  .temple__layout { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .comms__grid { grid-template-columns: 1fr; gap: 4rem; }
  .comm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
  .comm__copy { padding-top: 0; }
  .hscroll__head { grid-template-columns: 1fr; }
}

/* Navigation becomes the full-screen menu (matches data-msts-mega-breakpoint="960") */
@media (max-width: 960px) {
  :root { --header-h: 72px; }
  .site-header.is-solid { --header-h: 64px; }
  .nav-toggle { display: inline-block; flex: none; z-index: 2; }
  .brand { position: relative; z-index: 2; }
  .nav { position: fixed; inset: 0; z-index: 1; display: block; padding: calc(var(--header-h) + 1.75rem) var(--gutter) 2rem; background: var(--navy); overflow-y: auto; overscroll-behavior: contain;
    clip-path: circle(0% at calc(100% - var(--gutter) - 24px) calc(var(--header-h) / 2)); visibility: hidden; transition: clip-path 800ms var(--ease-io), visibility 0s linear 800ms; }
  .nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(167,200,230,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(167,200,230,.045) 1px, transparent 1px); background-size: 44px 44px; pointer-events: none; }
  .nav::after { content: ""; position: absolute; right: -30vmax; top: -30vmax; z-index: -1; width: 70vmax; height: 70vmax; border-radius: 50%; background: radial-gradient(circle, rgba(96,170,205,.18), transparent 62%); pointer-events: none; }
  .nav-open .nav { clip-path: circle(150% at calc(100% - var(--gutter) - 24px) calc(var(--header-h) / 2)); visibility: visible; transition: clip-path 900ms var(--ease-io); }
  .nav-open { overflow: hidden; }
  .nav-open .site-header { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; }
  .nav-open .site-header::after { opacity: 0; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__item { flex-wrap: wrap; border-bottom: 1px solid var(--line-d); opacity: 0; transform: translateY(28px); transition: opacity 400ms, transform 700ms var(--ease); }
  .nav-open .nav__item { opacity: 1; transform: none; transition-delay: calc(240ms + var(--ni, 0) * 60ms); }
  .nav__link { height: auto; padding: 1.05rem 0; font: 300 clamp(1.8rem, 1.2rem + 2.6vw, 2.6rem)/1.05 var(--f-display); letter-spacing: -.045em; color: var(--on-dark); }
  .nav__link.is-active { color: var(--blue); }
  .nav__indicator { display: none; }
  .nav__mobile-contact { display: grid; gap: .7rem; margin-top: 2.2rem; opacity: 0; transition: opacity 500ms; }
  .nav-open .nav__mobile-contact { opacity: 1; transition-delay: 700ms; }
  .nav__mobile-contact a { display: inline-flex; align-items: center; gap: .75rem; color: var(--on-dark-2); text-decoration: none; font-size: 1.05rem; }
  .nav__mobile-contact .ico { color: var(--blue); }

  .msts-mega.is-mobile .msts-mega__toggle { margin-left: auto; width: 46px; height: 46px; border: 1px solid var(--line-d2); border-radius: 50%; }
  .msts-mega.is-mobile .msts-mega__panel { position: static; width: 100%; flex-basis: 100%; padding: 0 0 1rem; transform: none; clip-path: none; display: none; opacity: 1; visibility: visible; transition: none; color: var(--on-dark); }
  .msts-mega.is-mobile.is-open .msts-mega__panel { display: block; }
  .msts-mega.is-mobile .msts-mega__inner { max-height: none; overflow: visible; grid-template-columns: 1fr; background: var(--navy-2); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .msts-mega.is-mobile .msts-mega__priority { grid-row: auto; padding: .8rem; border-right: 0; border-bottom: 1px solid var(--line-d); }
  .msts-mega.is-mobile .msts-mega__feature { align-items: center; padding: .55rem .6rem; }
  .msts-mega.is-mobile .msts-mega__feature .msts-mega__ico { grid-row: auto; width: 34px; height: 34px; }
  .msts-mega.is-mobile .msts-mega__fdesc { display: none; }
  .msts-mega.is-mobile .msts-mega__groups { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .4rem 1.2rem; padding: .9rem; }
  .msts-mega.is-mobile .msts-mega__cat { margin-bottom: .4rem; }
  .msts-mega.is-mobile .msts-mega__cat > a { padding: .3rem 0; }
  .msts-mega.is-mobile .msts-mega__cat ul { display: none; }
  .msts-mega.is-mobile .msts-mega__foot { grid-column: 1; padding: .8rem .9rem; }

  .netstory__grid { grid-template-columns: 1fr; }
  .netstory__sticky { top: calc(var(--header-h) + 6px); z-index: 2; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) .75rem; background: var(--navy-2); }
  .netstory__panel { max-width: 460px; margin-inline: auto; padding-top: 38px; }
  .netstory__diagram .msts-net { aspect-ratio: 528 / 330 !important; }
  .step { min-height: 0; padding-block: 2.2rem; }
  .js .step { opacity: .5; }
}

/* Tablet portrait */
@media (max-width: 800px) {
  .temple__layout { grid-template-columns: 1fr; }
  .temple__media { max-width: 420px; }
  .project { grid-template-columns: 1fr; }
  .project__media { min-height: 0; aspect-ratio: 16 / 9; }
  .js .project .project__media { clip-path: inset(0 0 100% 0); }
  .more__row { grid-template-columns: 40px minmax(0, 1fr); }
  .more__row p { grid-column: 2; }
  .about__foot { grid-template-columns: 1fr; }
  .comm { grid-template-columns: 1fr; gap: 0; }
  .comm__copy { padding-top: 1.75rem; }
  .sol { grid-template-columns: 50px minmax(0, 1fr) 46px; padding-block: 1.6rem; }
  .sol__n { display: none; }
  .sol__icon { width: 44px; height: 44px; }
  .sol__items { grid-column: 2 / -1; }
  .sol__go { grid-column: 3; }
  .creds__grid { grid-template-columns: 1fr; }
}

/* Phones */
@media (max-width: 600px) {
  :root { --section: 5.5rem; }
  .brand__plate { width: 40px; height: 40px; }
  .brand__plate img { width: 34px; height: 34px; }
  .brand__name { font-size: .58rem; padding-left: .65rem; letter-spacing: .12em; }
  .brand { gap: .6rem; }
  .hero { padding-top: calc(var(--header-h) + 2.5rem); }
  .hero__status { margin-bottom: 1.4rem; }
  .hero__lead { margin-top: 1.4rem; }
  .hero__actions { margin-top: 2rem; }
  .hero__actions .btn { flex: 1 1 auto; }
  .hero__call { display: none; }
  .hud-chip--a { display: none; }
  .hud-chip--c { bottom: 5.5rem; }
  .hero__foot { bottom: 1.25rem; }
  .stats { gap: 2.75rem 1.25rem; }
  .stat dt { font-size: .84rem; }
  .eco__legend { grid-template-columns: 1fr; }
  .msts-net .node-label { font-size: 16px; }
  .eco__diagram .node-sub, .netstory__diagram .node-sub { display: none; }
  .svc-index { grid-template-columns: 1fr; }
  .caps--2 { grid-template-columns: 1fr; }
  .caps--2 li:nth-child(2) { border-top: 0; }
  .chapter__vis--cctv { padding-top: 2.5rem; }
  .chapter__vis--cctv .cctv { --cam-w: 132px; }
  .cctv__screen { padding-top: 40px; }
  .cctv__bar { font-size: .56rem; letter-spacing: .1em; }
  .cctv__bar span:last-child { display: none; }
  .cam__hint { font-size: .55rem; }
  .cctv__switch { gap: .6rem; }
  .vis-frame, .vis-frame--lg, .comm__vis { aspect-ratio: 4 / 3.4; }
  .vc__grid { inset: 14px 14px 64px; }
  .seal { width: 56px; height: 56px; }
  .field-row { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 2rem 1.25rem; }
  .footer__bottom { flex-direction: column; }
  .ticker__list li::after { margin: 0 1.4rem; }
  .demo__status { left: 14px; bottom: 14px; }
  .demo__replay { right: 12px; bottom: 12px; }
  .vis-frame--lg .demo__replay { right: 10px; top: 10px; padding: .45rem; }
  .vis-frame--lg .demo__replay span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vis-frame--lg .demo__status { left: 10px; top: 10px; max-width: calc(100% - 64px); }
  .vis-frame--lg .demo__status [data-demo-text] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .intro__mark { width: 168px; height: 168px; }
  .intro__plate { width: 118px; height: 118px; }
  .intro__plate img { width: 98px; height: 98px; }
  .intro__hud--tr { display: none; }
}

@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .brand__name { font-size: .52rem; letter-spacing: .08em; }
  .footer__cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
}

/* Short landscape screens (phones turned sideways) */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: 560px; }
  .intro__mark { width: 130px; height: 130px; }
  .intro__plate { width: 92px; height: 92px; }
  .intro__plate img { width: 76px; height: 76px; }
}

/* Live feed + cards on phones */
@media (max-width: 600px) {
  .feed__bottom span:last-child, .feed__top [data-feed-cam] { display: none; }
  .feed__top, .feed__bottom { left: 12px; right: 12px; }
  .det b, .det i { font-size: .5rem; }
  .feed__run { width: 100%; justify-content: center; }
  .form__head { align-items: center; }
  .sv { scale: .8; right: 14px; }
  .form__head { padding-right: 132px; min-height: 80px; }
}
