/* Screen 3, Dictation. Desktop is drawn at 1440 (--u): a band of the morning's cream holds the
   headline, three stepped lines 30 under the band's top, with the morning's disc resting whole
   beside it (sections/morning.css). The section rises into the morning's foot, up to 275 px,
   so no hole of cream opens between the morning's last line and the headline (about 150 px
   from 1024 up). The lilac rises on rim-a, leaning left: its
   crest stands under the headline, so the headline stands on the hill and the horizon falls
   to the right. The scene's y starts where the lilac does; the spoken card straddles the
   horizon (most of it on the lilac, its high right corner on the cream), the typed card
   stands on the lilac beside him, and the 4x line, its small line and the way on to the
   Dictation page flow under it. The section has no background of its own, so the disc
   paints over nothing. */
/* The band is the canvas's 370 at 1440; narrower, the headline's px type keeps 70 px over the
   rim, so the spoken card's low left corner stays 36 px or more under "finish typing".
   The section rises 275 px into the morning's foot from 1200 up (263 at 1100, 254 at 1024),
   and everything under it follows: the morning's 490 px term always wins, so without the rise
   its foot left about 425 px of cream over the headline at every desktop width. */
.dictation { --band: max(calc(370 * var(--u)), calc(30 * var(--u) + 2.88 * var(--fs-l) + 70px)); margin-top: calc(-1 * min(275px, 132px + 172 * var(--u))); }
.dict-box { position: relative; width: calc(1440 * var(--u)); margin: 0 auto; }
.dict-band { position: relative; height: var(--band); }
.dict-band .dict-box { height: 100%; }
/* The scene's top is the box's top (the lilac's start); the foot flows 410 under it. */
.dict-body .dict-box { padding-top: calc(410 * var(--u)); }
/* The headline's first line: on a window wider than 1440 it joins the page's left line (the
   margin, where the 4x line and the way on stand); at 1440 and narrower it stops at 115, so the
   morning's dial, running off the window's left edge beside it, keeps 57 px or more clear of
   "You'll". "before others" steps in 1.7 em, so its end keeps clear of the resting disc. */
.dict-h { position: absolute; left: max(var(--m), calc(115 * var(--u) - max(0px, (100vw - 1440px) / 2))); top: calc(30 * var(--u)); z-index: 2; font-size: var(--fs-l); line-height: 0.96; letter-spacing: -0.04em; font-weight: 800; white-space: nowrap; color: var(--ink); }
.dict-h .dl { display: block; }
.dict-h .dl-2 { padding-left: 1.7em; }
.dict-h .dl-3 { padding-left: 0.8em; }
.dict-h .stop { margin-left: 0.06em; }
/* 1 px under the rim, so no hairline of cream shows between the two. */
.dict-body { position: relative; margin-top: -1px; background: var(--lilac); }
.dict-scene { position: absolute; left: 0; top: 0; width: 100%; height: calc(420 * var(--u)); }
.dict-art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
/* The phone's drawing holds the typed card there; on a desktop only the card shows, placed in the scene. */
.dict-art-phone { display: contents; }
.art-phone { display: none; }

/* What she says: written in full while she speaks. */
.dict-said {
  position: absolute; z-index: 2; left: calc(560 * var(--u)); top: calc(-152 * var(--u)); width: calc(640 * var(--u));
  padding: calc(30 * var(--u)) calc(40 * var(--u)) calc(26 * var(--u));
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-card); transform: rotate(-3deg);
}
.ds-head { margin-bottom: calc(18 * var(--u)); padding-bottom: calc(12 * var(--u)); border-bottom: 1px solid var(--line); font-size: max(12px, calc(15 * var(--u))); line-height: 1.5; font-weight: 600; color: var(--muted); }
/* Real spaces (for screen readers and copying), set the canvas's way: there each word carries a
   0.26em gap after it, the last on a line too. So the gap between words is 0.26em (the space,
   its letter spacing and this word spacing), and the line keeps 0.26em free at its end: the
   reply breaks as drawn, "Great talking today. I’ve / booked the demo for your team / Tuesday." */
