@layer layout {
  /* The page column. Everything readable sits in a .container; bands may run edge to edge behind it. */
  .container {
    inline-size: min(100% - 2 * var(--space-4), var(--content-width));
    margin-inline: auto;
  }
  .container--narrow { inline-size: min(100% - 2 * var(--space-4), var(--narrow-width)); }
  .page { padding-block: var(--space-5); }

  /* Bands: full-width stripes that give a page its rhythm. Section spacing comes from here, not from each page. */
  .band { padding-block: var(--space-7); background: var(--color-bg); color: var(--color-ink); }
  .band--tight { padding-block: var(--space-6); }
  /* Two plain bands in a row (a page's title, then its content) share one gap instead of adding theirs up. */
  .band--tight:not(.band--surface, .band--sky, .band--ink, .band--cta) + .band--tight:not(.band--surface, .band--sky, .band--ink, .band--cta) { padding-block-start: 0; }
  /* Phones: less room around a page's title band (not on the home page, whose sections keep their spacing). */
  @media (max-width: 40rem) { .band--tight:has(.hero-title:not(.hero-title--home)) { padding-block: var(--space-5) var(--space-4); } }
  .band--surface { background: var(--color-surface); }
  .band--sky { background: var(--color-band); }
  .band--ink { background: var(--color-band-ink); color: var(--color-on-ink); }
  .band--ink a:not(.button) { color: inherit; }
  .band--cta { background: var(--color-primary); color: var(--color-on-primary); }
  .band--cta a:not(.button) { color: inherit; }
  .band > .container > :first-child, .band__head > :first-child { margin-block-start: 0; }

  /* Small layout helpers. */
  .stack { display: grid; gap: var(--space-4); align-content: start; }
  .stack > * { margin-block: 0; }
  .stack--lg { gap: var(--space-6); }
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
  .split { display: grid; gap: var(--space-6); align-items: center; }
  @media (min-width: 52rem) {
    .split { grid-template-columns: 1.1fr 0.9fr; }
    .split--even { grid-template-columns: 1fr 1fr; }
  }
  .grid-auto { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
  .section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-block-end: var(--space-5); }
  .section-head > * { margin-block: 0; }
  .text-center { text-align: center; }
}
