/* Chrysalis v2, step 4 (Claude, 10 Nov 2026, overnight): Build a Stack in the shop's dark look, the vial cards with the same
   silver vial as the first screen, the shop and the product page (real label, no colour). Loaded on the Build a Stack page while
   chv2_is_stack() (inc/v2/v2-site.php, the shop's switch); every rule sits under body.chv2s4 .sx-page.
   Same idea as v2-shop.css: stack.css takes most colours from the C3 variables, so the dark look is those variables turned over
   (1) plus the fixed colours it spells out (2). 3. the vial cards   4. the stack's small pictures   5. the panel   6. phone */

/* ---------- 1. the colours, turned over ---------- */
.chv2s4 .c3-root.sx-page{
  --ink:#fff;--paper:#000;--tile:#0c0c0e;--tile-2:#1b1b1f;
  --mute:#a6a7ad;--mute-2:#8d8e94;--line:rgba(255,255,255,.12);--line-2:rgba(255,255,255,.28);
  --cl-acc-ink:#34C28A; /* the savings green for text on black (9.2:1); #077D55 stays for text on a white fill */
  background:#000;color:#fff;color-scheme:dark}

/* ---------- 2. the fixed colours of stack.css: text on a white fill is black now ---------- */
.chv2s4 .sx-page :is(.sx-tier.is-on,.sx-seg__b.is-on,.sx-card__q,.sx-chip.is-on,.sx-add:hover,.btn--black,.sx-peek__chev),
.chv2s4 .sx-page .sx-water__in:checked + .sx-water__box{color:#0e0e10}
.chv2s4 .sx-page .btn--black:hover{background:#e4e5e9}
.chv2s4 .sx-page .sx-tier.is-on .sx-tier__u{color:rgba(14,14,16,.6)}
.chv2s4 .sx-page .sx-tier.is-on .sx-tier__p{border-left-color:rgba(14,14,16,.2);color:#077D55}
.chv2s4 .sx-page .sx-chip.is-on .sx-chip__q{background:#0e0e10;color:#fff}
.chv2s4 .sx-page .sx-find input,.chv2s4 .sx-page .sx-chip:not(.is-on){background:transparent}
.chv2s4 .sx-page .sx-add{background:#000;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}
.chv2s4 .sx-page .sx-add:hover{background:#fff}
.chv2s4 .sx-page .sx-step{background:#000;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}
.chv2s4 .sx-page :is(.sx-step button:hover,.sx-tool:hover){background:#1b1b1f}
.chv2s4 .sx-page .sx-go:disabled{background:#1b1b1f;color:#76787e}
.chv2s4 .sx-page .sx-msg{background:rgba(255,92,72,.12);color:#ff9d90}
.chv2s4 .sx-page .sx-h1{background:linear-gradient(180deg,#fff 0%,#e9eaee 38%,#a8abb3 70%,#d9dbe0 100%);-webkit-background-clip:text;background-clip:text;color:transparent;padding-bottom:.06em}
.chv2s4 .sx-page .sx-card{box-shadow:inset 0 0 0 1px rgba(255,255,255,.07)}
.chv2s4 .sx-page .sx-card.is-in{box-shadow:inset 0 0 0 1.5px #fff}

/* ---------- 3. vial cards: the silver vial (inc/v2/v2-shop.php puts the render in) ----------
   The render is the whole studio (1200 x 1500); the vial stands at 32.14-67.86 % of its width and 20.76-82.10 % of its height
   (render/out/products/meta.json). It stands exactly where the old cut-out vial stood (stack.css + v2-site.css: contain, scale 1.3
   about 50% 51.7%; the cut-out's vial at 15.0-81.4 % of its height): vial top 3.99 % of the picture box, height 86.32 %, so the
   render is 86.32 / 61.34 = 140.73 % of the box high, top 3.99 - 20.76 x 1.4073 = -25.23 %, centred. Its studio fades out in a
   narrow oval around the vial (as in the shop). */
.chv2s4 .sx-page .sx-card__img--vial.chv2-r{position:absolute;inset:auto;top:-25.23%;left:50%;width:auto;height:140.73%;max-width:none;
  object-fit:fill;transform:translateX(-50%);transform-origin:50% 50%;
  -webkit-mask-image:radial-gradient(ellipse 29% 45% at 50% 53%,#000 66%,transparent 100%);mask-image:radial-gradient(ellipse 29% 45% at 50% 53%,#000 66%,transparent 100%)}

/* ---------- 4. the stack's small pictures (stack.js copies the card's picture into the circles and the list) ----------
   Square box, the render covers it (the vial 76.7 % of the box high, centre at 51.5 %), grown 1.22 so the vial fills the circle
   like the old cut-out did; the studio fades in an oval. */
.chv2s4 .sx-page :is(.sx-slot__img,.sx-line__img) img[src*="/assets/v4/products/vial-"]{object-fit:cover;object-position:50% 51%;
  transform:scale(1.22);transform-origin:50% 51.5%;
  -webkit-mask-image:radial-gradient(ellipse 34% 54% at 50% 51.5%,#000 72%,transparent 100%);mask-image:radial-gradient(ellipse 34% 54% at 50% 51.5%,#000 72%,transparent 100%)}

/* ---------- 5. the panel ---------- */
.chv2s4 .sx-page .sx-panel{background:#0c0c0e;border-color:rgba(255,255,255,.1)}
.chv2s4 .sx-page .sx-go-wrap{background:#0c0c0e}
.chv2s4 .sx-page .sx-slot{background:transparent}
.chv2s4 .sx-page .sx-slot.is-full{background:#000}
.chv2s4 .sx-page .sx-slot.is-tier:not(.is-full){border-color:rgba(255,255,255,.5)}
.chv2s4 .sx-page :is(.sx-line__img,.sx-water__pic){background:#000}
.chv2s4 .sx-page .sx-rail__track{background:#2a2a2f}
.chv2s4 .sx-page .sx-water__img,.chv2s4 .sx-page .sx-water__pic img{mix-blend-mode:normal}
@media (prefers-reduced-motion:no-preference){
  .chv2s4 .sx-page .sx-tier.is-hit{animation-name:chv2-sx-ping-pill}
}
@keyframes chv2-sx-ping-pill{0%{box-shadow:0 0 0 0 rgba(255,255,255,.35)}100%{box-shadow:0 0 0 10px rgba(255,255,255,0)}}

/* ---------- 6. phone: the panel is a bottom sheet over a scrim ---------- */
@media (max-width:899px){
  .chv2s4 .sx-page .sx-panel{border:0;box-shadow:0 0 0 1px rgba(255,255,255,.12),0 14px 36px -12px rgba(0,0,0,.7)}
  .chv2s4 .sx-page .sx-scrim{background:rgba(0,0,0,.6)}
  .chv2s4 .sx-page .sx-close{background:#1b1b1f}
  .chv2s4 .sx-page .sx-peek__pct{color:#077D55}
}

/* ---------- 7. the page behind the page: black, so the phone's top strip (iPhone Safari tints it from the page's own background)
   and the overscroll match the dark page ---------- */
html:has(body.chv2s4),html:has(body.chv2s4) body{background-color:#000}

/* ---------- 8. step 5: the true cut-out of the silver vial (class chv2-c) ----------
   Same frame as the studio picture, so the same place and size; no mask. */
.chv2s4 .sx-page .sx-card__img--vial.chv2-c{position:absolute;inset:auto;top:-25.23%;left:50%;width:auto;height:140.73%;max-width:none;
  object-fit:fill;transform:translateX(-50%);transform-origin:50% 50%;-webkit-mask-image:none;mask-image:none}
.chv2s4 .sx-page :is(.sx-slot__img,.sx-line__img) img[src*="/assets/v4/products/cut-vial-"]{object-fit:cover;object-position:50% 51%;
  transform:scale(1.22);transform-origin:50% 51.5%;-webkit-mask-image:none;mask-image:none}
