/* Insider Language Model. One phosphor screen, built to the measurements in NOTE.md:
   bezel inset 2.3% with an 11 px corner, content on a 10% margin, one display element at about
   two thirds of the column, a bracketed strip low on the glass, a 4 px scanline field over all of it. */

@font-face {
  font-family: "Jersey 25";
  src: url("/fonts/jersey25-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Azeret Mono";
  src: url("/fonts/azeret-mono-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --ground: #010402;
  --ink: #aef05c;          /* his measured phosphor */
  --ink-hot: #d4ff9a;
  --ink-mid: #8fcf52;
  --ink-dim: #7fb45f;
  --ink-low: #6ba354;      /* the dimmest ink that still clears 4.5:1 THROUGH the scan line field */
  --eve: #ffb000;          /* the other lab, amber phosphor */
  --void: #ff6a4d;

  --display: "Jersey 25", "Courier New", monospace;
  --mono: "Azeret Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --s1: 6px; --s2: 10px; --s3: 16px; --s4: 24px; --s5: 34px; --s6: 48px; --s7: 72px;
  --row: 44px;
  --gut: clamp(34px, 7vw, 136px);
  --inset: clamp(8px, 1.1vw, 15px);
  --col: min(1040px, calc(100vw - 2 * var(--gut)));
  --bez: clamp(14px, 1.5vw, 22px);
}

* { box-sizing: border-box; }

html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 18px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

/* ---- the glass: his bezel, fixed, with the ground painted outside it ------ */
.glass {
  position: fixed;
  inset: var(--inset);
  max-width: 1312px;
  margin-inline: auto;
  border: var(--bez) solid transparent;
  border-image: url("/img/bezel-1021.png") 64 fill / 1 / 0 stretch;
  box-shadow: 0 0 0 100vmax var(--ground);
  pointer-events: none;
  z-index: 40;
}
.field {
  position: fixed;
  inset: var(--inset);
  max-width: 1312px;
  margin-inline: auto;
  pointer-events: none;
  z-index: 30;
  overflow: hidden;
  background:
    repeating-linear-gradient(to bottom,
      rgba(174, 240, 92, .055) 0 1px,
      rgba(0, 0, 0, 0) 1px 5px,
      rgba(0, 0, 0, .42) 5px 7px),
    radial-gradient(120% 90% at 50% 45%, rgba(174, 240, 92, .06), rgba(0, 0, 0, 0) 72%);
  animation: flicker 5.5s steps(1, end) infinite;
}
.roll {
  position: absolute;
  left: 0; right: 0; top: -22%;
  height: 22%;
  background: linear-gradient(to bottom, rgba(174, 240, 92, 0), rgba(174, 240, 92, .045), rgba(174, 240, 92, 0));
  animation: roll 9s linear infinite;
}
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(560%); } }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .93; } 96% { opacity: 1; } 98% { opacity: .96; } }

/* ---- the column ---------------------------------------------------------- */
.col {
  position: relative;
  z-index: 10;
  width: var(--col);
  margin: 0 auto;
  padding: calc(var(--inset) + var(--bez) + var(--s5)) 0 calc(var(--inset) + var(--bez) + var(--s6));
}
.seg { margin: 0 0 var(--s7); }
.seg:last-child { margin-bottom: 0; }

/* ---- the two ident lines of his picture ---------------------------------- */
.ident {
  display: grid;
  grid-template-columns: 54px auto 1fr;
  align-items: center;
  column-gap: var(--s3);
  row-gap: var(--s2);
}
.mark { display: block; width: 54px; height: 54px; }
.name {
  font: 400 30px/1 var(--display);
  letter-spacing: .01em;
  margin: 0;
  color: var(--ink);
}
.tick {
  font: 500 16px/1 var(--mono);
  letter-spacing: .08em;
  color: var(--ink-mid);
  padding-top: 3px;
}
.pair {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.pair b, .commit b, .rnd b { font-weight: 500; color: var(--ink); }

.ident2 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  align-items: baseline;
  margin: var(--s3) 0 0;
  padding-bottom: var(--s2);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  position: relative;
}
.ident2::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink-low);
  opacity: .55;
}
.ident2 p { margin: 0; }
.ident2 .memo { margin-left: auto; }
.hash { font-variant-ligatures: none; word-break: break-all; }

