/* The site's main call to action (11 Nov 2026): Ali's pick (5 Nov, showreel/Scene-4.json) rebuilt live in his colours.
   .bb       = a Liquid Glass pill with a multicolour pigment blob inside (Blue Bell and Orange, which keep the ink text AA
               at any mix: 5.4:1 and 7.7:1 at full strength) under a thin milky veil; Imperial Blue is the glass's own
               shade along the bottom rim, never under the words (ink on Imperial Blue is about 1.2:1). Hover: grows a little and leans toward the
               pointer; the blob follows it (js/brief-button.js sets --bx --by --lx --ly). Press: a squish and a spring back.
               Touch: no lean, the blob drifts slowly on its own. Reduced motion: still. Focus: a ring, the blob centred.
   .bb--quiet = the second button: an outlined glass pill of the same family, no blob.
   Size from the container: --bb-size (font size), default 16px. Text: Young Serif (the showreel end card's face). */
.bb {
  --bx: 0; --by: 0; --lx: 0; --ly: 0; --s: 1; --sx: 1; --sy: 1;
  --ink: #232528; --orange: #ffa400; --bell: #009ffd; --imperial: #2a2a72; --alice: #eaf6ff;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1.25em; box-sizing: border-box;
  border: 0; border-radius: 999px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 400 var(--bb-size, 16px)/1 'Young Serif', Georgia, serif; letter-spacing: .005em; color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--alice) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -.32em .7em -.2em rgba(42, 42, 114, .55),
    0 8px 22px rgba(35, 37, 40, .22), 0 1px 3px rgba(35, 37, 40, .28);
  translate: calc(var(--lx) * .22em) calc(var(--ly) * .16em);
  scale: calc(var(--s) * var(--sx)) calc(var(--s) * var(--sy));
  transition: translate .45s cubic-bezier(.2, .8, .2, 1), scale .5s cubic-bezier(.3, 1.6, .5, 1), box-shadow .3s ease;
}
/* the pigment: three soft colour fields that move together */
.bb__blob {
  position: absolute; inset: -40% -12%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(closest-side at 30% 60%, var(--bell) 0%, var(--bell) 30%, rgba(0, 159, 253, 0) 100%),
    radial-gradient(closest-side at 70% 42%, var(--orange) 0%, var(--orange) 25%, rgba(255, 164, 0, 0) 100%);
  filter: blur(.5em);
  translate: calc(var(--bx) * 26%) calc(var(--by) * 20%);
  transition: translate .8s cubic-bezier(.2, .8, .2, 1);
}
/* the milky glass over the pigment, and the gloss line along the top */
.bb::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .16) 60%, rgba(255, 255, 255, .24) 100%);
}
.bb::after {
  content: ''; position: absolute; left: 12%; right: 12%; top: 6%; height: 34%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0));
}
.bb__label { position: relative; white-space: nowrap; }

@media (hover: hover) {
  .bb:hover { --s: 1.06; box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -.32em .7em -.2em rgba(42, 42, 114, .55),
    0 12px 28px rgba(35, 37, 40, .26), 0 1px 3px rgba(35, 37, 40, .28); }
}
.bb:active { --sx: .93; --sy: .86; transition: translate .45s cubic-bezier(.2, .8, .2, 1), scale .12s ease-out, box-shadow .3s ease; }

.bb:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.bb:focus-visible .bb__blob { translate: 0 0; animation: none; }

/* touch: the blob drifts on its own; no lean */
@media (hover: none) {
  .bb { translate: 0 0; }
  .bb__blob { animation: bb-drift 9s ease-in-out infinite alternate; }
}
@keyframes bb-drift {
  0% { translate: -18% 6%; }
  33% { translate: 14% -10%; }
  66% { translate: 6% 12%; }
  100% { translate: -10% -6%; }
}

