/* Phone layouts only. Tablet and desktop continue to use the existing grids. */
@media (max-width: 767px) {
  /* All three proof points share the same value and caption rows. */
  .hero > .hero-trust {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
  }

  .hero > .hero-trust > .trust-item,
  .hero > .hero-trust > .trust-item:last-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 30px 1fr;
    align-items: start;
    justify-items: start;
    min-width: 0;
    gap: 8px;
    text-align: left;
  }

  .hero > .hero-trust .trust-value {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 30px;
    margin: 0;
    line-height: 1;
  }

  .hero > .hero-trust .trust-caption {
    width: 100%;
    max-width: none;
    min-height: 52px;
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    text-wrap: balance;
  }

  .hero > .hero-trust .trust-value .eco-leaf {
    width: 26px;
    height: 26px;
    margin: 0;
  }

  /* Each rail owns its overflow; the document keeps its normal reading width. */
  .work-section .work-grid,
  .reviews-section .reviews-grid {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 4px 0 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scrollbar-width: thin;
    scrollbar-color: #a9cddd transparent;
    -webkit-overflow-scrolling: touch;
  }

  .work-section .work-grid:focus-visible,
  .reviews-section .reviews-grid:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 4px;
    border-radius: 4px;
  }

  .work-section .work-grid > .work-photo,
  .work-section .work-grid > .work-photo:last-child,
  .reviews-section .reviews-grid > .review {
    grid-column: auto;
    grid-row: auto;
    flex: 0 0 86%;
    width: 86%;
    min-width: 0;
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  /* A partially visible next card must not wait for a reveal threshold. */
  .motion-ready .work-section .work-grid > [data-reveal],
  .motion-ready .reviews-section .reviews-grid > [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .work-section .work-grid > .work-photo,
  .work-section .work-grid > .work-photo:last-child {
    aspect-ratio: 1448 / 1086;
    min-height: 0;
    border-radius: 15px;
  }

  .work-section .work-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .reviews-section .reviews-grid > .review {
    border-radius: 15px;
    padding: 20px;
  }

  .reviews-section .review-person {
    gap: 10px;
  }

  .reviews-section .review-person figcaption {
    min-width: 0;
  }

  .reviews-section .review blockquote {
    margin-top: 16px;
  }

  /* The complete scope remains in the existing, labelled service dialog. */
  .services-section .service-cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .services-section .service-card {
    display: grid;
    grid-template-columns: clamp(90px, 24vw, 104px) minmax(0, 1fr);
    align-content: start;
    align-items: start;
    gap: 8px 10px;
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
  }

  .services-section .service-card-photo {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1448 / 1086;
    border-radius: 10px;
    overflow: hidden;
  }

  .services-section .service-photo-button,
  .services-section .service-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: contain;
  }

  .services-section .service-card-content {
    display: contents;
  }

  .services-section .service-card h3 {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    font-size: clamp(18px, 5.2vw, 21px);
    line-height: 1.18;
    letter-spacing: -.04em;
  }

  .services-section .service-card-content > p {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    margin: 0;
  }

  .services-section .service-card .check-list {
    display: none;
  }

  .services-section .service-card-bottom {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin: 2px 0 0;
  }

  .services-section .service-card-bottom > p {
    flex-shrink: 0;
    margin: 0;
    white-space: nowrap;
  }

  .services-section .service-card-bottom > .round-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 0;
    width: auto;
    min-width: 104px;
    min-height: 44px;
    height: auto;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--pale);
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    transform: none;
  }

  .services-section .service-scope-label {
    display: inline;
  }

  .services-section .service-card-bottom > .round-button > .icon {
    display: none;
  }

  .services-section .service-card-bottom > .round-button:hover {
    background: #e1f0fa;
    transform: none;
  }

  .services-section .service-photo-button:focus-visible,
  .services-section .service-card-bottom > .round-button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -3px;
  }
}

@media (max-width: 374px) {
  .services-section .service-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }
}
