/* Keep the Home and Portfolio work cards on the same responsive grid. */
.home-feature,
.selected-work-grid {
  --work-grid-gap: 30px;
}

.selected-work-grid {
  gap: var(--work-grid-gap);
}

.selected-work-grid .work-preview {
  inline-size: 100%;
  min-inline-size: 0;
  aspect-ratio: 16 / 10;
}

@media (max-width: 1100px) {
  .home-feature,
  .selected-work-grid {
    --work-grid-gap: 24px;
  }
}

@media (min-width: 1001px) {
  .home-feature,
  .selected-work-grid {
    container-type: inline-size;
  }

  /* Half the shared grid width at 16:10, with room for the unchanged intro
     at narrower desktop widths. A minimum lets enlarged text grow safely. */
  .home-feature .feature-intro,
  .selected-work-grid .work-preview {
    min-block-size: max(22.5rem, calc((100cqi - var(--work-grid-gap)) * .3125));
  }

  /* Share spare height across the three text gaps, keeping the eyebrow
     at the image's top and the button at its bottom. */
  .home-feature .feature-intro {
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }

  .home-feature .feature-intro-content {
    display: contents;
  }

  .home-feature .feature-intro > .eyebrow,
  .home-feature .feature-intro-copy,
  .home-feature .button.feature-portfolio-link {
    margin-block: 0;
  }
}

@media (max-width: 800px) {
  .home-feature,
  .selected-work-grid {
    --work-grid-gap: 22px;
  }

  .selected-work-grid .work-preview {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 600px) {
  .home-feature,
  .selected-work-grid {
    --work-grid-gap: 20px;
  }

  .home-feature .feature-film-image {
    aspect-ratio: 4 / 3;
  }
}
