/* ============================================================
   Aspect V3 home - pair builder (markup build.mjs §pair, behaviour v3.js "Pair builder").
   A white tile: copy + one-tap popular pairs on the left, a navy stage on the right where the two
   real vials stand on lit plinths, joined by a pulsing "+". The vial of equal or lesser value is
   stamped $0 (mint plinth). A full-width total bar sits under the vials so nothing ever clips.
   MOTION: on enter vials rise (120ms apart), the orb pops, the beam draws, the $0 tag stamps;
   on change the vial drops out and the new one rises, prices roll, the $0 tag re-stamps where it
   lands; orb ring pulses gently while in view. Reduced motion: static.
   ============================================================ */
.v3-pair-sec { background: none; }
.pb { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: center;
  padding: clamp(22px, 3.6vw, 48px); border-radius: 30px; background: #fff;
  box-shadow: 0 0 0 1px rgba(11, 21, 49, .05), 0 1px 2px rgba(11, 21, 49, .04), 0 26px 60px -36px rgba(11, 21, 49, .35); }
.pb-copy .v3-h2 { font-size: clamp(2.1rem, 1.2rem + 2.4vw, 3.4rem); }
.pb-copy .v3-sub { max-width: 30em; }
.pb-k { margin: 28px 0 10px; font-family: var(--v-mono, var(--font-mono)); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #5a647d; }
.pb-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-pre { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #d3dae6; background: #fff;
  color: #0b1531; font: 600 13px var(--font-sans); cursor: pointer; transition: background-color 200ms, border-color 200ms, color 200ms, translate 200ms; }
.pb-pre i { font-style: normal; color: #1561dc; font-weight: 700; }
.pb-pre[aria-pressed="true"] { background: #0b1531; border-color: #0b1531; color: #fff; }
.pb-pre[aria-pressed="true"] i { color: #8cc0ff; }
.pb-alt { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font: 600 14px var(--font-sans); color: #1561dc; text-decoration: none; }
.pb-alt svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- stage ---------- */
.pb-stage { position: relative; isolation: isolate; overflow: hidden; padding: clamp(18px, 2.4vw, 30px); border-radius: 26px; color: #f2f5fb;
  background: radial-gradient(70% 60% at 50% 30%, #12347f 0%, #0a1f52 45%, #061331 80%, #040c22 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.pb-grid { position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background-image: linear-gradient(rgba(140, 192, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 192, 255, .07) 1px, transparent 1px); background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 80%); mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent 80%); }
.pb-pair { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); align-items: start; }
.pb-slot { min-width: 0; display: grid; }
.pb-vis { position: relative; height: clamp(220px, 20vw, 290px); display: grid; place-items: end center; }
.pb-vis img { position: relative; z-index: 2; display: block; height: 88%; width: auto; filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .5));
  transition: opacity 260ms, translate 420ms cubic-bezier(.22, 1, .36, 1), filter 260ms; }
.pb-plinth { position: absolute; z-index: 1; left: 50%; bottom: -2px; width: 74%; height: 44px; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(79, 141, 255, .6), rgba(21, 97, 220, .2) 60%, transparent); transition: background 500ms; }
.pb-plinth::after { content: ""; position: absolute; inset: 24% 16%; border-radius: 50%; border: 1px solid rgba(140, 192, 255, .55); box-shadow: 0 0 22px rgba(79, 141, 255, .55), inset 0 0 14px rgba(79, 141, 255, .35); transition: border-color 500ms, box-shadow 500ms; }
.pb-slot.is-free .pb-plinth { background: radial-gradient(closest-side, rgba(94, 230, 166, .5), rgba(31, 157, 99, .18) 60%, transparent); }
.pb-slot.is-free .pb-plinth::after { border-color: rgba(124, 240, 181, .6); box-shadow: 0 0 22px rgba(94, 230, 166, .5), inset 0 0 14px rgba(94, 230, 166, .3); }
.pb-tag { position: absolute; z-index: 3; top: 6%; right: 6%; padding: 6px 11px; border-radius: 999px; background: #fff; color: #071a45;
  font: 700 11px var(--v-mono, var(--font-mono)); letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .6); }
.pb-slot.is-free .pb-tag { background: #5ee6a6; color: #04301c; font-size: 15px; letter-spacing: .02em; rotate: -8deg; }
.pb-label { margin: 16px 0 6px; font-family: var(--v-mono, var(--font-mono)); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #93a1bd; }
.pb-select { position: relative; }
.pb-select select { width: 100%; height: 48px; padding: 0 40px 0 14px; border-radius: 14px; appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 1px solid rgba(140, 192, 255, .26); background: rgba(255, 255, 255, .07); color: #fff; font: 600 15px var(--font-sans); text-overflow: ellipsis; }
.pb-select select option, .pb-select select optgroup { color: #0b1531; background: #fff; }
.pb-select svg { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; translate: 0 -50%; pointer-events: none; fill: none; stroke: #8cc0ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pb-select select:focus-visible { outline: none; border-color: #8cc0ff; box-shadow: 0 0 0 3px rgba(79, 141, 255, .35); }
.pb-price { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0; min-height: 30px; }
.pb-price s { font-size: 14px; color: #93a1bd; }
.pb-price b { font-size: 1.5rem; font-weight: 600; letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }
.pb-slot.is-free .pb-price b { color: #7cf0b5; }

.pb-link { position: relative; height: clamp(220px, 20vw, 290px); display: grid; place-items: center; }
.pb-beam { position: absolute; left: -60%; right: -60%; top: 62%; height: 2px; border-radius: 2px; transform-origin: 50% 50%;
  background: linear-gradient(90deg, transparent, rgba(79, 141, 255, .8) 30%, #e6f0ff 50%, rgba(124, 240, 181, .8) 70%, transparent); box-shadow: 0 0 12px rgba(79, 141, 255, .6); }
.pb-orb { position: relative; z-index: 2; top: 12%; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #fff; color: #071a45;
  font: 600 26px/1 var(--font-sans); box-shadow: 0 0 0 6px rgba(79, 141, 255, .18), 0 14px 30px -10px rgba(0, 0, 0, .7); }
.pb-orb::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(140, 192, 255, .6); opacity: 0; }
.pb-bogo { position: absolute; z-index: 2; top: calc(62% + 34px); white-space: nowrap; font-family: var(--v-mono, var(--font-mono)); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #8cc0ff; }

.pb-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 22px; padding: 16px 16px 16px 22px; border-radius: 18px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(140, 192, 255, .18); }
.pb-tot { display: grid; gap: 2px; margin: 0; }
.pb-tot span { font-family: var(--v-mono, var(--font-mono)); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #93a1bd; }
.pb-tot s { font-size: 1.15rem; color: #c3cde0; font-variant-numeric: tabular-nums; }
.pb-pay b { font-size: 2rem; font-weight: 600; letter-spacing: -.045em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.pb-save { margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(94, 230, 166, .14); border: 1px solid rgba(94, 230, 166, .35); color: #7cf0b5; font: 600 13px var(--font-sans); }
.pb-add { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 24px; border: 0; border-radius: 999px; background: #fff; color: #071a45;
  font: 600 15px var(--font-sans); cursor: pointer; box-shadow: 0 12px 30px -12px rgba(140, 192, 255, .8); transition: background-color 180ms; }
.pb-add svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pb-add.is-added { background: #5ee6a6; color: #04301c; }
.pb :is(button, a):focus-visible { outline: 2px solid #1561dc; outline-offset: 3px; }
.pb-stage :is(button, a):focus-visible { outline-color: #8cc0ff; }
@media (hover: hover) and (pointer: fine) {
  .pb-pre:hover:not([aria-pressed="true"]) { border-color: #1561dc; color: #1561dc; translate: 0 -1px; }
  .pb-add:hover { background: #e9f2ff; }
  .pb-alt:hover { text-decoration: underline; text-underline-offset: 3px; }
  .pb-select select:hover { border-color: rgba(140, 192, 255, .5); }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .pb-arm .pb-vis img { opacity: 0; translate: 0 34px; filter: blur(8px) drop-shadow(0 22px 22px rgba(0, 0, 0, .5)); }
  .pb-arm .pb-orb { scale: .3; opacity: 0; }
  .pb-arm .pb-beam { scale: 0 1; opacity: 0; }
  .pb-arm .pb-tag { opacity: 0; scale: 1.6; }
  .pb-arm .pb-sum { opacity: 0; translate: 0 14px; }
  .pb-in .pb-vis img { opacity: 1; translate: 0 0; filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .5)); transition: opacity 700ms cubic-bezier(.22, 1, .36, 1), translate 800ms cubic-bezier(.22, 1, .36, 1), filter 700ms; }
  .pb-in [data-slot="b"] .pb-vis img { transition-delay: 120ms; }
  .pb-in .pb-orb { scale: 1; opacity: 1; transition: scale 600ms cubic-bezier(.34, 1.56, .64, 1) 420ms, opacity 300ms 420ms; }
  .pb-in .pb-beam { scale: 1 1; opacity: 1; transition: scale 900ms cubic-bezier(.22, 1, .36, 1) 520ms, opacity 300ms 520ms; }
  .pb-in .pb-tag { opacity: 1; scale: 1; transition: opacity 260ms 900ms, scale 520ms cubic-bezier(.34, 1.56, .64, 1) 900ms; }
  .pb-in .pb-sum { opacity: 1; translate: 0 0; transition: opacity 500ms 700ms, translate 600ms cubic-bezier(.22, 1, .36, 1) 700ms; }
  .pb-live .pb-orb::before { animation: pb-ring 2.6s ease-out infinite; }
  .pb-slot.is-out .pb-vis img { opacity: 0; translate: 0 22px; filter: blur(6px) drop-shadow(0 22px 22px rgba(0, 0, 0, .5)); transition-duration: 220ms; }
  .pb-tag.is-stamp { animation: pb-stamp 520ms cubic-bezier(.34, 1.56, .64, 1); }
  .pb-roll { display: inline-block; animation: pb-roll 380ms cubic-bezier(.22, 1, .36, 1); }
}
@keyframes pb-ring { 0% { opacity: .8; scale: 1; } 100% { opacity: 0; scale: 1.7; } }
@keyframes pb-stamp { 0% { scale: 1.7; opacity: 0; } 60% { scale: .92; opacity: 1; } 100% { scale: 1; } }
@keyframes pb-roll { from { opacity: .2; translate: 0 8px; } }

/* ---------- tablet / phone ---------- */
@media (max-width: 1023px) { .pb { grid-template-columns: minmax(0, 1fr); } .pb-copy .v3-sub { max-width: 40em; } }
@media (max-width: 599px) {
  .pb { padding: 20px 16px 16px; border-radius: 24px; }
  .pb-stage { padding: 16px 12px; border-radius: 20px; }
  .pb-pair { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); }
  .pb-vis, .pb-link { height: 190px; }
  .pb-orb { width: 38px; height: 38px; font-size: 20px; }
  .pb-bogo { display: none; }
  .pb-tag { top: 2%; right: 0; font-size: 9.5px; padding: 5px 8px; }
  .pb-slot.is-free .pb-tag { font-size: 13px; }
  .pb-select select { height: 46px; padding: 0 30px 0 10px; font-size: 16px; border-radius: 12px; }
  .pb-select svg { right: 9px; }
  .pb-price b { font-size: 1.25rem; }
  .pb-sum { gap: 12px 18px; padding: 14px; }
  .pb-pay b { font-size: 1.7rem; }
  .pb-add { width: 100%; justify-content: center; margin-left: 0; }
}
/* the vial image is sized by its slot, never by its intrinsic 760px */
.pb-vis img { position: absolute; left: 0; right: 0; bottom: 14px; margin-inline: auto; height: 86%; width: auto; max-width: none; }
/* refinements: more stage on desktop, tags on each vial's shoulder, full-width pickers on phones */
.pb-vis { --vh: clamp(220px, 20vw, 300px); height: var(--vh); }
.pb-link { height: clamp(220px, 20vw, 300px); }
.pb-tag { top: 9%; right: max(4px, calc(50% - var(--vh) * .19 - 18px)); }
@media (min-width: 1200px) { .pb { grid-template-columns: minmax(0, 4.2fr) minmax(0, 7.8fr); } }
@media (max-width: 599px) {
  .pb-vis { --vh: 190px; }
  .pb-pair { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    grid-template-areas: "va lk vb" "la la pa" "sa sa sa" "lb lb pb" "sb sb sb"; }
  .pb-slot { display: contents; }
  [data-slot="a"] .pb-vis { grid-area: va; } [data-slot="b"] .pb-vis { grid-area: vb; } .pb-link { grid-area: lk; }
  [data-slot="a"] .pb-label { grid-area: la; } [data-slot="b"] .pb-label { grid-area: lb; }
  [data-slot="a"] .pb-select { grid-area: sa; } [data-slot="b"] .pb-select { grid-area: sb; }
  [data-slot="a"] .pb-price { grid-area: pa; } [data-slot="b"] .pb-price { grid-area: pb; }
  .pb-label { margin: 16px 0 6px; align-self: end; }
  .pb-price { margin: 16px 0 6px; justify-content: flex-end; align-self: end; min-height: 0; }
  .pb-price b { font-size: 1.1rem; }
  .pb-select select { padding: 0 38px 0 14px; }
  .pb-select svg { right: 14px; }
}
/* vial swap: a fresh image fades up once loaded, the old one fades down; no filter on the swap */
.pb-vis img.pb-img-out { opacity: 0; translate: 0 16px; transition: opacity 220ms ease-in, translate 260ms ease-in; }
@media (prefers-reduced-motion: no-preference) { .pb-vis img.pb-img-in { animation: pb-rise 520ms cubic-bezier(.22, 1, .36, 1) both; } }
@keyframes pb-rise { from { opacity: 0; translate: 0 24px; } }
/* touch screens: no blur at all in the entrance (iPhone Safari repaint), opacity + rise only */
@media (hover: none), (pointer: coarse) {
  .pb-arm .pb-vis img { filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .5)); }
  .pb-slot.is-out .pb-vis img { filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .5)); }
}
.pb-who { flex: 1 0 100%; margin: 0; font-size: 14px; color: #c3cde0; }
.pb-slot.is-free .pb-tag { letter-spacing: .06em; font-size: 12px; text-transform: uppercase; }
