/* 100% corner smoothing (assets/js/squircle.js). The script turns each shape's border-radius into a smoothed outline
   (--sq) and an outline ring (--sq-ring, --ring-w wide) and adds .is-sq; these rules then clip the shapes and redraw
   what clip-path would cut off: box-shadow rings become ring layers, ledges become shifted copies of the shape, and
   outer shadows become drop-shadow filters on a parent. Load after base.css / portfolio.css / resume.css. */
@property --ring-w { syntax: "<length>"; inherits: false; initial-value: 0px; }

/* 3D buttons: the depth layer and the face share one outline (same size); the face's ring is a layer of its own. */
.btn__face { --ring-w: 1.5px; }
@media (min-width: 900px) { .p-nav .btn__face, .resume .btn__face { --ring-w: calc(1.5 * var(--u)); } }
.btn.is-sq::before { clip-path: var(--sq); }
.btn.is-sq .btn__face { clip-path: var(--sq); box-shadow: none; }
.btn.is-sq .btn__face::after { content: ""; position: absolute; inset: 0; background: var(--border); clip-path: var(--sq-ring); pointer-events: none; }

/* Hall / Kitchen tabs: ledge, face and ring layers under the picture (the tab itself stays unclipped for its focus ring). */
.p-tab { --ring-w: max(1px, calc(1.5 * var(--px))); }
.p-tab.is-sq, .p-tab.is-sq:hover, .p-tab.is-sq:active, .p-tab.is-sq[aria-pressed="true"] { background: none; box-shadow: none; }
.p-tab.is-sq img { position: relative; }
.p-tab .sq-layer { position: absolute; inset: 0; pointer-events: none; clip-path: var(--sq); transition: translate 120ms ease, background-color 120ms ease; }
.p-tab .sq-layer--ledge { background: #c9d4e3; translate: 0 calc(5 * var(--px)); }
.p-tab .sq-layer--face { background: #fff; }
.p-tab .sq-layer--ring { background: #d3dce8; clip-path: var(--sq-ring); }
.p-tab:hover .sq-layer--ledge { translate: 0 calc(7 * var(--px)); }   /* the tab lifts 2px, the ledge's bottom stays put */
.p-tab:hover .sq-layer--ring { background: #b9c7da; }
/* Pressed: sunk onto the ledge, light blue face with a soft shade along the top, blue ring. */
.p-tab:active .sq-layer--ledge, .p-tab[aria-pressed="true"] .sq-layer--ledge { translate: none; }
.p-tab:active .sq-layer--face, .p-tab[aria-pressed="true"] .sq-layer--face { background: linear-gradient(rgb(6 52 153 / 0.12), rgb(6 52 153 / 0) calc(10 * var(--px))) #edf4ff; }
.p-tab:active .sq-layer--ring, .p-tab[aria-pressed="true"] .sq-layer--ring { background: #8fb4ff; }

/* Stroke | Fill switches: the bar's fill is a clipped layer and its shadow a drop shadow; the pill is clipped. */
.p-switch__bar.is-sq { background: none; box-shadow: none; filter: drop-shadow(0 calc(2 * var(--px)) calc(4 * var(--px)) rgb(55 73 98 / 0.16)); }
.p-switch__bar.is-sq::before { content: ""; position: absolute; inset: 0; background: #f1f5f9; clip-path: var(--sq); }
.p-switch__pill.is-sq { clip-path: var(--sq); }

/* Other Work tiles: clipped; the hover shadow moves to the list item as a drop shadow (tile-parallax.js writes
   --mx / --my there), and the focus ring too. */
.p-bento .p-tile.is-sq, .p-bento .p-tile.is-sq:hover, .p-bento .p-tile.is-sq:active { clip-path: var(--sq); box-shadow: none; }
.p-bento > li:has(> .p-tile.is-sq) { filter: drop-shadow(0 0 0 rgb(21 28 40 / 0)); transition: filter 300ms cubic-bezier(.22, 1, .36, 1); }
@media (hover: hover) {
  .p-bento > li:has(> .p-tile.is-sq:hover) { filter: drop-shadow(calc(var(--mx, 0) * -18 * var(--b)) calc((28 - var(--my, 0) * 12) * var(--b)) calc(48 * var(--b)) rgb(21 28 40 / 0.24)); }
}
.p-bento > li:has(> .p-tile.is-sq:active) { filter: drop-shadow(0 0 0 rgb(21 28 40 / 0)); }
.p-bento .p-tile.is-sq:focus-visible { outline: none; }
.p-bento > li:has(> .p-tile.is-sq:focus-visible) { outline: 3px solid #0a57ff; outline-offset: 4px; border-radius: calc(24 * var(--b)); }

@media (prefers-reduced-motion: reduce) { .p-tab .sq-layer, .p-bento > li { transition: none; } }
