.blob {
  --n: 13;  /* number of vertices in shape */
  --d: 10%; /* depth, percentage */
  --s: 1;   /* softness, 0 (straight) to 1 (smooth) */

  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;

  --_r: element-scoped,0px,var(--d);
  --x0: (50% + (50% - random(--0 var(--_r)))*cos(0turn/var(--n)));
  --y0: (50% + (50% - random(--0 var(--_r)))*sin(0turn/var(--n)));
  --x1: (50% + (50% - random(--1 var(--_r)))*cos(1turn/var(--n)));
  --y1: (50% + (50% - random(--1 var(--_r)))*sin(1turn/var(--n)));
  --x2: (50% + (50% - random(--2 var(--_r)))*cos(2turn/var(--n)));
  --y2: (50% + (50% - random(--2 var(--_r)))*sin(2turn/var(--n)));
  --x3: (50% + (50% - random(--3 var(--_r)))*cos(3turn/var(--n)));
  --y3: (50% + (50% - random(--3 var(--_r)))*sin(3turn/var(--n)));
  --x4: (50% + (50% - random(--4 var(--_r)))*cos(4turn/var(--n)));
  --y4: (50% + (50% - random(--4 var(--_r)))*sin(4turn/var(--n)));
  --x5: (50% + (50% - random(--5 var(--_r)))*cos(5turn/var(--n)));
  --y5: (50% + (50% - random(--5 var(--_r)))*sin(5turn/var(--n)));
  --x6: (50% + (50% - random(--6 var(--_r)))*cos(6turn/var(--n)));
  --y6: (50% + (50% - random(--6 var(--_r)))*sin(6turn/var(--n)));
  --x7: (50% + (50% - random(--7 var(--_r)))*cos(7turn/var(--n)));
  --y7: (50% + (50% - random(--7 var(--_r)))*sin(7turn/var(--n)));
  --x8: (50% + (50% - random(--8 var(--_r)))*cos(8turn/var(--n)));
  --y8: (50% + (50% - random(--8 var(--_r)))*sin(8turn/var(--n)));
  --x9: (50% + (50% - random(--9 var(--_r)))*cos(9turn/var(--n)));
  --y9: (50% + (50% - random(--9 var(--_r)))*sin(9turn/var(--n)));
  --x10: (50% + (50% - random(--10 var(--_r)))*cos(10turn/var(--n)));
  --y10: (50% + (50% - random(--10 var(--_r)))*sin(10turn/var(--n)));
  --x11: (50% + (50% - random(--11 var(--_r)))*cos(11turn/var(--n)));
  --y11: (50% + (50% - random(--11 var(--_r)))*sin(11turn/var(--n)));
  --x12: (50% + (50% - random(--12 var(--_r)))*cos(12turn/var(--n)));
  --y12: (50% + (50% - random(--12 var(--_r)))*sin(12turn/var(--n)));

  clip-path: shape(
    from      calc((var(--x0 ) + var(--x1 ))/2) calc((var(--y0 ) + var(--y1 ))/2),
    curve  to calc((var(--x1 ) + var(--x2 ))/2) calc((var(--y1 ) + var(--y2 ))/2) with calc(var(--x1)) calc(var(--y1)),
    smooth to calc((var(--x2 ) + var(--x3 ))/2) calc((var(--y2 ) + var(--y3 ))/2),
    smooth to calc((var(--x3 ) + var(--x4 ))/2) calc((var(--y3 ) + var(--y4 ))/2),
    smooth to calc((var(--x4 ) + var(--x5 ))/2) calc((var(--y4 ) + var(--y5 ))/2),
    smooth to calc((var(--x5 ) + var(--x6 ))/2) calc((var(--y5 ) + var(--y6 ))/2),
    smooth to calc((var(--x6 ) + var(--x7 ))/2) calc((var(--y6 ) + var(--y7 ))/2),
    smooth to calc((var(--x7 ) + var(--x8 ))/2) calc((var(--y7 ) + var(--y8 ))/2),
    smooth to calc((var(--x8 ) + var(--x9 ))/2) calc((var(--y8 ) + var(--y9 ))/2),
    smooth to calc((var(--x9 ) + var(--x10))/2) calc((var(--y9 ) + var(--y10))/2),
    smooth to calc((var(--x10) + var(--x11))/2) calc((var(--y10) + var(--y11))/2),
    smooth to calc((var(--x11) + var(--x12))/2) calc((var(--y11) + var(--y12))/2),
    smooth to calc((var(--x12) + var(--x0 ))/2) calc((var(--y12) + var(--y0 ))/2),
    smooth to calc((var(--x0 ) + var(--x1 ))/2) calc((var(--y0 ) + var(--y1 ))/2)
  );
  cursor: pointer;
  transition: 1s linear(0, 0.024, 0.068 1%, 0.22 2.2%, 0.968 6.1%, 1.221 7.7%, 1.314, 1.383, 1.426 10%, 1.438, 1.445, 1.447, 1.445 11.4%, 1.432, 1.405, 1.365 13.4%, 1.272 14.6%, 1.004 17.7%, 0.892 19.3%, 0.855, 0.828, 0.811, 0.802, 0.802, 0.808, 0.819, 0.837 24.8%, 0.879 26.1%, 0.998 29.1%, 1.048 30.8%, 1.076 32.2%, 1.084, 1.088 33.6%, 1.086, 1.077, 1.059 37.2%, 1.006 40.3%, 0.984 41.7%, 0.968 43.4%, 0.963, 0.961 45%, 0.962, 0.966 47.3%, 1.007 53.2%, 1.014, 1.017 56.4%, 1.015 58.8%, 0.997 64.6%, 0.992 67.8%, 0.993 70.2%, 1.001 75.9%, 1.003 78.9%, 0.999 90.2%, 1);
}
img:hover {
  --d: 0%;
  transition: .3s;
}

