/* ── tokens ─────────────────────────────────────────────────────────────── */
:root{
  --bg:#ffffff;
  --sunk:#f4f4f6;
  --ink:#0c0c0e;
  --ink-2:#43434c;
  --muted:#77777f;
  --line:#e7e7ec;
  --line-2:#d4d4dc;
  --ok:#12793f;
  --bad:#b3271f;
  --shadow:0 1px 2px rgba(12,12,14,.06), 0 16px 40px rgba(12,12,14,.12);
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  --bar-h:52px;
}
/* The wall is paper: this page commits to one light palette in both OS themes,
   so a creator's logo always sits on the same white it was designed against. */
:root{ color-scheme:light; }

*{box-sizing:border-box}
html,body{height:100%;height:100dvh}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font:15px/1.5 var(--sans);-webkit-font-smoothing:antialiased;
  display:flex;flex-direction:column;overflow:hidden;
}
h1,h2{margin:0;font-weight:700;letter-spacing:-.025em;line-height:1.15}
h1{font-size:26px}
h2{font-size:16px}
p{margin:0}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
a{color:inherit;text-decoration:none}
:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:6px}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}

/* ── top bar ────────────────────────────────────────────────────────────── */
.bar{
  height:var(--bar-h);flex:none;display:flex;align-items:center;gap:22px;
  padding:0 16px;border-bottom:1px solid var(--line);background:var(--bg);
}
.brand{display:flex;align-items:center;gap:8px;font-weight:700;letter-spacing:-.02em}
.brand-mark{
  width:16px;height:16px;border-radius:3px;background:var(--ink);
  box-shadow:0 0 0 3px var(--bg), 0 0 0 4px var(--line-2);
}
.tabs{display:flex;gap:2px}
.tab{
  padding:6px 12px;border-radius:7px;font-size:14px;color:var(--muted);
}
.tab:hover{color:var(--ink);background:var(--sunk)}
.tab[aria-selected="true"]{color:var(--ink);background:var(--sunk);font-weight:600}
.bar-right{margin-left:auto;display:flex;align-items:center;gap:18px}
.stat{display:flex;align-items:baseline;gap:6px}
.stat b{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:13px;font-weight:600}
.stat span{font-size:11px;color:var(--muted);letter-spacing:.04em}

.btn{
  padding:8px 15px;border-radius:999px;background:var(--ink);color:var(--bg);
  font-size:14px;font-weight:600;border:1px solid var(--ink);
}
.btn:hover{opacity:.85}
.btn:disabled{opacity:.35;cursor:not-allowed}
.btn.ghost{background:transparent;color:var(--ink);border-color:var(--line-2)}
.btn.ghost:hover{background:var(--sunk);opacity:1}
.btn.sm{padding:5px 11px;font-size:13px}
.icon-btn{width:28px;height:28px;border-radius:7px;color:var(--muted);display:grid;place-items:center}
.icon-btn:hover{background:var(--sunk);color:var(--ink)}

/* ── views ──────────────────────────────────────────────────────────────── */
main{flex:1;min-height:0;position:relative}
.view{position:absolute;inset:0;display:none}
.view.is-active{display:block}
.sheet{overflow:auto;background:var(--bg)}
.sheet-in{max-width:840px;margin:0 auto;padding:64px 28px 96px;display:flex;flex-direction:column;gap:34px}
.sheet-head{display:flex;flex-direction:column;gap:10px}
.sheet-head h1{font-size:clamp(28px,3.4vw,38px)}
.eyebrow{font-family:var(--mono);font-size:10.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.lede{color:var(--muted);max-width:56ch;font-size:16px}

.facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:36px;margin:0;
  border-top:1px solid var(--line)}
.facts>div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;
  padding:12px 0;border-bottom:1px solid var(--line)}
.facts dt{color:var(--muted);font-size:13.5px}
.facts dd{margin:0;font-size:13.5px}
@media (max-width:640px){ .facts{grid-template-columns:1fr} }