/* ---- the stage: the one display element ---------------------------------- */
.stage { padding: var(--s5) 0 var(--s4); text-align: center; }
.stage-lab {
  margin: 0 0 var(--s4);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  max-width: 100%;
  font-family: var(--display);
  font-size: 56px;
  line-height: 1.04;
  letter-spacing: .005em;
  text-transform: uppercase;
  color: var(--ink-hot);
  text-shadow: 0 0 18px rgba(174, 240, 92, .34);
  min-height: 196px;
  overflow-wrap: anywhere;
}
.message.void { color: var(--void); text-shadow: 0 0 18px rgba(255, 106, 77, .3); }
.message .caret { opacity: .9; animation: caret 1s steps(1, end) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.status {
  margin: var(--s3) 0 0;
  font-size: 22px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.status b { font-weight: 500; font-variant-numeric: tabular-nums; }
.status.sample { color: var(--ink-dim); }
.premise {
  margin: var(--s4) auto 0;
  max-width: 62ch;
  font-size: 18px;
  color: var(--ink-mid);
}

/* ---- his bracketed strip ------------------------------------------------- */
.bracket {
  border: 22px solid transparent;
  border-image: url("/img/strip-1021.png") 62 fill / 1 / 0 stretch;
  padding: var(--s3) var(--s4);
}

.decode {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 130px;
  gap: var(--s4);
  align-items: stretch;
}
.dc { display: flex; flex-direction: column; justify-content: flex-start; gap: var(--s1); min-width: 0; }
.dc + .dc { position: relative; }
.dc + .dc::before {
  content: "";
  position: absolute;
  left: calc(var(--s4) / -2);
  top: 2px; bottom: 2px;
  width: 1px;
  background: var(--ink-low);
  opacity: .5;
}
.dc-lab, .dc-note {
  font-size: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.dc-note { color: var(--ink-low); }
.dc-val {
  font: 400 44px/1 var(--display);
  color: var(--ink-low);
  font-variant-numeric: tabular-nums;
}
.dc-val.on { color: var(--ink-hot); }
.dc-val.eve { color: var(--eve); }
.dc-lock { align-items: flex-start; }
.lock { display: block; width: 46px; height: 46px; object-fit: contain; object-position: left center; margin: var(--s1) 0; }

/* ---- the 16 candidates --------------------------------------------------- */
.cands { margin-top: var(--s6); }
.cands-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 var(--s3);
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.cands-sub { color: var(--ink-dim); }
.cand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1) var(--s4);
}
.cand {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: var(--s3);
  min-height: var(--row);
  padding: 0 var(--s3);
  background: none;
  border: 0;
  color: var(--ink-mid);
  font: 400 18px/1.2 var(--mono);
  text-align: left;
  cursor: pointer;
  position: relative;
}
.cand::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink-low);
  opacity: .32;
}
.cand .i {
  font: 400 22px/1 var(--display);
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.cand .t { color: var(--ink); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand .m { color: var(--ink-dim); font-size: 16px; font-variant-numeric: tabular-nums; }
.cand:hover:not(:disabled) { color: var(--ink-hot); }
.cand:hover:not(:disabled) .i { color: var(--ink-hot); }
.cand[aria-pressed="true"] .i { color: var(--ground); background: var(--ink); border-radius: 2px; text-align: center; }
.cand[aria-pressed="true"] .t { color: var(--ink-hot); }
.cand.secret .i { color: var(--ground); background: var(--ink-hot); border-radius: 2px; text-align: center; }
.cand:disabled { cursor: default; opacity: .74; }

/* ---- the entry: the answer and the coin ---------------------------------- */
.entry { margin-top: var(--s5); }
.entry-act {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s2) var(--s4);
  padding-bottom: var(--s3);
  position: relative;
}
.entry-act::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink-low);
  opacity: .5;
}
.entry-lab, .coin-lab {
  margin: 0;
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.entry-pick { margin: 0; font-size: 22px; color: var(--ink); letter-spacing: .04em; }
.entry-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 16px;
  color: var(--ink-mid);
}
.entry-coin { padding-top: var(--s3); display: grid; gap: var(--s2); min-width: 0; }
.mint-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s3); }
.mint {
  margin: 0;
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--ink-hot);
  word-break: break-all;
  min-width: 0;
}
.mint.empty { color: var(--ink-low); font-size: 18px; letter-spacing: .06em; text-transform: uppercase; }
.coin-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s1); min-width: 0; }

