:root {
  --paper: #ffffff;
  --ink: #0b0c0e;
  --on-ink: #f4f3ef;
  --accent: #2f6bff;
  --wait: #f1f1f2;
  --wait-line: rgba(11, 12, 14, .07);
  --hush: #8b8b90;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.resend {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 999px;
}
.resend[aria-disabled="true"] { cursor: default; }
.resend:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
/* the pill: GSAP moves and colours this element */
.resend__body {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vmin, 11px);
  height: clamp(52px, 9vmin, 60px);
  padding: 0 clamp(22px, 3.6vmin, 28px) 0 clamp(17px, 2.8vmin, 22px);
  border-radius: 999px;
  background: var(--wait);
  color: var(--hush);
  box-shadow: 0 0 0 1px var(--wait-line) inset, 0 10px 24px -16px rgba(11,12,14,0), 0 2px 4px -2px rgba(11,12,14,0);
  will-change: transform;
}
.resend__icon {
  width: clamp(24px, 4.2vmin, 28px);
  height: clamp(24px, 4.2vmin, 28px);
  overflow: visible;
  flex: none;
}
.resend__track, .resend__ring, .resend__head, .resend__check {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* the empty path the countdown runs along: a hair of a line, gone once it is full */
.resend__track { stroke: currentColor; stroke-width: 1; opacity: .22; }
.resend__ring, .resend__head { stroke: var(--accent); stroke-width: 2; }
.resend__check { stroke: var(--accent); stroke-width: 2.1; }
.resend__label {
  position: relative;
  display: grid;
  height: 1.2em;
  /* clipped only above and below: the word may open a hair wider than its slot while it settles */
  clip-path: inset(0 -24px);
  font-size: clamp(16px, 2.7vmin, 19px);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.resend__word {
  grid-area: 1 / 1;
  display: block;
  white-space: nowrap;
  width: max-content;
  font-variation-settings: 'wght' 560, 'wdth' 100;
  will-change: transform;
}
.resend__word--wait { color: var(--hush); }
.resend__word[data-word="ready"], .resend__word[data-word="sent"] { color: var(--on-ink); }
/* the seconds: each digit is a thin vertical roller in a slot of its own width, so nothing jitters */
.resend__time { display: inline-flex; align-items: flex-start; height: 1.2em; vertical-align: top; color: var(--ink); }
.resend__min { display: inline-block; width: .62em; text-align: center; }
.resend__slot {
  position: relative;
  display: inline-block;
  width: .62em;
  height: 1.2em;
  overflow: hidden;
  /* soft edges top and bottom, so the digits come in out of nothing */
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.resend__reel { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.resend__reel span { display: block; height: 1.2em; text-align: center; }
