/* Voxden: the signing goal's corner capsule (assets/support/capsule.js), on
   the home and download pages.

   A glass tube in the bottom-left corner, filled with ink-like liquid as the
   goal fills: a highlight along the top, a lit rim, no shadow and no glow.
   Pressed, it grows upward into a card that holds the tube at its foot. It
   sits clear of the back-to-top button on the right, under the nav, and out
   of the way while the phone menu is open. */

.vcap {
  --vcap-h: 44px;
  position: fixed; z-index: 45;
  left: calc(15px + env(safe-area-inset-left));
  bottom: calc(15px + env(safe-area-inset-bottom));
  display: grid; width: 300px; padding: 5px; border-radius: 27px;
  pointer-events: none;
  transition: opacity 320ms var(--ease), transform 520ms cubic-bezier(.16, 1, .3, 1), visibility 0s;
}
.vcap > * { pointer-events: auto; }
.vcap.is-waiting { opacity: 0; transform: translateY(14px); }
.vcap.is-away, .vcap.is-gone {
  opacity: 0; visibility: hidden; transform: translateY(calc(100% + 40px));
  transition: opacity 260ms var(--ease), transform 460ms cubic-bezier(.16, 1, .3, 1), visibility 0s linear 460ms;
}
html.nav-open .vcap { opacity: 0; visibility: hidden; }

/* The shell: glass that appears around card and tube when open. */
.vcap::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  -webkit-backdrop-filter: var(--glass-bar-blur); backdrop-filter: var(--glass-bar-blur);
  background: var(--glass-bar);
  box-shadow: inset 0 0 0 1px var(--glass-line-strong), inset 0 1px 0 var(--glass-hi);
  opacity: 0; transition: opacity 220ms var(--ease);
}
.vcap.is-open::before { opacity: 1; }

/* ---------- the card ---------- */
.vcap-card {
  position: relative; display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows 320ms cubic-bezier(.16, 1, .3, 1), opacity 180ms var(--ease);
}
.vcap-card[hidden] { display: none; }
.vcap.is-open .vcap-card { grid-template-rows: 1fr; opacity: 1; transition-delay: 0s, 80ms; }
.vcap-card:focus { outline: none; }
.vcap-in { min-height: 0; overflow: hidden; }
.vcap-body { padding: 13px 8px 14px; }
.vcap-head { display: flex; align-items: flex-start; gap: 10px; }
.vcap-title { flex: 1; margin: 0; font: 600 17px/1.28 var(--font-display); letter-spacing: -.015em; color: var(--text); text-wrap: balance; }
.vcap-fold {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -4px 0 0;
  border: 0; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.vcap-fold:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.vcap-fold svg, .vcap-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.vcap-meta { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-3); font-variant-numeric: tabular-nums; }