/* ---- keys: his two filled blocks ----------------------------------------- */
.key {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 46px;
  padding: 0 1.3em;
  border: 14px solid transparent;
  border-image: url("/img/key-dark-1021.png") 58 fill / 1 / 0 stretch;
  background: none;
  color: var(--ink);
  font: 500 16px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.key img { display: block; width: 22px; height: 22px; object-fit: contain; }
.key:hover:not(:disabled):not([aria-disabled="true"]),
.key:focus-visible {
  border-image-source: url("/img/key-lit-1021.png");
  color: var(--ground);
}
.key:hover:not(:disabled):not([aria-disabled="true"]) img { filter: none; }
.key:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.key:disabled, .key[aria-disabled="true"] { color: var(--ink-low); cursor: default; opacity: .74; }
.key-wide { min-width: 220px; }
.key-mark { min-width: 0; }
.key-mark span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink-hot); outline-offset: 3px; }

/* ---- segment heads ------------------------------------------------------- */
.seg-head {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin: 0 0 var(--s3);
  font: 400 34px/1 var(--display);
  letter-spacing: .01em;
  color: var(--ink-hot);
  text-shadow: 0 0 16px rgba(174, 240, 92, .22);
  position: relative;
  padding-bottom: var(--s3);
}
.seg-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink-low);
  opacity: .55;
}
.seg-head i {
  font-style: normal;
  font-size: 22px;
  color: var(--ink-low);
  font-variant-numeric: tabular-nums;
}
.seg-line { margin: 0 0 var(--s4); max-width: 76ch; font-size: 18px; color: var(--ink-mid); }

/* ---- tables -------------------------------------------------------------- */
.table { width: 100%; }
.tr {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 120px 72px 72px 118px;
  align-items: center;
  gap: var(--s3);
  min-height: var(--row);
  padding: var(--s1) var(--s2);
  font-size: 16px;
  color: var(--ink-mid);
  position: relative;
}
.tr::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink-low);
  opacity: .3;
}
.tr.th {
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.tr.th::after { opacity: .6; }
.tr > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .said { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr .pt-in { color: var(--ink-hot); }
.tr .pt-eve { color: var(--eve); }
.tr .pt-none { color: var(--ink-low); }
.tr-s { grid-template-columns: 96px minmax(0, 1fr) minmax(0, 1fr) 96px 120px 120px; }
.tr-t { grid-template-columns: 96px minmax(0, 1fr) 110px 110px 110px 110px; }
.tr-r { grid-template-columns: 80px minmax(0, 1fr) 90px 130px 150px; }
.xlink { color: var(--ink-dim); text-decoration: none; border-bottom: 1px solid var(--ink-low); }
.xlink:hover { color: var(--ink-hot); border-bottom-color: var(--ink-hot); }
.empty { margin: var(--s4) 0 0; font-size: 18px; color: var(--ink-low); }

/* ---- search -------------------------------------------------------------- */
.search { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.search-lab { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.search-in {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 46px;
  padding: 0 var(--s3);
  background: rgba(174, 240, 92, .05);
  border: 1px solid var(--ink-low);
  color: var(--ink-hot);
  font: 400 18px/1 var(--mono);
}
.search-in::placeholder { color: var(--ink-low); }
.search-count { font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }

/* ---- season -------------------------------------------------------------- */
.season-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: stretch; margin-bottom: var(--s5); }
.curve-box { min-width: 0; display: flex; flex-direction: column; gap: var(--s2); }
#curve { width: 100%; height: auto; display: block; }
.curve-legend { display: flex; gap: var(--s4); margin: 0; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }
.lg { display: inline-flex; align-items: center; gap: var(--s1); color: var(--ink-dim); }
.lg::before { content: ""; width: 18px; height: 3px; background: currentColor; }
.lg-in { color: var(--ink-hot); }
.lg-eve { color: var(--eve); }
.lg-none { color: var(--ink-low); }
.season-side { display: flex; flex-direction: column; }
.side-head { margin: 0 0 var(--s3); font-size: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); }
.rows { display: flex; flex-direction: column; }
.srow {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  min-height: 40px; font-size: 16px; color: var(--ink-dim); position: relative;
}
.srow::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink-low); opacity: .3; }
.srow b { font: 400 22px/1 var(--display); color: var(--ink); font-weight: 400; }

