/* Versus. The design is the reference sheet in art/ref/reference.jpg: a flat printed catalogue,
   hairline ink rules, cream paper, one yellow band, one orange accent, everything set in one mono. */

@font-face { font-family: Sono; src: url("fonts/sono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Sono; src: url("fonts/sono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Sono; src: url("fonts/sono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --field: #e9dac5;
  --paper: #fdeed9;
  --card: #fffdf5;
  --ink: #1a1512;
  --mute: #8a7f6b;
  --rule: #1a1512;
  --yellow: #f6e66d;
  --orange: #f07235;
  --band: 88px;
  --rail: 104px;
  --pad: 32px;
  --gap: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 18px/1.5 Sono, ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
::selection { background: var(--orange); color: #fff; }

/* ---------- the sheet: rail | catalogue | panel, with a band across the top ---------- */

.sheet {
  display: grid;
  grid-template-columns: var(--rail) 1px minmax(0, 1fr) 1px clamp(380px, 29%, 520px);
  grid-template-rows: var(--band) minmax(0, 1fr);
  width: calc(100% - 64px);
  height: calc(100vh - 64px);
  margin: 32px auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  overflow: hidden;
}
/* the three zones are divided by hairlines of their own, so no scrolling column is a bordered box */
.v-rule { grid-row: 1 / 3; background: var(--rule); }
.v-rule-1 { grid-column: 2; }
.v-rule-2 { grid-column: 4; }

.rail {
  grid-row: 1 / 3;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 0 24px;
  overflow: hidden;
}
.rail-mark { display: block; width: 56px; height: 56px; margin: 0 auto 26px; }
.rail-mark img { width: 100%; height: 100%; object-fit: contain; }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rail-foot { margin-top: auto; }
.rail-item {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px;
  text-decoration: none;
  font-size: 16px;
  color: var(--mute);
}
.rail-item img { width: 34px; height: 34px; object-fit: contain; }
.rail-item span { line-height: 1.1; }
.rail-item:hover { color: var(--ink); }
.rail-item.is-on { color: var(--ink); font-weight: 700; }

.band { display: flex; align-items: center; border-bottom: 1px solid var(--rule); }
.band-search { grid-column: 3; background: var(--yellow); gap: 20px; padding: 0 24px; }
.band-wallet { grid-column: 5; padding: 0; }

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 460px;
  height: 52px;
  padding: 0 20px;
  background: var(--paper);
  border: 1px solid var(--ink);
}
.search-icon { width: 22px; height: 22px; object-fit: contain; flex: none; }
.search input { width: 100%; border: 0; background: none; outline: none; font-size: 18px; }
.search input::placeholder { color: var(--mute); }
.band-note { margin: 0; font-size: 17px; color: #4a4036; white-space: nowrap; }
.band-note b { font-weight: 700; color: var(--ink); }
.band-note b[data-empty] { color: #6b6152; font-weight: 400; }

.wallet {
  flex: 1;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 0 28px;
  text-align: left;
  border-right: 1px solid var(--rule);
}
.wallet-label { font-size: 16px; color: var(--mute); }
.wallet-value { font-size: 18px; font-weight: 700; }
.bell { width: 88px; height: 100%; display: grid; place-items: center; }
.bell img { width: 26px; height: 26px; object-fit: contain; }

/* ---------- catalogue ---------- */

.catalog { grid-column: 3; overflow-y: auto; padding: var(--pad) var(--pad) 40px; }
.panel { grid-column: 5; overflow-y: auto; padding: var(--pad); }

.block + .block { margin-top: 26px; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 14px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.more { font-size: 17px; font-weight: 400; color: var(--mute); }
.more:hover { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  font-size: 17px;
  white-space: nowrap;
}
.chip:hover { background: var(--card); }
.chip.is-on { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--gap) var(--gap); }

.card { margin: 0; }
.poster {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--card);
}
.poster-mat {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  aspect-ratio: 1 / 1.3;
  background: var(--paper);
}
.poster-a, .poster-b { width: 100%; height: 100%; object-fit: contain; }
.poster-stamp {
  width: 46%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
}
.poster:hover { outline: 2px solid var(--orange); outline-offset: -1px; }

.card-title { margin: 12px 0 2px; font-size: 20px; font-weight: 500; line-height: 1.25; min-height: 2.5em; }
.card-sub { margin: 0; font-size: 17px; color: var(--mute); min-height: 3em; overflow: hidden; }
.card-foot {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 17px;
  white-space: nowrap;
}
.card-score { font-weight: 700; }
.card-clock { color: var(--mute); font-variant-numeric: tabular-nums; }

.is-example .poster { position: relative; }
.is-example .poster::after {
  content: "example";
  position: absolute;
  left: 0;
  top: 0;
  padding: 5px 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.2;
}

.demo-note {
  margin: 0 0 20px;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  background: var(--card);
  font-size: 17px;
  color: #4a4036;
}

.empty {
  border: 1px solid var(--rule);
  padding: 28px 32px;
  font-size: 18px;
  color: #4a4036;
  background: var(--card);
}
.empty b { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 700; }

/* ---------- right panel ---------- */

.panel-head { display: flex; gap: 18px; margin-bottom: 22px; }
.panel-cover { flex: none; width: 132px; border: 1px solid var(--ink); background: var(--card); }
.panel-title { margin: 0 0 8px; font-size: 30px; font-weight: 700; line-height: 1.2; }
.panel-by { margin: 0; font-size: 17px; color: var(--mute); }
.panel-by a { text-decoration: underline; text-underline-offset: 3px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  margin-bottom: 12px;
  border: 1px solid var(--ink);
  font-size: 18px;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: var(--card); }
.btn img { width: 22px; height: 22px; object-fit: contain; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }
.btn-primary:hover { background: #e2632a; }
.btn[disabled], .btn[aria-disabled="true"] { color: var(--mute); border-color: var(--mute); cursor: default; }
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { background: none; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 22px; }
.trio a, .trio button {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 8px;
  border: 1px solid var(--ink);
  margin-left: -1px;
  font-size: 16px;
  text-decoration: none;
  text-align: center;
}
.trio > :first-child { margin-left: 0; }
.trio img { width: 24px; height: 24px; object-fit: contain; }
.trio a:hover, .trio button:hover { background: var(--card); }

.meta { margin: 0 0 22px; }
.meta div { display: flex; align-items: baseline; gap: 16px; padding: 6px 0; font-size: 18px; }
.meta dt { flex: none; width: 46%; color: var(--mute); }
.meta dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.meta dd[data-empty] { font-weight: 400; color: #6b6152; }

.score { border: 1px solid var(--rule); padding: 20px 24px; margin-bottom: 22px; background: var(--card); }
.score-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 18px; }
.score-row + .score-row { margin-top: 10px; }
.score-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.score-bar { height: 10px; margin: 8px 0 14px; border: 1px solid var(--ink); }
.score-bar i { display: block; height: 100%; background: var(--orange); }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 22px 0; }
.prose { margin: 0; font-size: 18px; line-height: 1.6; }
.prose + .prose { margin-top: 14px; }

.mint { border: 1px solid var(--rule); padding: 20px 24px; margin-bottom: 18px; background: var(--card); }
.mint-label { margin: 0 0 8px; font-size: 16px; color: var(--mute); }
.mint-value { margin: 0 0 14px; font-size: 18px; font-weight: 700; word-break: break-all; user-select: all; }
.mint-value[data-empty] { font-weight: 400; color: #6b6152; }
.copy { height: 48px; padding: 0 24px; border: 1px solid var(--ink); font-size: 17px; }
.copy:hover { background: var(--paper); }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; display: flex; gap: 16px; padding: 12px 0; font-size: 18px; line-height: 1.5; }
.steps li::before { content: counter(step, decimal-leading-zero); flex: none; font-weight: 700; color: var(--orange); }
.steps li + li { margin-top: 2px; }

/* ---------- widths ---------- */

@media (max-width: 1500px) {
  .sheet { width: calc(100% - 48px); height: calc(100vh - 48px); margin: 24px auto; }
}

@media (max-width: 1100px) {
  :root { --rail: 96px; --pad: 24px; }
  .sheet {
    grid-template-columns: var(--rail) 1px minmax(0, 1fr);
    width: 100%;
    height: 100vh;
    margin: 0;
    border: 0;
  }
  .v-rule-2 { display: none; }
  .band-search { grid-column: 3; padding-right: 210px; }
  .band-wallet { grid-column: 3; grid-row: 1; justify-self: end; background: none; }
  .wallet { border-right: 0; padding: 0 22px; }
  .bell { display: none; }
  .band-note { display: none; }
  .panel {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: none;
    background: var(--paper);
    padding: 28px;
  }
  .panel.is-open { display: block; }
}

@media (max-width: 720px) {
  :root { --band: 76px; --pad: 20px; --gap: 14px; }
  body { font-size: 17px; }
  .sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--band) minmax(0, 1fr) auto;
  }
  .v-rule { display: none; }
  .rail {
    grid-row: 3;
    grid-column: 1;
    flex-direction: row;
    padding: 0;
    border-top: 1px solid var(--rule);
  }
  .rail-mark { display: none; }
  .rail-list { flex-direction: row; flex: 1; gap: 0; }
  .rail-foot { flex: 0 0 68px; }
  .rail-list li { flex: 1; }
  .rail-item { padding: 10px 0; font-size: 16px; letter-spacing: -0.02em; }
  .rail-foot { margin: 0; }
  .band-search { grid-column: 1; gap: 14px; padding: 0 16px; }
  .band-wallet { display: none; }
  .catalog { grid-column: 1; }
  .search { flex: 1; height: 48px; padding: 0 16px; }
  .block-head { font-size: 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-title { font-size: 26px; }
}
