/* Crest liquid bottom navigation — phone only.
   Ported from the "Crest" React piece; frosted recipe and inks follow the sidebar. */
@property --ct-k { syntax: "<number>"; inherits: true; initial-value: 0; }

.crest-nav {
  --ct-pitch: clamp(58px, 3.2vw + 42px, 84px);
  --ct-bar-h: calc(var(--ct-pitch) * .82);
  --ct-icon: clamp(20px, calc(var(--ct-pitch) * .318), 28px);
  --ct-pad: calc(var(--ct-pitch) * .42);
  --ct-out: cubic-bezier(.22, .84, .3, 1);
  --ct-in: cubic-bezier(.55, 0, .78, .2);
  --ct-bg: linear-gradient(168deg, rgba(255, 255, 255, .88), rgba(255, 255, 255, .62));
  --ct-acc: #3b82f6;
  --ct-ink: #3f4756;
  --ct-rim: rgba(255, 255, 255, .85);
  --ct-edge: rgba(255, 255, 255, .6);
  --ct-shade: rgba(15, 23, 42, .14);
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: none;
  width: max-content;
  max-width: calc(100vw - 20px);
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--ct-bg);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
  backdrop-filter: blur(28px) saturate(1.35);
  box-shadow:
    0 0 0 1px var(--ct-rim),
    0 1px 0 var(--ct-edge) inset,
    0 12px 32px var(--ct-shade);
}
html[data-theme="dark"] .crest-nav {
  --ct-bg: linear-gradient(168deg, rgba(23, 23, 23, .92), rgba(23, 23, 23, .78));
  --ct-acc: #ffffff;
  --ct-ink: #d9d9d9;
  --ct-rim: rgba(255, 255, 255, .12);
  --ct-edge: rgba(255, 255, 255, .08);
  --ct-shade: rgba(0, 0, 0, .5);
}
@media (max-width: 767px) and (prefers-reduced-transparency: reduce) {
  .crest-nav { background: #fff; }
  html[data-theme="dark"] .crest-nav { background: #171717; }
}
@media (max-width: 767px) { body.crest-on .crest-nav { display: block; } }
@media (max-width: 380px) { .crest-nav { --ct-pitch: clamp(50px, 15.5vw, 58px); } }

.ct-liquid { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ct-liquid svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; fill: var(--ct-acc); }
.ct-items { position: relative; display: flex; margin: 0; padding: 0 var(--ct-pad); list-style: none; }
.ct-items > li { display: flex; }
.ct-item {
  --ct-k: 0;
  display: grid;
  place-items: center;
  width: var(--ct-pitch);
  height: var(--ct-bar-h);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ct-ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ct-item[data-on="1"] { --ct-k: 1; color: var(--ct-acc); }
.ct-boot .ct-item { transition: --ct-k .12s var(--ct-in); }
.ct-boot .ct-item[data-on="1"] { transition: --ct-k .2s var(--ct-out); }
.ct-item:focus-visible { outline: none; }
.ct-item:focus-visible .ct-ic::after {
  content: "";
  position: absolute;
  inset: calc(var(--ct-icon) * -.45);
  border-radius: 999px;
  outline: 2px solid var(--ct-acc);
}
.ct-ic {
  position: relative;
  display: block;
  width: var(--ct-icon);
  height: var(--ct-icon);
  transform: translate3d(0, calc(var(--ct-k) * .8px), 0);
}
.ct-glyph { position: absolute; inset: 0; transition: transform .22s var(--ct-out); }
@media (hover: hover) { .ct-item:hover .ct-glyph { transform: scale(1.08); } }
.ct-item:active .ct-glyph { transform: scale(.93); transition-duration: .08s; }
.ct-glyph svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
/* One disc floods the icon from its bottom centre: a hole in the outline, a clip on the solid. */
.ct-line {
  --ct-r: calc(var(--ct-k) * var(--ct-icon) * 1.125);
  -webkit-mask-image: radial-gradient(circle at 50% 100%, transparent var(--ct-r), #000 var(--ct-r));
  mask-image: radial-gradient(circle at 50% 100%, transparent var(--ct-r), #000 var(--ct-r));
}
.ct-solid { clip-path: circle(calc(var(--ct-k) * var(--ct-icon) * 1.125) at 50% 100%); }

/* Reserve room below the page so the floating bar never covers content. */
@media (max-width: 767px) {
  body.crest-on .shell { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.crest-on main { padding-bottom: 10px; }
  body.crest-on .site-footer { padding: 14px 0 4px; }
  body.crest-on[data-page="landing"] .shell { padding-bottom: 0; }
  body.crest-on[data-page="landing"] .catalog-hero .legal-disclaimer { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  body.crest-on .notice { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  /* Fade scrolling content out under the floating pill so no stray sliver shows in the gap below it. */
  body.crest-on:not([data-page="landing"])::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(84px + env(safe-area-inset-bottom, 0px));
    z-index: 5;
    pointer-events: none;
    background: linear-gradient(to top, var(--canvas) 0%, var(--canvas) 12%, transparent 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ct-boot .ct-item, .ct-boot .ct-item[data-on="1"] { transition: none; }
  .ct-glyph { transition: none; }
  .ct-item:hover .ct-glyph, .ct-item:active .ct-glyph { transform: none; }
}