/* ==========================================================================
   DUM Studio · shop.css
   Get Quote: blackout mode, method choice, product picker, the mock-up
   editor and Text + artwork upload. Builds on the .rpg windows in windows.css.
   ========================================================================== */

/* ---------- blackout: the room dims, the menu shrinks to Back ---------- */
.room .stage { transition: filter .45s steps(5, end); }
.room.in-blackout .stage { filter: brightness(.22) saturate(.5); }
.room.in-blackout .menu li:not(.menu__back) { display: none; }
.room.in-blackout .menu__back { margin-top: 0; }
.room.in-blackout .ui .windows {
  right: max(16px, calc(var(--u) * 60));
  bottom: calc(var(--u) * 250);
  container: edl / size;
}

/* ---------- progress bar (Get Quote) ---------- */
.progress {
  --pb: clamp(24px, calc(var(--u) * 52), 32px);          /* bar height */
  display: none; position: absolute; z-index: 6;
  left: 50%; bottom: calc(var(--u) * 60); translate: -50% 0;
  width: min(940px, calc(100% - var(--u) * 1700));
  margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  font: 400 clamp(8px, calc(var(--u) * 22), 12px)/1.5 var(--pixel);
  color: var(--rpg-dim); letter-spacing: .06em;
  -webkit-font-smoothing: none;
  pointer-events: none;
}
.room.in-blackout .progress { display: grid; }
.progress li { position: relative; padding-top: calc(var(--pb) + .8em); text-align: center; text-shadow: 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 -2px 0 #000; }
.progress li::before {                         /* the frame */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--pb); box-sizing: border-box;
  background: #000; border: 3px solid #6d6a66; box-shadow: 0 0 0 2px #000;
}
.progress li::after {                          /* the fill: chunky pixel blocks */
  content: ""; position: absolute; left: 6px; top: 6px; height: calc(var(--pb) - 12px); width: 0;
  background: repeating-linear-gradient(90deg, var(--rpg-fg) 0 calc(var(--pb) - 12px), transparent calc(var(--pb) - 12px) calc(var(--pb) - 7px));
}
.progress li.is-on, .progress li.is-done { color: var(--rpg-fg); }
.progress li.is-on::before, .progress li.is-done::before { border-color: var(--rpg-fg); }
.progress li.is-done::after { width: calc(100% - 12px); }
.progress li.is-on::after { width: calc(50% - 6px); animation: pg-load 3s steps(5, end) infinite alternate; }
.progress li.is-on span::before { content: "▶ "; animation: rpg-blink 1s steps(1) infinite; }
@keyframes pg-load { from { width: calc(25% - 6px); } to { width: calc(60% - 6px); } }

