/* Opening transitions and comfortable measures for the original KIP reader. */
.reader.cinema-score .flow-passage { padding-inline: clamp(1rem, 6vw, 7rem); }
.reader.cinema-score .flow-title {
  min-height: clamp(12rem, 34svh, 27rem);
  padding-block: clamp(2.5rem, 10vh, 6rem) clamp(1.2rem, 4vh, 3.25rem);
  max-width: 91rem;
  margin-inline: auto;
}
.reader.cinema-score .flow-title .kinetic-type {
  max-width: min(100%, 15ch);
  min-width: 0;
  font-size: clamp(2.2rem, 6.9vw, 8.5rem);
  overflow-wrap: anywhere;
  white-space: normal;
}
.reader.cinema-score .flow-title .type-line { max-width: 100%; white-space: normal; }
.reader.cinema-score .flow-content { max-width: 72rem; }
.reader.cinema-score .opening-top .eyebrow { color: #d3d0c9; }
.reader.cinema-score .flow-meta { max-width: 91rem; margin-inline: auto; }
.reader.cinema-score .thought-pause .flow-title {
  min-height: 0;
  padding-block: clamp(2.2rem, 8svh, 6rem) 1.6rem;
}
.reader.cinema-score .thought-pause .flow-content .pause-reading {
  border-top: 1px solid #eeede845;
  max-width: 39rem;
  margin-inline: auto;
}
.reader.cinema-score .thought-pause .flow-content .pause-reading [data-slot="accordion-trigger"] { color: #eeede8; }
.reader.cinema-score.read-mode .thought-pause .flow-content .pause-reading [data-slot="accordion-trigger"] { color: #191818; }
.reader.cinema-score .flow-passage[id] { scroll-margin-block-start: 4.8rem; }
.reader.cinema-score:has(.scene-opening) .book-opening { display: none; }

.reader-rail {
  position: sticky; top: var(--reader-header-height, 4.6rem); z-index: 8;
  display: flex; justify-content: end; gap: 1px; width: max-content; max-width: calc(100% - 1.25rem);
  margin-inline: auto clamp(.625rem, 5vw, 5rem); padding: .3rem 0;
  background: #0c0c0cf2; color: #efede9;
  font-size: .86rem;
}
.reader-rail button, .reader-rail select {
  border: 1px solid #7778; min-height: 2.5rem; background: #131312; color: inherit;
  padding: .35rem .5rem; font: inherit;
}
.reader-rail select { width: min(13.5rem, 53vw); }
.reader-rail button { min-width: 2.5rem; cursor: pointer; }
.reader-rail button:disabled { opacity: .45; cursor: default; }
.reader-rail :focus-visible, .scene-opening :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.scene-opening {
  --scene-red: #ea5351;
  position: relative;
  min-height: 250svh;
  color: #f3efe8;
  background: #11100f;
  isolation: isolate;
}
.scene-sticky {
  top: 0; position: sticky; height: 100svh; min-height: 34rem;
  display: grid;
  grid-template: minmax(0, 1fr) auto auto / minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: .75rem clamp(.8rem, 4vw, 5rem);
  padding: clamp(7.4rem, 17vh, 11rem) clamp(1rem, 6vw, 8rem) 1.7rem;
  background: radial-gradient(ellipse at 78% 45%, #24221f 0%, #181616 38%, #100f0f 73%);
}
.scene-heading { min-width: 0; align-self: center; }
.scene-heading h1 {
  margin: .24em 0 .28em;
  font-size: clamp(2.35rem, 5.4vw, 7.1rem);
  font-weight: 400; max-width: 13ch; letter-spacing: -.071em; line-height: .96;
  text-wrap: balance; animation: scene-title .42s cubic-bezier(.2,.74,.25,1) both;
}
@keyframes scene-title { from { opacity: .35; transform: translateY(.28em); } }
.scene-credit { color: #d2cac0; font-size: .8rem; }
.scene-line { font-size: clamp(.91rem, 1.45vw, 1.2rem); line-height: 1.48; max-width: 37ch; color: #ded6cc; margin: 0; }
.scene-screen { min-width: 0; max-height: 100%; }
.scene-screen svg { display: block; width: 100%; max-height: min(49vh, 34rem); overflow: visible; }
.scene-sequence, .scene-go { grid-column: 1 / -1; display: flex; gap: .5rem 1rem; flex-wrap: wrap; }
.scene-sequence { border-top: 1px solid #eeede847; padding-top: .65rem; }
.scene-sequence button {
  color: #d8cec4; background: transparent; border: 0; border-bottom: 2px solid transparent;
  min-height: 2.5rem; cursor: pointer; font: inherit; font-size: .83rem; padding: .4rem .6rem;
}
.scene-sequence button[aria-current="step"] { color: #fff; border-color: var(--scene-red); }
.scene-go a { color: #f4ebe1; text-underline-offset: .24em; font-size: .9rem; padding-block: .25rem; }
.scene-go a + a { color: #ffa29a; }
.scene-film { transform: translateX(calc(14px - var(--scene-progress,0) * 24px)); transform-origin: center; }
.scene-film-bed { fill: #252320; stroke: #ad9d8d; stroke-width: 1.1; }
.scene-perf { fill: #927f70; opacity: .55; }
.scene-plate { fill: #242626; stroke: #8d8480; }
.scene-ink, .scene-grid-line, .scene-chair-line, .scene-red-line { fill: none; stroke: #aa9a8d; stroke-width: 2; }
.scene-grid-line { stroke-width: 1; opacity: .42; }
.scene-red-line { stroke: var(--scene-red); stroke-width: 3; }
.scene-red-fill { fill: var(--scene-red); }
.scene-profile { fill: #967a68; stroke: #dac1ac; stroke-width: 2; }
.scene-frame-center { opacity: .15; transform: translateY(22px); }
.scene-frame-left, .scene-frame-center, .scene-frame-right, .scene-window, .scene-door, .scene-reflection,
.scene-light, .scene-sentence, .scene-alert-one, .scene-alert-two, .scene-boundary { transition: transform .5s ease, opacity .45s ease, filter .4s ease; }
.scene-cut:not([data-beat="0"]) .scene-frame-center { opacity: 1; transform: translateY(0); }
.scene-cut[data-beat="2"] :is(.scene-frame-left, .scene-frame-right) { opacity: .49; }
.scene-room-wall { fill: #302923; stroke: #716358; }
.scene-floor { fill: #1b191a; }
.scene-window-glass { fill: #465458; stroke: #ac9280; }
.scene-door-face { fill: #40352d; stroke: #a68c79; }
.scene-chair-line { stroke: #d9c5b2; stroke-width: 3; }
.scene-shaft { fill: #d2ac7d; opacity: .23; }
.scene-light { fill: #f59d69; opacity: .12; }
.scene-room[data-beat="1"] .scene-light { opacity: 1; }
.scene-room[data-beat="1"] .scene-window, .scene-room[data-beat="1"] .scene-chair { opacity: .5; }
.scene-reflection { opacity: 0; }
.scene-room[data-beat="2"] .scene-reflection { opacity: .82; }
.scene-room[data-beat="2"] .scene-door { opacity: .5; }
.scene-room .scene-screen svg { transform: scale(calc(1 + var(--scene-progress,0) * .045)); }
.scene-notification { fill: #261b1a; stroke: #cb7c6b; }
.scene-alert-one, .scene-alert-two { opacity: 0; transform: translate(15px,-10px); }
.scene-draft[data-beat="1"] :is(.scene-alert-one, .scene-alert-two) { opacity: 1; transform: none; }
.scene-draft[data-beat="1"] .scene-sentence { opacity: .27; transform: translateY(7px); }
.scene-boundary { opacity: 0; }
.scene-draft[data-beat="2"] .scene-boundary { opacity: 1; }
.scene-transcript { max-width: 60ch; margin: 2.2rem auto; padding-inline: 1rem; }
@media (max-width: 760px), (max-height: 560px) {
  .reader.cinema-score .flow-title { min-height: 0; }
  .scene-sticky {
    overflow: clip;
    display: flex; flex-direction: column; align-items: stretch; justify-content: center;
    height: 100svh; min-height: 36rem; padding: 7rem 5vw .8rem; gap: .7rem;
  }
  .scene-heading { align-self: stretch; }
  .scene-heading h1 { font-size: clamp(2.25rem, 7vw, 3.6rem); max-width: 16ch; }
  .scene-screen svg { max-height: min(29svh, 17rem); }
  .scene-sequence { column-gap: .2rem; }
  .scene-sequence button { font-size: .74rem; padding-inline: .32rem; }
  .scene-go { column-gap: .7rem; }
  .scene-go a { font-size: .8rem; }
  .reader-rail { top: 3.85rem; }
}
@media (max-height: 610px) {
  .scene-sticky { top: min(0px, calc(100svh - 36rem)); }
}
@media (prefers-reduced-motion: reduce) {
  .scene-opening *, .scene-opening *::before { animation: none !important; transition: none !important; }
}
.guide-reader .guide-hero-world {
  max-width: none; min-height: min(78svh, 49rem); grid-template-columns: minmax(0,1fr) minmax(0,.94fr);
  align-items: center; align-content: center; gap: clamp(1rem, 4vw, 4rem);
}
.guide-hero-world h1 { font-size: clamp(2.8rem,6vw,6.8rem); }
.guide-hero-world figure { margin: 0; }
.guide-hero-world svg { display: block; width: 100%; height: auto; }
.guide-hero-world figcaption { margin-top: .55rem; font-size: .78rem; color: #d2c4b9; }
.market-wire { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .2s linear; }
.guide-paper .guide-hero-world figure { display: none; }
.guide-paper .guide-hero-world { min-height: 0; display: block; }
@media (max-width: 760px) {
  .guide-reader .guide-hero-world { grid-template-columns: 1fr; min-height: 0; padding-block: 1.6rem; }
  .guide-hero-world h1 { max-width: 12ch; }
  .guide-hero-world figure { max-width: 32rem; }
}
/* The chapter controls take a row above the opening, so reserve that space. */
.scene-sticky { height: calc(100svh - 3.1rem); }
.scene-heading h1 { color: #f3efe8; }
.scene-opening[data-beat="0"] h1 { animation: none; }
@keyframes scene-title { from { opacity: .84; transform: translateY(.18em); } }
@media (max-height: 610px) {
  .scene-sticky { overflow: visible; }
}