body {
  margin: 0;
  background: #fff;
}

.intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 0;
  font: 16px/1.5 system-ui, sans-serif;
  color: #333;
}
.intro h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}
.intro p {
  margin: 0 0 8px;
}

.controls {
  display: grid;
  grid-template-columns: auto 1fr 4ch;
  gap: 8px 12px;
  align-items: center;
  margin-top: 16px;
}
.controls[hidden] {
  display: none;
}
.controls output {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 24px;
}

/* A static version until better support */
@supports not (opacity: random(0,1)) {
  .blob {
    clip-path: shape(from 94.80% 41.19%,curve to 89.45% 56.74% with 94.12% 50.00%,smooth to 82.35% 70.37%,smooth to 73.36% 80.51%,smooth to 60.17% 85.99%,smooth to 46.15% 88.86%,smooth to 32.49% 85.49%,smooth to 20.20% 76.84%,smooth to 12.60% 64.74%,smooth to 12.53% 50.28%,smooth to 14.56% 35.84%,smooth to 18.89% 21.10%,smooth to 30.06% 9.86%,smooth to 46.01% 3.36%,smooth to 62.39% 5.10%,smooth to 74.95% 16.17%,smooth to 87.59% 27.66%,smooth to 94.80% 41.19%);
  }
  .blob:nth-child(even) {
    clip-path: shape(from 90.21% 42.27%,curve to 91.01% 58.04% with 90.49% 50.00%,smooth to 84.61% 70.67%,smooth to 71.89% 78.77%,smooth to 59.97% 86.94%,smooth to 45.66% 92.82%,smooth to 31.66% 88.03%,smooth to 18.22% 78.19%,smooth to 5.97% 66.75%,smooth to 3.05% 50.32%,smooth to 11.76% 36.10%,smooth to 19.54% 20.68%,smooth to 29.60% 10.81%,smooth to 46.33% 10.07%,smooth to 62.76% 7.76%,smooth to 78.76% 11.86%,smooth to 87.85% 25.96%,smooth to 90.21% 42.27%);
  }
  /* Hover target for the static version: a circle with the same 17-point
     structure, so Chrome can interpolate between the two shapes. */
  .blob:hover {
    clip-path: shape(from 98.31% 40.97%,curve to 98.31% 59.03% with 100.00% 50.00%,smooth to 91.79% 75.87%,smooth to 79.62% 89.22%,smooth to 63.45% 97.27%,smooth to 45.47% 98.94%,smooth to 28.09% 94.00%,smooth to 13.68% 83.11%,smooth to 4.17% 67.75%,smooth to 0.85% 50.00%,smooth to 4.17% 32.25%,smooth to 13.68% 16.89%,smooth to 28.09% 6.00%,smooth to 45.47% 1.06%,smooth to 63.45% 2.73%,smooth to 79.62% 10.78%,smooth to 91.79% 24.13%,smooth to 98.31% 40.97%);
  }
}

/* Set by blob.js when it runs; the rules above cover the no-JS case.
   Kept last so they win over the equally specific static fallbacks. */
.blob.blob-js {
  clip-path: var(--blob-shape);
}
.blob.blob-js:hover {
  clip-path: var(--blob-hover);
}
