/* The button with weight under the finger: a minimal piece. One hairline pill on a white page, a light label in a
   variable grotesque and one blue tick. Letters, outline and tick are placed by the script.
   In a real page the button sits wherever the call to action goes: drop .stage and .frame and keep .call. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #141414;           /* the letters and the outline of the pill */
  --fill: #ffffff;          /* the inside of the pill */
  --accent: #2448ff;        /* the tick, and the focus ring */
}

* {
  box-sizing: border-box;
}

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

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

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

.frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 240px;             /* set by the script from the measured type */
  height: 76px;
  max-width: 100%;
}

/* ---------------------------------------------------------------- the button */
.call {
  position: relative;
  display: block;
  width: 160px;             /* set by the script, frame by frame */
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.call[aria-disabled='true'] {
  cursor: default;
}

.call:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 5px;
}

/* the pill: width, height and outline follow springs, so it is drawn on its own around the centre of the button */
.call__pill {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160px;
  height: 60px;
  margin: -30px 0 0 -80px;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--ink);
  opacity: 0;
}

/* the line of type: its origin is the centre of the pill, every letter is placed from there */
.call__line {
  position: absolute;
  left: 50%;
  top: 50%;
}

.ch {
  position: absolute;
  left: 0;
  top: 0;
  height: 26px;
  margin-top: -13.5px;
  font-size: 19px;
  line-height: 26px;
  color: var(--ink);
  white-space: pre;
  font-kerning: none;
  font-variation-settings: 'wght' 340, 'GRAD' 0;
  opacity: 0;
  will-change: transform;
}

.call__tick {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  margin-top: -10.5px;
  overflow: visible;
  opacity: 0;
}

.call__tick path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* ---------------------------------------------------------------- the ruler: hidden, measures the type */
.ruler {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  font-size: 19px;
  font-kerning: none;
}

.ruler span {
  display: inline-block;
  white-space: pre;
}

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