/* ==========================================================
   Breakpoint overrides for shared components.
   Bootstrap breakpoints: 576 / 768 / 992 / 1200.
   ========================================================== */

/* ---------- Large screens ---------- */
@media (min-width: 992px) {
  :root { --section-y: 96px; }
  .hero { padding: 76px 0 84px; }
  .hero-mark { right: -130px; bottom: -160px; width: 540px; }
  .hero-actions { flex-direction: row; align-items: center; }
  .hero-visual { max-width: 520px; margin: 0 0 0 auto; }
  .final-actions { align-items: stretch; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .jsa-nav-link { padding: 12px 10px; }
  .jsa-nav-link::after { left: 10px; right: 10px; }
  .nav-cta { padding: 12px 16px; margin-left: 4px; }
}

/* ---------- Tablet and below ---------- */
@media (max-width: 991.98px) {
  /* header */
  .topbar-text { display: none; }
  .topbar-inner { justify-content: center; }
  .brand .jsa-mark, .scrolled .brand .jsa-mark { height: 46px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 80px); padding: 10px 20px 22px; overflow-y: auto; background: var(--color-bg); border-bottom: 1px solid var(--color-border); box-shadow: 0 16px 30px rgba(17,26,46,.1); }
  .main-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .jsa-nav-link { width: 100%; justify-content: space-between; padding: 15px 14px; font-size: 16px; }
  .jsa-nav-link::after { left: 14px; right: auto; width: 28px; bottom: 8px; transform-origin: left; }
  .mega { position: static; width: auto; margin: 2px 0 8px; border: 0; border-radius: 12px; background: var(--color-bg-alt); box-shadow: none; animation: none; }
  .mega::before { display: none; }
  .mega-grid { grid-template-columns: 1fr; padding: 8px; }
  .mega-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .nav-cta { justify-content: center; width: 100%; margin: 12px 0 0; }

  /* hero: copy first, illustration second, centred as a unit */
  .hero { text-align: left; }
  .hero-visual { margin-top: 12px; }

  /* section 2 */
  .structure { margin-top: 8px; }

  /* section 3: vertical connected process */
  .cycle { grid-template-columns: 1fr; gap: 0; }
  .cycle-step { padding: 0 0 32px 78px; }
  .cycle-step:last-child { padding-bottom: 0; }
  .cycle-node { position: absolute; left: 0; top: 0; margin: 0; }
  .cycle-step:not(:last-child)::after { top: 64px; bottom: 8px; left: 27px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, rgba(17,26,46,.28) 0 6px, transparent 6px 11px); }
  .cycle-step h3 { padding-top: 12px; }

  /* section 4: three stacked panels */
  .paths { grid-template-columns: 1fr; }

  /* section 8 */
  .res-feature { padding: 30px; }
}

/* ---------- Tablet portrait ---------- */
@media (min-width: 576px) and (max-width: 991.98px) {
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .final-actions { flex-direction: row; flex-wrap: wrap; margin-top: 24px; }
  .paths { grid-template-columns: 1fr 1fr; }
  .path-cambridge { grid-column: 1 / -1; }
}

/* ---------- Phones ---------- */
@media (max-width: 575.98px) {
  .hero { padding: 32px 0 44px; }
  .hero-desc { font-size: 17px; }
  .hero-actions .btn { width: 100%; }
  .hero-visual { padding-right: 12px; }
  .hero-cycle { right: 12px; padding: 9px 13px; font-size: 12px; gap: 6px; }

  .structure-base { grid-template-columns: 1fr; }

  .beyond { grid-template-columns: 1fr; gap: 28px; }

  .parent-points li { gap: 16px; }
  .parent-ico { width: 48px; height: 48px; }
  .parent-points h3 { font-size: 20px; }

  /* stats: stacked, each on its own readable row */
  .stats { grid-template-columns: 1fr; gap: 22px; }
  .stats li { padding-top: 4px; padding-bottom: 4px; }

  .res-feature { padding: 26px; }
  .res-glyph { font-size: 110px; }
  .res-feature h3 { font-size: 24px; }

  .jsa-faq summary { padding: 14px 18px; font-size: 16px; }
  .jsa-faq details p { padding: 0 18px 18px; font-size: 16px; }

  .final-actions .btn { width: 100%; }
  .final-actions { margin-top: 24px; }
  .section-foot .btn { width: 100%; }
  .foot-actions .btn { width: 100%; }
}
