:root {
  --bg: #f3efe8;
  --ink: #1f1a17;
  --muted: #8f8983;
  --rule: #d9d4cc;
  --stage: min(72vh, 560px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.55 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
  transition: background-color .7s ease, color .7s ease;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.top {
  position: fixed; inset: 0 0 auto 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px;
}
.mark {
  font-family: 'Silkscreen', 'Geist Mono', monospace;
  font-size: 16px; letter-spacing: .02em;
  color: inherit; text-decoration: none;
}

.link { padding: 4px 0; color: var(--muted); transition: color .2s; }
.link:hover, .link:focus-visible { color: var(--ink); outline: none; }

main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: auto 320px;
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
  justify-content: center;
  padding: 96px 28px 64px;
}

.art { width: var(--stage); height: var(--stage); }
#stage { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.panel { display: flex; flex-direction: column; gap: 30px; min-width: 0; }

.field input {
  width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  color: inherit; font: inherit; font-size: 14px; letter-spacing: .01em;
  padding: 10px 0; border-radius: 0; outline: none;
  transition: border-color .25s;
}
.field input:focus { border-bottom-color: var(--ink); }
.field input::placeholder { color: var(--muted); }
.hint { margin-top: 9px; min-height: 18px; font-size: 11px; color: var(--muted); }
.field.err input { animation: nope .32s ease; border-bottom-color: var(--ink); }
.field.err .hint { color: var(--ink); }
@keyframes nope {
  20% { transform: translateX(-5px); } 45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); } 100% { transform: none; }
}

.tag { font-size: 11px; color: var(--muted); min-height: 17px; }
.name {
  font-family: 'Silkscreen', 'Geist Mono', monospace;
  font-weight: 400; font-size: 46px; line-height: 1.05; letter-spacing: .01em;
}
.name.in { animation: rise .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.addr {
  margin-top: 12px;
  font-size: 11px; letter-spacing: .02em; line-height: 1.7;
  color: var(--muted); word-break: break-all;
}
.addr span { transition: background-color .15s, color .15s; cursor: default; }
.addr span.on { background: var(--ink); color: var(--bg); }

.traits { list-style: none; display: flex; flex-direction: column; }
.traits li {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 12px;
  padding: 4px 0; border-top: 1px solid var(--rule); cursor: default;
}
.traits li:last-child { border-bottom: 1px solid var(--rule); }
.traits .k { color: var(--muted); }
.traits .c { color: var(--muted); letter-spacing: .12em; }
.traits li.on .k { color: var(--ink); }
.traits li.on .c { background: var(--ink); color: var(--bg); }

.foot { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.odds { color: var(--muted); }
.actions { display: flex; gap: 18px; }

/* ---- how it works */
.nav { display: flex; gap: 20px; align-items: center; }
.q {
  width: 24px; height: 24px; padding: 0; border: 1px solid var(--rule);
  font-family: 'Silkscreen', 'Geist Mono', monospace; font-size: 12px; line-height: 22px;
}
.q:hover { border-color: var(--ink); }
.supply { font-size: 12px; color: var(--muted); }
.supply b { font-weight: 400; color: var(--ink); }
.sendp .left { font-size: 11px; color: var(--muted); }
@media (max-width: 520px) { .supply { display: none; } }
.how {
  margin: auto; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 40px 36px 36px; border: 1px solid var(--rule);
  background: var(--bg); color: var(--ink);
  font: inherit; line-height: 1.65; overflow-y: auto;
}
.how::backdrop { background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px); }
.how[open] { animation: rise .35s cubic-bezier(.2, .7, .2, 1); }
.how h2 { font-family: 'Silkscreen', 'Geist Mono', monospace; font-weight: 400; font-size: 26px; margin-bottom: 26px; }
.how h3 { font-size: 13px; font-weight: 500; margin: 24px 0 6px; }
.how p { color: var(--muted); }
.how p + p { margin-top: 10px; }
.how b { font-weight: 400; color: var(--ink); word-spacing: -.15em; }
.how sup { font-size: .7em; }
.how .aside { font-size: 11.5px; }
.how .close { position: absolute; top: 16px; right: 20px; font-size: 12px; }

/* ---- the two modes: explore (traits) and send (NFT card) */
main { transition: opacity .2s ease, transform .2s ease; }
main.swap { opacity: 0; transform: scale(.985); }

.card { position: relative; }
.card-foot { display: none; }
body[data-mode=send] #explore,
body[data-mode=explore] #sendp { display: none; }

.go {
  width: 100%; padding: 15px 18px;
  background: var(--ink); color: var(--bg);
  font-size: 13px; letter-spacing: .04em; text-align: center;
  transition: opacity .2s, transform .1s;
}
.go:hover:not(:disabled) { opacity: .88; }
.go:active:not(:disabled) { transform: translateY(1px); }
.go:disabled { opacity: .42; cursor: default; }
.go.busy::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

body[data-mode=send] main {
  grid-template-columns: auto; justify-items: center; align-content: center;
  gap: 28px; padding-top: 88px;
}
body[data-mode=send] .card { border: 1px solid var(--rule); background: var(--bg); }
body[data-mode=send] .art { --stage: min(300px, calc(100vw - 66px)); }
body[data-mode=send] .card-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px 14px 13px; border-top: 1px solid var(--rule);
  font-size: 11px; color: var(--muted);
}
.card-name { font-family: 'Silkscreen', 'Geist Mono', monospace; font-size: 18px; color: var(--ink); }
.card.hop { animation: hop .7s cubic-bezier(.3, .7, .3, 1); }
@keyframes hop { 30% { transform: translateY(-14px) rotate(-1deg); } 60% { transform: translateY(2px); } }

.sendp { width: min(302px, calc(100vw - 64px)); display: flex; flex-direction: column; gap: 6px; }
.sendp .to { color: var(--muted); font-size: 12px; }
.sendp .wallet { font-size: 22px; letter-spacing: .02em; margin-bottom: 16px; }
.sendp .hint { margin-top: 8px; min-height: 18px; }
.sendp .view { font-size: 12px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.sendp .row { display: flex; gap: 18px; margin-top: 18px; font-size: 12px; }

@media (max-width: 880px) {
  main {
    grid-template-columns: 1fr; justify-items: center;
    gap: 32px; padding: 76px 16px 48px;
  }
  .top { padding: 18px 16px; }
  .art { --stage: min(calc(100vw - 32px), 440px); }
  .panel { width: 100%; max-width: 440px; }
  .name { font-size: 38px; }
  .field input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
