:root {
  --paper: #ffffff;
  --ink: #0d0e10;
  --rule: #e4e2dc;
  --hush: #8d8c87;
  --accent: #3657ff;
  --pill-h: clamp(52px, 9vmin, 62px);
  --clip-w: clamp(15px, 2.5vmin, 17px);
  --clip-h: calc(var(--clip-w) * 2);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
}
.attach {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 999px;
}
.attach:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
/* the pill: GSAP moves this element, the border and shadow stay in the CSS */
.attach__body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vmin, 13px);
  height: var(--pill-h);
  padding: 0 clamp(24px, 3.8vmin, 30px) 0 clamp(18px, 2.8vmin, 22px);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--rule), 0 12px 26px -18px rgba(13,14,16,.45), 0 2px 5px -3px rgba(13,14,16,.18);
  will-change: transform;
}
/* the empty place the clip sits in while it is an icon */
.attach__slot { width: var(--clip-w); height: var(--clip-h); flex: none; }
.attach__clip {
  position: absolute;
  left: clamp(18px, 2.8vmin, 22px);
  top: calc(var(--pill-h) / 2 - var(--clip-h) / 2);
  width: var(--clip-w);
  height: var(--clip-h);
  overflow: visible;
  pointer-events: none;
}
.attach__clip--back { z-index: 0; }
.attach__clip--front { z-index: 2; }
.attach__line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.attach__label {
  position: relative;
  display: grid;
  height: 1.2em;
  clip-path: inset(0 -24px);
  font-size: clamp(16px, 2.7vmin, 19px);
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.attach__word {
  grid-area: 1 / 1;
  display: block;
  white-space: nowrap;
  width: max-content;
  font-variation-settings: 'wght' 560, 'wdth' 100;
  will-change: transform;
}
.attach__file {
  display: inline-block;
  margin-left: 0.5em;
  padding-left: 0.5em;
  color: var(--hush);
  font-variation-settings: 'wght' 460, 'wdth' 92;
  box-shadow: -1px 0 0 0 var(--rule);
}
