/*
  ZUGHS interface.
  The same rules as the art: flat colours from a fixed ramp, hard edges, no
  gradients, no soft shadows, no rounded corners. Panels are drawn with a one
  pixel dark outline and a two pixel light bevel, the way an eight bit menu is.
  Nothing scales by a fraction: borders are 4px, the grid steps in 8px.
*/
:root {
  --bg:        #12131c;
  --bg-2:      #1b1d2a;
  --panel:     #232637;
  --panel-hi:  #343a52;
  --panel-lo:  #0d0e15;
  --ink:       #e8ecf4;
  --ink-dim:   #97a0bb;
  --accent:    #46b0c8;
  --accent-hi: #8ae4f0;
  --hot:       #c83a82;
  --hot-hi:    #f892c0;
  --ok:        #6ad8b4;
  --px: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
html { background: var(--panel-lo); }   /* the strip above the fold matches the bar */
body {
  font-family: "Press Start 2P", ui-monospace, monospace;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.9;
  image-rendering: pixelated;
  padding-bottom: 64px;
  /* a flat checker, drawn once, tiled: the same dither the art uses */
  background-image:
    linear-gradient(45deg, var(--bg-2) 25%, transparent 25%, transparent 75%, var(--bg-2) 75%),
    linear-gradient(45deg, var(--bg-2) 25%, transparent 25%, transparent 75%, var(--bg-2) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
img { image-rendering: pixelated; display: block; }

/* the faint horizontal lines of a CRT, one pixel on, three off */
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 40;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.20) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply;
}

/* ── panels ─────────────────────────────────────────────────────────────── */
.panel {
  max-width: 1040px;
  margin: 24px auto;
  padding: 24px;
  background: var(--panel);
  border: var(--px) solid var(--panel-lo);
  box-shadow:
    inset 0 var(--px) 0 0 var(--panel-hi),
    inset var(--px) 0 0 0 var(--panel-hi),
    inset calc(var(--px) * -1) 0 0 0 var(--panel-lo),
    inset 0 calc(var(--px) * -1) 0 0 var(--panel-lo),
    0 var(--px) 0 0 rgba(0,0,0,.55);
}
h2 {
  font-size: 14px; margin: 0 0 20px; letter-spacing: 2px; color: var(--accent-hi);
  text-shadow: 0 var(--px) 0 var(--panel-lo);
}

/* ── header ─────────────────────────────────────────────────────────────── */
/* a real top bar: it starts at the very top of the page, so there is no bare
   strip of background above it, and it carries its own floor line */
.top {
  margin: 0; padding: 20px 24px 16px; text-align: center;
  /* a cold night with wind, rendered by the same engine as the art; the dark
     wash over it keeps the wordmark and the buttons readable */
  background:
    linear-gradient(rgba(10,11,18,.55), rgba(10,11,18,.78)),
    url("/art/header-cold.gif") center / cover no-repeat,
    var(--panel-lo);
  image-rendering: pixelated;
  border-bottom: var(--px) solid var(--panel-hi);
  box-shadow: 0 var(--px) 0 0 rgba(0,0,0,.5);
}
.brand { display: block; }
.brand img { width: 100%; max-width: 704px; height: auto; margin: 0 auto; }
.menu { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ── buttons: a hard bevel, and they physically move down when pressed ──── */
.btn {
  display: inline-block;
  padding: 12px 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--panel);
  border: var(--px) solid var(--panel-lo);
  box-shadow: inset 0 var(--px) 0 0 var(--panel-hi), 0 var(--px) 0 0 var(--panel-lo);
  cursor: pointer;
  font: inherit;
}
.btn:hover { background: var(--panel-hi); color: var(--accent-hi); }
.btn:active { transform: translateY(var(--px)); box-shadow: inset 0 var(--px) 0 0 var(--panel-hi); }
.btn.big { width: 100%; padding: 16px; margin-top: 16px; background: var(--accent); color: #07131a; }
.btn.big:hover { background: var(--accent-hi); }
.btn.big:disabled { background: var(--panel-hi); color: var(--ink-dim); cursor: not-allowed; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.lead { margin: 0 0 16px; line-height: 2.1; }
.facts { margin: 0; padding-left: 18px; color: var(--ink-dim); }
.facts b { color: var(--accent-hi); }
.stat-grid { display: grid; grid-template-rows: repeat(4, 1fr); gap: 8px; }
.stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; background: var(--bg-2);
  border: var(--px) solid var(--panel-lo);
  box-shadow: inset 0 var(--px) 0 0 rgba(255,255,255,.06);
}
.stat .k { color: var(--ink-dim); }
.stat .v { color: var(--ok); }

/* ── mint ───────────────────────────────────────────────────────────────── */
.mint-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.preview img { width: 100%; height: auto; image-rendering: pixelated;
  border: var(--px) solid var(--panel-lo); }
.mint-box .row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 2px dashed var(--panel-hi); }
.mint-box .row span { color: var(--ink-dim); }
.mint-box .total b { color: var(--ok); }
.field { display: block; margin-top: 16px; }
.field span { display: block; color: var(--ink-dim); margin-bottom: 8px; }
.field input {
  width: 100%; padding: 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: var(--px) solid var(--panel-lo);
  box-shadow: inset 0 var(--px) 0 0 rgba(0,0,0,.5);
}
.field input:focus { outline: none; border-color: var(--accent); }
.note { color: var(--ink-dim); line-height: 2.1; margin: 16px 0 0; }
.note.bad { color: var(--hot-hi); }

/* ── gallery ────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card { background: var(--bg-2); border: var(--px) solid var(--panel-lo); padding: 8px; }
.card img { width: 100%; height: auto; image-rendering: pixelated; }
.card .id { color: var(--ink-dim); padding-top: 8px; text-align: center; }

/* ── market ─────────────────────────────────────────────────────────────── */
.market table { width: 100%; border-collapse: collapse; }
.market th, .market td { text-align: left; padding: 12px 8px; border-bottom: 2px solid var(--panel-hi); }
.market th { color: var(--ink-dim); }

.how { margin: 0; padding-left: 20px; line-height: 2.2; }
.how b { color: var(--accent-hi); }

.foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-between;
  padding: 14px 24px; color: var(--ink-dim);
  background: var(--panel-lo); border-top: var(--px) solid var(--panel-hi);
}

