/* The seismograph button: a thin ink pill on a white page, one vermilion line for the tremor. The words are Archivo,
   whose width and weight move as the button is pressed and as the new words land. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #141414;           /* the pill's line and the words */
  --muted: #8a8780;         /* the small line under the pill */
  --rule: #d9d5cc;          /* the flat line before the quake */
  --accent: #e8452c;        /* the pen and the tremor */
  --focus: #141414;         /* the ring of the keyboard's focus */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.quake {
  display: grid;
  justify-items: center;
  gap: 16px;
}

/* ---------------------------------------------------------------- the pill */
.quake__btn {
  position: relative;
  display: block;
  width: 252px;
  max-width: calc(100vw - 32px);
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--page);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.quake__btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

html[data-using='pointer'] .quake__btn:focus-visible {
  outline: none;
}

/* the paper: an SVG as big as the pill, its view box set by the script in pixels */
.quake__paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.quake__base {
  fill: none;
  stroke: var(--rule);
  stroke-width: 1;
}

.quake__trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.quake__pen {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------- the words */
.quake__words {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.quake__word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.01em;
  font-weight: 520;
  font-stretch: 100%;
  padding-bottom: 1px;
}

.quake__word--done {
  opacity: 0;
  visibility: hidden;
  font-weight: 320;
  font-stretch: 112%;
}

.quake__note {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
