/* Words in the jar: a minimal physics piece. A warm white page and a glass jar drawn with two hairlines, the outer
   wall in ink and the inner one lighter, like glass seen edge on. The words are HTML, one rigid body each: they drop
   in, bounce, settle on the others and slide when the pointer tilts the jar. */
:root {
  --paper: #f3f0e8;     /* the page */
  --ink: #141414;       /* the words and the outer wall of the glass */
  --glass: #a9a396;     /* the inner wall of the glass */
  --accent: #e2462b;    /* the word that just arrived, and the angle of the jar */
  --muted: #8a857b;     /* the small print and the plumb line */
}

* {
  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: none;
}

/* the whole page is the button that drops a word */
.drop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.drop:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -10px;
}

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

.measure__plumb {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}

.measure__axis,
.measure__arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  stroke-linecap: round;
}

.measure__label {
  fill: var(--accent);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* the jar: a point in the middle of the jar, moved and turned by the script; the glass and the words hang off it */
.jar {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  will-change: transform;
}

.glass {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: visible;
}

.glass__outer,
.glass__lip {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.words {
  position: absolute;
  left: 0;
  top: 0;
}

/* a word: the outer box is the rigid body (moved by the script), the ink inside is for GSAP (weight, width, squash) */
.tag {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  will-change: transform;
}

.tag__ink {
  display: block;
  line-height: 1;
  white-space: pre;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  transform-origin: 50% 100%;
}

.tag__l {
  display: inline-block;
}

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

/* empty the jar: a quiet text button; on hover the jar leans a little its way, as if about to pour */
.empty {
  position: absolute;
  right: 24px;
  bottom: 16px;
  margin: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.empty__text {
  display: inline-block;
  font-variation-settings: 'wdth' 100;
  transform-origin: 100% 50%;
}

.empty:focus-visible .empty__text {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.empty[aria-disabled='true'] {
  color: var(--muted);
  cursor: default;
}

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

  .empty {
    right: 16px;
    bottom: 12px;
  }
}
