/* Goldbug. One amber phosphor screen, one monospace grid, hairline rectangles.
   Geometry is read off art/ref/bios-reference.jpg: see NOTE.md > Reference teardown. */

@font-face {
  font-family: "Departure";
  src: url("/fonts/departure-mono.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
/* The IBM VGA 8x16 character ROM: the only face whose rules and underscores
   join edge to edge, so the character art is drawn in it. CC BY-SA 4.0, see README. */
@font-face {
  font-family: "VGA";
  src: url("/fonts/vga437.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: block;
}
@font-face {
  font-family: "Anybody";
  src: url("/fonts/anybody-800i-cond.woff2") format("woff2");
  font-weight: 800; font-style: italic; font-stretch: 75%; font-display: swap;
}

:root {
  /* sampled off his own avatar and header (art/ref/his-*.jpg) */
  --black: #141310;  /* his field is a warm charcoal wall, not pure black */
  --a1: #7a5206;     /* hairlines */
  --a2: #c07c00;     /* the prefix column and secondary text: his shadow gold */
  --a3: #ecac1c;     /* body: his body gold */
  --a4: #fccc2c;     /* bright: menu, figures, the banner */
  --a5: #fce874;     /* his highlight, the top face of a pixel */
  --body: 18px;
  --line: 24px;
  --tab: clamp(22px, 1.88vw, 36px);
  --pad: 28px;
  --gut: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--black); }
body {
  font-family: "Departure", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--body);
  line-height: var(--line);
  color: var(--a3);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.04em;
  overflow-x: hidden;
}

/* the screen's own glow and raster, both decoration only */
.bloom {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(118% 78% at 50% 36%, rgba(252,204,44,.085), rgba(236,172,28,.035) 46%, rgba(0,0,0,0) 74%);
  animation: flicker 7s steps(1) infinite;
}
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 3; opacity: .17;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.55) 2px 4px);
}
@keyframes flicker { 0%,96% { opacity: 1 } 97% { opacity: .88 } 98% { opacity: 1 } 99% { opacity: .93 } }
@media (prefers-reduced-motion: reduce) { .bloom { animation: none } }

.screen {
  position: relative; z-index: 1;
  max-width: 2100px; margin: 0 auto;
  padding: 20px 32px 24px;
  display: flex; flex-direction: column; gap: 10px;
}

/* ---- identification strip ------------------------------------------- */
.strip {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  color: var(--a2); letter-spacing: 0.16em; white-space: nowrap;
  overflow: hidden;
}
.strip b { color: var(--a4); font-weight: 400; }
.strip .lead { font-style: normal; color: var(--a1); }

/* ---- the menu rectangle ---------------------------------------------- */
.menu {
  border: 1px solid var(--a1);
  height: 86px;
  display: flex; align-items: stretch; justify-content: space-between;
  padding: 1px;
}
.tab {
  display: flex; align-items: center; justify-content: center;
  padding: 0 clamp(18px, 1.9vw, 36px);
  font-size: var(--tab); line-height: 1;
  color: var(--a4); text-decoration: none; letter-spacing: 0.1em;
  transition: background-color .08s linear, color .08s linear;
}
.tab:hover { background: rgba(255,199,82,.14); }
.tab[aria-current="page"] { background: var(--a4); color: #141310; }
.tab:focus-visible { outline: 2px solid var(--a4); outline-offset: -4px; }

/* ---- the two panels -------------------------------------------------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gut); }
.panel {
  border: 1px solid var(--a1);
  padding: var(--pad);
  min-width: 0; min-height: 0;
  overflow: hidden;
}
.panels .panel { min-height: 440px; }
.panel.wide { margin-top: 2px; }

/* the picture sits on his own wall colour, so the panel IS the picture */
.panel-art { display: flex; align-items: center; justify-content: center; padding: 0; position: relative; overflow: hidden; background: #1b1b1a; }
/* the refresh bar of a phosphor tube, the one thing that moves in the picture */
.panel-art::after {
  content: ""; position: absolute; left: 0; right: 0; height: 84px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,190,60,0), rgba(255,190,60,.10) 46%, rgba(255,205,90,.17) 52%, rgba(255,190,60,0));
  animation: sweep 7.5s linear infinite;
}
@keyframes sweep { from { top: -90px } to { top: 100% } }
@media (prefers-reduced-motion: reduce) { .panel-art::after { animation: none; top: 46%; opacity: .5 } }
/* His own pixels, kept square: the picture is generated in the register of
   the avatar and the header he drew (art/ref/his-*.jpg), never scaled smooth. */
.art {
  display: block; max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain;
  image-rendering: pixelated;
}

