/* Chapter 2 · Dictation ("Say it messy. Get what you meant."). Round 2 (Jonathan, 12 Nov): one take, two clear steps,
   big readable text, a short scroll. The copy on the left, one stage on the right: what you said (the messy line, big),
   then what Stash wrote (the clean message, sent in Messages). Mail plays only when you press its button. Holding fn or
   Space is a quiet extra (dict.js). Colours only from tokens.css. */
.dict { position: relative; block-size: 200svh; background: var(--surface); color: var(--ink); }
.dict-stick { position: sticky; inset-block-start: 0; block-size: 100svh; overflow: clip; display: grid; place-items: center; }
.d-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 700px); gap: clamp(32px, 4.5vw, 64px); align-items: center; justify-content: center;
  inline-size: 100%; padding: calc(var(--mb) + 24px) var(--gutter) 24px; }
.d-copy .sec-lead { margin-block-end: 26px; }

/* the quiet extra: fn + the space bar */
.d-keys { display: flex; align-items: center; gap: 8px; }
.d-key { display: grid; align-content: space-between; justify-items: start; block-size: 44px; padding: 6px 9px; border: 0; border-radius: 10px; cursor: pointer;
  font: 500 13px/1 var(--font-text); color: var(--ink); background: var(--surface); touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: 0 0 0 1px rgb(var(--ink-rgb) / .12), 0 5px 12px -7px rgb(var(--shade-rgb) / .35);
  transition: transform .12s var(--soft), box-shadow .12s var(--soft), background-color .2s var(--soft); }
.d-key { inline-size: 52px; font-size: 14px; }
.d-key svg { justify-self: end; inline-size: 12px; block-size: 12px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.d-hint { margin: 0 0 0 8px; font: 400 13px/1.3 var(--font-text); color: var(--ink-2); transition: color .3s var(--soft); }
.d-hint.on { color: var(--ink); }
.d-key:hover { background: var(--surface-hover); }
.d-key:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.d-key.down { transform: translateY(2px); background: var(--sky-fill); box-shadow: 0 0 0 1.5px var(--sky-text); }

/* the stage */
.d-stage { position: relative; block-size: clamp(500px, calc(100svh - var(--mb) - 72px), 600px); border-radius: 24px; background: var(--paper);
  box-shadow: inset 0 0 0 1px rgb(var(--ink-rgb) / .05); overflow: hidden; }

/* what you said: big, plain, word by word */
.d-said { position: absolute; inset: 34px 38px auto; margin: 0; font: 400 31px/1.38 var(--font-serif); letter-spacing: -.01em; color: var(--ink-2); text-wrap: pretty; }
.d-said.long { font-size: 26px; }
.d-said .x { position: relative; transition: color .35s var(--soft); }
.d-said .x::after { content: ""; position: absolute; inset-inline: -2px; inset-block-start: 54%; block-size: 2px; border-radius: 2px; background: var(--coral-deep);
  transform: scaleX(var(--s, 0)); transform-origin: left center; }
.d-said .x.cut { color: var(--ink-3); }
.d-said .w { display: inline-block; white-space: pre; }

/* one quiet line, once the message is sent: what Stash took out */
.d-took { position: absolute; inset-inline-start: 38px; inset-block-start: var(--took-top, 160px); display: flex; align-items: center; gap: 7px; margin: 0;
  font: 500 13px/1.3 var(--font-text); color: var(--ink-2); opacity: 0; }
.d-took svg { inline-size: 14px; block-size: 14px; flex: none; fill: none; stroke: var(--success); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the apps */
.d-app { position: absolute; inset: auto 24px 72px; block-size: 300px; display: grid; grid-template-rows: auto 1fr auto; border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 1px rgb(var(--ink-rgb) / .1), 0 24px 50px -26px rgb(var(--shade-rgb) / .45);
  transition: opacity .45s var(--soft); }
.d-app[data-d-app="mail"] { grid-template-rows: auto auto 1fr; }
.d-app.off { opacity: 0; pointer-events: none; }
.d-app .win-bar { block-size: 38px; }
.d-thread { display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; padding: 14px 16px 10px; min-block-size: 0; }
.d-b { max-inline-size: 82%; margin: 0; padding: 9px 14px; border-radius: 19px; font: 400 17px/1.38 var(--font-text); }
.d-b.in { align-self: flex-start; background: var(--well); border-end-start-radius: 6px; }
.d-b.out { align-self: flex-end; color: var(--surface); background: var(--focus); border-end-end-radius: 6px; }
.d-field { margin: 0 12px 12px; padding: 8px 14px; border-radius: 18px; font: 400 15px/1.35 var(--font-text); box-shadow: inset 0 0 0 1px rgb(var(--ink-rgb) / .16); }
.d-ph { color: var(--ink-2); }
.d-mailhead { padding: 2px 18px; font: 400 13px/1 var(--font-text); color: var(--ink-2); border-block-end: 1px solid rgb(var(--ink-rgb) / .07); }
.d-mailhead p { margin: 0; padding: 9px 0; } .d-mailhead p + p { border-block-start: 1px solid rgb(var(--ink-rgb) / .05); }
.d-mailhead b { font-weight: 500; color: var(--ink); }
.d-mailbody { padding: 14px 20px; font: 400 17px/1.5 var(--font-text); color: var(--ink); min-block-size: 0; }
.d-mailbody p { margin: 0 0 10px; } .d-mailbody ol { margin: 0; padding-inline-start: 24px; }

/* Messages / Mail */
.d-apps { position: absolute; inset: auto 0 18px; display: flex; justify-content: center; gap: 4px; }
.d-apps button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 0; border-radius: 99px; cursor: pointer;
  font: 500 13px/1 var(--font-text); color: var(--ink-2); background: none; transition: background-color .3s var(--soft), color .3s var(--soft), box-shadow .3s var(--soft); }
.d-apps button:hover { color: var(--ink); }
.d-apps button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 0 0 1px rgb(var(--ink-rgb) / .08), 0 2px 6px -2px rgb(var(--shade-rgb) / .2); }
.d-apps button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.d-apps img { inline-size: 16px; block-size: 16px; }

@media (max-width: 860px) {
  .d-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; padding-block-start: calc(var(--mb) + 18px); }
  .d-copy .sec-lead { margin-block-end: 0; font-size: 15px; }
  .d-copy .eyebrow { margin-block-end: 8px; }
  .d-keys { display: none; }
  .d-stage { block-size: clamp(440px, calc(100svh - 290px), 520px); }
  .d-said { inset: 22px 22px auto; font-size: 22px; }
  .d-took { inset-inline-start: 22px; font-size: 12.5px; }
  .d-said.long { font-size: 18.5px; }
  .d-app { inset: auto 12px 62px; block-size: 270px; }
  .d-b, .d-mailbody { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .d-key, .d-app, .d-apps button { transition: none; } }

.d-art { display: block; inline-size: 100%; block-size: auto; margin-block-start: 34px; border-radius: 18px; }
@media (max-width: 1000px), (max-height: 720px) { .d-art { display: none; } }
