/* The cyan layer is cut away in the coordinates of this sheet of paper. */
[data-page-stock] {
  position: relative;
  isolation: isolate;
  --paper-fiber: url('assets/print-paper.webp');
  background-color: #2b1b19;
  background-image: linear-gradient(124deg, #35251fd4, #211a1ce8 52%, #543124c9), var(--paper-fiber);
  background-size: cover, 17rem auto;
  background-blend-mode: normal, multiply;
}
[data-page-stock][data-burn-ready]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  clip-path: var(--page-burn-mask, inset(0));
  background-color: #173f58;
  background-image: radial-gradient(ellipse at 19% 12%, #42688535, transparent 67%), linear-gradient(124deg, #0f334f77, #142b44aa), var(--paper-fiber);
  background-size: cover, cover, 17rem auto;
  background-blend-mode: screen, normal, multiply;
  box-shadow: inset 0 1px #b7d9f02e;
}
[data-page-stock][data-burn-state='revealed']::before { visibility: hidden; }
[data-page-stock] > .scroll-burn-overlay { z-index: -1; }

:root[data-flame-mode='cold'] { --stock-resting-heat: 0; }
:root[data-flame-mode='hot'] { --stock-resting-heat: 1; }
:root[data-flame-mode] { --stock-heat-share: calc(var(--scroll-heat, var(--stock-resting-heat)) * 100%); }
:root[data-flame-mode] [data-page-stock] {
  --field-cream: color-mix(in srgb, #f0f8ff, #fff4e7 var(--stock-heat-share));
  --field-muted: color-mix(in srgb, #c3d9eb, #c9bfb4 var(--stock-heat-share));
  --field-fire: color-mix(in srgb, #a8d7f0, #ff873d var(--stock-heat-share));
  --field-rule: color-mix(in srgb, #c6e2f14a, #d7b9a834 var(--stock-heat-share));
}
:root[data-flame-mode] :is(.ticket-entry label, .ticket-counter small, .field-reel .reel-lead .reel-label span) {
  color: color-mix(in srgb, #cfebf8, #ffdab6 var(--stock-heat-share));
}
:root[data-flame-mode] .ticket-entry input {
  background: color-mix(in srgb, #e8f4fb, #fff3df var(--stock-heat-share));
  border-color: color-mix(in srgb, #93bad3, #a89379 var(--stock-heat-share));
  color: color-mix(in srgb, #102a40, #221b18 var(--stock-heat-share));
}
:root[data-flame-mode] .ticket-entry input::placeholder { color: color-mix(in srgb, #415e75, #706254 var(--stock-heat-share)); }
:root[data-flame-mode] .ticket-entry input:focus-visible { outline-color: color-mix(in srgb, #c8eeff, #ffc380 var(--stock-heat-share)); }
.cinema-ticket output { z-index: 4; }
:root[data-flame-mode] .cinema-ticket output { color: color-mix(in srgb, #153853, #746244 var(--stock-heat-share)); }
:root[data-flame-mode] [data-personalized] .cinema-ticket output {
  color: color-mix(in srgb, #153853, #132c43 var(--stock-heat-share));
}

.opening-furnace {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 49%, #0b142244, #01050beb 85%), linear-gradient(#082038bb, #05090fcf), url('assets/torch-skyline.webp') 48% 58% / cover no-repeat;
}
.opening-coals { background: radial-gradient(ellipse at 53% 50%, #c6561933, transparent 56%); }
.opening-flight[data-profile] {
  width: clamp(9.7rem, 41vw, 18.75rem);
  height: auto;
  aspect-ratio: var(--flight-ratio, 2.6);
}
.opening-flight[data-profile] img { filter: none; }
.opening-flight .flight-plasma { width: 100%; height: 100%; visibility: hidden; filter: none; }
.opening-flight[data-plasma] .flight-plasma { visibility: visible; }
.opening-flight[data-plasma] img { visibility: hidden; }
.opening-sparks { position: absolute; z-index: 3; width: 100%; height: 100%; inset: 0; mix-blend-mode: screen; pointer-events: none; }
.opening-flight { z-index: 4; }

/* Picture, gutter and caption form one registered print under the cyan proof. */
.torch-sequence { gap: clamp(.68rem, 1.35vw, 1.2rem); max-width: 78rem; }
.torch-sequence .torch-sheet {
  background-image: var(--paper-fiber);
  background-blend-mode: multiply;
  background-size: 15rem;
}
.torch-sequence .torch-copy { padding: clamp(.78rem, 1.8vw, 1.35rem); }
.torch-sequence .torch-copy h3 { font-size: clamp(1.69rem, 4.2vw, 3.45rem); }
.torch-sequence .torch-copy p { max-width: 46ch; }
.torch-sequence .torch-chapters { margin-bottom: .4rem; }
.story-playback-slot { display: inline-flex; }
.story-playback {
  align-self: center;
  min-height: 44px;
  padding: .38rem .9rem;
  border: 1px solid #ffbf8896;
  border-radius: 2rem;
  background: #30251e;
  color: #ffcd9f;
  font: 700 .95rem/1 var(--print-face);
}
.story-playback[data-playing] {
  position: fixed;
  right: max(1rem,env(safe-area-inset-right));
  bottom: max(1rem,env(safe-area-inset-bottom));
  z-index: 8;
  background: #272018;
  box-shadow: 0 3px 14px #0c121178;
}
.torch-panel .torch-sheet.scroll-burn-cold { background-blend-mode: luminosity; }
@media (min-width: 765px) {
  .torch-sequence { grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr); }
  .torch-chapters, #torch-family { grid-column: 1 / -1; }
  #torch-sequence .torch-sheet { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100%; }
  #torch-sequence .torch-picture { grid-column: auto; grid-row: auto; }
  #torch-sequence .torch-copy { grid-column: auto; grid-row: auto; display: block; border: 0; }
  #torch-flame .torch-picture, #torch-uncle .torch-picture { height: clamp(12rem, 23vw, 18.3rem); aspect-ratio: auto; }
  #torch-family .torch-sheet { display: grid; grid-template: 'splash' 1fr / 1fr; }
  #torch-family .torch-picture, #torch-family .torch-copy { grid-area: splash; }
  #torch-family .torch-picture { height: clamp(17.4rem, 37vw, 30.5rem); aspect-ratio: auto; }
  #torch-family .torch-picture img { object-position: center 46%; }
  #torch-family .torch-copy {
    z-index: 1;
    align-self: end;
    justify-self: start;
    width: min(31%, 22rem);
    padding: clamp(.85rem, 1.7vw, 1.5rem);
    background: var(--sheet) var(--paper-fiber);
    background-size: 15rem;
    background-blend-mode: multiply;
    border-top: 1px solid var(--sheet-border);
    border-right: 1px solid var(--sheet-border);
    border-top-right-radius: .22rem;
  }
  #torch-family .torch-copy h3 { font-size: clamp(1.85rem, 3.35vw, 3.22rem); }
  #torch-family .torch-copy p { font-size: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-flame-mode]) [data-page-stock]::before { display: none; }
}
