/* The word on the reel: one line on warm paper, «We make» and a last word that sits on a reel, like the drum of a
   mechanical counter. Every turn brings a word of a different width: the window stretches with a spring, the word
   fills it on the width axis of the typeface (Archivo, width 62 to 125) and the rest of the line moves over. */
:root {
  --paper: #f2f0eb;    /* the page */
  --ink: #151515;      /* the words that stay */
  --accent: #2b45ff;   /* the word on the reel and the full stop */
}

* {
  box-sizing: border-box;
}

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

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

.stage {
  position: fixed;
  inset: 0;
}

/* the line: a point in the middle of the page; the script places every piece from there, in pixels */
.line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  margin: 0;
  font-size: var(--size, 120px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  font-kerning: normal;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ the words that stay */
.prefix {
  position: absolute;
  left: 0;
  top: -0.5em;
}

/* every letter in its own cell: the cell slides, the letter inside rises from under the baseline */
.cell {
  position: absolute;
  left: 0;
  top: 0;
  height: 1em;
  white-space: pre;
  clip-path: inset(-40% -40% -6% -40%);
}

.glyph {
  display: block;
  white-space: pre;
  font-variation-settings: 'wdth' 100, 'wght' var(--pre-weight, 380);
}

/* ------------------------------------------------------------------ the reel */
/* a tall window around the word: the faces turn inside it, and they fade towards its top and bottom */
.reel {
  position: absolute;
  left: 0;
  top: -2em;
  height: 4em;
  color: var(--accent);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 38%, #000 62%, transparent 100%);
}

.face {
  position: absolute;
  left: 0;
  top: 1.5em;
  height: 1em;
  white-space: pre;
  transform-origin: 0 50%;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

/* ------------------------------------------------------------------ the full stop at the end of the window */
.dot {
  position: absolute;
  left: 0;
  top: -0.5em;
  height: 1em;
  color: var(--accent);
  white-space: pre;
}

.dot__ink {
  display: block;
  transform-origin: 30% 80%;
  font-variation-settings: 'wdth' 100, 'wght' var(--word-weight, 720);
}