/* the machine's log, the left panel's whole content */
.logLines { margin: 0; }
.ln { display: flex; gap: 14px; }
.ln .pre { color: var(--a2); flex: 0 0 auto; width: 3.6em; letter-spacing: 0.08em; white-space: pre; }
.ln .txt { color: var(--a3); min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cursor { color: var(--a4); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 0%, 55% { opacity: 1 } 56%, 100% { opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none } }
.ln.head .txt { color: var(--a4); letter-spacing: 0.14em; }
.ln .dim { color: var(--a2); }
.ln .hot { color: var(--a4); }
.ln.gap { height: 12px; }

/* the headline: the live figure as character art, sitting in the log flow */
.bannerWrap { display: flex; gap: 14px; }
.bannerWrap .pre { color: var(--a2); flex: 0 0 auto; width: 3.6em; letter-spacing: 0.08em; white-space: pre; }
.banner {
  margin: 0; font-family: "VGA", monospace;
  font-size: clamp(16px, 1.08vw, 20px); line-height: 1;
  letter-spacing: 0; white-space: pre; color: var(--a4);
  text-shadow: 0 0 1px currentColor, 0 0 14px rgba(255,180,40,.45);
}

/* ---- the band: token box, figures, keeper box ------------------------ */
.band {
  display: grid;
  grid-template-columns: minmax(560px, 44%) 1fr minmax(280px, 19%);
  gap: 16px;
  align-items: stretch;
}
.box { border: 1px solid var(--a1); display: flex; flex-direction: column; min-width: 0; }
.boxTitle {
  background: var(--a1); color: #141310; letter-spacing: 0.22em;
  padding: 6px 20px; font-size: 16px; line-height: 24px;
}
.token .boxTitle { background: var(--a4); }
.boxBody { padding: 18px 20px; min-width: 0; }
.box.status .boxBody { color: var(--a2); white-space: pre; font-size: 16px; line-height: 22px; overflow: hidden; padding: 14px 20px; }
.box.status .boxBody b { color: var(--a4); font-weight: 400; }

.mintRow { display: flex; gap: 16px; align-items: baseline; margin-bottom: 16px; }
.mintRow .k { color: var(--a1); letter-spacing: 0.18em; flex: 0 0 auto; }
.mint {
  font: inherit; font-size: 18px; color: var(--a4); user-select: all;
  min-width: 0; overflow-wrap: anywhere; word-break: break-all;
}
.mint.empty { color: var(--a2); }

.keys { display: flex; flex-wrap: wrap; gap: 10px; }
.keys .key { flex: 1 1 auto; }
.key {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 10px 22px; white-space: nowrap;
  border: 1px solid var(--a2); background: transparent;
  font: inherit; font-size: 17px; letter-spacing: 0.1em; color: var(--a4);
  text-decoration: none; cursor: pointer;
  transition: transform .06s linear, background-color .1s linear;
}
.key img { display: block; }
.key.key-go { background: var(--a4); color: #141310; border-color: var(--a4); }
.key:hover:not([aria-disabled="true"]):not(:disabled) { background: rgba(255,199,82,.18); }
.key.key-go:hover:not([aria-disabled="true"]) { background: var(--a5); }
.key:active:not([aria-disabled="true"]):not(:disabled) { transform: translateY(2px); }
.key:focus-visible { outline: 2px solid var(--a4); outline-offset: 2px; }
.key[aria-disabled="true"], .key:disabled {
  color: var(--a1); border-color: var(--a1); background: transparent; cursor: not-allowed;
}
.key[aria-disabled="true"] img, .key:disabled img { opacity: .34; filter: grayscale(1); }
.key.ok { background: var(--a4); color: #141310; border-color: var(--a4); }

/* the figures: the one place on the page that is not the mono grid */
.figures { display: flex; flex-direction: column; justify-content: flex-start; gap: 22px; min-width: 0; padding-top: 2px; }
.figRow { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 48px); min-width: 0; }
.figLabel { color: var(--a2); letter-spacing: 0.2em; font-size: 17px; flex: 0 0 auto; width: 6.4em; }
.fig {
  font-family: "Anybody", "Departure", monospace; font-weight: 800; font-style: italic; font-stretch: 75%;
  font-size: clamp(24px, 2.1vw, 40px); line-height: 1.1; letter-spacing: 0;
  color: var(--a4); white-space: nowrap;
  text-shadow: 0 0 12px rgba(255,170,30,.3);
}
.fig.cold { color: var(--a2); text-shadow: none; }

/* ---- the foot: boot script and the giant wordmark -------------------- */
.foot { display: grid; grid-template-columns: minmax(430px, 36%) 1fr auto; gap: 16px; align-items: end; }
.batch { margin: 0; font: inherit; font-size: 16px; line-height: 23px; color: var(--a1); white-space: pre; overflow: hidden; }
.wordmark.two { display: none; }
.wordmark {
  margin: 0; justify-self: end;
  font-family: "VGA", monospace;
  font-size: clamp(16px, 1.58vw, 30px); line-height: 1;
  letter-spacing: 0; white-space: pre; color: var(--a4);
  text-shadow: 0 0 1px currentColor, 0 0 18px rgba(255,170,30,.4);
}
.wordmarkTag { align-self: end; color: var(--a2); font-size: 16px; padding-bottom: 4px; }

/* ---- the wide panel: the log of deposits and burns -------------------- */
.panel.wide { padding: var(--pad); }
.wideHead { display: flex; justify-content: space-between; gap: 24px; color: var(--a4); letter-spacing: 0.14em; margin-bottom: 4px; }
.rule { color: var(--a1); white-space: pre; overflow: hidden; height: var(--line); }
table.grid { width: 100%; border-collapse: collapse; font: inherit; }
table.grid th {
  text-align: left; color: var(--a1); font-weight: 400; letter-spacing: 0.18em;
  padding: 2px 20px 2px 0; white-space: nowrap;
}
table.grid td { padding: 2px 20px 2px 0; color: var(--a3); white-space: nowrap; }
table.grid td.n { color: var(--a4); }
table.grid td.s { color: var(--a2); }
table.grid td a { color: var(--a2); text-decoration: none; border-bottom: 1px solid var(--a1); }
table.grid td a:hover { color: var(--a4); }
table.grid tr.empty td { color: var(--a2); white-space: normal; }

/* ---- forms (redeem) --------------------------------------------------- */
.field { display: flex; align-items: center; gap: 16px; margin: 8px 0 18px; flex-wrap: wrap; }
.field label { color: var(--a2); letter-spacing: 0.16em; flex: 0 0 auto; }
input[type="text"], input[type="number"] {
  font: inherit; font-size: 20px; color: var(--a4); background: #0d0c0a;
  border: 1px solid var(--a2); padding: 12px 16px; min-height: 56px; min-width: 0; flex: 1 1 220px;
  letter-spacing: 0.06em;
}
input::placeholder { color: var(--a1); }
input:focus-visible { outline: 2px solid var(--a4); outline-offset: 1px; }

.note { color: var(--a2); }
.hot { color: var(--a4); }
.dim { color: var(--a1); }

/* ---- widths ----------------------------------------------------------- */
@media (max-width: 1620px) {
  :root { --body: 17px; --line: 23px; --pad: 22px; }
  .ln .pre, .bannerWrap .pre { width: 3.2em; }
  .band { grid-template-columns: minmax(380px, 46%) 1fr; }
  .box.status { grid-column: 1 / -1; }
  .box.status .boxBody { white-space: pre-wrap; }
  .foot { grid-template-columns: 1fr auto; }
  .batch { display: none; }
}
@media (max-width: 1100px) {
  .panels { grid-template-columns: 1fr; }
  .panels .panel { height: auto; }
  .panel-art { height: 340px; }
  .band { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; justify-items: start; }
  .wordmark { justify-self: start; }
  .wordmarkTag { padding-bottom: 0; }
}
/* the phone is drawn, not squeezed: no prefix column, one strip line per fact */
@media (max-width: 760px) {
  :root { --pad: 18px; --body: 16px; --line: 22px; }
  .screen { padding: 14px 16px 28px; gap: 10px; }
  .strip { display: grid; grid-template-columns: 1fr; gap: 2px; font-size: 16px; white-space: nowrap; }
  .strip span:nth-child(2), .strip span:nth-child(3), .strip span:nth-child(4) { display: none; }
  .ln .pre, .bannerWrap .pre { display: none; }
  .ln, .bannerWrap { gap: 0; }
  .ln.head .txt { letter-spacing: 0.08em; }
  .menu { height: auto; flex-wrap: wrap; padding: 0; }
  .tab { flex: 1 1 28%; min-height: 58px; font-size: 19px; padding: 0 21px; }
  .panel-art { height: 230px; }
  .ln { gap: 10px; }
  .ln .pre { width: 3.2em; }
  .mintRow { flex-direction: column; align-items: flex-start; gap: 6px; }
  .keys .key { flex: 1 1 100%; }
  .figRow { flex-wrap: wrap; gap: 6px 20px; }
  .fig { font-size: 30px; }
  .figLabel { width: 100%; }
  .wordmark.wide1 { display: none; }
  .wordmark.two { display: block; font-size: 16px; }
  table.grid { font-size: 16px; }
  .scroller { overflow-x: auto; }
}

/* the gold the vault holds, printed under the mint in the same window */
.mintRow.second { margin-bottom: 16px; }
.mint.small { font-size: 16px; color: var(--a2); }
.statusLine b { color: var(--a4); }

.tokenFacts { margin-top: 16px; color: var(--a2); font-size: 16px; }
.tokenFacts b { color: var(--a4); font-weight: 400; }
