/* Keep company text at the designed scale when iOS rotates to landscape.
   100% prevents automatic text inflation while preserving user zoom. */
html,
.company-intro,
.company-copy,
.company-copy > p {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Match service copy on short landscape screens, including iPhone Safari. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1100px) {
  .panel .company-copy > p {
    min-width: 0;
    font-size: 14px;
    line-height: 1.65;
  }
}

/* Responsive review: keep text and imagery together at intermediate widths. */
@media (min-width: 601px) and (max-width: 1100px) {
  .company-intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px 26px;
    align-items: start;
  }
  .company-copy { display: contents; }
  .company-copy > .eyebrow { grid-column: 1; align-self: end; }
  .company-copy > h3 { grid-column: 1; margin: 0; }
  .company-copy > p,
  .company-copy > a { grid-column: 1 / -1; margin: 0; }
  .company-copy > a { justify-self: start; }
  .company-photo { grid-column: 2; grid-row: 1 / 3; padding-top: 0; align-self: center; }

  .waiting-room .waiting-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 28px;
    align-items: center;
  }
  .waiting-copy { display: contents; }
  .waiting-copy > .eyebrow { grid-column: 1 / -1; }
  .waiting-room .waiting-copy > h1,
  .waiting-room .waiting-copy > h2 { grid-column: 1; margin: 0; }
  .waiting-room .waiting-copy > h1 { align-self: end; }
  .waiting-room .waiting-copy > h2 { align-self: start; }
  .waiting-copy > p,
  .waiting-copy > .waiting-actions { grid-column: 1 / -1; margin: 0; max-width: none; }
  .waiting-photo { grid-column: 2; grid-row: 2 / 4; }
}

@media (min-width: 901px) {
  .panel[aria-labelledby="tab-software"] .service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }
  .panel[aria-labelledby="tab-software"] .service-detail {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 16px;
  }
  .panel[aria-labelledby="tab-software"] .service-marker {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .panel[aria-labelledby="tab-software"] .service-detail:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .contact .wrap { display: block; }
  .contact h2 { text-wrap: balance; }
  .all-reference-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .contact a.big { font-size: clamp(18px, 6vw, 22px); overflow-wrap: anywhere; }
}

/* Let short testimonials end naturally instead of stretching to a long neighbour. */
@media (min-width: 761px) {
  .all-reference-grid { display: block; columns: 2; column-gap: 18px; }
  .all-reference-grid .reference-card {
    display: inline-block;
    vertical-align: top;
    width: 100%;
    margin: 0 0 18px;
    break-inside: avoid;
  }
}
