:root {
  --paper: #f4f0df;
  --ink: #17130f;
  --yellow: #f5c842;
  --red: #f24a32;
  --blue: #7db9d8;
  --acid: #d8ef57;
  --violet: #9a77d6;
  --muted: #6a655b;
  --line: rgba(23, 19, 15, .25);
  --mono: "DM Mono", monospace;
  --display: "Gasoek One", Impact, sans-serif;
  --header-height: 72px;
  --side-width: 250px;
  --operation-width: 260px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template:
    "header header header" var(--header-height)
    "side workspace operation" minmax(calc(100svh - var(--header-height)), auto)
    / var(--side-width) minmax(0, 1fr) var(--operation-width);
}

.app-header {
  grid-area: header;
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: var(--side-width) 1fr auto;
  align-items: center;
  min-height: var(--header-height);
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.wordmark {
  height: 100%;
  display: flex;
  align-items: center;
  padding-inline: 24px;
  border-right: 1px solid var(--line);
  color: inherit;
  font: 400 1.18rem var(--display);
  letter-spacing: .015em;
  text-decoration: none;
}
.network-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 24px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
}
.network-dot {
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 0 4px rgba(154, 119, 214, .18);
}
.network-chain { color: var(--muted); letter-spacing: 0; }
.wallet-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  height: 100%;
  padding: 0 20px;
  border-left: 1px solid var(--line);
}
.wallet-address {
  max-width: 160px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-rail {
  grid-area: side;
  position: sticky;
  top: var(--header-height);
  height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #ebe5d2;
}
.rail-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--violet);
  font-size: 9px;
}
.rail-label strong { font-size: 14px; }
.workspace-nav { display: grid; }
.workspace-nav button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: padding .18s, background .18s;
}
.workspace-nav button:hover { padding-left: 23px; background: rgba(245, 200, 66, .45); }
.workspace-nav button[aria-current="page"] { background: var(--yellow); }
.workspace-nav span, .workspace-nav i {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}
.workspace-nav strong { font-size: 11px; text-transform: uppercase; }
.workspace-nav i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.rail-foot {
  margin-top: auto;
  padding: 18px;
  border-top: 1px solid var(--line);
  font-size: 8px;
  line-height: 1.55;
  text-transform: uppercase;
}
.rail-foot p { margin: 0 0 12px; color: var(--muted); }
.rail-foot a { color: inherit; }

.workspace { grid-area: workspace; min-width: 0; }
.workspace-view { min-height: calc(100svh - var(--header-height)); animation: view-in .28s ease-out both; }
.workspace-heading {
  display: grid;
  grid-template-columns: minmax(340px, 1.45fr) minmax(230px, .55fr);
  gap: 6vw;
  align-items: end;
  padding: clamp(42px, 6vw, 84px);
  border-bottom: 1px solid var(--line);
}
.workspace-heading h1 {
  margin: 16px 0 0;
  font: 400 clamp(4.5rem, 8vw, 9rem)/.8 var(--display);
  letter-spacing: -.045em;
}
.workspace-heading > p {
  max-width: 440px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}
.compact-heading { padding-block: clamp(38px, 5vw, 70px); }
.compact-heading h1 { font-size: clamp(4rem, 7vw, 7.5rem); }
.eyebrow {
  margin: 0;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mint-floor {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, .8fr);
  min-height: 620px;
}
.mint-figure {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  display: grid;
  place-items: end center;
  border-right: 1px solid var(--line);
  background: var(--yellow);
}
.mint-figure::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(23,19,15,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(23,19,15,.08) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
}
.mint-figure img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(90%, 630px);
  max-height: 570px;
  object-fit: contain;
  filter: drop-shadow(10px 13px 0 rgba(23, 19, 15, .14));
  transform-origin: bottom;
  animation: guy-arrives .6s cubic-bezier(.2,.9,.2,1.18) both;
}
.mint-figure > p {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 14px;
  max-width: 240px;
  margin: 0;
  font-size: 8px;
  line-height: 1.5;
  text-align: right;
  text-transform: uppercase;
}
.figure-stamp {
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 24px;
  padding: 13px 10px;
  border: 2px solid;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1.25;
  text-align: center;
  transform: rotate(-10deg);
}
.mint-controls { align-self: center; padding: clamp(34px, 5vw, 72px); }
.system-line {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}
.system-line:first-child { border-top: 1px solid var(--line); }
.system-line span { color: var(--muted); }

