/* A scroll-told story as one long sheet (js/plates.js): no pinned drawing, no slot the words pass through. Each step is
   a paragraph and its own drawing, in the page, and the page is the only thing that moves. Loaded after the story's
   own stylesheet; a story section opts in with class "plated". */

/* the pinned sheet the drawings are built on is kept in the page but takes no room and is not seen (its drawings are
   moved out one by one; what a scene keeps there, a gradient, a clip path, still resolves) */
html .story.plated { display: block; position: relative; width: min(1040px, calc(100% - 40px)); margin: 0 auto; }
html .story.plated > .stage, html .story.plated .stage.emptied { position: absolute; left: 0; top: 0; width: 600px; max-width: 100%; height: 0; padding: 0; overflow: hidden; visibility: hidden; pointer-events: none; background: none; z-index: auto; }
html .story.plated .stage::before { content: none; }
html .story.plated .stage > svg { width: 600px; max-width: 100%; }

/* a wide screen: the words on the left, their drawing beside them, one pair after another down the sheet */
html .story.plated .steps { display: block; padding: clamp(3rem, 9vh, 6rem) 0 clamp(3rem, 10vh, 7rem); position: static; pointer-events: auto; z-index: auto; }
html .story.plated .step { display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr); column-gap: clamp(2rem, 6vw, 5rem); align-items: center;
  min-height: 0; max-width: none; padding: 0; margin: 0 0 clamp(5rem, 16vh, 10rem); opacity: 1; transition: none; }
html .story.plated .step:last-child { margin-bottom: 0; }
html .story.plated .step > .say { max-width: 30rem; }
html .story.plated .step > .say > :last-child { margin-bottom: 0; }
html .story.plated .step.wordsonly { display: block; }
.story.plated .plate { min-width: 0; -webkit-tap-highlight-color: transparent; }
.story.plated .plate > svg { display: block; width: 100%; height: auto; overflow: visible; }
/* the words are read at a column's width now, not from across a pinned drawing: a size for reading */
@media (min-width: 701px) {
  html .story.plated .step p { font-size: clamp(1.3rem, 2.05vw, 1.72rem); line-height: 1.34; }
  html .story.plated .step p.small { font-size: clamp(1rem, 1.45vw, 1.15rem); line-height: 1.45; }
  html .story.plated .step p.src { font-size: 0.8rem; }
  /* the afterword's steps are whole paragraphs of the chapter: set as text to read, not as a line to a drawing */
  html .told .story.plated .step p { font-size: clamp(1.12rem, 1.5vw, 1.32rem); line-height: 1.5; }
  .detour.tall .dt-map .lab { font-size: 13px; }
  .detour.tall .dt-map .lab .who { font-size: 16px; }
}

/* the pencil's weight: a drawing is made 600 units wide and shown narrower, so each line's own width (--w, copied from
   its stroke-width by plates.js) is multiplied back up by --pen to what it weighs on a desk */
.psvg [stroke-width] { stroke-width: calc(var(--w) * var(--pen, 1) * 1px); }
.idea .psvg .lvl path.hand { stroke-width: calc(var(--sw, 1.7) * var(--pen, 1) * 1px); }
.idea .psvg .lvl path.hand.tip { stroke-width: calc(var(--sw, 1.7) * var(--pen, 1) * 0.5px); }
.idea .psvg .lvl path.hand.soft { stroke-width: calc(var(--sw, 1.7) * var(--pen, 1) * 0.6px); }

/* Pure-SVG Fine pencil finish for plated story drawings: muted graphite/colored-pencil hues, 7-stop userSpaceOnUse
   pressure gradients (Sketch.pencilize), 2D cotton-paper tooth mask, and light-mode multiply blending into parchment */
