/* ══ /design.html — the visualiser ══
   Rides on product.css: same tokens, same rail, same footer. Only the tool
   itself is new. */

.dhero{padding-block:clamp(30px,6vh,66px) clamp(18px,3vh,30px)}
.dhero h1{font-family:var(--display);font-size:clamp(34px,6.4vw,68px);line-height:.98;
  letter-spacing:-.02em;color:var(--ink);margin-top:12px}
.dhero h1 em{font-style:normal;color:var(--azure-ink)}
.dhero .lede{margin-top:clamp(14px,2vh,20px);max-width:52ch;
  font-size:clamp(16.5px,1.5vw,19px);line-height:1.65;color:var(--ink-2)}

.dtool{padding-block:0 clamp(40px,7vh,80px)}
.vwrap .step{margin-top:clamp(24px,3.6vh,40px)}
.vwrap .sn{font-family:Plex,monospace;font-size:12px;letter-spacing:.12em;color:var(--ink-3);
  display:flex;align-items:center;gap:10px;margin-bottom:12px}
.vwrap .sn s{text-decoration:none;color:var(--azure-ink);font-weight:700}

/* ── the drop zone ── */
.vwrap .drop{display:block;position:relative;border:2px dashed var(--line);border-radius:4px;
  background:var(--white);cursor:pointer;overflow:hidden;transition:border-color .18s,background .18s}
