.experience {
  --album-lyrics-row: 58px;
  --scene-portrait-size: clamp(52px, 10vw, 100px);
  --scene-photo-height: clamp(240px, calc(100svh - 289px - var(--album-lyrics-row) - var(--reading-bottom-clearance)), 596px);
}

.experience .reading-page:has(.scene-frame:not([hidden])) {
  align-content: start;
  overflow-anchor: none;
}

.book-sheet .scene-frame:has(.scene-visual:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  inline-size: min(100%, 980px);
}

.book-sheet .scene-frame:has(.scene-visual:not([hidden]) + .scene-story > .scene-portrait:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) var(--scene-portrait-size);
  column-gap: clamp(6px, 1vw, 14px);
}

.scene-visual:not([hidden]) + .scene-story {
  align-self: center;
}

.scene-visual {
  position: relative;
  display: grid;
  min-inline-size: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--scene-photo-height) var(--album-lyrics-row);
  row-gap: 4px;
}

.scene-story:not(:has(> :not([hidden]))) {
  display: none;
}

.scene-photo-mat {
  --scene-picture-height: calc(var(--scene-photo-height) - 2px);
  position: relative;
  grid-area: 1 / 1;
  display: grid;
  min-inline-size: 0;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid #706355;
  border-radius: 3px;
  background: var(--photo-mat, #101923);
}

.scene-picture {
  position: relative;
  display: grid;
  place-items: center;
  min-inline-size: 0;
  min-block-size: 0;
  overflow: hidden;
}

.experience .book-sheet .scene-picture > .scene-art {
  grid-area: 1 / 1;
  z-index: 1;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
}

.experience .book-sheet .scene-visual .scene-art .scene-image {
  display: block;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: var(--scene-picture-height);
  object-fit: contain;
}

.book-sheet .scene-picture > .scene-content {
  position: absolute;
  z-index: 3;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  max-inline-size: calc(100% - 16px);
  margin: 0;
  padding: 0;
  pointer-events: none;
}

#scene-pencil-reveal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.scene-art[data-pencil-reveal] {
  background-color: #faf8f3;
}

.scene-art[data-pencil-reveal] > .scene-image {
  visibility: hidden;
}

.experience .book-sheet .scene-picture > .scene-art[data-photo-pair] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(3px, .6vw, 8px);
  inline-size: 100%;
  block-size: var(--scene-picture-height);
}

.experience .book-sheet .scene-visual .scene-art[data-photo-pair] > :is(#scene-pair-previous, .scene-image) {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: 0;
  min-block-size: 0;
  max-block-size: 100%;
  object-fit: contain;
}

.book-sheet .scene-frame .scene-picture .scene-meta {
  margin: 0;
  padding: 0 6px;
  font-size: .76rem;
  font-weight: 650;
  line-height: 1.25;
}

.experience .book-sheet .scene-picture > .scene-art[data-storefront-clip] {
  inline-size: 100%;
  block-size: var(--scene-picture-height);
}
#experience .book-sheet .scene-picture > .scene-art[data-storefront-clip] > #scene-image,
.beat-cut-outgoing > .scene-art[data-storefront-clip] > canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  max-block-size: none;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.scene-art:has(:is(#storefront-film, #storefront-still-film):not([hidden])) > .scene-image {
  visibility: hidden;
}
:is(#storefront-film, #storefront-still-film):not([hidden]) {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  pointer-events: none;
}

.scene-visual > .album-lyrics-slot,
.closing-photos-frame > .album-lyrics-slot {
  min-inline-size: 0;
  grid-area: 2 / 1;
}

#scene-text-lyrics-slot,
#journal-lyrics-slot {
  block-size: var(--album-lyrics-row);
  flex: 0 0 auto;
  margin-block-start: 4px;
}

.closing-photos-frame {
  position: relative;
  min-block-size: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--album-lyrics-row);
  row-gap: 4px;
}

.closing-photos-frame > img {
  inline-size: 100%;
  block-size: 100%;
  place-self: stretch;
  background: var(--photo-mat, #17222d);
  object-fit: contain;
}

@media (orientation: landscape) and (min-width: 511px) {
  .book-sheet .scene-frame:has(.scene-visual:not([hidden])) {
    inline-size: 100%;
  }
}

@media (orientation: landscape) and (min-width: 511px) and (min-height: 551px) {
  .experience .reading-page:has(.scene-frame:not([hidden])) {
    --scene-photo-height: clamp(245px, calc(100dvh - var(--reading-header-height) - 46px - var(--album-lyrics-row) - var(--reading-bottom-clearance)), 784px);
    padding-block: 4px 2px;
  }

  .reading-book:has(.scene-frame:not([hidden])) {
    inline-size: min(calc(100% - 26px), 1330px);
  }
}

@media (orientation: landscape) and (max-height: 550px) {
  .experience {
    --album-lyrics-row: 54px;
    --scene-photo-height: max(116px, calc(100dvh - var(--reading-header-height) - 26px - var(--album-lyrics-row) - var(--reading-bottom-clearance)));
  }

  .experience .reading-page:has(.scene-frame:not([hidden])) {
    padding-block: 2px 0;
  }

  .reading-book:has(.scene-frame:not([hidden])) {
    inline-size: min(calc(100% - 12px), 1180px);
  }

  .book-sheet:has(.scene-frame:not([hidden])) {
    padding: 2px clamp(8px, .9vw, 14px) 1px;
  }
}

@media (orientation: portrait) and (max-width: 560px) {
  .experience {
    --scene-photo-space: clamp(235px, calc(100svh - 84px - var(--reading-bottom-clearance) - env(safe-area-inset-top, 0px)), 690px);
    --scene-photo-height: min(58svh, max(195px, calc(var(--scene-photo-space) - 117px - var(--album-lyrics-row))));
  }
}

.experience-head:not(:has(#contents-button)) .music-lp-button {
  grid-column: -2;
}

#scene-meta #contents-button {
  position: relative;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: auto;
}

#scene-meta #contents-button::after { display: none; }
#scene-meta #contents-button::before {
  content: "";
  position: absolute;
  inset: -6px -8px;
}

