/* Woordstroom workshop, 15 September 2026.
   The public build and word-time pose light the existing paper. All painted
   fields sit behind the reading tracks; the axle, letters and gauge stay put. */
#zineApp[data-word-press] {
  --wordstream-room-gain: 1;
  --wordstream-floor-dim: 0;
  --wordstream-light-x: 0%;
  --wordstream-light-y: 0%;
  --wordstream-paper-light: calc(.18 + .2 * var(--moment-word-build, 0));
  --wordstream-room-exposure: calc((.62 * var(--moment-word-build, 0) + .26 * var(--moment-word-breath, 0)) * var(--wordstream-room-gain));
  --wordstream-source-exposure: calc((.06 + .16 * var(--moment-word-build, 0) + .1 * var(--moment-word-breath, 0)) * var(--wordstream-room-gain));
  --wordstream-source-pigment: #f4cb9c;
  --wordstream-clamp-inset: 0px;
  --wordstream-clamp-drop: 0px;
  --wordstream-clamp-turn: 0deg;
  --wordstream-guide-drop: 0px;
  --wordstream-platen-drop: 0px;
  --wordstream-guide-pigment: var(--action);
  --wordstream-clamp-pigment: #b36a25;
}
#zineApp[data-word-press][data-moment-active="true"][data-moment-world-state="steady"] {
  --wordstream-floor-dim: calc((.3 * var(--moment-word-build, 0) + .14 * var(--moment-word-breath, 0)) * var(--wordstream-room-gain));
}
/* The set has a light even before Start. A single pigment direction is
   multiplied into the existing stock, so its original fibres stay crisp.
   The warm upper-left corner falls into purple shadow at lower right. */
#zineApp[data-word-press][data-load-state="ready"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: linear-gradient(118deg, #be968c 0%, #79548f 28%, #5f3b78 49%, #3c254d 100%), var(--stock);
  background-size: 100% 100%, 640px;
  background-position: 0 0, 0 0;
  background-blend-mode: multiply;
}

/* Retire the old entering scenery and its screen-edge accents. The same
   optional carrier now paints registered stock across the whole workshop. */
#zineApp[data-word-press] > .moment-world :is(.moment-wing, .moment-cut) {
  display: none;
  animation: none;
}
#zineApp[data-word-press] > .moment-world {
  background: none;
  transition: none;
}
#zineApp[data-word-press] > .moment-world::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* A darker exposure of the same registered set gradually takes over.
     Its alpha follows public pressure; it adds no moving edge or vignette. */
  background-image: linear-gradient(118deg, #674756 0%, #482956 35%, #24162f 100%), var(--stock);
  background-size: 100% 100%, 640px;
  background-position: 0 0, 0 0;
  background-blend-mode: multiply;
  opacity: var(--wordstream-room-exposure);
  transition: opacity 520ms linear;
}
#zineApp[data-word-press] > .moment-world::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* A tighter source stays in the upper-left side of the stage. Lower and
     right-hand stock retains its shadow as the long attempt grows darker. */
  background: var(--wordstream-source-pigment) var(--stock) 0 0 / 640px;
  background-blend-mode: multiply;
  mask-image: radial-gradient(ellipse 55% 75% at var(--wordstream-light-x) var(--wordstream-light-y), #000 0 7%, #0009 29%, transparent 78%);
  opacity: var(--wordstream-source-exposure);
  transition: opacity 520ms linear, background-color 240ms linear;
}

/* A small warm reflection belongs to the stock below its printed words.
   It does not filter, tint or dim the text, fitted word size or time cells. */
html[data-session-release] #zineApp[data-word-press] .wordstream-sheet > .scene-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(124deg, #ffdda6 0%, #fff0c19c 30%, transparent 73%);
  opacity: 0;
  transition: opacity 520ms linear;
}
html[data-session-release] #zineApp[data-word-press][data-moment-world-state="steady"] .wordstream-sheet > .scene-paper::before {
  opacity: var(--wordstream-paper-light);
}

/* A miss holds the outgoing room for 280ms, then returns its ordinary work
   light over 700ms. The director retires decoration at 1050ms; no input waits. */
