/* ==========================================================================
   Bridge Tech: Responsive layer
   Targets: 1920 · 1440 · 1024 · 768 · 390 · 320
   ========================================================================== */

/* ---------- Large desktop (≥1600) ---------- */
@media (min-width: 1600px) {
  :root {
    --container: 1320px;
    --container-wide: 1480px;
  }
}

/* ---------- ≤1280 ---------- */
@media (max-width: 1280px) {
  .nav { gap: var(--sp-4); }
  .nav__link { padding-inline: 0.7rem; }

  .p-panel {
    grid-template-columns: 1fr;
  }

  .p-panel__media {
    order: -1;
  }

  .browser,
  .product-detail--reverse .browser {
    transform: none;
  }
}

/* ---------- ≤1024 (tablet / small laptop) ---------- */
@media (max-width: 1024px) {
  :root { --header-h: 76px; }

  .nav { display: none; }
  .nav__toggle { display: block; }

  .brand img { height: 52px; }
  .site-header.is-scrolled .brand img { height: 46px; }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero__visual {
    justify-self: center;
    max-width: 480px;
    margin-top: 1rem;
  }

  .intro__grid {
    grid-template-columns: 1fr;
  }

  .intro__visual {
    max-width: 640px;
  }

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

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

  .p-panel__media { order: 0; }

  .timeline__steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .timeline__step h3 { font-size: 1.1rem; }

  .tech__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tech-card,
  .tech-card:nth-child(4),
  .tech-card:nth-child(5) { grid-column: span 1; }
  .tech-card:nth-child(5) { grid-column: span 2; }

  .footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

/* ---------- ≤860: process timeline goes vertical ---------- */
@media (max-width: 860px) {
  .timeline__track {
    left: 31px;
    right: auto;
    top: 32px;
    bottom: 32px;
    width: 2px;
    height: auto;
  }

  .timeline__fill {
    transform-origin: top center;
    transform: scaleY(var(--progress));
  }

  .timeline__steps {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .timeline__step {
    display: grid;
    grid-template-columns: 64px 1fr;
    column-gap: 1.25rem;
    text-align: left;
    padding: 0;
  }

  .timeline__node {
    grid-row: span 2;
    margin: 0;
  }

  .timeline__step h3 {
    align-self: end;
    padding-top: 0.6rem;
  }

  .timeline__step p {
    margin-top: 0.3rem;
  }

  .p-panel {
    grid-template-columns: 1fr;
  }

  .p-panel__media { order: -1; }
}

/* ---------- ≤768 (tablet portrait) ---------- */
@media (max-width: 768px) {
  .section-head--split {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 3rem);
  }

  .hero__visual { max-width: 400px; }

  .hero__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__scroll { display: none; }

  .build__grid { grid-template-columns: 1fr; }

  .cert-grid {
    flex-direction: column;
    height: auto;
  }

  .cert-grid > li,
  .cert-grid > li:hover,
  .cert-grid > li:has(.cert-card:focus-visible) {
    flex: none;
  }

  .cert-card__layout,
  .cert-grid > li:hover .cert-card__layout,
  .cert-grid > li:has(.cert-card:focus-visible) .cert-card__layout {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .cert-card__media,
  .cert-grid > li:hover .cert-card__media,
  .cert-grid > li:has(.cert-card:focus-visible) .cert-card__media {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cert-card__media img {
    width: 88px;
  }

  .cert-card__desc,
  .cert-grid > li:hover .cert-card__desc,
  .cert-grid > li:has(.cert-card:focus-visible) .cert-card__desc {
    max-height: none;
    margin-top: 0.55rem;
    opacity: 1;
    transform: none;
  }

  .engage__grid { grid-template-columns: 1fr; }

  .tech__grid { grid-template-columns: 1fr; }
  .tech-card:nth-child(5) { grid-column: span 1; }

  .review-note { margin-top: -1rem; }

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

/* ---------- ≤480 (mobile) ---------- */
@media (max-width: 480px) {
  :root { --header-h: 70px; }

  .brand img { height: 46px; }
  .site-header.is-scrolled .brand img { height: 42px; }

  .hero__title { letter-spacing: -0.04em; }

  .hero__actions,
  .cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn,
  .cta__actions .btn {
    width: 100%;
  }

  .hero__pillars { gap: 0.5rem 1.25rem; }

  .sm-chip text { font-size: 15px; }

  .p-panel { padding: 1.25rem; }
  .p-panel__logo { width: 60px; height: 60px; border-radius: 16px; }

  .p-panel__actions .btn { width: 100%; }

  .browser__screen { aspect-ratio: 4 / 3; }
  .wire { grid-template-columns: 1fr; }
  .wire__side { display: none; }

  .studio__cta { width: 100%; }

  .clarity-card__caption { font-size: var(--fs-xs); }

  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; }

  .contact-form__footer .btn { width: 100%; }
}

/* ---------- Contact page ---------- */
@media (max-width: 1024px) {
  .contact__grid { grid-template-columns: 1fr; }
  .contact-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (max-width: 768px) {
  .contact-form { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice__body { grid-template-columns: 18px 1fr; column-gap: 0.75rem; }
  .choice__dot { grid-row: span 2; margin: 0.15rem 0 0; }
  .contact-aside { grid-template-columns: 1fr; }
}

/* ---------- ≤360 (small mobile) ---------- */
@media (max-width: 360px) {
  :root { --gutter: 1rem; }

  .hero__eyebrow {
    font-size: var(--fs-xs);
    padding-inline: 0.7rem;
  }

  .btn { --btn-pad-x: 1.2rem; font-size: 0.95rem; }

  .placeholder-badge { padding: 0.6rem 0.75rem; }
  .placeholder-badge span { font-size: 0.72rem; }
}
