/* The bookmark ribbon button: a thin ink pill on a white page and one vermilion ribbon. The words are Archivo, whose
   width and weight move as the button is pressed and as the new word lands. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #141414;           /* the pill's line and the words */
  --muted: #8a8780;         /* the small line under the pill */
  --ribbon: #e8452c;        /* the ribbon */
  --ribbon-dark: #b8321e;   /* the ribbon's fold and shadow side */
  --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;
}

.mark {
  display: grid;
  justify-items: stretch;
  gap: 18px;
  padding-bottom: 40px;
}

.mark__wrap {
  position: relative;
}

/* ---------------------------------------------------------------- the pill */
.mark__btn {
  position: relative;
  z-index: 2;
  display: block;
  width: 236px;
  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;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

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

.mark__words {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.mark__word {
  grid-area: 1 / 1;
  font-size: 17px;
  letter-spacing: 0.005em;
  white-space: nowrap;
  font-weight: 460;
  font-stretch: 100%;
}

.mark__word--done {
  opacity: 0;
}

/* ---------------------------------------------------------------- the ribbon: it hangs from the bottom edge of the
   pill, under it, so the pill's line covers the stitch */
.mark__ribbon {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 140px;
  overflow: visible;
  pointer-events: none;
}

.mark__tape {
  fill: var(--ribbon);
}

.mark__shade {
  fill: var(--ribbon-dark);
}

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

.mark__note {
  justify-self: start;
  margin: 0 0 0 24px;
  max-width: calc(100% - 80px);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
  font-stretch: 100%;
}
