/* The sentence that raises its voice: a short sentence in small letters on warm paper, standing on three hairlines
   of the type (baseline, x-height, cap height). One letter at a time grows into its capital and the neighbours make
   room; when the whole sentence is in capitals the cap line lights up, then it all goes quiet again. Archivo, a
   variable typeface (width 62 to 125, weight 100 to 900). */
:root {
  --paper: #f3f0e8;    /* the page */
  --ink: #141414;      /* the letters and the baseline */
  --rule: #c4bdaf;     /* the x-height, the cap line and the labels */
  --accent: #2346ff;   /* the cap line when the whole sentence reaches it */
}

* {
  box-sizing: border-box;
}

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

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

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

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

/* ------------------------------------------------------------------ the rig */
/* the script writes the size of the type (--size), the line box (--line) and where the baseline sits in it (--base) */
.rig {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.rig.is-ready {
  visibility: visible;
}

/* the hairlines: the script places them (top, left, width) */
.rule {
  position: absolute;
  left: 0;
  top: 0;
  width: 600px;
  height: 0;
}

.rule__line,
.rule__lit {
  position: absolute;
  left: 0;
  top: -0.5px;
  width: 100%;
  height: 1px;
  background: var(--rule);
  transform: scaleX(0);
  transform-origin: 0% 50%;
}

.rule--base .rule__line {
  background: var(--ink);
}

/* the cap line waits dashed: it is where the letters are going */
.rule--cap .rule__line {
  background: repeating-linear-gradient(90deg, var(--rule) 0 5px, transparent 5px 9px);
}

.rule__lit {
  top: -1.5px;
  height: 2px;
  background: var(--accent);
}

.rule__label {
  position: absolute;
  right: 0;
  bottom: 7px;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--rule);
  font-variation-settings: 'wdth' 100, 'wght' 520;
  opacity: 0;
}

/* ------------------------------------------------------------------ the sentence */
.phrase {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: var(--line, 200px);
}

/* every letter is an anchor at the middle of its place; its two forms hang from it, centred */
.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: var(--line, 200px);
}

.glyph {
  position: absolute;
  left: 0;
  top: 0;
  font-size: var(--size, 160px);
  line-height: var(--line, 200px);
  white-space: pre;
  font-kerning: none;
  transform-origin: 50% var(--base, 150px);
  will-change: transform, opacity;
}

.glyph--up {
  opacity: 0;
}

/* an invisible letter, to measure */
.probe {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: pre;
  font-kerning: none;
}

.probe i {
  display: inline-block;
  width: 0;
  height: 0;
}
