/* hoichoi Pillow · CSS kit
   The Pillow is a superellipse with n = 5: |x/a|^5 + |y/b|^5 = 1.
   Rule: up to 1.5:1 it is one Pillow; wider than that, two half-Pillow caps hold the ends and a straight body fills the middle.
   CSS draws it with corner-shape: superellipse(K), where the corner exponent is 2^K, so n = 5 is K = log2(5) = 2.3219.
   Works in Chrome and Edge today; other browsers get the closest rounded corner (see the fallback block). */

:root{
  --hc-pillow-shape: superellipse(2.3219);
  --hc-pillow-r: 36px;            /* container corner. Coming from a circular radius? Multiply it by 2.27: same cut, Pillow curve */
}

/* 1 · Wide controls: buttons, chips, text fields, tags, toasts (wider than 1.5 × their height). Split caps. */
.hc-pillow{
  border-radius: 9999px;
  corner-shape: var(--hc-pillow-shape);
}

/* 2 · Square-ish controls up to 1.5:1: icon buttons, avatars, dots, app tiles, badges. One whole Pillow. */
.hc-pillow-sq{
  border-radius: 50%;
  corner-shape: var(--hc-pillow-shape);
}

/* 3 · Containers: cards, panels, sheets, modals, thumbnails. Pillow-curved corners; content keeps its layout. */
.hc-pillow-corners{
  border-radius: var(--hc-pillow-r);
  corner-shape: var(--hc-pillow-shape);
}

/* Fallback for browsers without corner-shape: the nearest circular corner that sits inside the Pillow curve */
@supports not (corner-shape: superellipse(2)){
  .hc-pillow{ border-radius: .75em; }                                   /* about 0.3 × a 2.5em control */
  .hc-pillow-sq{ border-radius: 30%; }
  .hc-pillow-corners{ border-radius: calc(var(--hc-pillow-r) / 2.27); }
}