.vwrap .drop:hover, .vwrap .drop.over{border-color:var(--azure-ink);background:#fbfaf8}
.vwrap .drop:focus-within{outline:3px solid var(--azure-ink);outline-offset:2px}
.vwrap .dz{display:grid;place-items:center;gap:7px;text-align:center;
  padding:clamp(30px,7vw,62px) 20px;min-height:150px}
.vwrap .dz b{font-family:var(--display);font-size:clamp(18px,1.9vw,23px);color:var(--ink)}
.vwrap .dz s{text-decoration:none;font-size:14.5px;line-height:1.5;color:var(--ink-3);max-width:34ch}
.vwrap .drop img{display:none;width:100%;height:auto;max-height:60vh;object-fit:contain;background:var(--navy)}
.vwrap .drop.has .dz{display:none}
.vwrap .drop.has img{display:block}

/* ── choice chips ── */
.vwrap .chips{display:flex;flex-wrap:wrap;gap:9px}
.vwrap .chips.wide{display:grid;gap:9px;grid-template-columns:repeat(auto-fit,minmax(178px,1fr))}
.vwrap .chip input{position:absolute;opacity:0;width:0;height:0}
.vwrap .chip span{display:flex;flex-direction:column;gap:3px;min-height:46px;
  justify-content:center;padding:10px 16px;border:1px solid var(--line);border-radius:100px;
  background:var(--white);color:var(--ink-2);cursor:pointer;transition:.16s;
  font-size:15.5px;line-height:1.35}
.vwrap .chips.wide .chip span{border-radius:4px;align-items:flex-start;padding:12px 15px}
.vwrap .chip b{font-weight:700;color:var(--ink)}
.vwrap .chip s{text-decoration:none;font-size:13.5px;color:var(--ink-3)}
.vwrap .chip i{width:17px;height:17px;border-radius:50%;border:1px solid rgba(15,35,51,.22);
  display:inline-block;margin-inline-end:8px;vertical-align:-3px}
.vwrap .chips:not(.wide) .chip span{flex-direction:row;align-items:center}
.vwrap .chip input:checked+span{border-color:var(--azure-ink);background:#eef7fc;
  box-shadow:inset 0 0 0 1px var(--azure-ink)}
.vwrap .chip input:focus-visible+span{outline:3px solid var(--azure-ink);outline-offset:2px}

/* The pergola's two questions. Same card as a pattern tile, minus the
   photograph: there is no reference shot of a bare roof slat to put in one,
   and a pill would set the line and its explanation side by side. This has to
   come after the :not(.wide) row rule above, which it ties with on
   specificity. */
.vwrap .chips.said{display:grid;gap:9px;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.vwrap .chips.said .chip span{flex-direction:column;align-items:flex-start;
  border-radius:4px;padding:13px 15px;gap:3px}
.vwrap .sn2{margin-block-start:clamp(20px,3vh,30px)}

.vwrap .note{margin-top:11px;font-size:14.5px;line-height:1.6;color:var(--ink-3)}
.vwrap .note b{color:var(--ink);font-weight:700}
.vwrap .note a{color:var(--azure-ink);text-decoration:underline;
  text-decoration-thickness:2px;text-underline-offset:5px}

/* ── go ── */
.vwrap .go{margin-top:clamp(26px,4vh,42px);width:100%;min-height:56px;border:0;border-radius:3px;
  background:var(--azure-ink);color:#fff;font-family:var(--display);
  font-size:clamp(17px,1.7vw,20px);cursor:pointer;transition:background .18s}
/* white on that grey measured 1.81:1. A disabled control is exempt from the
   contrast rule, but the label still has to be readable — it is telling the
   visitor what the button will do once they add a photo. */
.vwrap .go:disabled{background:#e4e7ea;color:#59636d;cursor:not-allowed}
.vwrap .go:not(:disabled):hover{background:var(--ink)}
.vwrap .go:focus-visible{outline:3px solid var(--ink);outline-offset:3px}

.vwrap .err{margin-top:14px;padding:13px 16px;border-radius:3px;background:#fdecec;
  border:1px solid #e7b4b4;color:#8a2020;font-size:15.5px;line-height:1.55}

/* ── output ── */
.vwrap .out{margin-top:clamp(26px,4vh,42px)}
.vwrap .ph{display:grid;place-items:center;gap:9px;text-align:center;min-height:230px;
  padding:34px 20px;border:1px solid var(--line);border-radius:4px;background:var(--white)}
.vwrap .ph b{font-family:var(--display);font-size:clamp(17px,1.8vw,21px);color:var(--ink)}
.vwrap .ph s{text-decoration:none;font-size:14.5px;color:var(--ink-3)}
.vwrap .spin{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);
  border-top-color:var(--azure-ink);animation:sp 1s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.vwrap .spin{animation-duration:2.4s}}

.vwrap .res{margin:0}
.vwrap .res img{display:block;width:100%;height:auto;border-radius:4px;background:var(--navy)}
.vwrap .res figcaption{margin-top:12px;font-size:14.5px;line-height:1.6;color:var(--ink-3)}
.vwrap .res figcaption b{color:var(--ink);font-weight:700}

.vwrap .dacts{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.vwrap .dacts button, .vwrap .dacts a{flex:1 1 190px;min-height:52px;display:grid;place-items:center;
  border-radius:3px;font-family:var(--display);font-size:16.5px;cursor:pointer;
  text-align:center;padding:0 18px}
.vwrap .dacts .p{border:0;background:var(--azure-ink);color:#fff}
.vwrap .dacts .p:hover{background:var(--ink)}
.vwrap .dacts .s{border:1px solid var(--line);background:var(--white);color:var(--ink)}
.vwrap .dacts .s:hover{border-color:var(--ink)}
.vwrap .dacts button:focus-visible, .vwrap .dacts a:focus-visible{outline:3px solid var(--azure-ink);outline-offset:2px}

.vwrap .priv{margin-top:clamp(22px,3vh,34px);font-size:14px;line-height:1.6;color:var(--ink-3)}
.vwrap .priv b{color:var(--ink);font-weight:700}
.vwrap .priv a{color:var(--azure-ink);text-decoration:underline;
  text-decoration-thickness:2px;text-underline-offset:5px}

/* The hidden attribute hides only through the UA sheet's display:none, so any
   author rule that sets display beats it. .ph is a grid and .dacts is a flex
   row, which is why the spinner stayed on screen above the finished render
   even though the attribute had been set correctly. */
.vwrap .ph[hidden], .vwrap .dacts[hidden], .vwrap .out[hidden], .vwrap .res[hidden]{display:none}

/* ── design chips carry a photograph of that design ──
   The names alone are not usable: nobody choosing a gate knows what הייטק
   looks like, and a wrong guess costs a real render. Photographs come from the
   old site, where the company named its own files — so the label is theirs,
   not an identification made here. */
.vwrap .chips.wide .chip span{padding:0;overflow:hidden;gap:0}
.vwrap .chips.wide .chip img{display:block;width:100%;height:auto;aspect-ratio:4/3;
  object-fit:cover;background:var(--navy);border-block-end:1px solid var(--line)}
.vwrap .chips.wide .chip b{padding:11px 14px 0}
.vwrap .chips.wide .chip s{padding:2px 14px 12px}
.vwrap .chips.wide .chip input:checked+span img{border-block-end-color:var(--azure-ink)}
/* Three across, not auto-fit. The home page's wrap is wider than the product
   pages', and auto-fit put five in a row and left שילוב זכוכית alone on a
   second one with a hole beside it. A fixed count divides six evenly on both
   pages and makes each reference big enough to read. */
@media(min-width:900px){
  .vwrap .chips.wide{grid-template-columns:repeat(5,1fr)}
}
@media(max-width:899px){
  /* two across on a phone: big enough to read the pattern, small enough that
     all six are visible without a long scroll before the colour step */
  .vwrap .chips.wide{grid-template-columns:1fr 1fr;gap:8px}
  .vwrap .chips.wide .chip b{font-size:15.5px;padding:9px 11px 0}
  .vwrap .chips.wide .chip s{font-size:12.5px;padding:2px 11px 10px}
}

/* The file input is hidden visually, NOT with display:none.
   A display:none file input cannot be reliably opened by clicking its label on
   mobile — iOS Safari frequently does nothing — which left the visitor unable
   to choose a photo at all, and therefore stuck behind a button that never
   enabled. This keeps it operable, focusable and in the tab order. */
.vwrap .drop input[type=file]{position:absolute;width:1px;height:1px;
  padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.vwrap .drop:focus-within{outline:3px solid var(--azure-ink);outline-offset:2px}

/* ── the elapsed count ── */
.vwrap .ph .phTime{font-family:Plex,monospace;font-size:26px;letter-spacing:.04em;
  color:var(--azure-ink);font-variant-numeric:tabular-nums}

/* ── before / after ──
   Both images occupy the same box; the render is clipped from the left and the
   handle sits on that edge. The 3:2 below is only the shape of the empty frame
   before a render lands: the render now comes back the shape it was sent, so
   design.js writes the real ratio inline once the picture has decoded. The
   uploaded photo is object-fit:cover into the same frame, and since both are
   now the same shape, the two line up whatever the phone shot. */
.vwrap .vba{position:relative;overflow:hidden;border-radius:4px;background:var(--navy);
  aspect-ratio:3/2;touch-action:pan-y;cursor:ew-resize;user-select:none}
.vwrap .vba img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.vwrap .baAfter{position:absolute;inset:0;clip-path:inset(0 0 0 50%)}
.vwrap .baHandle{position:absolute;inset-block:0;left:50%;width:44px;margin-inline-start:-22px;
  border:0;background:transparent;cursor:ew-resize;padding:0;z-index:3}
.vwrap .baHandle::before{content:'';position:absolute;inset-block:0;left:50%;width:2px;
  margin-left:-1px;background:#fff;box-shadow:0 0 0 1px rgba(8,21,31,.35)}
.vwrap .baHandle::after{content:'⟷';position:absolute;top:50%;left:50%;
  transform:translate(-50%,-50%);width:40px;height:40px;border-radius:50%;background:#fff;
  color:var(--ink);font-size:17px;line-height:40px;text-align:center;
  box-shadow:0 4px 14px -4px rgba(8,21,31,.5)}
.vwrap .baHandle:focus-visible{outline:3px solid var(--azure-ink);outline-offset:-3px}
.vwrap .baLabel{position:absolute;top:10px;z-index:2;padding:5px 11px;border-radius:100px;
  background:rgba(8,21,31,.62);color:#fff;font-size:12.5px;letter-spacing:.06em;
  pointer-events:none;backdrop-filter:blur(3px)}
.vwrap .baLabel.bl{left:10px}
.vwrap .baLabel.br{right:10px}
.vwrap .baZoom{position:absolute;bottom:10px;right:10px;z-index:4;width:44px;height:44px;
  border:0;border-radius:50%;background:rgba(8,21,31,.62);color:#fff;font-size:19px;
  cursor:pointer;backdrop-filter:blur(3px)}
.vwrap .baZoom:hover{background:var(--azure-ink)}
.vwrap .baZoom:focus-visible{outline:3px solid #fff;outline-offset:2px}

/* ── full screen ── */
.vlb{position:fixed;inset:0;z-index:200;background:rgba(8,21,31,.94);
  display:grid;place-items:center;padding:18px}
.vlb[hidden]{display:none}
.vlb img{max-width:100%;max-height:92vh;border-radius:3px}
.vlb .x{position:absolute;top:12px;inset-inline-end:12px;width:48px;height:48px;
  border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;
  font-size:30px;line-height:1;cursor:pointer}
.vlb .x:hover{background:rgba(255,255,255,.26)}
.vlb .x:focus-visible{outline:3px solid #fff;outline-offset:2px}

/* zoom on the uploaded photo — only once there is one */
.vwrap .vprevZoom{display:none;position:absolute;bottom:10px;inset-inline-start:10px;z-index:4;
  width:44px;height:44px;border:0;border-radius:50%;background:rgba(8,21,31,.62);color:#fff;
  font-size:19px;cursor:pointer;backdrop-filter:blur(3px)}
.vwrap .drop.has .vprevZoom{display:block}
.vwrap .vprevZoom:hover{background:var(--azure-ink)}
.vwrap .vprevZoom:focus-visible{outline:3px solid #fff;outline-offset:2px}
.vwrap .drop{position:relative}

/* the overlay holds either a picture or the comparison itself */
.vlb .slot{width:min(100%,1500px);max-height:92vh;display:grid;place-items:center}
.vlb .slot img{max-width:100%;max-height:92vh;border-radius:3px}
.vlb .slot .vba{width:100%;max-width:1400px;max-height:88vh;cursor:ew-resize;
  aspect-ratio:3/2;margin-inline:auto}
.vlb .slot .vba .baZoom{display:none}

/* A resumed render has no before — the uploaded photo lived only in the page
   that was left behind. Show the render alone rather than half an empty frame. */
.vwrap .vba.solo .baHandle,
.vwrap .vba.solo .baLabel,
.vwrap .vba.solo .baBefore{display:none}
.vwrap .vba.solo{cursor:default}

/* The tool is injected, so without a reserved box everything below it
   jumps when the 188 nodes arrive. The value only has to be close. */
#viz:empty{min-height:1400px}
@media(min-width:900px){#viz:empty{min-height:1100px}}