/* Numbered because the steps really are a sequence: each one needs the one
   before it. Hairline grid keeps four short items from reading as a thin list. */
.steps{
  margin:0;padding:0;list-style:none;
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;
  background:var(--line);border:1px solid var(--line);border-radius:12px;overflow:hidden;
}
.steps li{background:var(--bg);padding:22px 22px 24px;display:flex;flex-direction:column;gap:7px}
.step-n{font-family:var(--mono);font-size:11px;letter-spacing:.16em;color:var(--muted)}
.steps h2{font-size:16.5px}
.steps p{color:var(--ink-2);font-size:14px;max-width:40ch}
@media (max-width:640px){ .steps{grid-template-columns:1fr} }

/* ── the wall ───────────────────────────────────────────────────────────── */
.board-scroll{
  position:absolute;inset:0;overflow:auto;background:var(--sunk);
  /* One finger pans, two fingers pinch — but the pinch is ours, not the
     browser's, so the wall zooms instead of the whole page. */
  touch-action:pan-x pan-y;
  -webkit-overflow-scrolling:touch;
  /* `safe` keeps the top-left reachable once the wall is bigger than the frame */
  display:grid;justify-content:safe center;align-content:safe center;
}
.board-sizer{
  width:calc(1000px * var(--scale,1));
  height:calc(1000px * var(--scale,1));
  flex:none;
}
.board{
  position:relative;width:1000px;height:1000px;
  background:var(--bg);
  transform:scale(var(--scale,1));transform-origin:top left;
  box-shadow:0 0 0 1px var(--line-2);
}
.block{position:absolute;display:block;background:#fff}
.block img{width:100%;height:100%;display:block;object-fit:cover}
.block:hover,.block.peek{outline:2px solid var(--ink);outline-offset:0;z-index:3}
.board.filtered .block:not(.match){opacity:.15}

.ghost{
  position:absolute;display:none;z-index:6;pointer-events:none;
  border:2px solid var(--ok);background:color-mix(in srgb,var(--ok) 20%,transparent);
}
.ghost.bad{border-color:var(--bad);background:color-mix(in srgb,var(--bad) 20%,transparent)}
.board-scroll.aiming{touch-action:none}
.board.placing{cursor:crosshair}
.board.placing .block{pointer-events:none}
.board.placing .ghost{display:block}

.board-filters{
  position:absolute;left:14px;bottom:14px;display:flex;gap:4px;flex-wrap:wrap;max-width:60%;
  background:var(--bg);border:1px solid var(--line-2);border-radius:10px;padding:4px;
  box-shadow:var(--shadow);
}
.chip{
  display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:7px;
  font-size:12.5px;color:var(--ink-2);
}
.chip b{font-size:11px;color:var(--muted);font-weight:600}
.chip:hover{background:var(--sunk)}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.chip[aria-pressed="true"] b{color:color-mix(in srgb,var(--bg) 70%,transparent)}
.chip[aria-pressed="true"] .pf-icon{color:var(--bg)!important}

.board-tools{
  position:absolute;right:14px;bottom:14px;display:flex;align-items:center;gap:2px;
  background:var(--bg);border:1px solid var(--line-2);border-radius:10px;padding:3px;
  box-shadow:var(--shadow);
}
.tool{width:28px;height:26px;border-radius:7px;font-size:15px;line-height:1;color:var(--ink-2)}
.tool.wide{width:auto;padding:0 10px;font-size:12px}
.tool:hover{background:var(--sunk);color:var(--ink)}
.zoom-level{font-size:11px;color:var(--muted);min-width:38px;text-align:center}

.place-bar{
  position:absolute;left:50%;top:14px;transform:translateX(-50%);display:none;
  align-items:center;gap:12px;z-index:8;
  background:var(--ink);color:var(--bg);border-radius:999px;padding:7px 8px 7px 16px;
  font-size:13px;box-shadow:var(--shadow);white-space:nowrap;
}
.place-bar.on{display:flex}
.place-bar .btn.ghost{color:var(--bg);border-color:color-mix(in srgb,var(--bg) 45%,transparent)}
.place-bar .btn.ghost:hover{background:color-mix(in srgb,var(--bg) 15%,transparent)}

/* ── hover card ─────────────────────────────────────────────────────────── */
.hovercard{
  position:fixed;z-index:20;width:320px;pointer-events:none;
  background:var(--bg);border:1px solid var(--line-2);border-radius:12px;
  box-shadow:var(--shadow);overflow:hidden;
}
.hc-top{display:flex;gap:11px;padding:13px 14px 10px;align-items:center}
.hc-logo-wrap{position:relative;flex:none;width:44px;height:44px}
.hc-logo{width:44px;height:44px;border-radius:10px;background:var(--sunk);object-fit:cover;display:block}
.hc-badge{
  position:absolute;right:-5px;bottom:-5px;width:19px;height:19px;border-radius:50%;
  background:var(--bg);box-shadow:0 0 0 1px var(--line-2);
  display:grid;place-items:center;
}
.hc-badge svg{width:12px;height:12px;display:block}
.hc-id{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}
/* names and handles wrap rather than truncate — the whole point of the card */
.hc-name{font-weight:600;letter-spacing:-.01em;line-height:1.25;overflow-wrap:anywhere}
.hc-handle{font-family:var(--mono);font-size:12.5px;color:var(--muted);overflow-wrap:anywhere}

.hc-line{
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
  padding:0 14px 11px;font-size:12.5px;color:var(--muted);
}
.hc-platform{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2);font-weight:500}
.hc-followers b{font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--ink);font-weight:600}
.pf-icon{display:inline-flex;width:15px;height:15px}
.pf-icon svg{width:100%;height:100%;display:block}