.ink-button, .outline-button, .text-control {
  border: 0;
  color: inherit;
  text-transform: uppercase;
}
.ink-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 46px;
  padding: 13px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 10px;
  transition: transform .18s, background .18s, color .18s;
}
.ink-button:hover { background: var(--red); color: var(--ink); transform: translateX(4px); }
.ink-button:disabled, .outline-button:disabled {
  cursor: not-allowed;
  opacity: .35;
  transform: none;
}
.ink-button.compact { min-height: 38px; padding: 10px 13px; }
.ink-button.jumbo { width: 100%; min-height: 62px; margin-top: 30px; padding: 17px 20px; }
.outline-button {
  padding: 10px 13px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 9px;
  transition: background .18s, color .18s;
}
.outline-button:hover { background: var(--ink); color: var(--paper); }
.text-control {
  padding: 5px 0;
  border-bottom: 1px solid;
  background: transparent;
  font-size: 9px;
}
.microcopy { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.faucet-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: center;
  margin-top: 50px;
  padding: 20px;
  border: 1px solid;
  background: var(--acid);
  box-shadow: 7px 7px 0 var(--ink);
  transform: rotate(.5deg);
}
.faucet-block[aria-disabled="true"] { background: #ded9c8; box-shadow: none; transform: none; }
.faucet-tag { grid-column: 1 / -1; font-size: 8px; letter-spacing: .12em; }
.faucet-block strong { font: 400 1.15rem var(--display); letter-spacing: .015em; }
.faucet-block p { margin: 5px 0 0; font-size: 8px; line-height: 1.5; }
.faucet-block small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }

.collection-toolbar, .inventory-key, .board-heading, .parts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(24px, 4vw, 55px);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  text-transform: uppercase;
}
.guy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.guy-card {
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.guy-card:nth-child(3n) { border-right: 0; }
.guy-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  display: grid;
  place-items: end center;
  background: var(--blue);
}
.guy-card:nth-child(3n + 2) .guy-image { background: var(--yellow); }
.guy-card:nth-child(3n + 3) .guy-image { background: var(--acid); }
.guy-image img { display: block; width: 98%; max-height: 100%; object-fit: contain; transition: transform .25s; }
.guy-card:hover .guy-image img { transform: scale(1.035) rotate(-1deg); }
.token-origin {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 8px;
  border: 1px solid;
  background: var(--paper);
  font-size: 8px;
  text-transform: uppercase;
}
.card-body { padding: 18px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-title strong { font: 400 1.25rem var(--display); letter-spacing: .015em; }
.card-title span { color: var(--muted); font-size: 9px; }
.card-meta { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.inline-transfer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 15px;
}
.inline-transfer input {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 9px;
}

.inventory-key { justify-content: flex-start; gap: 30px; }
.inventory-key span { display: flex; align-items: center; gap: 7px; }
.usage-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}
.usage-dot.unlimited { background: var(--acid); }
.usage-dot.finite { background: var(--yellow); }
.usage-dot.exclusive { background: var(--red); }
.trait-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trait-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 150px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.trait-row:nth-child(2n) { border-right: 0; }
.trait-swatch {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--yellow);
  font: 400 2.3rem var(--display);
}
.trait-row[data-usage-kind="unlimited"] .trait-swatch { background: var(--acid); }
.trait-row[data-usage-kind="exclusive"] .trait-swatch { background: var(--red); }
.trait-details { padding: 17px; }
.trait-details header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.trait-details h2 { margin: 0; font: 400 1.08rem var(--display); letter-spacing: .015em; }
.trait-details header span { font-size: 8px; text-transform: uppercase; }
.trait-uses { margin: 10px 0; font-size: 9px; }

