/* Rest: a minimal hover piece. Warm paper and a field of thin outlined squares drawn on a canvas. Near the pointer
   the corners round off on a spring until the squares are circles; when the pointer rests, every circle closes in
   and the squares left standing spell a word, in the one accent colour. The colours live here and the script reads
   them once at the start. */
:root {
  --paper: #f3f0e8;     /* the background */
  --line: #a29c90;      /* the squares at rest */
  --ink: #141414;       /* the squares under the pointer */
  --dim: #cdc7ba;       /* the circles around the word */
  --accent: #e0462a;    /* the squares that spell the word */
  --muted: #8a8478;     /* the small print */
  --stroke: 1.2;        /* how thick the outlines are, in pixels */
}

* {
  box-sizing: border-box;
}

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

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

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

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hint,
.read {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 460;
  font-stretch: 100%;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  opacity: 0;
}

.read {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* little windows the label and the value roll through when they change */
.read__win {
  display: inline-block;
  overflow: hidden;
  height: 1.3em;
  vertical-align: top;
}

.read__label,
.read__value {
  display: inline-block;
}

/* --r is the corner of the square under the pointer, 0 = sharp, 1 = a circle, written by the script */
.read__value {
  --r: 0;
  min-width: 2.6em;
  text-align: right;
  font-weight: calc(520 + var(--r) * 260);
  font-stretch: calc(112% - var(--r) * 24%);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.read__value.is-word {
  color: var(--accent);
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: 0.08em;
}

@media (max-width: 560px) {
  .hint,
  .read {
    font-size: 11px;
  }
}