/* ── phones ─────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero, .mint-grid, .artist { grid-template-columns: 1fr; }
  .panel { margin: 12px 8px; padding: 14px; }
  body { font-size: 9px; line-height: 2; }
  /* the wordmark took half the screen: cap it by height, not by width */
  .brand img { max-height: 84px; width: auto; max-width: 100%; }
  .top { padding: 12px 12px 10px; }
  .menu { gap: 8px; }
  .btn { padding: 10px 12px; }
  h2 { font-size: 12px; margin-bottom: 14px; }
  /* tables scroll sideways instead of pushing the page wide */
  .market, .rar, table { display: block; overflow-x: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .foot { flex-wrap: wrap; gap: 6px; padding: 10px 12px; font-size: 8px; }
  .filters { gap: 8px; }
  .filter select { min-width: 84px; }
}
@media (max-width: 420px) {
  .brand img { max-height: 62px; }
  .stat { padding: 10px; }
}
.btn.lang { min-width: 44px; }


/* skip link, keyboard focus and reduced motion: the things that separate a real
   site from a mock up */
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 60; background: var(--accent); color: #07131a; padding: 10px; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: var(--px) solid var(--accent-hi); outline-offset: 2px;
}
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--ink-dim); text-decoration: none; }
.foot-links a:hover { color: var(--accent-hi); }
@media (prefers-reduced-motion: reduce) {
  .scanlines { display: none; }
  * { animation: none !important; transition: none !important; }
}

.artist { display: grid; grid-template-columns: 256px 1fr; gap: 24px; align-items: start; }
.artist img { width: 100%; height: auto; border: var(--px) solid var(--panel-lo); }
@media (max-width: 860px) { .artist { grid-template-columns: 1fr; } }

/* the line sits under the wordmark, spaced out like a title screen subtitle */
.slogan {
  margin: 14px 0 0; color: var(--accent-hi); letter-spacing: 3px; font-size: 9px;
  text-shadow: 0 var(--px) 0 var(--panel-lo);
}
@media (max-width: 860px) { .slogan { letter-spacing: 1px; font-size: 8px; } }

/* the X button: the mark and the word sit on one line, same bevel as the rest */
.btn.x { display: inline-flex; align-items: center; gap: 8px; }
.btn.x svg { display: block; }
.btn.x:hover { background: var(--accent); color: #07131a; }

/* the rarity table on a token page */
.rar { width: 100%; border-collapse: collapse; }
.rar th, .rar td { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--panel-hi); }
.rar th { color: var(--ink-dim); }
.rar td:nth-child(2) { color: var(--accent-hi); }
.rar td:last-child { color: var(--ok); text-align: right; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }

/* the filter bar: plain selects, styled like the rest, no custom dropdowns */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.filter { display: flex; flex-direction: column; gap: 6px; }
.filter span { color: var(--ink-dim); font-size: 8px; }
.filter select {
  font: inherit; font-size: 9px; color: var(--ink); background: var(--bg);
  border: var(--px) solid var(--panel-lo); padding: 8px; min-width: 96px;
}
.filter select:focus { outline: none; border-color: var(--accent); }

/* code you are meant to copy and run */
.code {
  background: var(--bg); border: var(--px) solid var(--panel-lo); padding: 14px;
  color: var(--ok); font: inherit; font-size: 9px; line-height: 1.9;
  overflow-x: auto; white-space: pre;
}

.card.pending .plate {
  aspect-ratio: 1 / 1; display: grid; place-items: center; text-align: center;
  color: var(--ink-dim); background: var(--bg); border: 2px dashed var(--panel-hi);
  font-size: 8px; line-height: 2;
}

.sub { font-size: 10px; color: var(--ink-dim); letter-spacing: 2px; margin: 20px 0 8px; }

/* the distribution bars: one flat block, no gradient, width is the number */
.barcell { width: 40%; }
.bar { display: inline-block; height: 8px; background: var(--accent); }
