@layer layout {
  .nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 2rem; padding: 1.25rem var(--gutter);
    position: relative; z-index: 3;
  }
  .nav__brand { display: block; width: clamp(150px, 18vw, 210px); }
  .nav__links { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem); }
  .nav__link {
    font-size: .8125rem; letter-spacing: .02em;
    color: var(--ink-quiet);
    padding-block: .35rem;
    border-bottom: 1px solid transparent;
  }
  .nav__link:hover, .nav__link.is-current { color: var(--ink); border-bottom-color: var(--accent); }
  .nav__link--cta { color: var(--ink); }

  main { display: block; }

  /* .band is the padded page section; .prose is only a measure and is meant
     to nest inside one. Having .prose carry the page padding meant any use
     inside an already-padded container indented twice and gained a rhythm of
     empty space above it. */
  .band, .intro, .work, .error { padding: var(--rhythm) var(--gutter); }

  /* ---- the world page below the hero ---------------------------------- */

  /* --rhythm is the gap between unrelated things on a page. Stacked three
     deep — intro, films, packages — it put over 200px between each, and the
     page read as four separate pages that happened to share a scrollbar.
     These sections belong together, so they get a tighter rhythm of their
     own rather than the page-level one. */
  .world-body {
    --rhythm: clamp(2.25rem, 4vw, 3.5rem);
  }


  /* One rhythm between sections, not two. Each pays for the space above it
     and nothing below, so the gap between any two is a single rhythm rather
     than one section's bottom plus the next one's top. The last still needs
     its own, or the footer hugs it. */
  .world-body > * { padding-bottom: 0; }
  .world-body > :last-child { padding-bottom: var(--rhythm); }

  /* Twelve columns, copy in the first eight. The last four stay empty on
     purpose: the text stops short of the right edge rather than running the
     full width, which gives the page a margin to breathe into and leaves a
     place for something to sit alongside the copy later.

     A grid rather than a max-width, because the copy then lines up with
     anything else placed on the same twelve columns instead of being its own
     measurement. */
  .world-intro {
    /* Close under the tagline: the hero's type and this copy are one thought,
       and a full section's rhythm between them read as a mistake. */
    padding: clamp(1.5rem, 2vw, 2.25rem) var(--gutter) 0;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(1rem, 2vw, 2rem);
  }
  .world-intro .prose {
    /* .prose caps itself at --measure, which is narrower than eight columns —
       without this the grid placement would have nothing to fill. */
    max-width: none;
    grid-column: 1 / span 8;
  }

  /* One column below the point where eight of twelve stops being a sensible
     measure: on a phone the copy wants the whole width, not two thirds of it. */
  @media (max-width: 60rem) {
    .world-intro .prose { grid-column: 1 / -1; }
  }

  .intro__lead {
    max-width: 36ch;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.5rem, 1rem + 2.6vw, 3.25rem);
    line-height: 1.08;
    letter-spacing: var(--display-tracking);
  }

  /* Same family as the lead, half its size, a step lighter. The clamp is the
     lead's halved, except for the floor: half of the lead's smallest would be
     13px, which is too small to read comfortably on a phone. */
  .intro__sub {
    max-width: 52ch;
    margin-top: clamp(1rem, 2vw, 1.75rem);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(0.9375rem, 0.5rem + 1.3vw, 1.625rem);
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--ink-quiet);
  }

  .grid {
    display: grid; gap: clamp(1rem, 2.5vw, 2rem);
    align-items: start;     /* mixed card heights sit top-aligned, not stretched */
    min-width: 0;
    grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
  }

  .footer {
    display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem;
    padding: 2rem var(--gutter) 3rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-quiet); font-size: .8125rem;
  }
  .footer__links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-right: auto; }
  .footer__motion { cursor: pointer; border-bottom: 1px solid var(--rule); }

  /* Below ~48rem the brand plus four links cannot share one row: the nav
     overflowed the viewport, which scrolled the whole page sideways. Wrap the
     links onto their own line rather than letting anything spill. */
  @media (max-width: 48rem) {
    .nav {
      flex-wrap: wrap;
      gap: .85rem 1rem;
      padding-inline: var(--gutter);
    }
    .nav__brand { width: clamp(128px, 38vw, 168px); }
    .nav__links {
      width: 100%;
      flex-wrap: wrap;          /* four links will not fit one 414px row */
      justify-content: flex-start;
      gap: .6rem 1.15rem;
    }
    .nav__link { font-size: .75rem; }
  }
}
