/* Intermediate widths only: preserve <=760px phones and >=1001px desktop. */
@media (min-width: 761px) and (max-width: 1000px) {
  html:has(body.landing-page) { scroll-padding-top: 128px; }

  /* Give the existing navigation a full row instead of splitting each label. */
  .landing-page .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    padding-block: 10px;
    row-gap: 12px;
    column-gap: 24px;
  }
  .landing-page .site-header .brand { grid-column: 1; grid-row: 1; }
  .landing-page .site-header .header-cta {
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
  }
  .landing-page .site-header .desktop-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    gap: 16px;
    margin-left: 0;
  }
  .landing-page .site-header .desktop-nav a { white-space: nowrap; }

  /* Keep the full explanations readable without narrow side-by-side columns. */
  .landing-page #main #problem .split-grid,
  .landing-page #main #price .price-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .landing-page #main #problem .type-section-summary { margin-bottom: 0; }
  .landing-page #main #price .price-card { min-width: 0; }

  /* Two company cards remain legible; center the last card at the same width. */
  .landing-page #main #companies .company-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .landing-page #main #companies .company-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc((100% - 24px) / 2);
    justify-self: center;
  }

  /* Improve Japanese line endings without changing type sizes or alignment. */
  .landing-page #main :is(.section,.apply) :is(p,li,dd,summary) {
    text-wrap: pretty;
    line-break: strict;
  }
  .landing-page #main :is(.feature-card,.company-card,.env-card) h3,
  .landing-page #main #companies .company-role {
    text-wrap: balance;
    line-break: strict;
  }

  @supports (grid-template-rows: subgrid) {
    .landing-page #main #companies .company-card {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 5;
      row-gap: 0;
    }
    .landing-page #main #companies .company-card > a {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 5;
      row-gap: 0;
    }
    .landing-page #main #companies .company-card-copy {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 4;
      row-gap: 0;
    }
  }
}
