/* The hot air balloon button: a dark pill on a white page; the balloon is drawn by the script in the canvas above it.
   The colours of the fabric, the basket and the flame are here too: the script reads them. */
:root {
  --page: #ffffff;          /* the page */
  --ink: #17161f;           /* the pill */
  --ink-hover: #2a2836;     /* the pill under the pointer */
  --on-ink: #fbf8f2;        /* the words on the pill */
  --muted: #8a8794;         /* the line under the pill */
  --ok: #4cd18a;            /* the tick when the photos are up */
  --gore-1: #ff6a3d;        /* the panels of fabric, in turn round the balloon */
  --gore-2: #ffd04a;
  --gore-3: #fff1d6;
  --gore-4: #17a596;
  --gore-5: #3b46a8;
  --gore-6: #ff8fae;
  --band: #fff7e8;          /* the band round the balloon's waist */
  --wicker: #b9823f;        /* the basket */
  --rim: #5a3a22;           /* the leather round the top of the basket */
  --rope: #6e6052;          /* the ropes */
  --flame: #ffb23f;         /* the burner's flame */
}

* {
  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: 'Bricolage Grotesque 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 component: the sky the balloon climbs in, the pill under it, a line under the pill */
.balloon {
  position: relative;
  width: min(340px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
}

.balloon__sky {
  display: block;
  width: 100%;
  aspect-ratio: 340 / 400;
  pointer-events: none;
}

/* ---------------------------------------------------------------- the pill */
.balloon__btn {
  position: relative;
  width: 268px;
  max-width: 100%;
  height: 58px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font: inherit;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 10px 24px -12px rgba(23, 22, 31, 0.55), 0 2px 4px rgba(23, 22, 31, 0.12);
  transition: background-color 0.25s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.25s;
  -webkit-tap-highlight-color: transparent;
}

/* the slot in the top of the pill, where the basket comes out: only while the balloon is out */
.balloon__btn::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 46px;
  height: 3px;
  margin-left: -23px;
  border-radius: 0 0 4px 4px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.3s;
}

.balloon[data-state]:not([data-state='idle']) .balloon__btn::before {
  opacity: 1;
}

@media (hover: hover) {
  .balloon__btn:hover {
    background: var(--ink-hover);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 14px 28px -12px rgba(23, 22, 31, 0.6), 0 2px 4px rgba(23, 22, 31, 0.12);
  }

  .balloon[data-state='idle'] .balloon__btn:hover .balloon__icon path:last-child {
    transform: translateY(-1.5px);
  }
}

.balloon__btn:active {
  transform: scale(0.97);
}

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

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

.balloon__face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.balloon__icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.balloon__icon path {
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.balloon__icon--ok {
  stroke: var(--ok);
  stroke-width: 2.4;
}

.balloon__pct {
  opacity: 0.6;
  font-weight: 500;
}

/* ---------------------------------------------------------------- the line under it */
.balloon__hint {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.balloon__hint span {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .balloon__btn,
  .balloon__icon path {
    transition: background-color 0.25s;
  }

  .balloon__btn:active {
    transform: none;
  }
}
