/* hand-lettering.css
 *
 * Handwritten headings, lettered by hand (js/hand-lettering.js) and
 * painted (js/hand-paint.js). Each scene sets the size, the colour and
 * where they go.
 */

/* Nanum Pen Script has only one weight, and its strokes are thin: a
   browser's made-up bold would smear them, so it is never used. */
.hand-written {
  font-family: "Nanum Pen Script", cursive;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1;
}

/* The line, turned a little as a whole. */
.hand {
  display: inline-block;
  white-space: nowrap;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 0 60%;
}

/* A heading long enough to need more than one line: its words wrap (each
   word still stays together), and the lines are tilted as one. */
.hand-written--wraps .hand {
  white-space: normal;
}

.hand__word {
  display: inline-block;
}

/* Each letter nudged up or down and turned by its own small amount, so
   the baseline wanders. */
.hand__letter {
  display: inline-block;
  transform: translateY(var(--rise, 0em)) rotate(var(--turn, 0deg));
}

/* The paint's filters live in a hidden <svg> (made by hand-paint.js). */
.hand-paint-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Read by screen readers and search engines, but not shown. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
