/* ============================================================
   NexGen Software Innovation LLP — responsive layer
   ------------------------------------------------------------
   Breakpoints (max-width, desktop-first):
     1280px  large desktop trims
     1080px  tablet landscape + mobile navigation kicks in
      900px  tablet portrait
      768px  large phone / small tablet
      560px  phone
      380px  small phone
   ============================================================ */

/* ------------------------------------------------------------
   Very large screens: a little more breathing room
   ------------------------------------------------------------ */
@media (min-width: 1600px) {
  :root {
    --container: 1280px;
  }
}

/* ------------------------------------------------------------
   <= 1280px
   ------------------------------------------------------------ */
@media (max-width: 1280px) {
  .hero__visual {
    min-height: 420px;
  }

  .orb {
    width: 300px;
    height: 300px;
  }

  .solution-card {
    padding: 30px;
  }
}

/* ------------------------------------------------------------
   <= 1080px — mobile navigation, single-column hero
   ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .nav-toggle {
    display: grid;
  }

  /* Nav becomes a slide-down panel under the sticky header. */
  .site-nav {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - var(--nav-h));
    padding: 10px var(--gutter) 28px;
    overflow-y: auto;
    background: rgba(7, 7, 12, 0.97);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-14px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
      visibility var(--dur) var(--ease);
  }

  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__link {
    display: block;
    padding: 16px 2px;
    border-bottom: 1px solid var(--border);
    color: var(--color-text);
    font-size: 1rem;
  }

  .site-nav__link::after {
    left: 0;
    right: auto;
    bottom: 0;
    width: 34px;
    height: 2px;
  }

  .site-nav__cta {
    width: 100%;
    margin-top: 24px;
  }

  body.nav-open {
    overflow: hidden;
  }

  /* Layout */
  .hero__inner,
  .about,
  .why,
  .contact,
  .section__head--row {
    grid-template-columns: minmax(0, 1fr);
  }

  .section__head--row {
    align-items: start;
  }

  .hero {
    padding-top: calc(var(--nav-h) + 48px);
  }

  .hero__lead {
    max-width: 62ch;
  }

  .hero__visual {
    min-height: 400px;
    margin-top: 8px;
  }

  .code-card {
    margin-inline: auto;
  }

  .float-card--status {
    top: 0;
  }

  .about__visual,
  .why__visual {
    order: 2;
  }

  .trust-grid,
  .service-grid,
  .project-grid,
  .tech-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 44px;
  }

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

  .site-footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------
   <= 900px
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .solution-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Decorative stack becomes a simple vertical flow. */
  .why__visual {
    min-height: 0;
    display: grid;
    gap: 16px;
  }

  .stack-card {
    position: static;
    width: auto;
  }

  .stack-card--front {
    justify-self: start;
  }

  .glow-blob {
    top: 50%;
    left: 50%;
    width: 260px;
    height: 260px;
    transform: translate(-50%, -50%);
    animation: none;
  }
}

/* ------------------------------------------------------------
   <= 768px
   ------------------------------------------------------------ */
@media (max-width: 768px) {
  :root {
    --section-y: 68px;
  }

  .service-grid,
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__points {
    gap: 10px 20px;
  }

  .hero__visual {
    min-height: 360px;
  }

  .orb {
    width: 250px;
    height: 250px;
    left: 6%;
  }

  .float-card--stack {
    display: none;
  }

  /* Timeline flips to a vertical rail. */
  .process-timeline {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .process-timeline::before {
    display: block;
    top: 10px;
    bottom: 10px;
    left: 7px;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, rgba(93, 169, 233, 0), #5da9e9, #5a56a6, #b84cb5, rgba(184, 76, 181, 0));
  }

  .process-step {
    padding-left: 40px;
    padding-bottom: 36px;
  }

  .process-step:last-child {
    padding-bottom: 0;
  }

  .process-step__node {
    position: absolute;
    left: 0;
    top: 5px;
    margin: 0;
  }

  .process-step__text {
    max-width: 46ch;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ------------------------------------------------------------
   <= 560px
   ------------------------------------------------------------ */
@media (max-width: 560px) {
  .trust-grid,
  .tech-grid,
  .pillar-grid,
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__actions .btn,
  .contact-form .btn {
    width: 100%;
  }

  .hero__visual {
    min-height: 0;
  }

  /* Floating chrome collapses into normal flow on small screens. */
  .float-card {
    position: static;
    margin-top: 14px;
    animation: none;
  }

  .node-web {
    opacity: 0.3;
  }

  .orb {
    width: 210px;
    height: 210px;
    filter: blur(46px);
  }

  .code-card__body {
    font-size: 0.75rem;
    padding: 16px;
  }

  .solution-card {
    flex-direction: column;
    gap: 14px;
  }

  .brand__tagline {
    font-size: 0.625rem;
  }

  .section__lead {
    font-size: 1rem;
  }

  .to-top {
    width: 42px;
    height: 42px;
  }
}

/* ------------------------------------------------------------
   <= 380px
   ------------------------------------------------------------ */
@media (max-width: 380px) {
  :root {
    --gutter: 18px;
  }

  .brand__tagline {
    display: none;
  }

  .hero__points {
    flex-direction: column;
  }

  .social-list {
    flex-wrap: wrap;
  }
}