.ds-words { min-height: calc(132 * var(--u)); padding-right: 0.26em; font-size: calc(36 * var(--u)); line-height: 1.22; font-weight: 600; letter-spacing: -0.02em; word-spacing: 0.105em; color: var(--ink); }
.ds-done-row { display: flex; justify-content: flex-end; margin-top: calc(16 * var(--u)); }
.ds-done { display: inline-flex; align-items: center; gap: calc(8 * var(--u)); height: max(28px, calc(34 * var(--u))); padding: 0 calc(14 * var(--u)) 0 calc(12 * var(--u)); border-radius: 999px; background: var(--peach); color: var(--peach-text); font-size: max(13px, calc(15 * var(--u))); font-weight: 700; }
.ds-done svg { width: max(14px, calc(16 * var(--u))); height: auto; fill: none; stroke: var(--ember); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* What he has typed by then: a quarter of it, his caret where he got to. */
.dict-typed {
  position: absolute; z-index: 2; left: calc(840 * var(--u)); top: calc(218 * var(--u)); width: calc(300 * var(--u));
  padding: calc(14 * var(--u)) calc(20 * var(--u)) calc(16 * var(--u));
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; transform: rotate(2.5deg);
}
.dt-head { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: max(11px, calc(12 * var(--u))); line-height: 1.5; font-weight: 600; color: var(--muted); }
.dt-text { min-height: 1.25em; font-size: max(17px, calc(24 * var(--u))); line-height: 1.25; font-weight: 500; letter-spacing: -0.015em; color: var(--plum); white-space: pre; }
.dict-typed .caret { width: 2.5px; height: 0.95em; margin-left: 2px; border-radius: 2px; vertical-align: -0.12em; background: var(--plum); }

/* The 4x line, on the canvas's x 80 (the margin), the small line and the way on. The
   section ends at the link's box: You set the tone's hill begins right under it. */
.dict-foot { position: relative; z-index: 2; padding-left: var(--m); }
.dict-x4 { font-size: clamp(26px, calc(32 * var(--u)), 32px); line-height: 1.2; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; color: var(--ink); }
.x4 { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.3em; height: 1.3em; margin: 0 0.08em; border-radius: 50%; background: var(--orange); color: var(--ink); vertical-align: -0.3em; transform: rotate(-8deg); }
.x4 > span { font-size: 0.6em; letter-spacing: -0.04em; line-height: 1; }
/* Its quake lines show only while it shakes (js/dictation.js). */
.quake { position: absolute; top: 0; width: 0.5em; height: 1.31em; opacity: 0; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.quake.ql { left: -0.6em; }
.quake.qr { right: -0.6em; }
.dict-sub { margin-top: 10px; font-size: 18px; line-height: 1.5; }
.dict-more { margin-top: 2px; }

@media (max-width: 1023.98px) {
  /* The headline on the cream, then a 40 px rim (its crest at the same share of the width),
     and the spoken card pulled up into it: its low left corner just on the lilac, its high
     right corner on the cream. The two of them stand under it, drawn at 390 (up to 1.25x).
     The section follows the morning without rising into it. */
  .dictation { margin-top: 0; }
  .dict-band { height: auto; padding: 32px var(--m) 48px; }
  .dict-band .dict-box { height: auto; }
  .dict-box { width: auto; }
  /* Three lines on any phone: at 11.5vw with these steps "before others" fits the column down to 320 wide. */
  .dict-h { position: relative; left: auto; top: auto; font-size: min(var(--fs-l), 11.5vw); white-space: normal; }
  .dict-h .dl-2 { padding-left: 1.2em; }
  .dict-h .dl-3 { padding-left: 0.5em; }
  .dict-body { padding: 0 var(--m) 48px; }
  .dict-body .dict-box { padding-top: 0; }
  .dict-scene { position: relative; height: auto; }
  .art-desk { display: none; }
  /* Up to 520 wide, so a tablet keeps the phone's lines and its low left corner on the rim. Wider
     than 768 the crest moves on toward the card's right corner, so the card rises a little more,
     keeping that corner on the cream. */
  .dict-said { position: relative; left: auto; top: auto; width: auto; max-width: 520px; margin-top: calc(-24px - max(0px, (100vw - 768px) * 0.03)); padding: 20px 22px 18px; transform: rotate(-2deg); }
  .ds-head { margin-bottom: 12px; padding-bottom: 10px; font-size: 13px; }
  /* The phone's card is not the canvas's: plain spaces, as its corners were set against. */
  .ds-words { min-height: 0; padding-right: 0; font-size: 22px; line-height: 1.24; word-spacing: normal; }
  .ds-done-row { margin-top: 12px; }
  .ds-done { gap: 6px; height: 30px; padding: 0 12px 0 10px; font-size: 14px; }
  .ds-done svg { width: 14px; }
  /* The window's width up to 390 x 1.25, centred under the spoken card; the grounds run on off the window's edges. */
  .dict-art-phone { display: block; position: relative; width: min(100% + 2 * var(--m), 487.5px); margin: 8px 0 0 calc(min(100%, 520px) / 2 - min(100% + 2 * var(--m), 487.5px) / 2); }
  .art-phone { display: block; position: relative; width: 100%; height: auto; }
  .dict-typed { left: auto; right: 16px; top: 20px; width: 168px; padding: 10px 14px 12px; }
  .dt-head { margin-bottom: 6px; padding-bottom: 6px; font-size: 10px; }
  .dt-text { font-size: 16px; }
  .dict-foot { margin-top: 16px; padding-left: 0; }
  .dict-x4 { font-size: 24px; }
  .dict-sub { font-size: 16px; }
}

/* ---------------------------------------------------------------- motion
   js/dictation.js plays the scene once as it comes into view (.is-live): her words wait,
   then each turns on as its word-dot lands; Done follows; he types on at a quarter of her
   pace. His caret blinks while he types (.is-playing until Done, under 3 s), and holds
   still otherwise: before, after, and in the finished frame. */
.dictation.is-live .ds-words .w { opacity: 0; transition: opacity 0.12s ease; }
.dictation.is-live .ds-words .w.on { opacity: 1; }
.dictation.is-live .ds-done { opacity: 0; transition: opacity 0.15s ease; }
.dictation.is-live.is-done .ds-done { opacity: 1; }
.motion .dictation.is-playing:not(.is-done) .dict-typed .caret { animation: dict-blink 1s steps(1) infinite; }
@keyframes dict-blink { 50% { opacity: 0; } }
