/* Words in bubbles: a minimal physics piece. A warm white page, a hairline surface near the top and words in
   bubbles drawn with a single thin line, rising slowly. The words are HTML, the bubbles one SVG path each. */
:root {
  --paper: #f3f0e8;     /* the page */
  --ink: #141414;       /* the words and the bubbles */
  --accent: #2b46e6;    /* the bubble of two words that found each other */
  --surface: #a29d92;   /* the line at the top, where the bubbles pop */
  --muted: #8a857b;     /* the small print and the glint inside the bubbles */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.surface {
  fill: none;
  stroke: var(--surface);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* a bubble: one closed path, flattened where it presses on another bubble or on the surface */
.bubble {
  fill: none;
  stroke: var(--ink);
  stroke-linejoin: round;
}

/* the glint: a short arc inside the bubble, where the light would catch it */
.glint {
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
}

.ring {
  fill: none;
}

.words {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* a word: the outer box is moved by the script, the ink inside is centred on that point */
.word {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.word__ink {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  translate: -50% -56%;
  line-height: 1;
  white-space: pre;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.hint {
  position: absolute;
  left: 24px;
  top: 22px;
  margin: 0;
  max-width: calc(100% - 48px);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 450;
  letter-spacing: 0.01em;
  color: var(--muted);
  pointer-events: none;
}

.said {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .hint {
    left: 16px;
    top: 16px;
    max-width: calc(100% - 32px);
  }
}
