/* Screen 1, the hero. The frame is 1440 x 700 under the nav and --u is one design px of
   it, as on the home page's hero, so the headline, the drawing and the copy scale
   together; the phone frame is drawn at 390. The window is drawn at 480 x 290 and --wu is
   one px of that drawing wherever the window stands. */
.dh { container: dh / inline-size; }
/* The frame is at least the drawing's height; it grows with the words, if a reader's own
   spacing makes them taller, so nothing runs into the next screen. */
.dh-frame { --u: min(1px, calc(100cqw / 1440)); --s: var(--u); position: relative; width: calc(1440 * var(--u)); min-height: calc(700 * var(--u)); margin: 0 auto; }
.dh-scene { position: absolute; inset: 0; z-index: 1; }
.dh-art { position: absolute; left: 0; top: 0; width: 100%; height: auto; overflow: visible; pointer-events: none; }
.dh-art-phone { display: none; }

/* The words, in one column on the logo's left line: the label, the headline, then the line
   and the download, in flow, so whatever grows (a reader's own spacing) pushes what is under
   it down instead of running over it. The headline's top is 34 of the frame, the label's
   line (1.2 of its size, base.css) over it. The drawing lies under the column. */
.dh-text { position: relative; z-index: 2; padding: calc(12 * var(--u)) 0 0 calc(80 * var(--u)); }
.dh-label { margin-left: calc(4 * var(--u)); }
.dh-h1 { margin-top: max(0px, calc(22 * var(--u) - 1.2 * var(--fs-label))); font-size: calc(150 * var(--u)); line-height: 0.95; font-weight: 800; letter-spacing: -0.045em; white-space: nowrap; }
.dh-h1 .line { display: block; }
/* The full stop: the home hero's (0.2 em, 0.08 em off its word). The travelling dot starts here. */
.dh-h1 .station { margin-left: 0.08em; }

/* The copy keeps the design's sizes from 1200 up; narrower, it stops shrinking at a readable size. */
/* 55 under the headline, so at 374 of the frame. */
.dh-copy { width: calc(560 * var(--u)); margin-top: calc(55 * var(--u)); }
.dh-mid { font-size: max(20px, calc(36 * var(--u))); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.dh-mid span { display: block; }
.dh-cta { display: flex; flex-wrap: wrap; align-items: center; gap: calc(14 * var(--u)) calc(24 * var(--u)); margin-top: calc(32 * var(--u)); }
.dh-cta .btn { height: max(44px, calc(58 * var(--u))); padding: 0 max(22px, calc(32 * var(--u))); font-size: max(15px, calc(18 * var(--u))); }

/* The window: lilac, an empty strip at its top, the other side's message, and the field. */
.dh-win {
  --wu: calc(var(--w) * var(--s) / 480);
  position: absolute; left: calc(var(--x) * var(--s)); top: calc(var(--y) * var(--s));
  width: calc(480 * var(--wu)); height: calc(290 * var(--wu)); border-radius: calc(26 * var(--wu)); background: var(--lilac);
}
.dh-msg { position: absolute; left: calc(24 * var(--wu)); top: calc(52 * var(--wu)); width: calc(300 * var(--wu)); height: calc(64 * var(--wu)); }
/* The field: where the cursor is, so where the words land. Its line keeps two balanced rows. */
.dh-field {
  position: absolute; left: calc(24 * var(--wu)); right: calc(24 * var(--wu)); top: calc(134 * var(--wu)); bottom: calc(24 * var(--wu));
  padding: calc(18 * var(--wu)) calc(22 * var(--wu)); border: 2px solid var(--ink); border-radius: calc(16 * var(--wu)); background: var(--paper);
  font-size: max(15px, calc(30 * var(--wu))); line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); text-wrap: balance;
}
/* The caret is ink, as the app's cursor is drawn: the one after the line, and the one
   waiting at the field's start before anything is said (motion only). */
.dh-field .caret { width: max(2px, calc(3 * var(--wu))); margin-left: 0.08em; border-radius: 2px; background: var(--ink); }
.dh-caret0 { display: none; position: absolute; left: calc(22 * var(--wu)); top: calc(18 * var(--wu) + 0.125em); width: max(2px, calc(3 * var(--wu))); height: 1.05em; border-radius: 2px; background: var(--ink); }

@media (max-width: 1023.98px) {
  /* The phone: the window over the copy, the character cut by the left edge and facing
     it, everything to the download above the fold at 390 x 844. Up to 1.25x on wider. */
  .dh-frame { --u: min(1.25px, calc(100cqw / 390)); width: calc(390 * var(--u)); min-height: calc(600 * var(--u)); }
  .dh-art-desk { display: none; }
  .dh-art-phone { display: block; }
  .dh-text { padding: calc(14 * var(--u)) 0 0 calc(20 * var(--u)); }
  .dh-label { margin-left: 0; }
  .dh-h1 { font-size: calc(52 * var(--u)); }
  /* Under the window and the ground, at 420 of the frame. */
  .dh-copy { width: calc(350 * var(--u)); margin-top: calc(285.2 * var(--u)); }
  .dh-mid { font-size: calc(22 * var(--u)); }
  .dh-cta { flex-direction: column; align-items: stretch; gap: calc(12 * var(--u)); margin-top: calc(22 * var(--u)); }
  .dh-win { --wu: calc(var(--pw) * var(--s) / 480); left: calc(var(--px) * var(--s)); top: calc(var(--py) * var(--s)); }
  .dh-field { border-width: 1.5px; }
}

/* ---------------------------------------------------------------- motion
   js/pages/dictation/hero.js plays the said line twice: the field starts empty (its words
   wait, motion.css) with the caret at its start; when the line is written (.is-done) the
   caret after it blinks a few times, then holds. */
.motion .dh-field.is-waiting:not(.has-words) .dh-caret0 { display: block; animation: dh-blink 1.06s steps(1) infinite; }
.motion .dh-field.is-done .caret { opacity: 1; animation: dh-blink 1.06s steps(1) 4; }
@keyframes dh-blink { 50% { opacity: 0; } }