.hc-bio{padding:0 14px 12px;font-size:13px;color:var(--ink-2)}
.hc-metrics{display:flex;border-top:1px solid var(--line)}
.hc-metrics div{flex:1;padding:8px 12px;border-right:1px solid var(--line)}
.hc-metrics div:last-child{border-right:0}
.hc-metrics b{display:block;font-family:var(--mono);font-size:13px;font-weight:600}
.hc-metrics span{font-size:10px;color:var(--muted)}
.hc-foot{display:flex;justify-content:space-between;gap:10px;padding:9px 14px;
  border-top:1px solid var(--line);background:var(--sunk);
  font-family:var(--mono);font-size:10.5px;color:var(--muted)}
.hc-foot b{color:var(--ink);font-weight:600}
.hc-skeleton{padding:16px;color:var(--muted);font-size:13px}

/* ── modal ──────────────────────────────────────────────────────────────── */
.scrim{
  position:fixed;inset:0;z-index:30;background:rgba(12,12,14,.4);
  display:flex;align-items:flex-start;justify-content:center;padding:6vh 16px;overflow:auto;
}
.scrim[hidden]{display:none}
.modal{width:min(480px,100%);background:var(--bg);border:1px solid var(--line-2);
  border-radius:14px;box-shadow:var(--shadow);overflow:hidden}
.modal-head{display:flex;align-items:center;gap:12px;padding:15px 16px;border-bottom:1px solid var(--line)}
.modal-head h2{flex:1;font-size:15px}
.steps-dots{display:flex;gap:4px}
.steps-dots i{width:16px;height:3px;border-radius:2px;background:var(--line-2)}
.steps-dots i.on{background:var(--ink)}
.modal-body{padding:16px;display:flex;flex-direction:column;gap:14px}
.modal-foot{display:flex;gap:8px;padding:13px 16px;border-top:1px solid var(--line);background:var(--sunk)}
.modal-foot .btn{flex:1;text-align:center}

