/* THE SHOP (/shop; site round eight, 2026-11-16). Loaded on the shop's page only, after the workshop's own stylesheet
   (jar.css: the comics, the reader, the coins, the records' sleeves and the envelope are the workshop's, so the two
   rooms keep one look). This file adds the co-op: one picture you act on, the things on its counter with their tags
   and lines, their papers, and the phone's page. Nothing here moves but a paper's arrival (stepped, as the workshop's),
   and base.css stops that under reduced motion. Without JavaScript the picture is a still and the papers stack after it. */

html[data-place="shop"], html[data-place="shop"] body { background: #0d0a07; }
html[data-place="shop"] #stage { display: none; } /* no world on this page */

/* ------------------------------------------------------------------ the set */
.shop-stage { position: relative; }
.js .shop-stage { position: fixed; z-index: 0; left: 0; top: 0; width: 100vw; height: var(--shop-h, 100dvh); overflow: hidden; background: #0d0a07; }
.js .shop-set { position: absolute; left: 0; top: 0; width: 1920px; height: 1072px; transform-origin: 0 0; }
.js .shop-set .shop-plate { position: absolute; left: 0; top: 0; display: block; width: 1920px; height: 1072px; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* the co-op's gilt window lettering, the site's own, read from inside: mirrored, as it should be */
.shop-gilt { display: none; }
.js .shop-gilt { display: block; position: absolute; overflow: visible; pointer-events: none; }
.gilt-t { font: 700 30px/1 var(--print); letter-spacing: 0.08em; fill: url(#gilt-g); stroke: rgba(46, 28, 6, 0.6); stroke-width: 0.9px; paint-order: stroke; opacity: 0.92; }
.gilt-b { font-size: 17px; letter-spacing: 0.2em; }

/* ------------------------------------------------------------------ the things on the counter: the object is the door, its tag and line hang off it */
.shop-doors { display: none; }
.js .shop-doors { display: block; position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.js .shop-doors .obj { pointer-events: auto; }
.shop-door[aria-expanded="true"] .frame { visibility: visible; }
.shop-door .hang { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; white-space: nowrap; }
.shop-door .hang .tag { position: relative; left: auto; top: auto; translate: none; }
.shop-door.hang-above .hang { left: 50%; bottom: calc(100% + 12px); transform: translateX(-42%); }
.shop-door.hang-below .hang { left: 50%; top: calc(100% + 16px); transform: translateX(-42%); }
.shop-door.hang-side .hang { left: calc(100% + 12px); top: 20%; }
.js .shop-door.hang-in .hang { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); align-items: center; }
.shop-door.hang-in .line { margin-left: 0; }
/* the tag's string runs down to the thing it is tied to when the tag hangs over it */
.shop-door.hang-above .tag .hole::after { bottom: auto; top: 4px; rotate: 172deg; height: 30px; }
.shop-door.hang-side .tag .hole::after { rotate: -100deg; left: -2px; height: 24px; }
.shop-door .price { margin-left: 12px; padding: 4px 7px 3px; font: 700 var(--t-small)/1 var(--type); letter-spacing: 0.04em; word-spacing: 0;
  color: #f2cf6b; background: #1c1813; border-radius: 2px; rotate: 2deg; }
.shop-door .line { margin-left: 14px; padding: 6px 11px 5px; rotate: 1.2deg; font: italic 400 var(--t-note)/1.2 var(--type); color: var(--ink);
  background: url(/shell/paper.webp) 0 0 / 128px, var(--paper); background-blend-mode: multiply; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55); }
.shop-door.not-yet .line::after { content: attr(data-closed); display: block; margin-top: 3px; font-style: normal; font-weight: 700; letter-spacing: 0.06em; color: var(--stamp); }
.shop-door:focus-visible .tag, .shop-door:hover .tag { outline: 3px solid var(--focus); outline-offset: 3px; }
.shop-door .tag.swing { animation: swing 0.333s steps(1, end) both; }

/* ------------------------------------------------------------------ the papers */
.shop-paper { color: #1c1813; font: 400 var(--t-note)/var(--lh-body) var(--type); }
.shop-paper h2 { margin: 0; font: 700 var(--t-small)/1 var(--type); letter-spacing: var(--track-label); }
.shop-paper h2:focus { outline: none; }
.shop-paper h2:focus-visible { outline: 2px solid #7a5a12; outline-offset: 4px; }
.shop-paper .small { margin: 10px 0 0; font-size: var(--t-small); line-height: 1.45; text-wrap: pretty; color: #4a3d2c; }
.shop-paper .note:empty { display: none; }
.shop-paper .note { font-weight: 700; color: #6b2a16; }
.js .shop-paper .paper-head { position: sticky; top: -20px; z-index: 2; margin: -20px -24px 6px; padding: 20px 24px 4px;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; }
.shop-paper .drop { margin: 4px 0 0 4px; }
.shop-paper .drop:disabled { filter: grayscale(0.8) brightness(0.86) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); cursor: default; }
.shop-paper .drop:focus-visible, .shop-follow a:focus-visible, .shop-library:focus-visible { outline: 3px solid #7a5a12; outline-offset: 3px; }
.shop-paper .envelope { margin: 10px 0 0; scroll-margin-top: 48px; background: url(/shell/paper.webp) 0 0 / 160px, #d9bf8c; background-blend-mode: multiply; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
.shop-paper .envelope summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 52px; padding: 10px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font: 700 var(--t-small)/1.2 var(--type); letter-spacing: var(--track-label); color: #7a1f17; }
.shop-paper .envelope summary::-webkit-details-marker { display: none; }
.shop-paper .envelope summary small { font: italic 400 var(--t-small)/1 var(--type); letter-spacing: 0; color: #4a3a28; }
.shop-paper .envelope summary:focus-visible { outline: 3px solid #7a5a12; outline-offset: -4px; }
.shop-paper .envelope .flap { width: 26px; height: 18px; flex: none; border: 2px solid #7a1f17; background: linear-gradient(to bottom right, transparent 48%, #7a1f17 49% 52%, transparent 53%) left / 50% 100% no-repeat, linear-gradient(to bottom left, transparent 48%, #7a1f17 49% 52%, transparent 53%) right / 50% 100% no-repeat; }
.shop-paper .envelope[open] .flap { background: linear-gradient(to top right, transparent 48%, #7a1f17 49% 52%, transparent 53%) left / 50% 100% no-repeat, linear-gradient(to top left, transparent 48%, #7a1f17 49% 52%, transparent 53%) right / 50% 100% no-repeat; }
.shop-paper .envelope .comics { margin: 0; padding: 4px 12px 14px; }
#card-comics .paper-say { margin-bottom: 9px; }

/* THE BOOK: the cover, the buy badge (or NOT FOR SALE YET), the library */
.shop-book { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); gap: 16px; align-items: start; }
.shop-cover { display: block; width: 100%; height: auto; aspect-ratio: 480 / 768; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); rotate: -1.5deg; }
.shop-books { display: block; }
.shop-buy .badge { min-height: 58px; }
.shop-buy .badge .ed-w b { font-size: var(--t-lead); }
.shop-closed { margin: 0; }
.shop-closed .stamp-x { display: inline-block; margin: 2px 0 8px; padding: 6px 10px 4px; rotate: -4deg; font: 700 var(--t-body)/1 'TF Stencil', var(--type); letter-spacing: 0.08em;
  color: var(--stamp); border: 3px solid var(--stamp); border-radius: 3px; mix-blend-mode: multiply; }
.shop-closed span:last-child { display: block; font-size: var(--t-small); line-height: 1.45; color: #4a3d2c; }
.shop-lib { margin-top: 14px !important; }
/* THE AUDIOBOOK: the tape (its heading is the paper's own), then the whole book */
.shop-tape .sample { margin: 0; padding: 0; border-top: 0; }
.shop-tape .sample-h { display: none; }
.shop-whole { display: block; margin-top: 14px; }
.shop-whole .small { margin: 0 0 6px; }
/* THE COMICS: the library's line */
.shop-published a { margin-left: 4px; color: #4a2a10; font-weight: 700; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 3px; }
/* THE RECORDS: one sleeve is a wide row, not a third of the paper */
.sleeves.one { grid-template-columns: minmax(0, 200px); }
/* FOLLOW */
.shop-follow { margin: 8px 0 4px 4px; }
.shop-follow .tag { white-space: normal; text-decoration: none; }
.shop-follow .tag .hole::after { display: none; }
.shop-honest { margin-top: 14px !important; }

/* ------------------------------------------------------------------ a desk: the paper opens on the side away from its thing */
.js[data-shop="desk"] .shop-paper {
  position: fixed; z-index: 12; display: none; top: calc(var(--padt) + 70px);
  width: min(420px, 36vw); max-height: calc(100dvh - var(--padt) - var(--padb) - 150px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 24px 22px; background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.7);
}
.js[data-shop="desk"] .shop-paper.left { left: calc(var(--pad) + 8px); rotate: -0.8deg; }
.js[data-shop="desk"] .shop-paper.right { right: calc(var(--padr) + 8px); rotate: 0.7deg; }
.js[data-shop="desk"] .shop-paper.open { display: block; animation: jar-in 0.25s steps(1, end) both; }
.js[data-shop="desk"] #card-comics { width: min(460px, 40vw); }
/* (a short laptop: the open covers a little smaller, so the paper shows whole with the envelope closed) */
@media (max-height: 760px) and (min-aspect-ratio: 9/10) { .js[data-shop="desk"] #card-comics .comics:not(details .comics) .comic-cover { max-height: 160px; width: auto; max-width: 100%; align-self: center; } }
/* a short, wide screen (a phone on its side): the papers use the height */
@media (max-height: 520px) and (min-aspect-ratio: 9/10) {
  .js[data-shop="desk"] .shop-paper { top: calc(var(--padt) + 50px); width: min(460px, 52vw); max-height: calc(100dvh - var(--padt) - var(--padb) - 112px); padding: 10px 16px 12px; }
  .js[data-shop="desk"] .shop-paper .paper-head { top: -10px; margin: -10px -16px 6px; padding: 10px 16px 4px; }
  .js[data-shop="desk"] #card-comics { width: min(520px, 56vw); }
  .shop-door .line { display: none; }
  .js .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
  .js .pick { grid-template-rows: 34px auto auto; min-height: 74px; padding: 4px 2px 5px; gap: 2px; }
  .js .pick .heap { scale: 0.7; transform-origin: 50% 0; margin-bottom: -16px; }
}

/* ------------------------------------------------------------------ a phone: the picture on top, the tags, then every paper: a page you scroll */
.js[data-shop="phone"] body { background: url(/shell/paper.webp) 0 0 / 220px, linear-gradient(180deg, #3a2716, #24170c 40%, #160e07); background-blend-mode: multiply; }
.js[data-shop="phone"] .shop-stage { position: relative; height: var(--shop-h); }
.js[data-shop="phone"] .shop-doors { position: relative; inset: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; padding: 16px 8px 4px; }
.js[data-shop="phone"] .shop-door { position: relative; min-width: 0; min-height: 0; }
.js[data-shop="phone"] .shop-door .frame { display: none; }
.js[data-shop="phone"] .shop-door .hang { position: static; transform: none; }
.js[data-shop="phone"] .shop-door .tag { font-size: var(--t-note); min-height: 46px; padding: 10px 14px 10px 29px; }
.js[data-shop="phone"] .shop-door .price { margin-left: 8px; }
.js[data-shop="phone"] .furniture::before { content: ''; position: absolute; z-index: -1; left: calc(-1 * var(--pad)); right: calc(-1 * var(--padr)); top: -14px; bottom: calc(-1 * var(--padb));
  background: linear-gradient(to top, rgba(14, 9, 4, 0.96) 72%, rgba(14, 9, 4, 0)); pointer-events: none; }
.js[data-shop="phone"] .shop-door .tag .hole::after { rotate: 14deg; left: 3.5px; top: auto; bottom: 4px; height: 26px; }
.js[data-shop="phone"] .shop-door .line { display: none; }
.js[data-shop="phone"] .shop-papers { padding: 6px 8px calc(var(--padb) + 128px); }
.js[data-shop="phone"] .shop-paper { position: relative; display: block; margin: 14px 0 0; padding: 16px 16px 18px; scroll-margin-top: 12px;
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.6); }
.js[data-shop="phone"] .shop-paper:nth-child(odd) { rotate: -0.4deg; }
.js[data-shop="phone"] .shop-paper:nth-child(even) { rotate: 0.4deg; }
.js[data-shop="phone"] .shop-paper .paper-head { position: static; margin: 0 0 6px; padding: 0; background: none; }
.js[data-shop="phone"] .shop-paper .close { display: none; }
.js[data-shop="phone"] .shop-paper .paper-say { margin-bottom: 10px; }
.js[data-shop="phone"] .picks { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.js[data-shop="phone"] .pick { grid-template-columns: minmax(0, 1fr); grid-template-rows: 38px auto auto; min-height: 92px; padding: 6px 2px 7px; gap: 3px; }
.js[data-shop="phone"] .pick .heap { scale: 0.7; transform-origin: 50% 0; margin-bottom: -16px; }
.js[data-shop="phone"] .pick .pick-l { font-size: var(--t-micro); letter-spacing: 0; white-space: normal; }
.js[data-shop="phone"] .pick .pick-v { font-size: var(--t-lead); }
.js[data-shop="phone"] .jar-stamp { position: relative; right: auto; bottom: auto; display: inline-block; vertical-align: middle; margin: 4px 0 0 14px; }
.js[data-shop="phone"] .comics { gap: 10px; }
.js[data-shop="phone"] .shop-book { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; }
@media (max-width: 360px) { .js[data-shop="phone"] .shop-book { grid-template-columns: minmax(0, 1fr); } .js[data-shop="phone"] .shop-cover { width: 120px; } }
/* the stamp on a desk: the jar's own place, over the paper's foot */
.js[data-shop="desk"] .jar-stamp { right: 18px; bottom: 54px; }

/* THE COMICS' reader on the shop: the co-op, dimmed behind the book (the shop's own picture, already on the page) */
html[data-place="shop"] .comic-reader {
  background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), url(/shop/plate.jpg);
  background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), image-set(url(/shop/plate.avif) type('image/avif'), url(/shop/plate.webp) type('image/webp'), url(/shop/plate.jpg) type('image/jpeg'));
  background-position: 50% 70%;
}
@media (max-width: 700px) {
  html[data-place="shop"] .comic-reader {
    background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), url(/shop/plate-s.jpg);
    background-image: radial-gradient(ellipse at 50% 46%, rgba(22, 14, 6, 0.7), rgba(12, 7, 3, 0.9) 70%), image-set(url(/shop/plate-s.avif) type('image/avif'), url(/shop/plate-s.webp) type('image/webp'), url(/shop/plate-s.jpg) type('image/jpeg'));
  }
}

/* ------------------------------------------------------------------ without JavaScript: the still, then the papers */
.no-js[data-place="shop"] body { display: flex; flex-direction: column; }
.no-js[data-place="shop"] .top { order: 0; }
.no-js[data-place="shop"] #panel { order: 1; }
.no-js[data-place="shop"] #script { order: 2; }
.no-js .shop-set { max-width: 780px; margin: 18px auto 0; padding: 0 16px; }
.no-js .shop-plate { display: block; width: 100%; height: auto; }
.no-js .shop-paper { display: block; max-width: 748px; margin: 18px auto; padding: 26px clamp(20px, 7.4%, 56px) 28px; position: relative; font-size: var(--t-body);
  background: url(/shell/paper.webp) 0 0 / 160px, var(--paper); background-blend-mode: multiply; }
.no-js .shop-paper h2 { font-size: var(--t-note); }
.no-js .shop-paper .close, .no-js .shop-paper .drop, .no-js .shop-paper .picks, .no-js .shop-paper .often, .no-js .shop-paper .own, .no-js .shop-paper .jar-stamp { display: none; }

@media (forced-colors: active), (prefers-contrast: more) {
  .shop-paper, .js .shop-paper .paper-head, .shop-paper .envelope, .shop-door .line { background-image: none !important; }
  .shop-paper .envelope { border: 2px solid CanvasText; }
  .shop-door .line { border: 1px solid CanvasText; }
}

/* (a phone's page scrolls inside the panel: the site's body never scrolls, and the furniture stays over it) */
html.js[data-shop="phone"] #panel { position: fixed; inset: 0; z-index: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
/* (scrolled past the picture, the mark keeps a band under it so the papers pass beneath it cleanly) */
.js[data-shop="phone"].shop-scrolled .top::before { content: ''; position: fixed; z-index: -1; left: 0; right: 0; top: 0; height: max(calc(var(--padt) + 62px), calc(var(--shop-head, 0px) + 14px));
  background: linear-gradient(to bottom, rgba(14, 9, 4, 0.96) 70%, rgba(14, 9, 4, 0)); pointer-events: none; }
.shop-follow .tag { text-wrap: balance; }
/* (the papers' links in a line of words are thumb-sized too) */
.shop-published a, .shop-paper .jar-manage a { display: inline-block; padding: 7px 0 6px; }