#zineApp[data-word-press][data-moment-world-state="exiting"] > .moment-world {
  opacity: 0;
  visibility: visible;
  transition: opacity 700ms cubic-bezier(.22, .61, .36, 1) 280ms;
}
html[data-session-release] #zineApp[data-word-press][data-moment-world-state="exiting"] .wordstream-sheet > .scene-paper::before {
  opacity: 0;
  transition: opacity 700ms cubic-bezier(.22, .61, .36, 1) 280ms;
}
#zineApp[data-word-press][data-moment-world-state="off"] > .moment-world,
#zineApp[data-word-press][data-moment-world-state="off"] > .moment-world::before,
#zineApp[data-word-press][data-moment-world-state="off"] > .moment-world::after,
html[data-session-release] #zineApp[data-word-press][data-moment-world-state="off"] .wordstream-sheet > .scene-paper::before {
  transition: none;
}
html[data-session-release] #zineApp[data-word-press][data-moment-active="false"] .wordstream-sheet > .scene-paper::before {
  opacity: 0;
  transition: none;
}

/* The roller mount stays fixed. Its surface and the orange clamp carriers
   take small held poses; the paper, glyphs and lower time rail do not move.
   World urgency retains the stopped pose during a loss, then retires it.
   A real next word or rescue sets urgency to zero immediately. */
html #zineApp[data-word-press][data-press-build="platen"][data-phase] .press-roller-top {
  translate: none;
  rotate: none;
  animation: none;
  transition: none;
}
/* All four direct children form one cut-card frame. The bottom child is
   also the fixed time lip: recolour its stock, never its twenty black cells.
   Strong amber and coral-red are held until the public deadline changes. */