.vcap-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.vcap-chip {
  height: 36px; padding: 0; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 600 13.5px/1 var(--font-text); color: var(--text-2); font-variant-numeric: tabular-nums;
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.vcap-chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px #3b3b41; }
.vcap-chip[aria-pressed="true"] { color: var(--text); background: rgba(var(--mint-rgb), .09); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), .75); }
.vcap-custom {
  display: flex; align-items: center; gap: 8px; height: 40px; margin-top: 8px; padding: 0 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px rgba(var(--mint-rgb), .75);
}
.vcap-custom[hidden] { display: none; }
.vcap-sym { font: 600 15px/1 var(--font-text); color: var(--text-2); }
.vcap-custom input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--text);
  font: 600 16px/1 var(--font-text); font-variant-numeric: tabular-nums;
}
.vcap-custom input::placeholder { color: var(--text-3); font-weight: 500; }
.vcap-hint { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.vcap-custom.is-bad .vcap-hint { color: #f3a9a9; }
.vcap-go { width: 100%; height: 42px; margin-top: 8px; }
.vcap-go:disabled { cursor: default; background: var(--cta-quiet); opacity: .55; }
.vcap-note { min-height: 1.35em; margin: 8px 0 0; font-size: 12.5px; line-height: 1.35; color: var(--text-3); }
.vcap-note:empty { min-height: 0; margin: 0; }
.vcap-note.is-error { color: #f3a9a9; }
.vcap-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.vcap-more { font-size: 13px; font-weight: 600; color: var(--text-2); transition: color var(--dur) var(--ease); }
.vcap-more:hover { color: var(--text); }
.vcap-hide {
  padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-3);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(237, 237, 239, .25);
}
.vcap-hide:hover { color: var(--text-2); }

/* ---------- the tube ---------- */
.vcap-tube {
  position: relative; display: flex; align-items: center; height: var(--vcap-h); border-radius: calc(var(--vcap-h) / 2);
  overflow: hidden; isolation: isolate;
  -webkit-backdrop-filter: var(--glass-bar-blur); backdrop-filter: var(--glass-bar-blur);
  background: var(--glass-bar);
}
.vcap.is-open .vcap-tube { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, .03); }
.vcap-ink, .vcap-fb { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.vcap-fb {
  display: none; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(180deg, rgb(26 20 56), rgb(6 13 26));
  box-shadow: inset -2px 0 0 rgba(var(--mint-rgb), .9);
  transition: transform 1.4s cubic-bezier(.16, 1, .3, 1);
}
.vcap-tube.no-gl .vcap-ink { display: none; }
.vcap-tube.no-gl .vcap-fb { display: block; }
/* Curved glass: a highlight along the top and a lit rim, over the ink. */
.vcap-tube::before {
  content: ""; position: absolute; z-index: 2; left: 12px; right: 12px; top: 2px; height: 42%;
  border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05) 55%, rgba(255, 255, 255, 0));
}
.vcap-tube::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(var(--mint-rgb), .1);
}
.vcap-open {
  position: relative; z-index: 1; display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; height: 100%;
  padding: 0 40px 0 17px; border: 0; border-radius: inherit; background: none; color: var(--text);
  text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.vcap-open:focus-visible { outline-offset: 2px; }
.vcap.is-open .vcap-open { padding-right: 17px; }
.vcap-label { font: 600 13.5px/1 var(--font-text); white-space: nowrap; }
.vcap-num { margin-left: auto; font: 600 14px/1 var(--font-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vcap-goal { font-style: normal; font-weight: 500; font-size: 12.5px; color: rgba(237, 237, 239, .74); }
.vcap-x {
  position: absolute; right: 7px; top: 50%; z-index: 4; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px;
  padding: 0; border: 0; border-radius: 50%; background: none; color: rgba(237, 237, 239, .7); cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), opacity 160ms var(--ease);
}
.vcap-x::before { content: ""; position: absolute; inset: -8px; }
.vcap-x:hover { background: rgba(255, 255, 255, .1); color: var(--text); }
.vcap.is-open .vcap-x { opacity: 0; visibility: hidden; }

/* ---------- phones: a small tube that opens to the full width ---------- */
@media (max-width: 639px) {
  .vcap {
    --vcap-h: 32px;
    left: calc(7px + env(safe-area-inset-left)); bottom: calc(7px + env(safe-area-inset-bottom));
    width: auto; max-width: calc(100vw - 14px - env(safe-area-inset-left) - env(safe-area-inset-right));
    border-radius: 21px;
  }
  .vcap.is-open { width: calc(100vw - 14px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  .vcap-open { gap: 8px; padding: 0 32px 0 12px; }
  .vcap-label { font-size: 12px; }
  .vcap-num { margin-left: 0; font-size: 12px; }
  .vcap:not(.is-open) .vcap-goal { display: none; }
  .vcap.is-open .vcap-num { margin-left: auto; }
  .vcap.is-open .vcap-open { padding-right: 12px; }
  .vcap-x { right: 4px; width: 24px; height: 24px; margin-top: -12px; }
  .vcap-x svg { width: 10px; height: 10px; }
  .vcap-tube::before { left: 9px; right: 9px; top: 1.5px; }
  .vcap-body { padding: 12px 8px 12px; }
  .vcap-title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .vcap, .vcap::before, .vcap-card, .vcap-fb { transition: none; }
}