/* ---------- shared bits ---------- */
.ed .rpg, .aw .rpg { font-size: calc(var(--rpg-size) * .78); }
.mk-btn {
  position: relative; padding: .6em .9em; margin: 0;
  background: transparent; color: var(--rpg-fg);
  border: 2px solid var(--rpg-fg); font: inherit; font-size: .8em; letter-spacing: .08em;
}
.mk-btn:hover, .mk-btn:focus-visible { background: var(--rpg-fg); color: var(--rpg-bg); outline: none; }
.pixelated { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ==========================================================================
   Get Quote: choose a method
   ========================================================================== */
.qs {
  --qw: clamp(240px, min(36cqw, calc((100cqh - 100px) * 1.2)), 560px);
  display: flex; flex-wrap: wrap; justify-content: center; align-content: safe center; align-items: start;
  gap: calc(var(--rpg-gap) * 1.2) max(56px, calc(var(--rpg-gap) * 2.6));
  min-height: 100cqh;
}
.qs__opt { display: flex; flex-direction: column; align-items: center; gap: calc(var(--rpg-size) * 1.4); width: var(--qw); min-width: max-content; text-decoration: none; color: var(--rpg-fg); }
.qs__label {
  display: block; text-align: center;
  font-size: clamp(26px, calc(var(--u) * 84), 56px); line-height: 1; white-space: nowrap;
  transition: transform .12s steps(2);
}
.qs__box { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; padding: 9%; cursor: inherit; }
.qs__box img { display: block; width: 100%; height: auto; }
.qs__sub { max-width: var(--qw); font: 400 calc(var(--rpg-size) * .72)/1.6 var(--pixel); color: var(--rpg-dim); text-align: center; text-shadow: 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 -2px 0 #000; }
.qs__opt:hover .qs__label, .qs__opt:focus-visible .qs__label { transform: translateY(-3px); }
.qs__opt:hover .qs__box, .qs__opt:focus-visible .qs__box { background: #161616; }
.qs__opt:hover .qs__sub { color: var(--rpg-fg); }
.qs__opt:focus-visible { outline: none; }

/* ==========================================================================
   Mock-up tool: pick a product
   ========================================================================== */
.qp-grid {
  --qb: clamp(140px, min(calc((100cqw - var(--rpg-gap) * 3) / 4 - 8px), calc((100cqh - 60px) / 2.45)), 300px);
  display: grid; grid-template-columns: repeat(4, var(--qb)); justify-content: center; align-content: safe center;
  gap: calc(var(--rpg-size) * 1.6) var(--rpg-gap);
  min-height: 100cqh;
}
.qp { display: flex; flex-direction: column; align-items: center; gap: calc(var(--rpg-size) * .9); text-decoration: none; color: var(--rpg-fg); }
.qp__label { font-size: clamp(18px, calc(var(--qb) * .16), 42px); line-height: 1.1; white-space: nowrap; transition: transform .12s steps(2); }
.qp__box { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 14%; }
.qp__box img { display: block; width: 100%; height: auto; transition: transform .15s steps(3); }
a.qp:hover .qp__box, a.qp:focus-visible .qp__box { background: var(--rpg-fg); }
a.qp:hover .qp__box img, a.qp:focus-visible .qp__box img { filter: invert(1); transform: scale(1.06); }
a.qp:hover .qp__label { transform: translateY(-3px); }
a.qp:focus-visible { outline: none; }
.qp.is-soon { cursor: not-allowed; }
.qp.is-soon .qp__label { opacity: .55; }
.qp.is-soon .qp__box img { opacity: .3; }
.qp__soon {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: -8deg;
  padding: .5em .7em; background: #000; border: 2px solid var(--rpg-fg); white-space: nowrap;
  font-size: calc(var(--rpg-size) * .62); letter-spacing: .08em;
}

/* ==========================================================================
   Editor  (left to right: colour | method + idea | upload + artwork | mock-up)
   --stg = size of the square mock-up stage
   ========================================================================== */
.ed {
  --stg: min(calc(100cqh - 128px), 38cqw);
  display: grid; align-items: stretch;
  height: 100cqh;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "col meth up view" "col idea list view";
  gap: calc(var(--rpg-gap) * .7 + var(--rpg-size) * .6) calc(var(--rpg-gap) * .7);
}
.ed__colour { grid-area: col; display: flex; flex-direction: column; min-height: 0; min-width: 7.6em; padding-left: .9em; padding-right: .9em; }
.ed__method { grid-area: meth; }
.ed__idea   { grid-area: idea; display: flex; flex-direction: column; min-height: 0; }
.ed__upload { grid-area: up; padding: .9em; display: flex; }
.ed__list   { grid-area: list; display: flex; flex-direction: column; min-height: 0; }
.ed__view   { grid-area: view; align-self: start; display: grid; gap: .9em;
  grid-template-columns: var(--stg) calc(var(--stg) * .22); grid-template-areas: "stage thumbs" "bar bar"; }

/* colour column */
.mk-swatches { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 4px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.mk-swatches::-webkit-scrollbar { display: none; }
.mk-sw { position: relative; display: block; flex: none; width: 2.2em; height: 2.2em; padding: 0; margin: 0; background: var(--c); border: 2px solid #777; cursor: var(--cur-link, pointer); }
.mk-sw[aria-pressed="true"], .mk-sw.is-on { border-color: var(--rpg-fg); box-shadow: 0 0 0 2px var(--rpg-bg), 0 0 0 4px var(--rpg-fg); }
.mk-sw:hover { border-color: var(--rpg-fg); }
.mk-sw:focus-visible { outline: 2px dashed var(--rpg-fg); outline-offset: 4px; }
.mk-sw--custom { display: grid; place-items: center; background: var(--c, transparent); }
.mk-sw--custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; }
.mk-sw--custom span { pointer-events: none; mix-blend-mode: difference; color: #fff; }

/* method < cycler > */
.mk-cycle { display: flex; align-items: center; justify-content: space-between; gap: .6em; }
.mk-cycle__name { flex: 1; text-align: center; letter-spacing: .06em; white-space: nowrap; }
.mk-cycle__btn { display: grid; place-items: center; width: 2.2em; height: 2.2em; padding: 0; margin: 0; background: none; border: 2px solid transparent; color: var(--rpg-fg); font: inherit; line-height: 1; }
.mk-cycle__btn::before { content: ""; width: .7em; height: .9em; background: currentColor; clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.mk-cycle__btn[data-dir="1"]::before { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.mk-cycle__btn:hover, .mk-cycle__btn:focus-visible { border-color: var(--rpg-fg); outline: none; }
.ed__method .mk-size { margin: .9em 0 0; font-size: .72em; line-height: 1.7; }
.ed__method .mk-note { margin-top: .5em; }
.mk-size.is-err { color: #ff7a6b; }
.ed__method.is-off .mk-cycle, .ed__method.is-off .mk-size { opacity: .38; }
.ed__method.is-off .mk-cycle__btn { pointer-events: none; }

/* idea */
.ed__idea .field { flex: 1; min-height: 0; }
.ed__idea textarea { min-height: 6em; height: 100%; }

/* upload button */
.ed__upload .drop { flex: 1; padding: 1em .8em; gap: .6em; }
.ed__upload .drop__cue { font-size: 1.05em; letter-spacing: .08em; }

/* artwork list */
.mk-list { list-style: none; margin: 0 -.4em; padding: 0 .4em; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #fff #000; }
.mk-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.8em; gap: .8em; align-items: center; padding: .8em 0; border-bottom: 2px dotted #fff5; }
.mk-row:first-child { padding-top: .2em; }
.mk-row:last-child { border-bottom: 0; }
.mk-row__info { display: grid; gap: .7em; justify-items: start; }
.mk-row__name { position: relative; font-size: .85em; letter-spacing: .04em; }
.mk-row.is-on .mk-row__name::before { content: "▶ "; animation: rpg-blink 1s steps(1) infinite; }
.mk-add { padding: .55em .7em; margin: 0; background: none; color: var(--rpg-fg); border: 2px solid var(--rpg-fg); font: inherit; font-size: .72em; letter-spacing: .06em; white-space: nowrap; }
.mk-add:hover, .mk-add:focus-visible { background: var(--rpg-fg); color: var(--rpg-bg); outline: none; }
.mk-row__pv { position: relative; display: block; }
.mk-icon {
  display: block; width: 100%; aspect-ratio: 1; padding: 4px;
  border: 2px solid var(--rpg-fg); cursor: grab; touch-action: none;
  background: repeating-conic-gradient(#2a2a2a 0 25%, #1a1a1a 0 50%) 0 0 / 12px 12px;
}
.mk-icon img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.mk-icon:hover { outline: 2px dashed var(--rpg-fg); outline-offset: 2px; }
.mk-row__pv .thumb__x { top: -.55em; right: -.55em; width: 1.7em; height: 1.7em; font-size: .62em; }
.mk-empty { margin: 0; color: var(--rpg-dim); font-size: .75em; line-height: 1.7; }
.mk-empty[hidden] { display: none; }
.mk-ghost { position: fixed; left: 0; top: 0; z-index: 100; width: 84px; height: 84px; object-fit: contain; pointer-events: none; opacity: .85; filter: drop-shadow(0 4px 8px #000); }

/* mock-up window */
.mk-stage {
  grid-area: stage; position: relative; width: var(--stg); height: var(--stg);
  overflow: hidden; background: #000; outline: none;
  box-shadow: inset 0 0 0 2px #fff3;
  user-select: none; -webkit-user-select: none;
}
.mk-stage.has-art { touch-action: none; }
.mk-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--rpg-fg); }
.mk-stage.is-over { box-shadow: inset 0 0 0 3px var(--rpg-fg); }
.mk-smoke { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none;
  filter: grayscale(1) brightness(.8) contrast(1.05); }
.mk-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 75% at 50% 50%, transparent 45%, rgba(0,0,0,.55) 100%); }
.mk-main { position: absolute; z-index: 1; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.55)); }
.mk-over { position: absolute; z-index: 2; pointer-events: none; }
.mk-area { position: absolute; border: 1px dashed #fff8; opacity: 0; transition: opacity .2s; }
.mk-stage:hover .mk-area, .mk-stage.is-dragging .mk-area, .mk-stage.is-over .mk-area, .mk-stage:focus-visible .mk-area { opacity: 1; }
.mk-sel { position: absolute; outline: 2px dashed #fff; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000; }
.mk-sel[hidden] { display: none; }
.mk-h { position: absolute; pointer-events: auto; background: #fff; border: 2px solid #000; touch-action: none; }
.mk-h--size { right: -9px; bottom: -9px; width: 16px; height: 16px; cursor: nwse-resize; }
.mk-h--rot { left: 50%; top: -34px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; cursor: grab; }
.mk-h--rot::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 18px; margin-left: -1px; background: #fff; }
.mk-h--del { right: -12px; top: -12px; width: 22px; height: 22px; display: grid; place-items: center;
  background: #000; color: #fff; border: 2px solid #fff; font: 400 10px/1 var(--pixel); font-style: normal; cursor: var(--cur-link, pointer); }
.mk-h--del:hover { background: #fff; color: #000; }
.mk-tag { position: absolute; z-index: 3; left: 10px; top: 10px; margin: 0; font-size: .6em; letter-spacing: .08em; text-shadow: 0 2px 0 #000, 2px 0 0 #000; pointer-events: none; }
.mk-msg { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; margin: 0; letter-spacing: .1em; animation: rpg-blink 1s steps(1) infinite; }
.mk-msg[hidden] { display: none; }

.mk-thumbs { grid-area: thumbs; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px; height: var(--stg); }
.mk-thumb {
  position: relative; display: grid; place-items: center; min-height: 0; padding: 4px 4px 18px; margin: 0;
  background: #0b0b0b; border: 2px solid #555; color: var(--rpg-dim); font: inherit; overflow: hidden;
}
.mk-thumb canvas { display: block; }
.mk-thumb span { position: absolute; left: 0; right: 0; bottom: 4px; font-size: .6em; letter-spacing: .08em; text-align: center; }
.mk-thumb:hover, .mk-thumb:focus-visible { border-color: #aaa; outline: none; }
.mk-thumb.is-on { border-color: var(--rpg-fg); color: var(--rpg-fg); }
.mk-thumb.is-on span::before { content: "▶ "; }

.mk-bar { grid-area: bar; display: flex; flex-wrap: wrap; align-items: center; gap: .7em 1em; }
.mk-bar .status { order: 9; flex-basis: 100%; min-height: 1.6em; margin: 0; font-size: .66em; line-height: 1.6; }
.mk-bar .send { margin: 0 0 0 auto; white-space: nowrap; }
.mk-btn.is-armed { background: #ff7a6b; border-color: #ff7a6b; color: #000; }
.mk-hint { color: var(--rpg-dim); }

/* ==========================================================================
   Text + artwork upload
   ========================================================================== */
.aw {
  display: grid; align-items: stretch; height: 100cqh;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "brief up" "brief gal" "brief next";
  gap: calc(var(--rpg-gap) * .7 + var(--rpg-size) * .6) calc(var(--rpg-gap) * .7);
}
.aw .rpg { font-size: calc(var(--rpg-size) * .85); }
.aw__brief { grid-area: brief; display: flex; flex-direction: column; min-height: 0; }
.aw__brief .field { flex: 1; min-height: 0; }
.aw__brief textarea { min-height: 10em; height: 100%; line-height: 1.9; }
.aw__up { grid-area: up; }
.aw__next { grid-area: next; display: flex; flex-direction: row; align-items: center; gap: 1.2em; }
.aw__next .send { margin: 0; flex: none; }
.aw__next .status { margin: 0; min-height: 0; flex: 1; font-size: .8em; }
.aw__gallery { grid-area: gal; min-height: 0; display: flex; flex-direction: column; }
.aw__empty { margin: 0; color: var(--rpg-dim); font-size: .8em; }
.aw__empty[hidden] { display: none; }
.aw__thumbs { margin: 0; padding: .7em .7em .2em 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #fff #000; grid-template-columns: repeat(auto-fill, minmax(8em, 1fr)); }
.aw__thumbs img { aspect-ratio: 1; object-fit: contain; background: repeating-conic-gradient(#2a2a2a 0 25%, #1a1a1a 0 50%) 0 0 / 12px 12px; }

/* ---------- narrower screens: mock-up on top, the rest below ---------- */
@container edl (max-width: 920px) {
  .ed {
    --stg: min(calc(100cqw - 170px), 64cqh);
    height: auto;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(16em, auto);
    grid-template-areas: "view view view" "col meth up" "col idea list";
  }
  .ed__view { justify-self: center; }
  .qp-grid { --qb: min(calc((100cqw - var(--rpg-gap)) / 2 - 8px), 260px); grid-template-columns: repeat(2, var(--qb)); min-height: 0; }
  .qs { --qw: min(80cqw, 380px); }
  .aw { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "brief" "up" "gal" "next"; }
}

/* ---------- phones ---------- */
@container room (aspect-ratio < 0.85) {
  .room.in-blackout .ui .windows { top: 118px; bottom: 182px; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
  .room.in-blackout .tuner__row, .room.in-blackout .tuner__dots { display: none; }
  .progress { --pb: 18px; left: 16px; right: 16px; width: auto; translate: none; bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + 90px); font-size: 7px; gap: 5px; }
  .ed {
    --stg: calc(100cqw - 56px);
    height: auto;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
    grid-template-areas: "view" "up" "list" "meth" "col" "idea";
  }
  .ed__view { grid-template-columns: var(--stg); grid-template-areas: "stage" "thumbs" "bar"; justify-self: stretch; }
  .mk-thumbs { grid-template-rows: none; grid-template-columns: repeat(4, minmax(0, 1fr)); height: calc(var(--stg) * .3); }
  .mk-hint { display: none; }
  .mk-swatches { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .ed__list .mk-list { max-height: 22em; }
  .qs { --qw: min(calc(100cqw - 40px), 250px); min-height: 0; gap: 26px; align-content: start; }
  .qs__opt { min-width: 0; }
  .qs__label { display: block; text-align: center; font-size: min(7cqw, 30px); white-space: normal; }
  .qp-grid { --qb: calc((100cqw - 28px) / 3); grid-template-columns: repeat(3, var(--qb)); gap: 14px; min-height: 0; padding-top: 6px; }
  .qp__label { font-size: min(4.8cqw, 20px); }
  .qp__soon { font-size: 6px; padding: .5em; }
  .aw { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "brief" "up" "gal" "next"; }
  .aw__next { flex-direction: column; align-items: stretch; }
  .ed .field textarea, .aw .field textarea { font: 400 20px/1.2 var(--mono); }   /* VT323 at 20px looks small but stays 16px+ so iPhones don't zoom in */
}
@media (max-width: 760px) {
  .ed .field textarea, .aw .field textarea { font: 400 20px/1.2 var(--mono); }   /* VT323 at 20px looks small but stays 16px+ so iPhones don't zoom in */
}

/* desktop: the method cards and the product grid are centred on the PAGE (in line with the progress bar)
   without shrinking: the group is slid left by half the difference between the layer's left inset (the menu)
   and its right inset, and capped so it never reaches the Back option. */
@container room (aspect-ratio >= 0.85) {
  .room.in-blackout .qs, .room.in-blackout .qp-grid {
    --R: max(16px, calc(var(--u) * 60));
    --half: calc((100cqw + var(--R) - var(--win-left, 0px)) / 2 - 8px);   /* page centre to the menu edge */
    translate: calc((var(--R) - var(--win-left, 0px)) / 2) 0;
  }
  .room.in-blackout .qs { --qw: min(clamp(240px, min(36cqw, calc((100cqh - 100px) * 1.2)), 560px), calc(var(--half) - 30px)); }
  .room.in-blackout .qp-grid { grid-template-columns: repeat(4, var(--qb)); --qb: min(clamp(140px, min(calc((100cqw - var(--rpg-gap) * 3) / 4 - 8px), calc((100cqh - 60px) / 2.45)), 300px), calc((var(--half) * 2 - var(--rpg-gap) * 3) / 4 - 8px)); }
}

@media (prefers-reduced-motion: reduce) {
  .room .stage { transition: none; }
  .mk-msg, .progress li.is-on::after, .progress li.is-on span::before, .mk-row.is-on .mk-row__name::before { animation: none !important; }
}