#zineApp[data-word-press][data-press-build="platen"] .press-current > .press-clamp {
  background-color: var(--wordstream-clamp-pigment);
}
#zineApp[data-word-press][data-press-build="platen"] .press-current > :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom) {
  background-color: var(--wordstream-guide-pigment);
}
#zineApp[data-word-press][data-moment-active="true"]:is([data-moment-world-state="steady"], [data-moment-world-state="exiting"])[data-moment-world-urgency="1"] {
  --wordstream-guide-pigment: #e9b54b;
  --wordstream-clamp-pigment: #e5a347;
  --wordstream-source-pigment: #ecc08a;
}
#zineApp[data-word-press][data-moment-active="true"]:is([data-moment-world-state="steady"], [data-moment-world-state="exiting"])[data-moment-world-urgency="2"] {
  --wordstream-guide-pigment: #e56f58;
  --wordstream-clamp-pigment: #cb5d36;
  --wordstream-source-pigment: #e3a08a;
}
@media (prefers-reduced-motion: no-preference) {
  #zineApp[data-word-press][data-moment-active="true"]:is([data-moment-world-state="steady"], [data-moment-world-state="exiting"])[data-moment-world-urgency="1"] {
    --wordstream-clamp-inset: 3px;
    --wordstream-clamp-drop: 1px;
    --wordstream-clamp-turn: 1deg;
    --wordstream-guide-drop: 1px;
  }
  #zineApp[data-word-press][data-moment-active="true"]:is([data-moment-world-state="steady"], [data-moment-world-state="exiting"])[data-moment-world-urgency="2"] {
    --wordstream-clamp-inset: 6px;
    --wordstream-clamp-drop: 2px;
    --wordstream-clamp-turn: 2deg;
    --wordstream-guide-drop: 2px;
    --wordstream-platen-drop: 1px;
  }
  #zineApp[data-word-press] :is(.press-clamp-left, .press-clamp-right) {
    translate: calc(var(--wordstream-clamp-sign, 1) * var(--wordstream-clamp-inset)) var(--wordstream-clamp-drop);
    rotate: calc(var(--wordstream-clamp-sign, 1) * var(--wordstream-clamp-turn));
    transition: translate 120ms steps(2, end), rotate 120ms steps(2, end), background-color 120ms steps(2, end);
  }
  #zineApp[data-word-press] .press-clamp-right { --wordstream-clamp-sign: -1; }
  #zineApp[data-word-press][data-press-build="platen"] .press-current > :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom) {
    transition: background-color 120ms steps(2, end);
  }
  #zineApp[data-word-press][data-press-build="platen"] .press-current > .press-guide-top {
    translate: 0 var(--wordstream-guide-drop);
    transition: translate 120ms steps(2, end), background-color 120ms steps(2, end);
  }
  #zineApp[data-word-press] .press-roller-top > span {
    translate: 0 var(--wordstream-platen-drop);
    transition: translate 120ms steps(2, end);
  }
  /* The controller already supplies these counter-driven cues and removes
     a used cue on the next accepted word. One 640ms light/material release
     shares the cassette's physical action; it never changes the room build. */
  html[data-session-release] #zineApp[data-word-press][data-moment-active="true"][data-phase="running"][data-rewind-cue="used"] .wordstream-sheet > .scene-paper::before {
    animation: wordstream-paper-relief 640ms linear both;
  }
  #zineApp[data-word-press][data-moment-active="true"][data-phase="running"][data-rewind-cue="used"] .press-current > :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom) {
    animation: wordstream-guide-relief 640ms steps(1, end) both;
  }
  /* The room's breath channel releases over 520ms within that same 640ms
     rescue. Its build channel stays earned; the whole frame lands together.
     A miss holds 280ms, then the stock returns with the outgoing room. */
  #zineApp[data-word-press][data-press-build="platen"][data-moment-world-state="exiting"] .press-current > :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom) {
    background-color: var(--action);
    transition: background-color 700ms cubic-bezier(.22, .61, .36, 1) 280ms;
  }
  /* Hidden, replaced or unsupported scenes cancel held mechanical poses
     immediately; returning to play may show only the current public pose. */
  #zineApp[data-word-press][data-moment-active="false"] :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom, .press-clamp-left, .press-clamp-right),
  #zineApp[data-word-press][data-moment-active="false"] .press-roller-top > span,
  #zineApp[data-word-press][data-moment-world-state="off"] :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom, .press-clamp-left, .press-clamp-right),
  #zineApp[data-word-press][data-moment-world-state="off"] .press-roller-top > span {
    animation: none !important;
    transition: none !important;
  }
}
@keyframes wordstream-paper-relief {
  0%, 12.5% { opacity: var(--wordstream-paper-light); }
  25% { opacity: calc(var(--wordstream-paper-light) + .2); }
  50% { opacity: calc(var(--wordstream-paper-light) + .13); }
  87.5%, 100% { opacity: var(--wordstream-paper-light); }
}
@keyframes wordstream-guide-relief {
  0%, 12.5% { background-color: var(--wordstream-guide-pigment); }
  25% { background-color: #f4e6a2; }
  50% { background-color: #eaf78a; }
  87.5%, 100% { background-color: var(--wordstream-guide-pigment); }
}

@media (max-width: 900px), (max-height: 560px) {
  #zineApp[data-word-press] { --wordstream-room-gain: .65; }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  #zineApp[data-word-press] { --wordstream-floor-dim: 0 !important; }
  #zineApp[data-word-press] > .moment-world,
  html[data-session-release] #zineApp[data-word-press] .wordstream-sheet > .scene-paper::before {
    display: none;
    animation: none;
    transition: none;
  }
  #zineApp[data-word-press] :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom, .press-clamp-left, .press-clamp-right),
  #zineApp[data-word-press] .press-roller-top > span {
    animation: none !important;
    transition: none !important;
    translate: none;
    rotate: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* Preserve the deadline meaning as two still pigment states. Reduced
     motion retires the animated world, so read the same live urgency fact. */
  #zineApp[data-word-press][data-moment-active="true"][data-phase="running"][data-moment-urgency="1"] {
    --wordstream-guide-pigment: #e9b54b;
    --wordstream-clamp-pigment: #e5a347;
  }
  #zineApp[data-word-press][data-moment-active="true"][data-phase="running"][data-moment-urgency="2"] {
    --wordstream-guide-pigment: #e56f58;
    --wordstream-clamp-pigment: #cb5d36;
  }
}
@media (forced-colors: active) {
  #zineApp[data-word-press][data-load-state="ready"]::before { display: none; }
  #zineApp[data-word-press][data-press-build="platen"] .press-current > :is(.press-guide-top, .press-guide-left, .press-guide-right, .press-guide-bottom) {
    background: Canvas !important;
    box-shadow: none;
  }
}