/* ---- treasury facts ------------------------------------------------------ */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); margin-bottom: var(--s5); }
.fact { margin: 0; display: flex; flex-direction: column; gap: var(--s1); }
.fact b { font: 400 44px/1 var(--display); color: var(--ink-hot); font-variant-numeric: tabular-nums; }
.fact span { font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); }

/* ---- rules --------------------------------------------------------------- */
.rules-list { margin: 0; padding-left: 1.6em; max-width: 86ch; }
.rules-list li { margin-bottom: var(--s3); font-size: 18px; color: var(--ink-mid); }
.rules-list b { color: var(--ink); font-weight: 500; }
.rules-list::marker, .rules-list li::marker { color: var(--ink-low); }
.risk { margin: var(--s5) 0 0; max-width: 86ch; font-size: 16px; color: var(--ink-low); }

/* ---- narrow -------------------------------------------------------------- */
@media (max-width: 760px) {
  .coin-keys { grid-template-columns: 1fr; }
  .key { padding: 0 1em; }
  .mint-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .decode { grid-template-columns: 1fr 1fr; }
  .dc + .dc::before { display: none; }
  .season-grid { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: 1fr 1fr; }
  .cand-grid { grid-template-columns: 1fr; }
  .tr { grid-template-columns: 76px minmax(0, 1fr) 84px; }
  .tr > :nth-child(n + 4) { display: none; }
  .tr-s, .tr-t, .tr-r { grid-template-columns: 76px minmax(0, 1fr) 84px; }
  .entry-act { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .key { padding: 0 .7em; letter-spacing: .02em; border-width: 10px; gap: 6px; }
  .key img { width: 18px; height: 18px; }
}
@media (max-width: 560px) {
  :root { --bez: 12px; --gut: 28px; --s7: 52px; }
  .wide-only { display: none; }
  .ident { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s2); }
  .ident .name { flex: 1 1 auto; }
  .premise, .seg-line, .rules-list li, .empty { font-size: 17px; }
  .ident2 .memo { margin-left: 0; }
  .bracket { border-width: 14px; padding: var(--s3) 19px; }
  .ident { grid-template-columns: 44px auto; }
  .mark { width: 44px; height: 44px; }
  .name { font-size: 23px; }
  .tick { grid-column: 2; }
  .stage { padding: var(--s4) 0 var(--s3); }
  .status { font-size: 18px; }
  .pair, .ident2 { letter-spacing: .04em; }
  .decode { grid-template-columns: 1fr; }
  .message { min-height: 120px; }
  .facts { grid-template-columns: 1fr; }
  .key-wide { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .field { animation: none; }
  .roll { display: none; }
  .message .caret { animation: none; }
}

.tr-ex { color: var(--ink-low); }
.tr-ex .said, .tr-ex .pt-in { color: var(--ink-low); }
.tr-ex span:first-child { letter-spacing: .08em; text-transform: uppercase; }