.field{display:flex;flex-direction:column;gap:6px}
.field label{font-family:var(--mono);font-size:10px;letter-spacing:.11em;text-transform:uppercase;color:var(--muted)}
.input{width:100%;padding:10px 12px;border:1px solid var(--line-2);border-radius:8px;
  background:var(--bg);color:var(--ink);font:14px var(--mono)}
.input:focus{outline:2px solid var(--ink);outline-offset:-1px}
.row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.hint{font-size:12px;color:var(--muted)}
.hint.err{color:var(--bad)}
.hint.ok{color:var(--ok)}

/* size picker — radio rows plus a revealed custom pair */
.opts{display:flex;flex-direction:column;gap:6px}
.opt{display:flex;align-items:center;gap:10px;padding:10px 12px;cursor:pointer;
  border:1px solid var(--line-2);border-radius:9px}
.opt:hover{border-color:var(--ink)}
.opt:has(input:checked){border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.opt:has(input:focus-visible){outline:2px solid var(--ink);outline-offset:2px}
.opt input{accent-color:var(--ink);width:15px;height:15px;margin:0;flex:none}
.opt-main{display:flex;flex-direction:column;gap:2px;min-width:0}
.opt-main b{font-size:13px;font-weight:600}
.opt-sub{font-size:11.5px;color:var(--muted)}
.opt-price{margin-left:auto;font-size:12.5px;font-weight:600;white-space:nowrap}


/* language picker */
.lang{display:flex;align-items:center}
.lang select{appearance:none;border:1px solid var(--line-2);border-radius:8px;
  padding:5px 24px 5px 9px;font:inherit;font-size:12px;color:var(--ink);
  background:var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center/9px;
  cursor:pointer}
.lang select:focus-visible{outline:2px solid var(--ink);outline-offset:1px}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}

.choices{display:grid;gap:8px}
.choices.c4{grid-template-columns:repeat(4,1fr)}
.choices.c3{grid-template-columns:repeat(3,1fr)}
.choice{border:1px solid var(--line-2);border-radius:9px;padding:10px 8px;text-align:center;
  display:flex;flex-direction:column;gap:2px;font-size:13px}
.choice b{font-family:var(--mono);font-size:13px;font-weight:600}
.choice span{font-family:var(--mono);font-size:10px;color:var(--muted)}
.choice:hover{border-color:var(--ink)}
.choice.pf{align-items:center;gap:5px;font-size:11px;padding:9px 4px}
.choice.pf .pf-icon{width:18px;height:18px}
.choice[aria-pressed="true"]{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}

.drop{border:1px dashed var(--line-2);border-radius:10px;padding:18px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:8px;color:var(--muted);font-size:13px}
.drop.has{border-style:solid;color:var(--ink)}
.drop img{width:56px;height:56px;border-radius:10px;object-fit:cover;background:var(--sunk)}

.summary{border:1px solid var(--line);border-radius:10px;background:var(--sunk);padding:12px;
  display:flex;flex-direction:column;gap:7px}
.srow{display:flex;justify-content:space-between;gap:12px;font-size:13px}
.srow span{color:var(--muted)}
.srow b{font-family:var(--mono);font-variant-numeric:tabular-nums;font-weight:600}
.srow.total{border-top:1px solid var(--line-2);padding-top:7px}
.srow.total b{font-size:15px}

