/*
  The Speak Screen tile (the other fact tiles' drawings: fact-drawings.css;
  their layout: fact-tiles.css, loaded last).  Its scroll staging stays with
  the others in fact-drawings.css.
*/
/*
  Spoken content: the phone's lower part, a render 288 by 360 units drawn
  256 units wide at the tile's foot, below the title, its top faded into the
  tile.  The screen's page and the
  Speak Screen bar are cut to the screen's shape by the render's mask, and
  the render's glass is laid over them, so its sheen falls on them.  The
  glass is a picture made from the render (tools/build_speak_glass.mjs):
  white at the glass's brightness, cut to the screen.  It draws what the
  render did in screen blending, without the compositor reading back the
  page and the bar's blur under it.  Inside, sizes are in the phone's
  points ('--pt'):
  the screen, 240.1 units wide, is 390 of them.
*/
.fact-art.speak {
  inset: auto auto 0 calc(50% - var(--u) * 128);
  width: calc(var(--u) * 256);
  height: auto;
  aspect-ratio: 288 / 360;
  container-type: inline-size;
  -webkit-mask-image: linear-gradient(transparent 4%, #000 30%);
  mask-image: linear-gradient(transparent 4%, #000 30%);
}
.speak-phone,
.speak-screen,
.speak-glass {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.speak-screen {
  --pt: 0.2138cqi; /* 240.1 / 390 units, in the drawing's width. */
  background: #1b0b0e;
  -webkit-mask: url('../assets/accessibility/phone-speak-mask.png?v=1') 0 0 / 100% 100%;
  mask: url('../assets/accessibility/phone-speak-mask.png?v=1') 0 0 / 100% 100%;
}
.speak-glass {
  background: url('../assets/accessibility/phone-speak-glass.webp?v=1') 0 0 / 100% 100%;
  pointer-events: none;
}
/* The screen's shown part: 23.9 to 264.1 units across, its foot at 326.7. */
.speak-page {
  position: absolute;
  left: 8.309%;
  width: 83.382%;
  top: 0;
  bottom: 9.247%;
  padding: calc(236 * var(--pt)) calc(24 * var(--pt)) 0;
  color: var(--color-white);
  font-family: 'Open Sans', Arial, sans-serif;
}
.speak-page p,
.speak-page ul {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
/*
  The page: the bakery's mobile view.  Its photo fills the top, darkening
  into the wine of the velvet behind the pastries, with the title over it
  and the menu below.
*/
.speak-photo {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(330 * var(--pt));
  background:
    linear-gradient(transparent 38%, rgb(27 11 14 / 0.7) 72%, #1b0b0e),
    url('../assets/accessibility/speak-bakery.jpg?v=1') 50% 0 / cover;
}
.speak-kicker {
  font-size: calc(11.5 * var(--pt));
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(243 235 220 / 0.72);
}
.speak-head {
  margin-top: calc(6 * var(--pt)) !important;
  max-width: calc(250 * var(--pt));
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: calc(46 * var(--pt));
  font-style: italic;
  line-height: 0.96;
  letter-spacing: -0.01em;
}
.speak-menu {
  margin-top: calc(20 * var(--pt)) !important;
  font-size: calc(16.5 * var(--pt));
  font-weight: 600;
}
.speak-menu li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(46 * var(--pt));
  border-top: calc(0.8 * var(--pt)) solid rgb(243 235 220 / 0.16);
}
.speak-menu svg {
  width: calc(18 * var(--pt));
  height: calc(18 * var(--pt));
  fill: none;
  stroke: rgb(243 235 220 / 0.55);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The word being read, lit as iOS lights it. */
.speak-page [data-read] span {
  border-radius: calc(4 * var(--pt));
  box-shadow: 0 0 0 calc(2 * var(--pt)) transparent;
  transition:
    background-color 0.14s var(--ease-out),
    box-shadow 0.14s var(--ease-out);
}
.speak-page [data-read] span.is-read {
  background: rgb(var(--color-accent-rgb) / 0.55);
  box-shadow: 0 0 0 calc(2 * var(--pt)) rgb(var(--color-accent-rgb) / 0.55);
}
.speak-home {
  position: absolute;
  left: calc(50% - 67 * var(--pt));
  bottom: calc(8 * var(--pt));
  width: calc(134 * var(--pt));
  height: calc(5 * var(--pt));
  border-radius: 99px;
  background: rgb(243 235 220 / 0.8);
}
/*
  The Speak Screen bar, as iOS draws it: a dark glass capsule of five
  controls, the middle one on a disc.  The script places it; held, it lifts.
*/
.speak-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(280 * var(--pt));
  height: calc(50 * var(--pt));
  touch-action: none;
  cursor: grab;
  will-change: transform;
}
.speak-bar.is-held {
  cursor: grabbing;
}
.speak-bar-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 calc(6 * var(--pt));
  border-radius: 99px;
  background: rgb(38 38 41 / 0.82);
  -webkit-backdrop-filter: blur(calc(8 * var(--pt))) saturate(1.6);
  backdrop-filter: blur(calc(8 * var(--pt))) saturate(1.6);
  box-shadow:
    inset 0 0 0 calc(0.7 * var(--pt)) rgb(255 255 255 / 0.13),
    inset 0 calc(1 * var(--pt)) 0 rgb(255 255 255 / 0.1),
    0 calc(6 * var(--pt)) calc(16 * var(--pt)) rgb(20 17 13 / 0.26);
  transition:
    transform 0.32s var(--ease-spring),
    box-shadow 0.32s var(--ease-out);
}
.is-held .speak-bar-body {
  transform: scale(1.06);
  box-shadow:
    inset 0 0 0 calc(0.7 * var(--pt)) rgb(255 255 255 / 0.16),
    inset 0 calc(1 * var(--pt)) 0 rgb(255 255 255 / 0.12),
    0 calc(16 * var(--pt)) calc(30 * var(--pt)) rgb(20 17 13 / 0.34);
}
.speak-act {
  display: grid;
  place-items: center;
  width: calc(44 * var(--pt));
  height: calc(44 * var(--pt));
  border-radius: 50%;
  color: #c7c7cc;
  transition: transform 0.2s var(--ease-spring);
}
.speak-act.is-main {
  background: rgb(255 255 255 / 0.1);
  color: #f2f2f7;
}
.speak-act.is-pressed {
  transform: scale(0.84);
}
.speak-act svg {
  width: calc(25 * var(--pt));
  height: calc(25 * var(--pt));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.speak-act .is-fill {
  fill: currentColor;
  stroke: none;
}
.speak-play,
.is-paused .speak-pause {
  display: none;
}
.is-paused .speak-play {
  display: inline;
}