.studio-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, .85fr);
  min-height: 650px;
}
.studio-canvas {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  min-height: calc(100svh - var(--header-height));
  overflow: hidden;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--red);
}
.studio-canvas::before {
  position: absolute;
  inset: 7%;
  border: 1px dashed rgba(23,19,15,.42);
  content: "";
}
.studio-canvas img { position: relative; display: block; width: min(90%, 650px); max-height: 72svh; object-fit: contain; }
.canvas-toolbar {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-size: 8px;
}
.selected-trait-tape {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  left: 18px;
  padding: 12px;
  border: 1px solid;
  background: var(--paper);
  font-size: 8px;
  line-height: 1.5;
}
.studio-parts { padding: clamp(30px, 4vw, 55px); }
.parts-heading { padding: 0 0 17px; }
.studio-trait-picker { display: grid; }
.studio-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}
.studio-option input { width: 18px; height: 18px; accent-color: var(--ink); }
.studio-option small { color: var(--muted); }

.pack-layout {
  display: grid;
  grid-template-columns: minmax(260px, .55fr) minmax(0, 1fr);
  min-height: 580px;
}
.pack-spec { padding: clamp(30px, 4vw, 55px); border-right: 1px solid var(--line); background: var(--blue); }
.pack-spec > p { font-size: 9px; letter-spacing: .12em; }
.pack-spec ol { margin: 45px 0 0; padding: 0; list-style: none; }
.pack-spec li {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid;
}
.pack-spec li:last-child { border-bottom: 1px solid; }
.pack-spec li strong { font: 400 2.2rem var(--display); }
.pack-spec li span { font-size: 10px; text-transform: uppercase; }
.pack-inventory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.pack-card { min-height: 290px; padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pack-card:nth-child(2n) { border-right: 0; }
.pack-visual {
  min-height: 165px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 2px solid;
  background: var(--yellow);
  box-shadow: 7px 7px 0 var(--ink);
  font: 400 3.2rem/.85 var(--display);
  text-align: center;
  transform: rotate(-1deg);
}
.pack-card:nth-child(2n) .pack-visual { background: var(--violet); transform: rotate(1deg); }

.exchange-balance {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 18px clamp(24px, 4vw, 55px);
  border-bottom: 1px solid var(--line);
  background: var(--acid);
  font-size: 9px;
}
.exchange-balance strong { margin-right: auto; font-size: 10px; }
.exchange-balance b { font: 400 1.8rem var(--display); }
.exchange-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 560px; }
.market-board { border-right: 1px solid var(--line); }
.listing-list { display: grid; }
.listing-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) .55fr .55fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px clamp(24px, 4vw, 55px);
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}
.listing-row strong { font: 400 1rem var(--display); letter-spacing: .015em; }
.listing-row small { display: block; margin-top: 4px; color: var(--muted); }
.listing-form { align-self: start; padding: 28px; }
.listing-form label {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  font-size: 9px;
  text-transform: uppercase;
}
.listing-form input, .listing-form select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: inherit;
}
.listing-form .ink-button { width: 100%; margin-top: 28px; }

.empty-state {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 50px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  text-align: center;
}
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font: 400 1.65rem var(--display); }

