#home .hero-art img {
  /* The plate outline must load along with the photo in a file: preview. */
  --plate-outline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 1440'%3E%3Cpath fill='white' d='M 727 68 C 1071 64 1385 368 1388 714 C 1394 1066 1087 1366 725 1368 C 360 1371 51 1070 54 706 C 55 373 363 70 727 68 Z'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--plate-outline);
  mask-image: var(--plate-outline);
}

/* The rendered frame and its photographic loading poster trade places together. */
#home .scroll-canvas { transition: none; }

/* Reserve the native scroll space before the module and the catalogue initialize. */
@media (scripting: enabled) {
  html[data-film-home] #home:has(#scene:is([data-state="loading"], [data-state="ready"])) {
    --journey-runway: calc(12.36 * min(112svh, 1100px));
  }
}

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  html[data-film-home] #home:has(#scene:is([data-state="loading"], [data-state="ready"])) {
    --journey-tail: calc(var(--film-header, 74px) - 54svh);
  }
}

#scene[data-state="file"] .model-status {
  display: none;
}

#scene[data-state="file"] .hero-art {
  pointer-events: auto;
}

.film-chapter h2 {
  font-size: clamp(24px, 3.2vw, 54px);
  letter-spacing: .075em;
}

.film-chapter .film-right {
  font: 400 clamp(12px, 1.12vw, 18px)/1.85 var(--sans);
  color: #b9c7bd;
  letter-spacing: .025em;
}

#home .hero-edition h2,
#home .hero-detail .hero-detail-lead {
  margin-top: 0;
}

.film-macro {
  display: block;
  right: auto;
  width: 22vw;
  max-width: 340px;
}

.film-macro h2 {
  font-size: clamp(28px, 3.55vw, 62px);
  letter-spacing: .06em;
}

.macro-body {
  margin: 18px 0 0;
  font: 400 clamp(13px, 1.12vw, 18px)/1.9 var(--sans);
  color: #bdc7bd;
}

.chapter-next svg {
  display: block;
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
}

.chapter-next {
  display: inline-flex;
  align-items: center;
  gap: .75em;
  min-height: 44px;
  width: max-content;
  font: 400 clamp(16px, 1.35vw, 21px)/1.4 var(--serif);
  letter-spacing: .06em;
  color: #cdd6c9;
  text-decoration: none;
  pointer-events: auto;
}

.chapter-next:hover { color: #f0f0df; }
qy-collection-flow:not([data-collection-last]) > [slot="next-chapter"] { display: none; }
qy-collection-flow .chapter-next { text-shadow: 0 1px 4px #060b08; }
.chapter-next:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.glaze-reading-chapter > .chapter-next, #tea > .chapter-next {
  margin-top: clamp(18px, 3svh, 32px);
}
.glaze-reading-chapter > .chapter-next { margin-left: 6vw; }
.film-next { margin-top: clamp(14px, 2.6svh, 28px); }

@media (max-width: 760px) {
  .glaze-reading-chapter > .chapter-next { margin-left: 0; }
  .film-next { margin-top: 4px; }
}

.film-ending .film-detail-note {
  margin: 0;
  letter-spacing: .12em;
}

.macro-matte {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* The opaque stage covers catalogue frames even when the compositor scrolls
     the page ahead of the main thread. It stays pinned through the hold. */
  #home #scene[data-film-cover] {
    position: fixed;
    inset: 0 0 auto;
    z-index: 20;
    /* Cover the extra area exposed when mobile browser chrome retracts. */
    box-shadow: 0 calc(100lvh - 100svh) 0 #000;
  }

  #home #scene[data-film-cover][data-film-exit] {
    opacity: var(--film-cover-alpha, 1);
    pointer-events: none;
  }

  #home #scene[data-state="ready"][data-film-exit] .scroll-canvas,
  #home #scene[data-state="loading"][data-film-exit] .hero-art-anchor {
    opacity: var(--film-outgoing-alpha, 1);
  }

  #home #scene[data-film-exit] .film-macro {
    opacity: var(--film-outgoing-alpha, 1) !important;
    visibility: var(--film-outgoing-visibility, visible) !important;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  #home #scene { padding-bottom: 0; }

  #home #scene[data-state="file"] .hero-art-anchor {
    width: min(74vw, max(160px, calc(100svh - 364px)), 300px);
  }

  .film-chapter {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 6px;
    text-align: center;
  }

  .film-chapter h2 {
    font-size: clamp(20px, 6vw, 27px);
  }

  .film-chapter .film-right {
    grid-column: 1;
    text-align: center;
    font-size: clamp(11px, 3.1vw, 13px);
    line-height: 1.65;
  }

  .film-macro {
    width: auto;
    max-width: none;
    right: 24px;
  }

  .film-macro h2 {
    font-size: clamp(25px, 7vw, 36px);
  }

  .macro-body {
    margin: 6px 0 0;
    font-size: 12px;
  }

  .macro-body br {
    display: none;
  }

  .macro-matte {
    display: block;
    background: linear-gradient(to bottom, black var(--matte-top), transparent calc(var(--matte-top) + 22px));
  }
}

@media (max-width: 760px) and (orientation: landscape) {
  .film-chapter h2 {
    font-size: clamp(18px, 3.4vw, 25px);
  }

  .film-chapter .film-right {
    font-size: 11px;
  }

  .film-macro h2 {
    font-size: clamp(18px, 3.4vw, 25px);
  }

  .macro-body {
    margin: 10px 0;
    font-size: 11px;
  }
}
