/* The page's end, where the writer writes on, and what Cue offers there (appWindow/cueLine.js), as the app
   draws it. An offer stands only where the writer has stopped: while the hand writes, only what the writer wrote,
   took or pinned is on the page. Sizes are the app's own, with the page's 16 px for its 17. */

.writing { display: none; }
:is([data-state^="cue"], [data-state="project-start"], [data-state^="plan"], [data-state^="ending"]) .writing { display: block; }
.writing p { margin: .6em 0 0; }
.writing > :not(.line), .writing .answer { display: none; }
/* The cursor takes no room, so no word moves when it does. */
.writing .caret { position: relative; width: 0; margin: 0; background: none; visibility: hidden; }
.writing .caret::before { content: ""; position: absolute; left: -1px; top: 0; width: 2px; height: 20px; background: var(--whisper); }
:is([data-state="cue-start"]:not([data-moving="camera"]), [data-state="cue-1"]) .writing .caret.here,
:is([data-state="cue-1-taken"], [data-state="cue-2"]) .writing .caret.after,
:is([data-state="cue-2-pinned"], [data-state="cue-2-answered"], [data-state="cue-2-free"], [data-state="cue-3"], [data-state="cue-3-lit"]) .answer .caret,
[data-state="cue-3-taken"][data-moving=""] .taken .caret { visibility: visible; }

/* ---- the key chip ---- */
.writing kbd { margin-left: 8px; padding: 1px 6px; font-size: .72em; line-height: 1.4; vertical-align: baseline; }
.writing .line kbd { display: none; }
[data-state="cue-1"] .writing .line kbd { display: inline-block; }
.ask kbd svg { display: inline-block; width: 1.15em; height: 1.15em; margin-right: 4px; vertical-align: -.2em; }

/* ---- a sentence: the writer's next words at the cursor, and ink once taken ---- */
/* The first line keeps the room of its whole sentence, so the hand that writes it moves nothing. */
.unwritten { visibility: hidden; }
[data-state="cue-start"] .next { visibility: hidden; }
[data-state="cue-1"] .next { color: var(--faint); font-style: italic; }

/* ---- beside the text: a question, and directions, under the paragraph they belong to and tied to it by a small corner ---- */
.writing :is(.ways, .ask) { position: relative; padding-left: 18px; font: 15px/1.45 var(--face-serif); color: var(--muted); }
.writing :is(.ways, .ask)::before { content: ""; position: absolute; left: 2px; top: -4px; width: 12px; height: 14px; border-left: 1px solid var(--faint); border-bottom: 1px solid var(--faint); border-bottom-left-radius: 4px; }
:is([data-state="cue-2"], [data-state="cue-2-pinned"], [data-state="cue-2-answered"]) .ask, :is([data-state="cue-3"], [data-state="cue-3-lit"]) .ways { display: block; }
/* Pinned, the pin alone stands after it, in the strongest ink, as the app's button to unpin it. */
.unpin { display: none; width: 1.45em; height: 1.45em; margin-left: 4px; align-items: center; justify-content: center; vertical-align: top; color: var(--ink-strong); }
:is([data-state="cue-2-pinned"], [data-state="cue-2-answered"]) .ask kbd { display: none; }
:is([data-state="cue-2-pinned"], [data-state="cue-2-answered"]) .unpin { display: inline-flex; }
/* The answer is the writer's, written on the same line. */
:is([data-state="cue-2-pinned"], [data-state="cue-2-answered"], [data-state="cue-2-free"], [data-state^="cue-3"], [data-state="project-start"], [data-state^="plan"], [data-state^="ending"]) .writing .answer { display: inline; }

/* ---- directions: with none lit Tab lights the first; lit, Enter chooses it ---- */
[data-state="cue-3-lit"] .way.first { border-radius: 4px; background: var(--hairline); color: var(--ink); }
.choose, [data-state="cue-3-lit"] .light { display: none; }
[data-state="cue-3-lit"] .choose { display: inline; }
/* In the app the lines come faint, a sentence to a Tab; here they stand in the writer's own ink as they are taken. */
:is([data-state="cue-3-taken"], [data-state="project-start"], [data-state^="plan"], [data-state^="ending"]) .taken { display: block; }
.taken h5 { font-size: 17px; }
.taken p { margin-top: .35em; }

/* ---- what is offered is there at the stop, and gone while the hand writes and the camera moves ---- */
.writing :is(.next, kbd, .ways, .ask) { transition: opacity var(--duration) linear; }
[data-state="cue-1"]:is([data-moving="write"], [data-moving="camera"]) .writing :is(.next, kbd),
[data-state^="cue"][data-moving="camera"] .writing :is(.ways, .ask) { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .writing :is(.next, kbd, .ways, .ask) { transition: none; } }
