/* Editions storefront. Same drawing-office language as the bed (title block
   header, paper on a bed, registration crop marks, one accent) — a shop built
   out of the app's own furniture rather than a second visual identity. */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');
@import url('controls.css');   /* select, tick box, slider, number — shared with the bed */

:root{
  --bed:#E9E9E1;
  --paper:#FBFBF8;
  --ink:#181812;
  --mut:#73736A;
  --line:#C6C6BB;
  --ultra:#2B3FA0;
  --crimson:#C03434;
  --shadow:0 1px 0 rgba(24,24,18,.22), 0 12px 30px rgba(24,24,18,.16);
}
*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:'IBM Plex Mono',ui-monospace,monospace;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0/24px 24px,
    var(--bed);
  color:var(--ink);font-size:13px;line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
b{font-weight:600}
code{font:inherit;color:var(--ultra)}

/* ---------- title block ---------- */
.titleblock{
  display:flex;align-items:stretch;background:var(--paper);
  border-bottom:2px solid var(--ink);position:sticky;top:0;z-index:20;
}
.titleblock .cell{
  padding:9px 16px;border-right:1px solid var(--line);
  display:flex;flex-direction:column;justify-content:center;min-width:0;
}
.titleblock .cell.grow{flex:1}
.eyebrow{font-size:10px;letter-spacing:.18em;color:var(--mut);text-transform:uppercase}
.titleblock .v{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wordmark{font-size:18px;font-weight:600;letter-spacing:.06em}
.wordmark .dot{color:var(--crimson)}
.queuebtn{
  font:inherit;text-align:left;cursor:pointer;border:0;border-left:1px solid var(--line);
  background:var(--paper);color:var(--ink);
}
.queuebtn:hover,.queuebtn[aria-expanded=true]{background:var(--ink);color:var(--paper)}
.queuebtn:hover .eyebrow,.queuebtn[aria-expanded=true] .eyebrow{color:var(--line)}
.queuebtn.bump{animation:bump .5s ease}
@keyframes bump{40%{background:var(--ultra);color:#fff}}

/* ---------- hero ---------- */
.hero{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.85fr);gap:44px;
  align-items:center;padding:52px 32px 44px;max-width:1400px;margin:0 auto;
}
.hero h1{font-size:clamp(26px,3.3vw,44px);line-height:1.12;font-weight:600;letter-spacing:-.01em}
.hero p{margin-top:16px;max-width:54ch;color:#3A3A32}
.hero p.lead{color:var(--ink)}
.marks{list-style:none;display:flex;flex-wrap:wrap;gap:0;margin-top:26px;border:1px solid var(--ink);width:fit-content;background:var(--paper)}
.marks li{padding:8px 16px;border-right:1px solid var(--line);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--mut)}
.marks li:last-child{border-right:0}
.marks b{display:block;font-size:15px;letter-spacing:0;color:var(--ink);text-transform:none}
.heroPlate figcaption{
  margin-top:14px;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--mut);text-align:center;
}

/* ---------- paper ---------- */
.sheet{
  background:var(--paper);box-shadow:var(--shadow);position:relative;line-height:0;
  width:100%;max-width:560px;margin:0 auto;
}
.sheet .art{width:100%;height:100%}
.sheet .art img,.sheet .art svg{display:block;width:100%;height:100%}
/* registration crop marks */
.sheet::before,.sheet::after,.sheet .crop::before,.sheet .crop::after{
  content:"";position:absolute;width:13px;height:13px;pointer-events:none;border:0 solid var(--crimson);
}
.sheet::before{top:-7px;left:-7px;border-top-width:1.5px;border-left-width:1.5px}
.sheet::after{top:-7px;right:-7px;border-top-width:1.5px;border-right-width:1.5px}
.sheet .crop::before{bottom:-7px;left:-7px;border-bottom-width:1.5px;border-left-width:1.5px}
.sheet .crop::after{bottom:-7px;right:-7px;border-bottom-width:1.5px;border-right-width:1.5px}
.sheet.busy .art{opacity:.32;transition:opacity .12s}

/* ---------- process strip ---------- */
.strip{
  display:grid;grid-template-columns:repeat(3,1fr);
  border-top:2px solid var(--ink);border-bottom:2px solid var(--ink);background:var(--paper);
}
.strip div{padding:14px 20px;border-right:1px solid var(--line);color:#3A3A32}
.strip div:last-child{border-right:0}
.strip b{display:inline-block;width:18px;color:var(--crimson)}

/* ---------- collections ---------- */
/* The shop reads as three groups of drawings rather than one long column: a
   heading that says what the group has in common, then the editions three to
   a row. Everything that needs a decision is one click away, in the detail
   dialog, so a row stays a row. */
#shop{max-width:1400px;margin:0 auto;padding:40px 32px 64px;display:flex;flex-direction:column;gap:52px}
.collection{display:flex;flex-direction:column;gap:20px}
.collection header{border-bottom:2px solid var(--ink);padding-bottom:11px;display:flex;flex-direction:column;gap:4px}
.collection h2{font-size:26px;font-weight:600;letter-spacing:-.01em}
.collection header p{color:#3A3A32;max-width:78ch}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;align-items:stretch}

.summary{background:var(--paper);border:1px solid var(--ink);display:flex;flex-direction:column;box-shadow:var(--shadow)}
.summary .thumb{
  height:280px;padding:14px;background:var(--bed);border-bottom:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;
}
.summary .thumb .sheet{width:auto;height:100%;max-width:100%;margin:0}
.summeta{padding:14px 16px 16px;display:flex;flex-direction:column;gap:8px;flex-grow:1}
.summeta .ref{border-bottom:0;padding-bottom:0}
.summeta h3{font-size:17px;font-weight:600;letter-spacing:-.01em}
.summeta .sub{
  font-size:12px;line-height:1.5;
  /* three lines: at two, 54 of 73 descriptions were cut off mid-phrase */
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.sumfoot{
  margin-top:auto;padding-top:10px;border-top:1px solid var(--line);
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.sumfoot .price{font-size:16px;min-width:0}
button.details{font-size:10px;letter-spacing:.1em;text-transform:uppercase;padding:9px 13px}

/* ---------- the detail view ---------- */
/* One card per edition is parked in #details and lifted into the dialog when
   it is asked for, so every control keeps the listeners store.js bound to it.
   With no JavaScript the dialog never opens and the parked cards are the shop,
   in full, exactly as it was before. */
#details{display:flex;flex-direction:column;gap:34px}
html.js #details{display:none}
dialog#detail{
  padding:0;border:1px solid var(--ink);background:var(--paper);color:var(--ink);
  width:min(1120px,94vw);max-height:92vh;overflow:auto;box-shadow:0 24px 70px rgba(24,24,18,.4);
  /* centred on the window, not pinned to a corner: inset and auto margins
     together are what centre a modal dialog once it has a width of its own */
  inset:0;margin:auto;
}
dialog#detail::backdrop{background:rgba(24,24,18,.55)}
.detailbar{
  position:sticky;top:0;z-index:3;background:var(--paper);
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:9px 12px;border-bottom:2px solid var(--ink);
}
.detailnav{display:flex;gap:6px}
.detailnav button{width:38px;height:38px;padding:0;font-size:15px;line-height:1}
.detailnav button[data-detailclose]{border-color:var(--crimson);color:var(--crimson)}
.detailnav button[data-detailclose]:hover{background:var(--crimson);border-color:var(--crimson);color:#fff}
#detailBody .card{border:0}
/* A portrait plate is twice as tall as it is wide, so in the dialog the sheet
   is capped by the window's height as well as by the column's width. The card
   writes its own ratio into --a, so the cap is expressed as a width and the
   paper keeps its proportions exactly. */
#detailBody .sheet{width:100%;max-width:min(560px, calc(56vh * var(--a, 1.414)))}

/* ---------- cards ---------- */
.card{
  display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:0;
  background:var(--paper);border:1px solid var(--ink);
}
.plate{padding:34px;border-right:1px solid var(--line);display:flex;flex-direction:column;justify-content:center;gap:22px;min-width:0}
.plateNote{font-size:12px;color:var(--mut);line-height:1.7;max-width:56ch}
.plateMade{font-size:11px;color:var(--mut);font-style:italic;margin-top:-12px}
.numnote{font-size:12px;line-height:1.55;color:var(--ink);max-width:46ch}
.field>span small{letter-spacing:normal;text-transform:none;font-size:10px}
.meta{padding:28px 30px;display:flex;flex-direction:column;justify-content:center;gap:12px;min-width:0}
.ref{
  display:flex;justify-content:space-between;gap:12px;font-size:10px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--mut);border-bottom:1px solid var(--line);padding-bottom:9px;
}
.ref b{color:var(--crimson);font-variant-numeric:tabular-nums}
.meta h3{font-size:21px;font-weight:600;letter-spacing:-.01em}
.sub{color:#3A3A32;max-width:48ch}
.brief{font-size:11px;color:var(--mut)}
.brief q{color:var(--ultra)}

.spec{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border:1px solid var(--line);margin-top:4px}
.spec>div{padding:8px 11px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.spec>div:nth-child(2n){border-right:0}
.spec>div:nth-last-child(-n+2){border-bottom:0}
.spec dt{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--mut)}
.spec dd{font-weight:500;font-variant-numeric:tabular-nums;line-height:1.4}

.buy{margin-top:18px;padding-top:0;display:flex;flex-direction:column;gap:12px}
.field{display:flex;align-items:center;justify-content:space-between;gap:14px}
.field>span{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--mut);white-space:nowrap}
select,input[type=number]{
  font:inherit;border:1px solid var(--ink);background:var(--paper);color:var(--ink);padding:6px 8px;
}
select{flex:1;min-width:0}
select:focus,input:focus,button:focus-visible{outline:2px solid var(--ultra);outline-offset:1px}
/* the drawn select sits where the native one did, at the shop's own size */
.field .selx{flex:1;min-width:0;max-width:none}
.field .selx-btn{
  font-size:13px;padding:6px 24px 6px 8px;
  background-position:calc(100% - 13px) 13px,calc(100% - 9px) 13px;
}
/* Which drawing: a number, not a quantity. Words on the arrows, "No." inside the box. */
.seedfield{display:flex;flex-direction:column;gap:6px}
.seedfield>label{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--mut)}
.seedfield>label small{letter-spacing:normal;text-transform:none;font-size:10px}
.seedbar{display:flex;gap:6px;align-items:stretch}
.seedbar button{min-height:44px;white-space:nowrap}
.seedno{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:4px;border:1px solid var(--ink);background:#fff;padding:0 8px;font-weight:600}
.seedno:focus-within{outline:2px solid var(--ultra);outline-offset:1px}
.seedno input{border:none;outline:none;background:transparent;width:7ch;min-width:0;min-height:42px;padding:0;text-align:left;font:inherit;font-weight:600;font-size:15px}
.seedmore{display:flex;gap:10px;align-items:center;font-size:11px;color:var(--mut)}
.seedmore .roll{min-height:36px}
.sold .seedno{border-color:var(--crimson);color:var(--crimson)}
.sold .seedno input{color:var(--crimson)}
button{font:inherit;font-weight:500;cursor:pointer;border:1px solid var(--ink);background:var(--paper);color:var(--ink);padding:6px 11px}
button:hover:not(:disabled){background:var(--ink);color:var(--paper)}
button:disabled{opacity:.35;cursor:not-allowed}
button.primary{background:var(--ultra);border-color:var(--ultra);color:#fff;padding:10px 16px}
button.primary:hover:not(:disabled){background:var(--ink);border-color:var(--ink)}
.roll{color:var(--ink)}
.checkout{display:flex;align-items:center;gap:14px;border-top:1px solid var(--line);padding-top:14px}
.price{font-size:24px;font-weight:600;font-variant-numeric:tabular-nums;min-width:5ch}
.checkout button{flex:1}
.hint{font-size:11px;color:var(--mut);min-height:2.6em}
.hint.err{color:var(--crimson);font-size:13px;font-weight:500}
.hint.work{color:var(--ultra)}

/* ---------- queue ---------- */
.queue{
  position:fixed;top:0;right:0;bottom:0;width:min(400px,100%);z-index:30;
  background:var(--paper);border-left:2px solid var(--ink);
  display:flex;flex-direction:column;box-shadow:-18px 0 40px rgba(24,24,18,.2);
}
.queue[hidden]{display:none}
.queueHead{display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:2px solid var(--ink)}
.queueHead h2{font-size:11px;letter-spacing:.18em;text-transform:uppercase;font-weight:500;color:var(--mut)}
#queueClose{border:0;padding:2px 8px;font-size:18px;line-height:1;background:transparent}
/* the totals follow the list; the panel's spare height falls below them */
#queueList{list-style:none;overflow-y:auto;flex:0 1 auto}
#queueList li{display:flex;gap:10px;align-items:flex-start;padding:12px 16px;border-bottom:1px solid var(--line)}
#queueList .t{flex:1;min-width:0}
#queueList .t b{display:block}
#queueList .t span{font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut)}
#queueList .p{font-variant-numeric:tabular-nums;font-weight:600}
#queueList .x{border:0;border-left:1px solid var(--line);background:transparent;color:var(--mut);padding:0 0 0 10px;min-width:44px;min-height:44px;font-size:16px}
#queueList .x:hover{background:transparent;color:var(--crimson)}
.queueEmpty{padding:22px 16px;color:var(--mut);font-size:11px;line-height:1.8}
.queuePaid{padding:26px 16px;display:flex;flex-direction:column;gap:12px;font-size:12px;line-height:1.7}
.queuePaid h3{margin:0;font-size:24px;font-weight:600}
.queuePaid ul{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.queuePaid li{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.queuePaid li span{color:var(--mut)}
.queuePaid p{margin:0}
.queuePaid a{color:var(--ultra)}
/* hidden must win over the display these set */
.queueFoot[hidden],.queuePaid[hidden]{display:none}
.queuePaid h3:focus{outline:none}
/* the receipt takes the panel's room; the empty list gives it up */
.queuePaid{flex:1;overflow-y:auto}
.queue:has(.queuePaid:not([hidden])) #queueList{flex:0}
.queueFoot{border-top:2px solid var(--ink);padding:14px 16px;display:flex;flex-direction:column;gap:7px;margin-bottom:auto}
.queueFoot .line{display:flex;justify-content:space-between;font-size:11px;color:var(--mut)}
.queueFoot .line b{font-variant-numeric:tabular-nums;color:var(--ink)}
.queueFoot .total{font-size:15px;color:var(--ink);border-top:1px solid var(--line);padding-top:8px;margin-top:2px}
.queueFoot .primary{margin-top:6px}
.queueSay{margin:4px 0 0;font-size:11px;line-height:1.6;color:var(--ink)}
.queueSay.err{color:var(--crimson)}
#queueList li.refused b{color:var(--crimson)}
.fine{font-size:11px;color:var(--mut);line-height:1.6}

.legend{border-top:2px solid var(--ink);border-bottom:0}
/* ---------- what a number does ---------- */
.numberdemo{max-width:1400px;margin:0 auto;padding:44px 32px 8px;display:flex;flex-direction:column;gap:18px}
.numberdemo header{display:flex;flex-direction:column;gap:6px;max-width:78ch}
.numberdemo h2{font-size:26px;font-weight:600;letter-spacing:-.01em}
.numberdemo header p{color:#3A3A32}
.demorow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.demo{display:flex;flex-direction:column;align-items:center;gap:12px;padding:22px 22px 14px;background:var(--bed);border:1px solid var(--line);cursor:pointer}
.demo:hover:not(:disabled){background:var(--paper);color:var(--ink)}
.demo .sheet{width:100%;max-width:300px}
.democap{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--crimson);font-weight:600}

/* ---------- the map: collections, with their counts ---------- */
.colstrip{max-width:1400px;margin:30px auto 0;padding:0 32px;display:flex;flex-wrap:wrap;gap:10px}
.colstrip a{display:flex;align-items:baseline;gap:8px;padding:10px 14px;border:1px solid var(--ink);background:var(--paper);color:var(--ink);text-decoration:none;min-height:44px}
.colstrip a:hover{background:var(--ink);color:var(--paper)}
.colstrip a span{font-size:11px;color:var(--mut);font-variant-numeric:tabular-nums}
.colstrip a:hover span{color:var(--line)}
/* the same links in the header, once the strip is out of sight */
.titleblock .colnav{display:none;gap:14px;margin-left:10px;padding-left:14px;border-left:1px solid var(--line)}
body.pastcols .titleblock .colnav{display:inline-flex}
.colnav a{white-space:nowrap}
.collection,.collection h2{scroll-margin-top:80px}
.legend .v{white-space:normal}
/* every cell takes an equal share: the grow cell once got 33 px and stacked a word a line */
.legend .cell{flex:1 1 0;min-width:0}
.legend a{color:var(--ultra)}

@media (max-width:1180px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1040px){
  .hero{grid-template-columns:1fr;gap:34px;padding:34px 20px}
  .card{grid-template-columns:1fr}
  .plate{border-right:0;border-bottom:1px solid var(--line);padding:26px}
  .strip{grid-template-columns:1fr}
  .strip div{border-right:0;border-bottom:1px solid var(--line)}
  #shop{padding:26px 20px 48px}
}
@media (max-width:660px){
  /* .titleblock .cell outranks a bare .hide-sm, so the header names itself
     here — without it every cell stayed, five of them in 390 px, the links
     printed over the wordmark. On a phone: the wordmark and the order on one
     row, the shops on the next, the rest of the title block left out. */
  .hide-sm,.titleblock .hide-sm,.titleblock .cell.grow{display:none}
  .titleblock{flex-wrap:wrap}
  .titleblock .cell:first-child{flex:1}
  .titleblock .nav{order:3;flex-basis:100%;border-right:0;border-top:1px solid var(--line);padding:6px 16px}
  /* on a phone the second header row carries every collection, scrolled sideways */
  .titleblock .nav{overflow-x:auto;white-space:nowrap;justify-content:flex-start;scrollbar-width:none}
  .titleblock .colnav,body.pastcols .titleblock .colnav{display:inline-flex}
  .numberdemo{padding:30px 20px 4px}
  .demorow{gap:10px}
  .demo{padding:10px 8px 8px}
  .colstrip{padding:0 20px}
  .collection,.collection h2{scroll-margin-top:118px}
  .grid{grid-template-columns:1fr}
  .summary .thumb{height:210px;padding:16px}
  .collection h2{font-size:22px}
  .spec{grid-template-columns:repeat(2,minmax(0,1fr))}
  .spec>div:nth-child(3n){border-right:1px solid var(--line)}
  .spec>div:nth-child(2n){border-right:0}
  .spec>div:nth-last-child(-n+3){border-bottom:1px solid var(--line)}
  .spec>div:nth-last-child(-n+2){border-bottom:0}
  .checkout{flex-direction:column;align-items:stretch;gap:10px}
  /* in the details on a phone: what it is and what it costs first, the drawing under it */
  #detail .card{display:flex;flex-direction:column}
  #detail .meta{order:-1;padding:20px 18px}
  #detail .plate{border-top:1px solid var(--line)}
  #detail .field{flex-direction:column;align-items:stretch;gap:6px}
  #detail .checkout{flex-direction:row;align-items:center}
  #detail .checkout .primary{flex:1}
  #detail .spec>div{padding:6px 9px}
  #detail .spec dd{font-size:12px}
  #detail .meta{gap:10px}
}
@media (prefers-reduced-motion:reduce){.queuebtn.bump{animation:none}}

/* a card title opens the drawing's own page */
.summary h3 a{color:inherit;text-decoration:none}
.summary h3 a:hover{text-decoration:underline;text-underline-offset:3px}
