/* The mercury button: a pill of liquid metal on a black page. The metal is drawn by a WebGL shader on a canvas
   larger than the button, so the drops have room to fly; the button itself is transparent and holds the words. */
:root {
  --page: #000000;          /* the page */
  --ink: #0d0e11;           /* the words on the metal */
  --text: #eef0f3;          /* the ring of the keyboard focus */
  --muted: #8b909a;         /* the line under the button */
  --light: #ffffff;         /* the brightest lights the metal reflects */
  --sky: #b9c1cc;           /* the wall behind you, reflected in the top of the metal */
  --floor: #3a3f48;         /* the floor, reflected in the bottom of the metal */
  --deep: #08090b;          /* the darkest corner of the room */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--text);
  font-family: 'Geist Variable', 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: 72px 16px;
}

.mercury {
  display: grid;
  justify-items: center;
  gap: 30px;
}

/* ---------------------------------------------------------------- the metal and the button */
.mercury__pool {
  position: relative;
  display: grid;
  place-items: center;
}

/* larger than the button and centred on it: the room the drops fly in */
.mercury__canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.mercury__btn {
  position: relative;
  display: grid;
  place-items: center;
  height: 64px;
  min-width: 248px;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16.5px;
  font-weight: 640;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* the three faces sit on top of each other, the widest one gives the button its width */
.mercury__face {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  /* engraved in the metal: a thin light line under the letters */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.mercury__icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.45));
}

.mercury__icon--check {
  stroke-width: 2.5;
  stroke-dasharray: 1;
}

.mercury__btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 8px;
}

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

.mercury__btn[aria-disabled='true'] {
  cursor: progress;
}

.mercury__hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.mercury__hint span {
  display: inline-block;
}

/* without WebGL: a still chrome pill drawn with gradients */
.is-flat .mercury__btn {
  background: linear-gradient(180deg, #ffffff 0%, var(--sky) 46%, var(--floor) 54%, #d9dee5 100%);
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.8);
}
