/* =====================================================================
   THE RELIQUARY — shop layer
   ---------------------------------------------------------------------
   Lifted VERBATIM from ui/reference-kits/UI-Kit_Reliquary.html.
   These are the shop's page-level classes — the product grid, the shot,
   the cart drawer, the reveal — the things blexx.css does not define
   because they are not general kit components.

   Same rule as every other kit file: do not edit, reformat or tidy this.
   It is extended only by extending the reference kit first.
   ===================================================================== */


  /* ------------------------------------------------------------------
     Shop-only layout. No new colours, radii, shadows or fonts — every
     value below is a --bx-* token or plain geometry. Non-bx- class names
     so nothing can ever collide with a kit component.
     ------------------------------------------------------------------ */
  body { overflow-x: hidden; }

  /* ---- shop chrome ---- */
  .topbar {
    position: sticky; top: 0; z-index: 90;
    display: flex; align-items: center; gap: 16px;
    padding: 14px clamp(16px, 4vw, 40px);
    background: linear-gradient(to bottom, rgba(19,17,18,.86), rgba(19,17,18,0));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .topbar .spacer { flex: 1; }
  .cartbtn { position: relative; }
  .cartbtn .count {
    position: absolute; top: -6px; right: -6px;
    min-width: 20px; height: 20px; padding: 0 5px;
    display: grid; place-items: center;
    border-radius: 999px; background: rgb(var(--bx-accent)); color: var(--bx-void);
    font-family: var(--bx-coded); font-size: 11px; font-weight: 500;
    box-shadow: 0 0 14px rgba(var(--bx-accent), .7);
    transition: transform .16s;
  }
  .cartbtn .count[data-empty] { opacity: 0; transform: scale(.5); }
  .count-pop { animation: pop .42s cubic-bezier(.2,1.6,.3,1); }
  @keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.55)} 100%{transform:scale(1)} }

  /* ---- the reveal ---------------------------------------------------
     The city is a fixed plate over the whole page. Scrolling dollies it
     forward and dissolves it, and the shop — which has been sitting
     underneath the entire time — comes through. Once it's gone the
     plate switches itself off and the page is an ordinary scroll.

     The shop carries a tall top padding so that at the moment the city
     clears, its first real content is exactly at the top of the screen.
     ------------------------------------------------------------------- */
  .reveal {
    position: fixed; inset: 0; z-index: 95; overflow: hidden;
    display: grid; place-items: center;
    will-change: opacity; pointer-events: none;
  }
  .reveal[data-done] { visibility: hidden; }
  .reveal img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; will-change: transform; transform-origin: 50% 44%;
  }
  .reveal::after {                    /* the grade over the city */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(ellipse at 50% 42%, transparent 32%, rgba(9,8,8,.5) 86%),
      linear-gradient(to bottom, rgba(9,8,8,.62) 0%, transparent 26%);
  }
  .reveal-copy {
    position: relative; z-index: 2; text-align: center;
    padding: 0 24px; will-change: transform, opacity;
  }
  /* the shop's name. Urbane, pulled tighter than the kit's .02em so the
     letters lock into one mass instead of reading as a headline. */
  .wordmark { letter-spacing: -.02em; margin: 0; }
  /* the line under it is coded text, which is Bitcount's whole job */
  .undertitle {
    font-family: var(--bx-coded); font-weight: 500;
    font-size: clamp(11px, 1.35vw, 15px);
    letter-spacing: .34em; text-indent: .34em; text-transform: uppercase;
    color: var(--bx-ink); margin: 20px 0 0;
    text-shadow: 0 0 18px rgba(var(--bx-accent), .5), 0 2px 14px rgba(0,0,0,.8);
  }
  .reveal-copy::before {     /* never set copy straight onto a bright bloom */
    content: ""; position: absolute; inset: -18% -12%; z-index: -1;
    background: radial-gradient(ellipse at 50% 50%, rgba(9,8,8,.72), rgba(9,8,8,.34) 52%, transparent 74%);
  }
  .reveal-cue {
    position: absolute; left: 50%; bottom: 6vh; transform: translateX(-50%);
    z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
    will-change: opacity;
  }
  .reveal-cue .bar {
    width: 1px; height: 46px;
    background: linear-gradient(to bottom, transparent, rgba(233,238,238,.7));
    animation: descend 2.6s ease-in-out infinite;
  }
  @keyframes descend {
    0%   { transform: scaleY(.3); transform-origin: top; opacity: .2 }
    45%  { transform: scaleY(1);  transform-origin: top; opacity: 1 }
    46%  { transform: scaleY(1);  transform-origin: bottom }
    100% { transform: scaleY(0);  transform-origin: bottom; opacity: .2 }
  }
  /* the room the reveal needs: the shop starts a screen down */
  [data-blexx-theme] .shopstart { padding-top: 102vh; }   /* the head lands just under the topbar as the city clears */

  @media (prefers-reduced-motion: reduce) {
    .reveal { display: none; }
    [data-blexx-theme] .shopstart { padding-top: 0; }
    .reveal-cue .bar { animation: none; }
  }

  /* ---- product grid ---- */
  .products { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .products > * { min-width: 0; }

  .product { display: flex; flex-direction: column; padding: 0; overflow: hidden;
             transition: opacity .32s, transform .32s; }
  .product[data-hidden] { display: none; }
  .shot {
    position: relative; isolation: isolate; aspect-ratio: 4/3;
    display: grid; place-items: center; overflow: hidden;
    border-bottom: 1px solid var(--bx-line);
  }
  /* stand-in for product photography: the object shot in the city.
     Same world as the page — one world per surface still holds. */
  .shot .bx-world { z-index: 0; }
  .shot::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse at 50% 46%, transparent 34%, rgba(9,8,8,.55) 88%);
  }
  .shot .bx-glyph { position: relative; z-index: 2; width: 34%; }
  /* A real product photograph sits on a plate the colour of its own
     backdrop, so the letterbox is invisible and the whole object is shown.
     contain, never cover — nothing gets cropped. */
  .shot.has-photo { background: #f2f2f0; }
  .shot.has-photo::after { display: none; }   /* no dark vignette over a light plate */
  .shot .shotimg {
    position: relative; z-index: 2;
    width: 100%; height: 100%; object-fit: contain; object-position: center;
    display: block;
  }
  .shot .placeholder {
    position: absolute; left: 12px; bottom: 10px; z-index: 2;
    font-family: var(--bx-coded); font-size: 10px; letter-spacing: .2em;
    color: var(--bx-t-low, rgba(233,238,238,.4));
  }
  .p-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
  .p-foot { margin-top: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .price { font-family: var(--bx-coded); font-weight: 500; font-size: 17px; letter-spacing: .06em; }
  .p-foot .bx-btn { margin-left: auto; }

  /* the letter picker on the sigil */
  .letters { display: flex; flex-wrap: wrap; gap: 5px; }
  .letters button {
    width: 27px; height: 27px; padding: 0; border-radius: var(--bx-r-sm, 8px);
    background: transparent; border: 1px solid var(--bx-line);
    color: var(--bx-t-mid, rgba(233,238,238,.7));
    font-family: var(--bx-coded); font-size: 11px; cursor: pointer;
    transition: all .16s;
  }
  .letters button:hover { border-color: rgba(var(--bx-accent), .6); color: var(--bx-t-hi); }
  .letters button[aria-pressed="true"] {
    background: rgba(var(--bx-accent), .16); border-color: rgb(var(--bx-accent));
    color: rgb(var(--bx-accent)); box-shadow: 0 0 12px rgba(var(--bx-accent), .45);
  }

  /* ---- the take button ---- */
  /* the label falls into the cipher for a beat — it must not resize the
     button, so the glyphs are pinned small and stripped of their glow */
  .take { min-width: 138px; justify-content: center; }
  .take .bx-word { display: inline-flex; gap: 5px; align-items: center; line-height: 0; }
  /* inherit the button's own foreground — on the primary (light) button the
     accent-coloured glyph would be off-white on off-white, i.e. invisible */
  .take .bx-word .bx-glyph { width: 15px; height: 15px; filter: none; color: currentColor; }

  /* the orb that flies to the cart */
  .flyer { position: fixed; z-index: 300; pointer-events: none; }

  /* ---- cart drawer ---- */
  .cart {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
    width: min(400px, 100%); display: flex; flex-direction: column;
    border-radius: 0; border-right: none; border-top: none; border-bottom: none;
    transform: translateX(101%); transition: transform .42s cubic-bezier(.2,.7,.2,1);
  }
  .cart[data-open] { transform: none; }
  .cart-head { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--bx-line); }
  .cart-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
  .cart-foot { padding: 20px; border-top: 1px solid var(--bx-line); display: flex; flex-direction: column; gap: 16px; }
  .line { display: flex; gap: 12px; align-items: center; }
  .line .bx-glyph { width: 30px; flex: none; }
  .line .n { flex: 1; min-width: 0; }
  .line .n strong { display: block; font-size: 13px; font-weight: 600; }
  .line .x { background: none; border: none; color: var(--bx-t-low, rgba(233,238,238,.45)); cursor: pointer; font-size: 17px; line-height: 1; padding: 4px; }
  .line .x:hover { color: rgb(var(--bx-accent)); }
  .empty { text-align: center; padding: 40px 0; }
  .scrim { position: fixed; inset: 0; z-index: 150; background: rgba(9,8,8,.6);
           backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  .scrim[data-open] { opacity: 1; visibility: visible; }

  /* whisper line under the take button */
  .whisperzone { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
                 z-index: 120; pointer-events: none; text-align: center; }

  @media (max-width: 700px) {
    /* the nav must never wrap — a wrapped bx-nav grows the sticky bar
       until it eats the page */
    .topbar .bx-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .topbar .bx-nav::-webkit-scrollbar { display: none; }
  }
  @media (max-width: 560px) {
    .topbar { padding: 12px 16px; gap: 10px; }
    .topbar .bx-nav { display: none; }
    .p-foot .bx-btn { margin-left: 0; width: 100%; }
  }


  /* -- transcription support ------------------------------------------
     The reference kit set these two values as inline style attributes on
     the product card. Components may not carry a style prop, so the same
     values live here as classes. Values unchanged.
     ------------------------------------------------------------------ */
  .p-name     { font-size: 18px; }
  .p-body .bx-body { font-size: 14px; }
  /* a digital spell says so on the tile — nothing arrives in a box */
  .shot .spell-kind { position: absolute; bottom: 12px; left: 12px; z-index: 3; }
  .p-variants { margin-top: 4px; }
  /* the mark you are choosing — drawn by the glyph engine, follows the pressed letter */
  .mark-preview { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; }
  .mark-preview .mark-glyph { width: 56px; height: 56px; color: var(--bx-ink); filter: drop-shadow(0 0 10px rgba(233,238,238,.35)); transition: transform .25s ease; }
  .mark-preview .mark-glyph svg { width: 100%; height: 100%; fill: currentColor; }
  .mark-preview .mark-letter { color: var(--bx-t-lo); }
  .cart-head .bx-eyebrow { flex: 1; }
  .cart-foot .bx-kv      { border-top: none; }
  .reveal-cue .cue-label { font-size: 9px; }

  /* -- spell shots -----------------------------------------------------
     A spell has no photograph; it has a house and a mark. The patron sits
     behind as the house, softened and bloomed in the accent; the mark sits
     crisp in front as the spell. Accent comes from data-blexx-accent on the
     card, so no colour is written here.
     ------------------------------------------------------------------ */
  .shot.spell { background: var(--bx-void-3); }
  .shot.spell::after { display: none; }

  .shot.spell .spell-bloom {
    position: absolute; inset: 0; z-index: 0;
    background:
      radial-gradient(ellipse at 50% 58%, rgba(var(--bx-accent), .20), transparent 62%),
      radial-gradient(ellipse at 50% 120%, rgba(var(--bx-accent), .12), transparent 60%);
  }
  .shot.spell .spell-patron {
    position: absolute; left: 50%; bottom: -6%;
    width: 68%; transform: translateX(-50%);
    z-index: 1; opacity: .34;
    filter: saturate(.7) drop-shadow(0 0 26px rgba(var(--bx-accent), .45));
  }
  .shot.spell .spell-mark {
    position: relative; z-index: 2; width: 34%;
    color: rgb(var(--bx-accent));
    filter: drop-shadow(0 0 18px rgba(var(--bx-accent), .55));
  }
  .shot.spell .spell-slot {
    position: absolute; left: 14px; top: 12px; z-index: 3;
  }
  .shot.spell .spell-patron-name {
    position: absolute; right: 14px; top: 12px; z-index: 3;
  }

  /* -- the patron arriving -------------------------------------------
     A being comes in out of the dark: smoke first, then the body rising
     and settling into its idle breath. Accent comes from the house on the
     wrapper, so no colour is written here.
     ------------------------------------------------------------------ */
  .patron-stage {
    position: relative; display: grid; place-items: center;
    min-height: clamp(280px, 46vh, 460px); margin: 8px 0 28px;
  }
  .patron-dust { position: absolute; inset: 0; width: 100%; height: 100%; }
  .patron-smoke {
    position: absolute; left: 50%; bottom: 4%;
    width: min(680px, 96%); height: 62%;
    transform: translateX(-50%); pointer-events: none;
    background:
      radial-gradient(ellipse at 50% 100%, rgba(var(--bx-accent), .16), transparent 62%),
      radial-gradient(ellipse at 50% 92%, rgba(0,0,0,.92), rgba(0,0,0,.55) 42%, transparent 72%);
    filter: blur(6px);
    animation: bx-smoke 9s ease-in-out infinite;
  }
  @keyframes bx-smoke {
    0%,100% { transform: translateX(-50%) scale(1)      translateY(0); opacity: .9; }
    50%     { transform: translateX(-51%) scale(1.06)   translateY(-8px); opacity: 1; }
  }
  .patron-body {
    position: relative; z-index: 2;
    width: min(320px, 62%);
    animation: bx-patron-arrive 1.9s cubic-bezier(.16,.9,.24,1) both;
  }
  .patron-body img { width: 100%; display: block; }
  @keyframes bx-patron-arrive {
    0%   { opacity: 0; transform: translateY(46px) scale(.88); filter: blur(14px); }
    55%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  }
  .patron-name { margin-top: 18px; text-align: center; }
  @media (prefers-reduced-motion: reduce) {
    .patron-body  { animation: none; }
    .patron-smoke { animation: none; }
  }

  /* -- the cards an order produced ------------------------------------
     What they bought, handed over on the spot. Never a promise that it is
     "on its way" — nothing sends it.
     ------------------------------------------------------------------ */
  .cards-out { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
  .card-out {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 20px; border-radius: var(--bx-r-md);
    text-decoration: none; transition: box-shadow .25s ease, transform .25s ease;
  }
  .card-out:hover { box-shadow: var(--bx-glow-md); transform: translateY(-1px); }
  .card-out-title { font-size: 20px; }
  .wallet-row { margin-top: 18px; }

  /* -- product page ----------------------------------------------------
     A real object gets a page of its own: the photograph large, the words
     beside it. No new colours, radii or shadows — tokens and geometry only.
     ------------------------------------------------------------------ */
  .pdp { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: start; padding-top: 40px; }
  @media (max-width: 860px) { .pdp { grid-template-columns: 1fr; gap: 24px; } }
  .pdp-shot { position: relative; border-radius: var(--bx-r-lg); overflow: hidden; background: #f2f2f0; box-shadow: var(--bx-veil-drop); }
  .pdp-words { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 92px; }
  .pdp-words .price { font-size: 22px; }
  .pdp-foot { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 8px; }
  .pdp-back { align-self: flex-start; }

  /* the zoom: magnify under the cursor, then open full */
  .zoom { cursor: zoom-in; overflow: hidden; aspect-ratio: 4 / 5; }
  .zoom img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; transform-origin: var(--zx, 50%) var(--zy, 50%); }
  .zoom.is-zooming img { transform: scale(2.2); transition: transform .12s ease; }
  .zoom-lightbox { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; overflow: auto; padding: 40px 20px; background: rgba(11,10,10,.94); cursor: zoom-out; backdrop-filter: var(--bx-veil-blur); -webkit-backdrop-filter: var(--bx-veil-blur); }
  .zoom-lightbox img { max-width: none; width: auto; height: auto; max-height: none; box-shadow: var(--bx-veil-drop); border-radius: var(--bx-r-md); }
  .zoom-lightbox .zoom-hint { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); }
  body.zoom-open { overflow: hidden; }

  /* a product card that opens a page: the shot and the name are the door */
  .product a.p-door { display: block; color: inherit; text-decoration: none; }
  .product a.p-door:hover .shotimg { transform: scale(1.03); }
  .product .shotimg { transition: transform .4s ease; }

  /* -- the threshold ---------------------------------------------------
     The door back to the city sits at the head of the topbar; the world's
     music has one button, fixed, bottom-right. Both mirror the city's own
     filter stack: a black depth shadow, then a glow in the ink colour that
     intensifies on hover. No new colours — tokens only.
     ------------------------------------------------------------------ */
  .city-door { display: block; height: 56px; line-height: 0; margin-right: 4px; flex: none; }
  .city-door img {
    height: 100%; width: auto; display: block;
    animation: bx-char-idle 7s ease-in-out infinite;
    transition: filter .4s ease, transform .4s ease;
    filter: drop-shadow(0 10px 16px rgba(0,0,0,.8)) drop-shadow(0 0 12px rgba(233,238,238,.45));
  }
  .city-door:hover img {
    transform: scale(1.08);
    filter: drop-shadow(0 10px 16px rgba(0,0,0,.8)) drop-shadow(0 0 24px rgba(233,238,238,.95));
  }
  @media (max-width: 700px) { .city-door { height: 44px; } }

  .sound-btn { position: fixed; right: 22px; bottom: 22px; z-index: 350; }
  .sound-btn.is-on { color: var(--bx-ink); border-color: var(--bx-ink); box-shadow: var(--bx-glow-sm); }
