/* The word under the press: a minimal type piece. Warm paper, one word in a variable typeface with parametric axes
   (Roboto Flex: cap height, width, weight), a press drawn with hairlines and a single vermilion plate. The script
   places everything and writes the axes of every letter on each frame. */
:root {
  --paper: #f3f0e8;    /* the page */
  --ink: #141414;      /* the word and the bed */
  --plate: #e2471d;    /* the plate of the press, the only accent */
  --rod: #d3cdc1;      /* the two rods the plate slides on */
  --mark: #9b9488;     /* the dimension line and the notes */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Roboto Flex Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.stage.is-dragging {
  cursor: grabbing;
}

/* ------------------------------------------------------------------ the word */
.row {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.word {
  margin: 0;
  display: flex;
  align-items: baseline;
  font-size: var(--size, 160px);
  font-weight: 400;
  line-height: 1;
  white-space: pre;
  opacity: 0;
}

.l {
  display: inline-block;
  white-space: pre;
}

/* an empty mark on the baseline: the script reads where the letters stand */
.base {
  display: inline-block;
  width: 0;
  height: 0;
}

/* ------------------------------------------------------------------ the press */
.rod,
.bed,
.plate {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
}

.rod {
  width: 1px;
  background: var(--rod);
  transform-origin: 50% 0;
  transform: scaleY(0);
}

.bed {
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
}

.plate {
  height: 2px;
  margin-top: -2px;
  background: var(--plate);
  opacity: 0;
}

/* ------------------------------------------------------------------ the dimension line */
.dim {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  opacity: 0;
}

.dim__line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--mark);
}

.dim__tick {
  position: absolute;
  left: -4px;
  width: 9px;
  height: 1px;
  background: var(--mark);
}

.dim__tick--top {
  top: 0;
}

.dim__tick--bottom {
  bottom: 0;
}

.dim__num {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-variation-settings: 'wdth' 100, 'wght' 520;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ------------------------------------------------------------------ the notes */
.foot,
.hint {
  position: absolute;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--mark);
  font-variation-settings: 'wdth' 100, 'wght' 460;
  opacity: 0;
}

.foot {
  left: max(20px, 4vw);
  right: max(20px, 4vw);
  bottom: max(20px, 4vh);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.foot__brand {
  color: var(--ink);
}

.foot__axes {
  display: flex;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.foot__axes b {
  display: inline-block;
  min-width: 3.4ch;
  font-weight: inherit;
  font-variation-settings: 'wdth' 100, 'wght' 620;
  color: var(--ink);
  text-align: right;
}

.hint {
  left: 0;
  right: 0;
  top: max(20px, 4vh);
  text-align: center;
}

@media (max-width: 560px) {
  .foot {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}
