/* Collection opening: the collection's name behind its first model */
.stage__word--title {
  font-size: calc((100vw - 2 * var(--margin)) / var(--fit));
  letter-spacing: -0.03em;
  gap: 0.25em;
  margin: 0;
}
.collection-opening .collection-opening__lead { grid-column: 1 / span 7; font: 400 var(--size-heading)/1.25 var(--font-display); }
/* Portrait screens (phones, tablets held upright) may open on their own photograph, chosen with
   small heads low in the frame; its mask and anchor come with it, and the name stays on one line
   above the models, where stacked they would hide half of every word. */
@media (max-aspect-ratio: 4 / 5) {
  .stage__slide--portrait .stage__back img { object-position: var(--focal-portrait, 50% 0%); }
  .stage__word--title.stage__word--portrait {
    display: flex;
    font-size: calc((100vw - 2 * var(--margin)) / var(--fit));
    -webkit-mask-image: var(--mask-portrait);
    mask-image: var(--mask-portrait);
    -webkit-mask-position: var(--focal-portrait, 50% 0%);
    mask-position: var(--focal-portrait, 50% 0%);
  }
}
.collection-opening__actions { grid-column: 9 / span 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 24px; }

/* The strip of small frames: one per look */
.frames {
  position: relative;
  display: grid;
  align-content: center;
  padding: 96px 0;
}
.frames__title {
  margin: 0 var(--margin) 24px;
  font: 500 var(--size-heading)/1 var(--font-display);
}
/* Every look takes an equal share of the width, in the gallery's 4:5. */
.frames__row {
  display: grid;
  grid-template-columns: repeat(var(--count), 1fr);
  gap: 16px;
  padding: 0 var(--margin);
}
.frames__row a { display: grid; gap: 10px; text-decoration: none; }
.frames__row picture { display: block; aspect-ratio: 4 / 5; overflow: hidden; }
.frames__row img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s var(--ease-out); }
.frames__row a:hover img, .frames__row a:focus-visible img { transform: scale(1.04); }
.frames__name { font-size: var(--size-small); }
.frames__row a:hover .frames__name { text-decoration: underline; }

/* One chapter per look, on the look's colour: the words across the top, the photographs below */
.chapter {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 48px 24px;
  padding: 120px var(--margin);
  background: var(--field);
  color: var(--field-ink);
}
.chapter__head { grid-column: 1 / span 5; display: grid; align-content: start; gap: 16px; }
/* A long word fits the column: tracked capitals run under 0.95em a letter. */
.chapter__head:has(.title-long) { container-type: inline-size; }
.chapter__title.title-long { font-size: min(var(--size-title), 100cqi / (var(--letters) * 0.95)); }
.chapter__text { grid-column: 7 / span 6; display: grid; gap: 18px; max-width: 62ch; }
.chapter__stage, .chapter__lead { font: 500 var(--size-heading)/1.15 var(--font-display); }
.chapter__stage { font-weight: 400; }
.chapter__material { font-size: var(--size-small); }
.chapter__text .button { justify-self: start; margin-top: 8px; }
.chapter__gallery {
  grid-column: 1 / -1;
  /* Clear of the words above, by more than the photographs are apart. */
  margin-top: clamp(24px, 4vw, 64px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: start;
}
.chapter__photo { margin: 0; cursor: zoom-in; }
.chapter__photo--full { grid-column: 2 / span 10; }
.chapter__photo--half { grid-column: span 6; }
.chapter__photo img { width: 100%; height: auto; }
/* A full-width photograph keeps its shape but never runs past one screen. */
.chapter__photo--full img { width: min(100%, 88svh * var(--ratio)); aspect-ratio: var(--ratio); margin-inline: auto; }
.chapter__photo--full figcaption { text-align: center; }
/* A pair shares one shape, so neither leaves a hole beside the other. */
.chapter__photo--half img { aspect-ratio: 4 / 5; object-fit: cover; }
.chapter__photo figcaption { padding-top: 10px; font-size: var(--size-small); }

/* A film sits like a full-width photograph, at its own 9:16, never taller than one screen. */
.chapter__film { grid-column: 2 / span 10; display: grid; justify-items: center; margin: 0; }
.chapter__film video { display: block; width: min(100%, 88svh * 9 / 16); aspect-ratio: 9 / 16; height: auto; margin-inline: auto; background: #000; }
/* The caption keeps the height of its controls, which appear once the script runs. */
.chapter__film figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 24px; min-height: 46px; padding-top: 2px; font-size: var(--size-small); }
.chapter__film-controls { display: flex; gap: 20px; }
.chapter__film-controls[hidden] { display: none; }
.chapter__film-controls .button { font-size: var(--size-small); }

.collection-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 120px var(--margin);
}
.collection-next__link {
  font: 500 var(--size-title)/1 var(--font-display);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.collection-next__link:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* The jeweller's loupe (round, the one tool on the page that is). Not rendered until in use. */
.loupe {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: none;
  border-radius: 50%;
  background-color: var(--ivory);
  background-repeat: no-repeat;
  outline: 2px solid var(--ivory);
  pointer-events: none;
}
.loupe.is-on { display: block; }

@media (max-width: 1023px) {
  .chapter__head, .chapter__text { grid-column: 1 / -1; }
  .collection-opening .collection-opening__lead { grid-column: 1 / span 12; }
  .collection-opening__actions { grid-column: 1 / span 12; justify-content: flex-start; }
}
@media (max-width: 767px) {
  .stage__word--title { display: block; font-size: calc((100vw - 2 * var(--margin)) / var(--fit-stacked)); }
  .collection-opening .collection-opening__lead { font-size: 22px; }
  .chapter { grid-template-columns: 1fr; padding: 96px var(--margin); }
  .chapter__gallery { grid-template-columns: 1fr; }
  .chapter__photo--full, .chapter__photo--half, .chapter__film { grid-column: 1; }
  .chapter__film { justify-items: stretch; }
  .chapter__film figcaption { justify-content: space-between; }
  .chapter__photo { cursor: default; }
  .chapter__photo--full figcaption { text-align: left; }
  /* On a phone the frames stay one row of small portraits that scrolls sideways. */
  .frames__row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    cursor: grab;
  }
  .frames__row::-webkit-scrollbar { display: none; }
  .frames__row.is-dragging { cursor: grabbing; }
  .frames__row li { flex: 0 0 auto; width: 40vw; }
  /* A name under a frame cut by the screen edge reads as cut off; the link still says it. */
  .frames__name { display: none; }
}