:is(#story, #story2, .story) .psvg[data-sp] { --p-ink: #303038; --p-acc: #2443a3; --p-warm: #a84824; }
.dark :is(#story, #story2, .story) .psvg[data-sp] { --p-ink: #caccd4; --p-acc: #8aa8ee; --p-warm: #e08a5e; }
html:not(.dark) .story.plated .plate > svg.psvg[data-sp] { mix-blend-mode: multiply; }
html:not(.dark) :is(#story, #story2, .story) .psvg[data-sp] text.halo { stroke: none; }
.psvg[data-sp] .pp-ink { stop-color: var(--p-ink); }
.psvg[data-sp] .pp-acc { stop-color: var(--p-acc); }
.psvg[data-sp] .pp-warm { stop-color: var(--p-warm); }
:is(#story, #story2, .story) .psvg[data-sp] text.acc { fill: var(--p-acc); }
:is(#story, #story2, .story) .psvg[data-sp] text.warmt { fill: var(--p-warm); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil[data-pg="0"] { stroke: var(--pg-ink-0); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil[data-pg="1"] { stroke: var(--pg-ink-1); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil[data-pg="2"] { stroke: var(--pg-ink-2); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil[data-pg="3"] { stroke: var(--pg-ink-3); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.accent[data-pg="0"] { stroke: var(--pg-acc-0); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.accent[data-pg="1"] { stroke: var(--pg-acc-1); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.accent[data-pg="2"] { stroke: var(--pg-acc-2); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.accent[data-pg="3"] { stroke: var(--pg-acc-3); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.warm[data-pg="0"] { stroke: var(--pg-warm-0); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.warm[data-pg="1"] { stroke: var(--pg-warm-1); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.warm[data-pg="2"] { stroke: var(--pg-warm-2); }
:is(#story, #story2, .story) .psvg[data-sp] .pencil.warm[data-pg="3"] { stroke: var(--pg-warm-3); }
:is(#story, #story2, .story) .psvg[data-sp] :is(.fillink, .bead)[data-pg="0"] { fill: var(--pg-ink-0); }
:is(#story, #story2, .story) .psvg[data-sp] :is(.fillink, .bead)[data-pg="1"] { fill: var(--pg-ink-1); }
:is(#story, #story2, .story) .psvg[data-sp] :is(.fillink, .bead)[data-pg="2"] { fill: var(--pg-ink-2); }
:is(#story, #story2, .story) .psvg[data-sp] :is(.fillink, .bead)[data-pg="3"] { fill: var(--pg-ink-3); }
:is(#story, #story2, .story) .psvg[data-sp] .fillacc[data-pg="0"] { fill: var(--pg-acc-0); }
:is(#story, #story2, .story) .psvg[data-sp] .fillacc[data-pg="1"] { fill: var(--pg-acc-1); }
:is(#story, #story2, .story) .psvg[data-sp] .fillacc[data-pg="2"] { fill: var(--pg-acc-2); }
:is(#story, #story2, .story) .psvg[data-sp] .fillacc[data-pg="3"] { fill: var(--pg-acc-3); }
:is(#story, #story2, .story) .psvg[data-sp] .fillwarm[data-pg="0"] { fill: var(--pg-warm-0); }
:is(#story, #story2, .story) .psvg[data-sp] .fillwarm[data-pg="1"] { fill: var(--pg-warm-1); }
:is(#story, #story2, .story) .psvg[data-sp] .fillwarm[data-pg="2"] { fill: var(--pg-warm-2); }
:is(#story, #story2, .story) .psvg[data-sp] .fillwarm[data-pg="3"] { fill: var(--pg-warm-3); }

/* a narrow screen: the words, then their drawing under them, the full width of the column */
@media (max-width: 700px) {
  html .story.plated .steps { padding: 2.5rem 0 4rem; }
  html .story.plated .step { display: block; margin-bottom: 5rem; }
  html .story.plated .step > .say { max-width: none; }
  html .story.plated .step > .plate { margin: 1.2rem -6px 0; }
  html .story.plated .step p { padding: 0; }
}
/* a foldable half open like a book: the words on the left page, the drawing on the right, either side of the hinge */
html.fold-book .story.plated { width: 100%; }
html.fold-book .story.plated .step { display: grid; grid-template-columns: var(--page-l) var(--page-r); column-gap: var(--hinge-w); }
html.fold-book .story.plated .step > .say { padding: 0 28px; }
html.fold-book .story.plated .step > .plate { padding: 0 24px; margin-top: 0; }

/* ---------------------------------------------------------------- the detour map as part of the sheet (detour.js):
   its paragraphs in the page one after another, and the map one tall drawing lying under them, the band and the lines
   beside it showing in the stretch of paper left under each paragraph */
.detour.js.tall { height: auto; }
.detour.tall .dt-sticky { position: relative; top: auto; height: auto; display: block; width: min(40rem, 100%); padding: 3rem 20px 2rem; box-sizing: border-box; }
.detour.tall .dt-map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; flex: none; pointer-events: none; }
.detour.tall .dt-caps { display: block; position: relative; max-width: none; padding: 0; }
.detour.tall .dt-cap { opacity: 1; transform: none; transition: none; font-size: clamp(1.08rem, 1.9vw, 1.4rem); line-height: 1.36; }
.detour.tall .dt-strip { margin: 0.7rem 0 1rem; }
@media (max-width: 700px) {
  .detour.tall .dt-map .lab { font-size: 11px; }
  .detour.tall .dt-map .lab .who { font-size: 13px; }
}
.detour.tall .dt-map .bandname { font-size: 18px; }

/* ---------------------------------------------------------------- the afterword on the sheet: its title and notes keep
   the column, the paragraphs and their drawings go down the page in pairs */
html .told .story.plated .toldbody { padding: 0; }
html .told .story.plated .toldbody .steps { padding: clamp(2.5rem, 7vh, 5rem) 0 clamp(3rem, 8vh, 6rem); }
html .told .story.plated .step.wordsonly { margin-bottom: clamp(2rem, 5vh, 3.2rem); }
html .told .story.plated .step.wordsonly > .say { max-width: 36rem; }
