/* Ropewell: a minimal physics piece. A warm white room, a hairline for the floor and one short word that skips a
   jump rope. The rope is drawn on two canvases, one behind the letters and one in front of them; the letters are
   HTML, each one moved, squashed and weighted by the script. */
:root {
  --paper: #f3f0e8;      /* the room */
  --ink: #161513;        /* the word and the rope in front */
  --rope-back: #b4aea3;  /* the rope behind the word */
  --floor: #cbc5ba;      /* the floor line */
  --muted: #8a857c;      /* the small print */
  --accent: #ff4a1c;     /* every tenth jump */
}

* {
  box-sizing: border-box;
}

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

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

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

.stage:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.layer--back {
  z-index: 0;
}

.word {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.layer--front {
  z-index: 2;
}

.letter {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 1;
  white-space: pre;
  font-weight: 640;
  font-stretch: 100%;
  letter-spacing: 0;
  will-change: transform;
}

/* a zero-size mark on the baseline: the script reads where it falls to stand each letter on the floor */
.letter__base {
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: baseline;
}

.brand,
.count,
.hint {
  position: absolute;
  z-index: 3;
  margin: 0;
  font-size: 13px;
  font-weight: 520;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.brand {
  top: clamp(16px, 3vw, 32px);
  left: clamp(16px, 3.4vw, 40px);
  color: var(--ink);
  font-weight: 680;
  font-stretch: 82%;
  font-size: 15px;
}

.count {
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3.4vw, 40px);
  font-variant-numeric: tabular-nums;
}

.count__value {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
  color: var(--ink);
  font-weight: 640;
}

.hint {
  bottom: clamp(16px, 3vw, 32px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hint__pace {
  margin-left: 6px;
  color: var(--ink);
  font-weight: 640;
}