.done{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.done .tick{width:34px;height:34px;border-radius:50%;border:1.5px solid var(--ok);color:var(--ok);
  display:grid;place-items:center;font-size:16px}

.spinner{width:14px;height:14px;border:2px solid var(--line-2);border-top-color:var(--ink);
  border-radius:50%;animation:spin .7s linear infinite;display:inline-block;vertical-align:-2px}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* ── touch and small screens ──────────────────────────────────────────────
   Two axes, deliberately separate: `hover:none` is about the input device
   (a finger cannot hover, so the preview card needs somewhere to live), and
   the width queries are about space. A big iPad has room but no hover; a
   small laptop window has hover but no room. */

@media (hover:none){
  /* Following a cursor is meaningless without one — the card becomes a sheet
     anchored to the bottom of the screen, out of the thumb's way. */
  .hovercard{
    left:0!important;right:0!important;top:auto!important;bottom:0;
    width:auto;max-width:none;border-radius:14px 14px 0 0;
    border-left:0;border-right:0;border-bottom:0;
    padding-bottom:calc(14px + env(safe-area-inset-bottom));
  }
  .tool{width:34px;height:32px}
  .tool.wide{padding:0 13px}
  .chip{padding:7px 11px}
}

/* Below this width the floating controls stop floating.
   On a desktop the filters and zoom sit over the wall like a map app's chrome —
   there is enough canvas that covering a corner costs nothing. On a phone the
   wall *is* the viewport, so anything hovering over it hides pixels somebody is
   paying for. Here they become a real toolbar row above the board and take up
   their own space instead. */
@media (max-width:900px){
  /* scoped to .is-active on purpose: a bare #view-board would out-specify
     `.view{display:none}` and leave the wall showing under the other tab */
  #view-board.is-active{
    display:grid;
    grid-template-rows:auto minmax(0, 1fr);
    grid-template-columns:minmax(0, 1fr) auto;
  }
  .board-scroll{
    position:relative;inset:auto;
    grid-row:2;grid-column:1 / -1;min-height:0;
  }

  .board-filters,.board-tools{
    position:static;grid-row:1;
    border:0;border-bottom:1px solid var(--line);border-radius:0;
    box-shadow:none;background:var(--bg);padding:6px 8px;max-width:none;
  }
  .board-filters{
    grid-column:1;flex-wrap:nowrap;overflow-x:auto;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
  }
  .board-filters::-webkit-scrollbar{display:none}
  .board-tools{grid-column:2;padding-left:0}
  .board-tools::before{
    content:'';width:1px;align-self:stretch;margin:2px 6px 2px 0;background:var(--line);
  }

  /* the chips must not squash themselves to fit the strip */
  .chip{flex:none}
}

@media (max-width:720px){
  :root{--bar-h:auto}
  .bar{flex-wrap:wrap;gap:10px 12px;padding:8px 12px}
  .tabs{order:3;width:100%}
  .stat{display:none}
  .bar-right{gap:10px}
  .brand{font-size:15px}
  .sheet-in{padding:40px 18px 72px;gap:26px}

  /* iOS zooms the page in whenever a focused field is under 16px */
  .input,.lang select{font-size:16px}

  .zoom-level{min-width:32px;font-size:10.5px}
  /* clears the docked toolbar instead of landing on top of it */
  .place-bar{left:12px;right:12px;top:52px;transform:none;white-space:normal;
    justify-content:space-between}

  /* The modal becomes a sheet. It has to be a flex column for this to work:
     `.modal` clips its overflow, so without a column the body has no height to
     scroll inside and the footer is simply cut off the bottom of the screen. */
  .scrim{align-items:flex-end;padding:0;overflow:hidden}
  .modal{
    width:100%;max-height:92dvh;border-radius:16px 16px 0 0;border-bottom:0;
    display:flex;flex-direction:column;
  }
  .modal-head,.modal-foot{flex:none}
  .modal-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch}
  .modal-foot{padding-bottom:calc(14px + env(safe-area-inset-bottom))}
  .row{grid-template-columns:1fr}
  .choices.c3{grid-template-columns:repeat(2,1fr)}
  .opt{padding:12px}
  .opt-price{font-size:12px}
}

@media (max-width:400px){
  .tabs{font-size:13px}
  .btn{padding:7px 12px;font-size:13.5px}
  .choices.c3{grid-template-columns:repeat(2,1fr)}
  .hovercard{font-size:13px}
}
