/* mossmoth · morph on the pencil line: the question hangs on the line like the contact form; the chain then walks down
   the line word by word, alternating sides, each word as far below the last as its jump in sound was big. */
.sub .first .lead { display: grid; justify-items: end; gap: calc(var(--u) * .5); text-align: right; }
.dek { color: var(--muted); max-width: 16em; }
.notice { grid-column: 2; color: var(--muted); font-size: .85em; max-width: 26em; }
.form .row.note { align-items: start; margin-top: calc(var(--u) * -.6); }
.status { color: var(--muted); min-height: var(--u); text-align: center; padding: 0 var(--right) 0 var(--left); }
.status.bad { color: var(--ink); }
[hidden] { display: none !important; }

/* above the chain: its possible lengths left of the line, play right of it */
.result { padding: 0 var(--right) calc(var(--u) * 2) var(--left); }
.bar { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(2 * var(--gap)); align-items: baseline; margin-bottom: calc(var(--u) * 1.2); }
.caps { justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3em 1em; color: var(--muted); }
.caps button, .play { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
/* attention in order: the form's [create the chain] and the chain's [read aloud] are the large actions; the chain's
   lengths are a quiet second choice */
.caps { font-size: .85em; }
.caps button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .3em; }
.caps button:hover, .play:hover { text-decoration: underline; text-decoration-thickness: max(1px, .065em); text-underline-offset: .22em; }
.play-wrap { color: var(--muted); font-size: 1.2em; }
.result :focus-visible { outline: 2px solid var(--link); outline-offset: .2em; }

/* the chain */
.chain { list-style: none; margin: 0; padding: 0; }
.chain li { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(2 * var(--gap)); cursor: pointer;
  margin-top: calc(var(--u) * (.12 + max(0, var(--jump) - .15) * 4.2)); }
.chain li:first-child { margin-top: 0; }
.chain .say { display: grid; gap: .1em; }
.chain li:nth-child(odd) .say { grid-column: 1; justify-self: end; text-align: right; }
.chain li:nth-child(even) .say { grid-column: 2; justify-self: start; }
.chain .w { font-size: 1.35em; line-height: 1.2; overflow-wrap: anywhere; transition: color .25s cubic-bezier(.22, 1, .36, 1); }
.chain li:first-child .w, .chain li:last-child .w { color: var(--moss); }
.chain li.on .w { color: var(--link); }
.chain .meta { color: var(--muted); font-size: .78em; font-variant-numeric: tabular-nums; }
.chain li:hover .w { text-decoration: underline; text-decoration-thickness: max(1px, .05em); text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }

@media (max-width: 47.99em) {
  .sub .first .lead { justify-items: start; text-align: left; }
  .notice { grid-column: 1; }
  .bar { grid-template-columns: 1fr; row-gap: .6em; padding-left: var(--hang); }
  .caps { justify-self: start; justify-content: flex-start; }
  .bar .play-wrap { order: -1; }                    /* on a phone, reading aloud comes before the lengths */
  .result { padding-left: 0; }
  .chain li { grid-template-columns: 1fr; padding-left: var(--hang); margin-top: calc(var(--u) * .55); }
  .chain li:nth-child(odd) .say, .chain li:nth-child(even) .say { grid-column: 1; justify-self: start; text-align: left; }
  .status { text-align: left; padding-left: var(--hang); }
  /* the thread (pencil.css): each word's distance from the last is a small knot on the line, the word hangs beside it */
  .chain .say { display: flex; align-items: baseline; }
  .chain .meta { order: -1; flex: none; position: relative; z-index: 1; width: calc(-1 * var(--tie) - .45em); margin: 0 .45em 0 var(--tie);
    font-size: .72rem; background: var(--white); box-shadow: 0 0 .25em .15em var(--white); }   /* a small halo: it must not reach the word */
  .notice { font-size: .8rem; }
}
