/* The liquid glass button: a pill of thick glass over its own small picture, a rounded cobalt panel where two lines
   of cream type slide past each other. Picture and glass are drawn by the same WebGL canvas, inside the panel; the
   real <button> is laid over the glass, sized by the same springs. */
:root {
  --page: #000000;          /* the page */
  --ground: #1b33c2;        /* the cobalt of the panel */
  --type: #f6efe3;          /* the type sliding in the panel, and the line under it */
  --label: #ffffff;         /* the words on the glass over something dark */
  --ink: #0b1440;           /* the words on the glass over something light */
  --success: #3fe0a2;       /* the tint the glass takes when the seats are held */
}

* {
  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(--type);
  font-family: 'Inter 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: 32px 16px;
}

/* ---------------------------------------------------------------- the button */
.glass {
  display: grid;
  justify-items: center;
  gap: 14px;
  -webkit-tap-highlight-color: transparent;
}

/* the panel: the glass's own picture, and the room the glass may take. Its two lines of type are centred on it, and
   the script sets its height to theirs, with a little room above and below */
.glass__slot {
  position: relative;
  width: min(400px, calc(100vw - 32px));
  height: 221px;
  overflow: hidden;
  border-radius: 30px;
  background: var(--ground);
}

/* the picture and the glass: the whole panel, under the button */
.glass__scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.glass__face {
  display: none;
}

/* the line under the panel: empty at rest, so its height is kept and nothing moves when it speaks */
.glass__hint {
  min-height: 1.5em;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.glass__hint span {
  display: inline-block;
}

/* the button is clear: the glass and its words are drawn by the canvas below, under the button's exact shape */
.glass__btn {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 84px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  font: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
}

.glass__btn:focus-visible {
  outline: 2px solid var(--type);
  outline-offset: 6px;
}

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

/* without WebGL: a frosted pill with its words in HTML, on the plain cobalt of the panel */
.no-gl .glass__btn {
  width: auto;
  height: 76px;
  padding: 0 30px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 30px rgba(6, 12, 60, 0.3);
  color: var(--label);
  font-size: 19px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.no-gl [data-state='rest'] [data-face='rest'],
.no-gl [data-state='busy'] [data-face='busy'],
.no-gl [data-state='done'] [data-face='done'] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
}

.no-gl .glass__face svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
