/* Mint page (direction B): the page wears the palette of the work on screen.
   Hierarchy: the work (left) and the mint panel (right) share the first screen; the Mint button is the one
   filled action. Activity sits small under the work; the gallery follows. Same soft tracks as the Engine. */
:root{--track:color-mix(in srgb,var(--ground) 92%,var(--ink));--track2:color-mix(in srgb,var(--ground) 86%,var(--ink));--r:14px}
button{font-family:"Archivo",system-ui,sans-serif;cursor:pointer}
button:disabled{cursor:not-allowed}

/* the two columns stretch to one height: the fine print in the panel ends on the activity's last line */
.mintgrid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(32px,4.5vw,72px);align-items:stretch;padding:28px var(--gut) 88px;max-width:1440px;margin:0 auto}

/* left: the work, then a small activity list */
.art{display:flex;flex-direction:column;gap:36px;min-width:0}
.workframe{position:relative;margin:0}
.work{aspect-ratio:16/9;border-radius:var(--r)}
.shuffle{position:absolute;top:14px;right:14px;z-index:2;width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:50%;
  background:var(--ground);color:var(--ink);box-shadow:0 2px 10px rgba(0,0,0,.18);transition:transform .2s,background-color .2s}
.shuffle svg{width:19px;height:19px}
.shuffle:hover{transform:rotate(-12deg);background:var(--ink);color:var(--ground)}
.workframe figcaption{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-top:12px;font-size:14px}
#viewLabel{font-weight:600;color:var(--ink)}
.workframe figcaption a{color:var(--soft);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.workframe figcaption a:hover{color:var(--ink)}

.activity .ahead{display:flex;justify-content:space-between;align-items:baseline;padding-bottom:10px;border-bottom:1px solid var(--line)}
.activity h2{margin:0;font:700 14px "Archivo";letter-spacing:.01em}
#actNote{font-size:13px;color:var(--soft)}
.acts{list-style:none;margin:0;padding:0}
.acts li{display:grid;grid-template-columns:1fr auto auto;gap:18px;align-items:baseline;padding:9px 0;border-bottom:1px solid var(--line);font-size:14px}
.acts li.empty{display:block;color:var(--soft)}
.acts a{color:var(--ink);font-weight:600;text-decoration:none}.acts a:hover{color:var(--accent)}
.acts .who{color:var(--soft);font-variant-numeric:tabular-nums}.acts .when{color:var(--soft);font-size:13px;min-width:72px;text-align:right}

/* right: the mint panel */
.panel{display:flex;flex-direction:column;gap:22px;min-width:0}
.phead{display:flex;flex-direction:column;gap:14px}
.title{margin:0;font:800 clamp(44px,4.6vw,68px)/.92 "Archivo";font-stretch:var(--wide);letter-spacing:-.035em}
/* every text block spans the full width of the Mint button, justified edge to edge */
.panel .lead{max-width:none;margin:0;font:400 17px/1.55 "Archivo";line-height:1.55;color:var(--soft);text-align:justify;hyphens:auto}

.status{display:flex;flex-direction:column;justify-content:center;gap:18px;background:var(--track);border-radius:var(--r);padding:26px 24px;min-height:112px}
.cd{display:flex;flex-direction:column;gap:14px}
.cdrow{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.cdrow>div{display:flex;flex-direction:column;align-items:center;gap:6px;background:var(--ground);border-radius:10px;padding:14px 0 12px}
.cdrow b{font:800 36px/1 "Archivo";font-stretch:110%;font-variant-numeric:tabular-nums}
.cdrow span{font-size:13.5px;color:var(--soft)}
.cdwhen{font-size:15px;color:var(--soft)}
.prog{display:flex;flex-direction:column;gap:14px}
.progrow{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:17px}
#state,#count{background:none}#state{flex:1;min-width:0}#count{white-space:nowrap}
#state{color:var(--soft)}#state.live{color:var(--ink);font-weight:500}
#count{font-weight:700;font-size:18px;font-variant-numeric:tabular-nums}
.bar{height:8px;background:var(--ground);border-radius:8px;overflow:hidden}.bar i{display:block;height:100%;width:0;background:var(--accent);border-radius:8px;transition:width .6s}

.spec{margin:0;display:flex;flex-direction:column}
.spec div{display:flex;justify-content:space-between;align-items:baseline;padding:12px 0;border-bottom:1px solid var(--line)}
.spec div:first-child{border-top:1px solid var(--line)}
.spec dt{font-size:14px;color:var(--soft)}.spec dd{margin:0;font:700 17px "Archivo"}

.buy{display:flex;flex-direction:column;gap:14px}
.qty{display:flex;justify-content:space-between;align-items:center;gap:12px}
.stepper{display:flex;align-items:center;gap:2px;background:var(--track);border-radius:999px;padding:4px}
.stepper button{width:40px;height:40px;border:0;border-radius:50%;background:transparent;color:var(--ink);font:500 19px/1 "Archivo"}
.stepper button:hover{background:var(--track2)}
.stepper input{width:48px;height:40px;border:0;background:transparent;color:var(--ink);text-align:center;font:700 17px "Archivo";-moz-appearance:textfield}
.stepper input::-webkit-inner-spin-button{display:none}
.total{display:flex;align-items:baseline;gap:10px;font-size:14px;color:var(--soft)}#total{font:700 22px "Archivo";color:var(--ink)}
.go{height:58px;border:0;border-radius:999px;background:var(--ink);color:var(--ground);font:700 16px "Archivo";letter-spacing:.01em;transition:background-color .2s,color .2s}
.go:hover:not(:disabled){background:var(--accent);color:var(--on-accent)}
.go:disabled{background:var(--track);color:var(--soft)}
.msg{font-size:14px;color:var(--soft)}.msg:empty{display:none}.msg.err,.msg.ok{color:var(--ink)}
.wallet{display:flex;justify-content:center;align-items:baseline;gap:10px;flex-wrap:wrap;font-size:13.5px;color:var(--soft)}
.textbtn{border:0;background:none;padding:0;color:var(--ink);font:600 13.5px "Archivo";text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
#walletRow{display:flex;gap:10px}#walletRow[hidden]{display:none}#who{display:none}
#walletRow #left::before{content:"·";margin-right:10px}
.fine{max-width:none;font-size:13.5px;line-height:1.6;color:var(--soft);margin:auto 0 0;padding-top:8px;text-align:justify;hyphens:auto}.fine a{color:var(--ink)}
.cd[hidden]{display:none}

/* gallery */
.block{padding:0 var(--gut) 96px;max-width:1500px;margin:0 auto}
.bhead{display:flex;justify-content:space-between;align-items:baseline;gap:16px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:28px;margin-bottom:20px}
.bhead .h2{margin:0;font-size:clamp(28px,3vw,40px)}

/* toolbar, one line: filter · search by ID · N items ········ OpenSea · All / My collection */
.gbar{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.gsp{flex:1}
.fbtn{position:relative;flex:none;width:46px;height:46px;display:grid;place-items:center;border:0;border-radius:50%;background:var(--track);color:var(--ink);transition:background-color .2s,color .2s}
.fbtn svg{width:21px;height:21px}
.fbtn:hover{background:var(--track2)}.fbtn[aria-expanded=true]{background:var(--ink);color:var(--ground)}
.fbtn .fn{position:absolute;top:-3px;right:-3px;min-width:18px;height:18px;border-radius:9px;background:var(--accent);color:var(--on-accent);font:700 11px/18px "Archivo";font-style:normal;text-align:center;padding:0 4px}
.fbtn .fn[hidden]{display:none}
.search{flex:0 1 340px;min-width:0;height:46px;display:flex;align-items:center;gap:9px;background:var(--track);border-radius:999px;padding:0 18px;color:var(--soft)}
.search svg{flex:none;width:18px;height:18px}
.search input{flex:1;min-width:0;border:0;background:transparent;color:var(--ink);font:500 15px "Archivo";outline:none}
.search input::placeholder{color:var(--soft)}
.search:focus-within{box-shadow:0 0 0 2px var(--ink)}
.search input::-webkit-search-cancel-button{-webkit-appearance:none}
.gcount{flex:none;font:600 13px "Archivo";letter-spacing:.08em;text-transform:uppercase;color:var(--soft);font-variant-numeric:tabular-nums;white-space:nowrap}
.osicon{flex:none;height:46px;display:flex;align-items:center;gap:6px;border-radius:999px;padding:0 14px 0 16px;background:var(--track);color:var(--ink);font:600 13.5px "Archivo";text-decoration:none;transition:background-color .2s}
.osicon:hover{background:var(--track2)}
.osicon svg{width:17px;height:17px}
.osicon img{width:24px;height:24px;display:block}
.osicon.logo{width:46px;padding:0;justify-content:center}.osicon.logo span,.osicon.logo svg{display:none}
.tabs{flex:none;display:flex;gap:2px;background:var(--track);border-radius:999px;padding:4px;height:46px;box-sizing:border-box}
.tabs button{border:0;border-radius:999px;background:transparent;color:var(--ink);font:500 14px "Archivo";padding:0 18px}
.tabs button[aria-selected=true]{background:var(--ink);color:var(--ground)}

/* body: the trait panel opens on the left, the grid takes the rest */
.gbody{display:grid;grid-template-columns:minmax(0,1fr);gap:28px;align-items:start}
#works.fopen .gbody{grid-template-columns:280px minmax(0,1fr)}
.fpanel{position:sticky;top:20px;max-height:calc(100vh - 40px);overflow:auto;display:flex;flex-direction:column;scrollbar-width:thin}
.fpanel[hidden]{display:none}
.fhead{display:flex;justify-content:space-between;align-items:baseline;padding:4px 0 12px;border-bottom:1px solid var(--line)}
.fhead b{font:700 16px "Archivo"}
.fclear{border:0;background:none;padding:0;color:var(--ink);font:500 13.5px "Archivo";text-decoration:underline;text-underline-offset:3px}
.fclear[hidden]{display:none}
.fnone{font-size:14px;color:var(--soft);margin:14px 0}
.fgroup{border-bottom:1px solid var(--line)}
.ftrait{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;border:0;background:none;padding:14px 0;color:var(--soft);font:500 15.5px "Archivo";text-align:left}
.ftrait:hover,.fgroup.open .ftrait{color:var(--ink)}
.fmeta{display:flex;align-items:center;gap:8px;font-variant-numeric:tabular-nums}
.fmeta i{font-style:normal;min-width:20px;height:20px;border-radius:10px;background:var(--ink);color:var(--ground);font:700 11px/20px "Archivo";text-align:center;padding:0 5px}
.fmeta svg{width:19px;height:19px;transition:transform .2s}.fgroup.open .fmeta svg{transform:rotate(180deg)}
.fvals{display:flex;flex-direction:column;padding:0 0 12px}
.fvals label{display:flex;align-items:center;gap:11px;padding:7px 4px;border-radius:8px;font-size:14.5px;color:var(--ink);cursor:pointer}
.fvals label:hover{background:var(--track)}
.fvals input{appearance:none;-webkit-appearance:none;flex:none;width:18px;height:18px;margin:0;border:1.5px solid var(--soft);border-radius:5px;display:grid;place-items:center;cursor:pointer}
.fvals input:checked{background:var(--ink);border-color:var(--ink)}
.fvals input:checked::after{content:"";width:9px;height:5px;border:2px solid var(--ground);border-top:0;border-right:0;transform:translateY(-1px) rotate(-45deg)}
.fvals span{flex:1;min-width:0}
.fvals b{font-weight:500;color:var(--soft);font-variant-numeric:tabular-nums}
.fdone{display:none}

.gempty{font-size:15px;color:var(--soft);margin:6px 0 18px}
.gempty[hidden]{display:none}
.ggrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}
/* each work on its own card: the image, then only its number */
.tile{display:flex;flex-direction:column;border:0;padding:0;text-align:left;color:var(--ink);text-decoration:none;background:var(--track);border-radius:12px;overflow:hidden;transition:background-color .2s,transform .2s}
.tile .im{aspect-ratio:16/9;overflow:hidden;background:var(--track2)}
.tile img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .4s}
.tile:hover{background:var(--track2)}.tile:hover img{transform:scale(1.03)}
.tile .id{font:700 16px "Archivo";padding:16px 16px 18px;font-variant-numeric:tabular-nums}
.more{display:block;margin:26px auto 0;height:46px;border:0;border-radius:999px;background:var(--track);color:var(--ink);font:600 14px "Archivo";padding:0 24px}

/* download popup (shared with the old page's script) */
.dl{position:fixed;inset:0;z-index:40;display:grid;place-items:center;background:rgba(0,0,0,.45);padding:16px}
.dl[hidden]{display:none}
.dlbox{width:min(380px,100%);background:var(--ground);border-radius:18px;padding:18px;display:flex;flex-direction:column;gap:12px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.dlhead{display:flex;justify-content:space-between;align-items:center}.dlhead b{font:700 17px "Archivo"}
.dlhead button{border:0;border-radius:999px;background:var(--track);color:var(--ink);font:500 13px "Archivo";padding:7px 13px}
.dlopts{display:flex;flex-direction:column;gap:2px;background:var(--track);border-radius:var(--r);padding:3px}
.dlopts button{display:flex;justify-content:space-between;align-items:center;border:0;border-radius:9px;background:var(--ground);color:var(--ink);font:500 14px "Archivo";padding:12px 14px}
.dlopts button:hover{background:var(--track2)}.dlopts small{font-size:12px;color:var(--soft)}
.dlnote,.dlstat{margin:0;font-size:13px;color:var(--soft)}
.testbar{background:#e8c547;color:#000;text-align:center;font:600 12px/1.4 "Archivo";padding:6px 12px;display:flex;gap:10px;justify-content:center;align-items:center;flex-wrap:wrap}
.testbar[hidden]{display:none}
.testbar button{font:600 11px "Archivo";color:#000;background:none;border:1px solid rgba(0,0,0,.35);border-radius:999px;padding:3px 10px}
.testbar button[aria-pressed=true]{background:#000;color:#e8c547}

@media (max-width:900px){
  .mintgrid{grid-template-columns:minmax(0,1fr);gap:28px;padding-top:20px}
  .art{position:static;display:contents}
  .workframe{order:0}.panel{order:1}.activity{order:2}
  .panel{gap:18px}
  .title{font-size:40px}
  .panel .lead{display:none}
  .spec{flex-direction:row;gap:24px}.spec div{flex:1;border-top:1px solid var(--line)}
  .status{padding:20px 18px;min-height:96px;gap:14px}.cdrow b{font-size:28px}.cdrow>div{padding:11px 0 9px}
  .progrow{font-size:15.5px}#count{font-size:16px}
  .fine{margin-top:0;padding-top:0}
  .workframe figcaption{font-size:13px}
  /* toolbar in two rows: filter · search · OpenSea, then N items · All / My collection */
  .gbar{display:grid;grid-template-columns:46px minmax(0,1fr) auto 46px;grid-template-areas:"f s s o" "c c t t";gap:12px 10px}
  .fbtn{grid-area:f}.search{grid-area:s}.osicon{grid-area:o}.gcount{grid-area:c}.tabs{grid-area:t;justify-self:end;height:42px}
  .osicon:not(.logo){width:46px;padding:0;justify-content:center}.osicon:not(.logo) span{display:none}
  .gsp{display:none}
  .tabs button{font-size:13.5px;padding:0 15px}
  /* the trait panel becomes a full-screen sheet */
  #works.fopen .gbody{grid-template-columns:minmax(0,1fr)}
  .fpanel{position:fixed;inset:0;z-index:50;max-height:none;background:var(--ground);padding:20px var(--gut) 0}
  .fhead{padding-top:6px}
  .fdone{display:block;position:sticky;bottom:0;margin:auto calc(-1 * var(--gut)) 0;border-radius:0;height:64px;flex:none}
  .ggrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .tile .id{font-size:14.5px;padding:11px 12px 13px}
}
body.fsheet{overflow:hidden}
#connect[hidden],.more[hidden]{display:none}
@media (max-width:900px){.mintgrid{padding-bottom:48px}.bhead{padding-top:24px}}

/* wallet apps sheet (phones without an injected wallet) */
.wsheet{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;background:rgba(0,0,0,.45);padding:12px}
.wsheet[hidden]{display:none}
.wbox{width:min(440px,100%);background:var(--ground);color:var(--ink);border-radius:20px;padding:18px;display:flex;flex-direction:column;gap:12px;box-shadow:0 20px 60px rgba(0,0,0,.3);margin-bottom:env(safe-area-inset-bottom)}
@media (min-width:901px){.wsheet{align-items:center}}
.whead{display:flex;justify-content:space-between;align-items:center}.whead b{font:700 18px "Archivo"}
.wclose{border:0;border-radius:999px;background:var(--track);color:var(--ink);font:500 13px "Archivo";padding:7px 13px}
.wnote{margin:0;font-size:14px;line-height:1.5;color:var(--soft);max-width:none}.wnote.small{font-size:13px}.wnote a{color:var(--ink)}
.wlist{display:flex;flex-direction:column;gap:2px;background:var(--track);border-radius:var(--r);padding:3px}
.wlist a{display:flex;justify-content:space-between;align-items:center;padding:15px 16px;border-radius:11px;background:var(--ground);color:var(--ink);font:600 16px "Archivo";text-decoration:none}
.wlist a:hover{background:var(--track2)}.wlist a span{color:var(--soft);font-weight:500}
.wcopy{border:0;border-radius:999px;background:var(--track);color:var(--ink);font:500 14px "Archivo";padding:13px 16px;text-align:center;word-break:break-all}

/* live gallery tile: the shared WebGL canvas fades in over the still image */
.tile .im{position:relative}
.tile .im .tilegl{position:absolute;inset:0;width:100%;height:100%;display:block;opacity:0;transition:opacity .35s ease;pointer-events:none}
.tile .im .tilegl.on{opacity:1}
.tile:has(.tilegl.on) img{transform:none}
