/* The field lines button: a hairline pill on black, the thin lines of a magnetic field between its two ends and one
   vermilion only where the pointer pulls them. The words are Archivo, whose width moves under the pointer. */
:root {
  --page: #000000;          /* the page */
  --ink: #efece6;           /* the words and the bright thread running along the lines */
  --line: rgba(239, 236, 230, 0.5);   /* the field lines */
  --muted: #7d7a74;         /* the small line under the pill */
  --rim: #3a3936;           /* the pill outline at rest */
  --accent: #ff5232;        /* the lines the pointer pulls */
  --focus: #efece6;         /* 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: 24px 16px;
  overflow: hidden;
}

/* the field: a box no wider than 480 px, as tall as half its width but never more than 46% of the screen height */
.field {
  position: relative;
  width: min(92vw, 480px);
  height: min(46vw, 240px, 46vh);
  display: grid;
  place-items: center;
}

/* the lines fade out towards the edges of the box, so the field has no border */
.field__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 52%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 52%, transparent 100%);
  pointer-events: none;
}

/* ---------------------------------------------------------------- the pill */
.field__btn {
  position: relative;
  display: block;
  width: min(200px, 52vw);
  height: 52px;
  padding: 0;
  border: 1px solid var(--rim);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.35s ease;
}

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

.field__btn.is-on {
  border-color: rgba(239, 236, 230, 0.55);
}

@media (hover: hover) {
  .field__btn:hover {
    border-color: rgba(239, 236, 230, 0.7);
  }
}

.field__words {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: inherit;
}

.field__word {
  grid-area: 1 / 1;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-stretch: 100%;
  white-space: nowrap;
}

.field__word[data-word="done"] {
  opacity: 0;
}

.field__note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(2px, calc(50% - 64px));
  margin: 0;
  text-align: center;
  font-size: 11px;
  font-stretch: 112%;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