/* the quiet one */
.bb--quiet {
  background: rgba(255, 255, 255, .34);
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 1px 1px rgba(255, 255, 255, .8), 0 6px 16px rgba(35, 37, 40, .12);
  -webkit-backdrop-filter: blur(8px) saturate(1.3); backdrop-filter: blur(8px) saturate(1.3);
}
.bb--quiet::before { background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .12)); }
@media (hover: hover) {
  .bb--quiet:hover { box-shadow: inset 0 0 0 2px var(--ink), inset 0 1px 1px rgba(255, 255, 255, .8), 0 10px 22px rgba(35, 37, 40, .16); }
}

/* the easel's "Start" (easel2, 11 Nov evening; Ali: "Add the same motion to the easel one"): Ali's 9 Nov look, the
   Imperial Blue pill with white words, sitting exactly on the baked pill, so at rest it matches it (no blob, no veil, no
   gloss). The same motion as the showreel's: a soft Blue Bell blob with a little Orange inside follows the pointer, a
   grow and a lean toward it, a squish on press. The blob is thin paint (Blue Bell at most 45 %, Orange 25 %) so the
   white words stay AA over any part of it (worst overlap about 4.9:1). Grow 1.08 and press 1.08 x 1.004 (no up-down lean while pressed): never smaller
   than the baked pill, so it never peeks out; lean kept inside that 4 % margin. Touch: the blob drifts, a little fainter. */
.bb.bb--imperial {
  color: #fff;
  background: linear-gradient(180deg, #35368b 0%, #2a2a74 55%, #242367 100%);
  box-shadow: inset 0 calc(var(--u, 1) * 2px) 0 rgba(255, 255, 255, .22), inset 0 calc(var(--u, 1) * -3px) calc(var(--u, 1) * 6px) rgba(0, 0, 0, .18),
    0 calc(var(--u, 1) * 14px) calc(var(--u, 1) * 26px) calc(var(--u, 1) * -10px) rgba(36, 35, 103, .45);
  translate: calc(var(--lx) * .12em) calc(var(--ly) * .05em);
  transition: translate .45s cubic-bezier(.2, .8, .2, 1), scale .35s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;   /* no spring under 1: the baked edge never shows */
}
.bb--imperial::before, .bb--imperial::after { display: none; }
.bb--imperial .bb__blob {
  opacity: 0;
  background:
    radial-gradient(closest-side at 32% 58%, rgba(0, 159, 253, .45) 0%, rgba(0, 159, 253, .3) 40%, rgba(0, 159, 253, 0) 100%),
    radial-gradient(closest-side at 70% 40%, rgba(255, 164, 0, .25) 0%, rgba(255, 164, 0, .14) 35%, rgba(255, 164, 0, 0) 100%);
  transition: translate .8s cubic-bezier(.2, .8, .2, 1), opacity .35s ease;
}
@media (hover: hover) {
  .bb--imperial:hover { --s: 1.08; box-shadow: inset 0 calc(var(--u, 1) * 2px) 0 rgba(255, 255, 255, .22), inset 0 calc(var(--u, 1) * -3px) calc(var(--u, 1) * 6px) rgba(0, 0, 0, .18),
    0 calc(var(--u, 1) * 18px) calc(var(--u, 1) * 30px) calc(var(--u, 1) * -10px) rgba(36, 35, 103, .5); }
  .bb--imperial:hover .bb__blob { opacity: 1; }
}
.bb.bb--imperial:active { --s: 1.08; --sx: 1; --sy: .93; translate: calc(var(--lx) * .12em) 0; transition: translate .45s cubic-bezier(.2, .8, .2, 1), scale .12s ease-out, box-shadow .3s ease; }
.bb--imperial:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.bb--imperial:focus-visible .bb__blob { opacity: 1; }
@media (hover: none) { .bb--imperial .bb__blob { opacity: .7; } }

@media (prefers-reduced-motion: reduce) {
  .bb, .bb:hover, .bb:active, .bb.bb--imperial, .bb.bb--imperial:active { translate: 0 0; scale: 1; transition: box-shadow .2s ease; }
  .bb__blob { translate: 0 0; animation: none; transition: none; }
}
@media (forced-colors: active) {
  .bb, .bb--quiet { border: 2px solid ButtonText; }
  .bb__blob, .bb::before, .bb::after { display: none; }
}