.operation-rail {
  grid-area: operation;
  position: sticky;
  top: var(--header-height);
  height: calc(100svh - var(--header-height));
  padding: 22px;
  border-left: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
}
.operation-rail > div { display: flex; align-items: center; gap: 10px; }
.operation-light {
  width: 10px;
  height: 10px;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: var(--acid);
}
.operation-rail[data-status="pending"] .operation-light { background: var(--yellow); animation: operation-pulse 1s infinite; }
.operation-rail[data-status="error"] .operation-light { background: var(--red); }
.operation-rail strong { display: block; margin-top: 32px; font: 400 1.35rem var(--display); letter-spacing: .015em; }
.operation-rail > p { color: #c4bcaa; font-size: 9px; line-height: 1.65; }
.operation-rail a { color: var(--acid); font-size: 9px; text-transform: uppercase; }

@keyframes view-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes guy-arrives { from { opacity: 0; transform: translateY(70px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes operation-pulse { 50% { opacity: .35; transform: scale(.72); } }

@media (max-width: 1180px) {
  :root { --operation-width: 0px; }
  .app-shell { grid-template-columns: var(--side-width) minmax(0, 1fr); grid-template-areas: "header header" "side workspace"; }
  .app-header { grid-template-columns: var(--side-width) 1fr auto; }
  .operation-rail {
    position: fixed;
    z-index: 45;
    right: 18px;
    bottom: 18px;
    top: auto;
    width: min(360px, calc(100vw - 36px));
    height: auto;
    min-height: 116px;
    border: 1px solid var(--paper);
    box-shadow: 8px 8px 0 var(--violet);
  }
  .operation-rail strong { margin-top: 16px; }
  .operation-rail > p { margin-bottom: 0; }
}

@media (max-width: 820px) {
  :root { --header-height: 64px; }
  .app-shell {
    display: block;
    padding-bottom: 70px;
  }
  .app-header {
    grid-template-columns: 1fr auto;
    min-height: var(--header-height);
  }
  .wordmark { border-right: 0; padding-inline: 16px; }
  .network-identity { display: none; }
  .wallet-controls { border-left: 0; padding-inline: 12px; }
  .wallet-address { display: none; }
  .side-rail {
    position: fixed;
    z-index: 40;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 68px;
    border-top: 2px solid var(--ink);
    border-right: 0;
  }
  .operation-rail {
    bottom: 86px;
    max-height: 185px;
    overflow: auto;
  }
  .rail-label, .rail-foot { display: none; }
  .workspace-nav {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
  }
  .workspace-nav button {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 4px;
    padding: 5px 2px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    text-align: center;
  }
  .workspace-nav button:hover { padding: 5px 2px; }
  .workspace-nav button > span, .workspace-nav button > i { display: none; }
  .workspace-nav strong { font-size: clamp(6px, 1.8vw, 8px); }
  .workspace-heading, .mint-floor, .studio-workbench, .pack-layout, .exchange-layout {
    grid-template-columns: 1fr;
  }
  .workspace-heading { gap: 28px; padding: 50px 22px; }
  .workspace-heading > * { min-width: 0; }
  .workspace-heading h1 { overflow-wrap: anywhere; font-size: clamp(3.7rem, 17vw, 7rem); }
  .workspace-heading > p { font-size: 10px; }
  .mint-figure { min-height: 500px; border-right: 0; border-bottom: 1px solid var(--line); }
  .mint-controls { padding: 38px 22px 70px; }
  .guy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guy-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .guy-card:nth-child(2n) { border-right: 0; }
  .trait-list { grid-template-columns: 1fr; }
  .trait-row { border-right: 0; }
  .studio-canvas { position: relative; top: auto; min-height: 540px; border-right: 0; border-bottom: 1px solid var(--line); }
  .pack-spec { border-right: 0; border-bottom: 1px solid var(--line); }
  .market-board { border-right: 0; border-bottom: 1px solid var(--line); }
  .listing-row { grid-template-columns: 1fr 1fr auto; padding-inline: 22px; }
  .listing-row > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .ink-button.compact { font-size: 8px; }
  .wallet-controls { gap: 8px; }
  .wallet-controls .text-control { font-size: 7px; }
  .mint-figure { min-height: 430px; }
  .guy-grid, .pack-inventory { grid-template-columns: 1fr; }
  .guy-card, .guy-card:nth-child(3n) { border-right: 0; }
  .pack-card { border-right: 0; }
  .inventory-key { flex-wrap: wrap; gap: 12px 20px; }
  .trait-row { grid-template-columns: 66px 1fr; }
  .studio-canvas { min-height: 450px; }
  .exchange-balance { flex-wrap: wrap; }
  .exchange-balance strong { margin-right: 0; }
  .exchange-balance .outline-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
