/* The Dictation page: what more than one of its screens draws with. Each screen's own
   rules (desktop, then its phone block, then its motion) are in this folder, one file each.
   Scenes are drawn in design px (1440 wide on desktop, the 350 column on the phone) and
   scale by --s; type keeps the site's steps (tokens.css). */

/* --s: one design px of a stage. Desktop draws at 1440, so it is --u.
   --dot: the travelling dot at full size, the hero's full stop (0.2 em of its 150 px
   headline at 1440); on the phone, the Notes page's (0.2 em of 64 px at 390, up to 1.25x),
   so a press's socket is one size on both pages. */
.dict-screen { --s: var(--u); --dot: calc(30 * var(--u)); }

/* ---------------------------------------------------------------- each screen's words */
/* The big thing is the title (.d-l); the mid line is the site's second voice, as the home
   page's screens draw it; the small lines are body type in Plum. */
.dict-mid { margin-top: calc(26 * var(--u)); font-size: var(--fs-how); line-height: 1.3; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; }
.dict-small { font-size: var(--fs-body); line-height: 1.5; color: var(--plum); text-wrap: pretty; }

/* ---------------------------------------------------------------- stages
   A scene: its drawing (one SVG for desktop, one for the phone) and, laid over it, what
   has words in it (keys, cards) and its stations, each placed by --x and --y in design px
   (on the phone, --px and --py). A stage centres itself on its screen. */
.stage { position: relative; width: calc(var(--sw) * var(--s)); height: calc(var(--sh) * var(--s)); margin: 0 auto; }
.stage > svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.stage > .art-phone { display: none; }
/* A point: where a voice leaves a face, read by the screen's script. */
.at { position: absolute; left: calc(var(--x) * var(--s)); top: calc(var(--y) * var(--s)); width: 0; height: 0; }
/* A station in a drawing: its box is the dot at full size (d), centred on its point. */
.at-dot {
  position: absolute; display: block;
  left: calc((var(--x) - var(--d) / 2) * var(--s)); top: calc((var(--y) - var(--d) / 2) * var(--s));
  width: calc(var(--d) * var(--s)); height: calc(var(--d) * var(--s)); border-radius: 50%;
}

/* A key cap, as the kit draws a thing: cream, its 3 px ink outline, the label real text.
   Under it a solid ink lip (a line, never a soft shadow), so a cap with no label still
   reads as a key. */
.key {
  position: absolute; left: calc(var(--x) * var(--s)); top: calc(var(--y) * var(--s));
  width: calc(var(--w) * var(--s)); height: calc(var(--h) * var(--s));
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--ink); border-radius: calc(14 * var(--s)); background: var(--cream);
  box-shadow: 0 calc(5 * var(--s)) 0 var(--ink);
  font-size: max(13px, calc(22 * var(--s))); line-height: 1; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
}
/* Pressed, it goes down onto its lip and fills Blue: blue acts. */
.key.is-down { background: var(--blue); color: var(--cream); translate: 0 calc(4 * var(--s)); box-shadow: 0 calc(1 * var(--s)) 0 var(--ink); }

/* ---------------------------------------------------------------- buttons and their presses */
/* A button as Murmur draws its own: blue acts. In the HTML it is a drawing (a span with
   data-btn); a screen's script makes it a real <button>, drawn the same (js/controls.js).
   Its socket stands at its end, after the label (the dot never reads as the label's bullet). */
.dict-btn { display: inline-flex; align-items: center; gap: 12px; height: max(44px, calc(54 * var(--u))); padding: 0 max(5px, calc(8 * var(--u))) 0 22px; border: 0; border-radius: 14px; background: var(--blue); color: var(--cream); font-size: 16px; line-height: 1; font-weight: 700; white-space: nowrap; }
button.dict-btn { cursor: pointer; }

/* Where her press lands: a round socket at the end of a button, and in it the station, the
   dot at full size (css/station.css draws it while no dot travels). While the dot travels
   the socket is empty until it is pressed: a navy disc waiting there would read as a
   switch, so it fills only as the dot arrives (data-arrived). */
.dict-sock { position: relative; display: inline-grid; place-items: center; flex: none; width: calc(var(--dot) + max(8px, calc(10 * var(--u)))); aspect-ratio: 1; border-radius: 50%; background: var(--navy); }
.dict-sock .station { position: relative; z-index: 1; display: block; width: var(--dot); height: var(--dot); border-radius: 50%; }
.thread-on .dict-sock { background: transparent; transition: background-color 0.2s ease; }
.thread-on .dict-sock:has(.station[data-arrived]) { background: var(--navy); }

@media (max-width: 1023.98px) {
  /* The phone's stages are drawn at 350, the column at 390, and fill it, up to 1.25x. */
  .dict-screen { --s: min(1.25px, calc((100vw - 40px) / 350)); --dot: calc(12.8 * min(1.25px, 100vw / 390)); }
  .dict-mid { margin-top: 14px; }
  .dict-small { font-size: 15px; }

  /* The phone's drawing stands in the page's flow and gives the stage its height. */
  .stage { width: calc(var(--psw) * var(--s)); height: auto; }
  .stage > .art-desk { display: none; }
  .stage > .art-phone { display: block; position: relative; height: auto; }
  .at { left: calc(var(--px) * var(--s)); top: calc(var(--py) * var(--s)); }
  .at-dot {
    left: calc((var(--px) - var(--pd) / 2) * var(--s)); top: calc((var(--py) - var(--pd) / 2) * var(--s));
    width: calc(var(--pd) * var(--s)); height: calc(var(--pd) * var(--s));
  }
  .key {
    left: calc(var(--px) * var(--s)); top: calc(var(--py) * var(--s));
    width: calc(var(--pw) * var(--s)); height: calc(var(--ph) * var(--s));
    border-width: 2.5px; border-radius: calc(10 * var(--s)); font-size: max(12px, calc(15 * var(--s)));
    box-shadow: 0 calc(4 * var(--s)) 0 var(--ink);
  }
  .key.is-down { translate: 0 calc(3 * var(--s)); }
  /* Every target on the phone is at least 44 px. */
  .dict-btn { height: 44px; gap: 10px; padding: 0 5px 0 16px; border-radius: 12px; font-size: 15px; }
  .dict-sock { width: calc(var(--dot) + 12px); }
}

/* ---------------------------------------------------------------- motion */
.key { transition: background-color 0.12s ease, color 0.12s ease, translate 0.12s ease, box-shadow 0.12s ease; }
/* A button pressed (the dot's press, or the visitor's): a shade deeper for a moment. Never
   moved or scaled: its socket holds a station, and a station's box must stay where it is. */
.dict-btn { transition: background-color 0.12s ease; }
button.dict-btn:not([aria-disabled="true"]):hover, .dict-btn.is-pressed { background: var(--navy); }
