/* ProofPad: one instrument sheet, laid over the pad's own world.
   The composition, the density and the bands come from the terminal sheet in art/ref.
   The palette, the lettering and the light come from his own mark: a gold pixel padlock
   glowing on deep blue, with cyan streaks and warm bokeh behind it. His mark wins on colour
   and on type; the sheet wins on where everything sits. */

@font-face { font-family: Sligoil; src: url(../fonts/sligoil-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Sligoil; src: url(../fonts/sligoil-medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Sligoil; src: url(../fonts/sligoil-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Pixeloid; src: url(../fonts/pixeloid.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: Pixeloid; src: url(../fonts/pixeloid-bold.woff2) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: VG5000; src: url(../fonts/vg5000.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --navy-0: #02101f;     /* the deepest water, behind everything */
  --navy: #031a33;       /* the sheet's own field */
  --navy-2: #062b4f;     /* a lifted surface */
  --gold: #ffcc3d;       /* his mark's colour: every stroke, every heading */
  --gold-hot: #ffee66;   /* the core of the glow */
  --gold-deep: #e8912a;  /* the edge of the glow, dim gold rules */
  --cyan: #35e2f2;       /* the streaks in his world: live values, links */
  --cyan-dim: #1f7f96;
  --red: #ff5a3c;        /* a missed deadline, a burn */
  --text: #c3dcf0;       /* prose */
  --text-dim: #7ba1c0;   /* secondary */
  --text-faint: #41678a; /* labels, the faintest grid */
  --frame: rgba(255, 204, 61, 0.32);
  --frame-dim: rgba(123, 161, 192, 0.22);

  --t-body: 19px;
  --t-small: 17px;
  --t-micro: 16px;       /* nothing on this site is smaller */
  --t-strip: 18px;
  --t-prompt: 34px;
  --t-notice: 30px;
  --t-ident: 52px;
  --t-mint: 24px;

  --pad: 32px;           /* every box keeps its text this far from its own edge */
  --pad-y: 20px;
  --strip-h: 46px;
  --gap: 10px;
  --sheet-w: 1680px;
  --bloom: 0 0 10px rgba(255, 204, 61, 0.42);
  --bloom-soft: 0 0 16px rgba(255, 204, 61, 0.22);
}

* { box-sizing: border-box; }

html { background: var(--navy-0); }

body {
  margin: 0;
  background: var(--navy-0);
  color: var(--text);
  font: 400 var(--t-body)/1.7 Sligoil, ui-monospace, monospace;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* the world behind the sheet: his blue, moving on its own clock, never with the pointer */
#world {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------- the sheet */

.screen {
  position: relative;
  z-index: 1;
  border: 1px solid var(--frame-dim);
  border-radius: 10px;
  margin: 14px;
  min-height: calc(100vh - 28px);
  background: linear-gradient(180deg, rgba(3, 26, 51, 0.82), rgba(2, 16, 31, 0.9));
  backdrop-filter: blur(2px);
}

.sheet {
  max-width: var(--sheet-w);
  margin: 0 auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: calc(100vh - 28px);
}

.box,
.strip {
  border: 1px solid var(--frame);
  position: relative;
  background: rgba(2, 16, 31, 0.46);
}

.box { padding: var(--pad-y) var(--pad); }

/* ---------------------------------------------------------------- prompt */

.prompt {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font: 700 var(--t-prompt)/1.15 Pixeloid, Sligoil, monospace;
  color: var(--gold);
  letter-spacing: 0.02em;
  padding: 10px 4px 2px;
  text-shadow: var(--bloom);
}

.prompt-caret { color: var(--gold-deep); }

.prompt input {
  font: inherit;
  color: var(--gold-hot);
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  width: 6ch;
  min-width: 1ch;
  max-width: 14ch;
  caret-color: transparent;
}

.prompt .block {
  display: inline-block;
  width: 0.56em;
  height: 0.8em;
  background: var(--gold);
  box-shadow: var(--bloom);
  transform: translateY(0.02em);
  animation: blink 1.05s steps(1) infinite;
}

.prompt.is-off .block { animation: none; opacity: 0.35; }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.prompt-hint {
  margin-left: auto;
  font: 500 var(--t-small)/1 Sligoil;
  letter-spacing: 0.16em;
  color: var(--text-faint);
  text-transform: uppercase;
  align-self: center;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- bands */

.band { display: grid; gap: var(--gap); align-items: stretch; }
.band-two { grid-template-columns: 1.52fr 1fr; }
.band-three { grid-template-columns: 1fr 1.22fr 0.92fr; }
.band > .box { min-width: 0; }

/* ---------------------------------------------------------------- strips */

.strip {
  height: var(--strip-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  min-width: 0;
  font: 700 var(--t-strip)/1 Sligoil;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  overflow: hidden;
  text-shadow: var(--bloom-soft);
}

.strip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.strip .ctl {
  margin-left: auto;
  flex: none;
  display: flex;
  gap: 10px;
  align-items: center;
}

.strip .ctl button {
  font: 700 18px/1 Sligoil;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px 8px;
  letter-spacing: 0;
  min-width: 34px;
}

.strip .ctl button:hover,
.strip .ctl button:focus-visible { color: var(--gold); }

/* the ticker runs its own clock, like the stardate line on the sheet he dropped */
.ticker { color: var(--text-dim); font-weight: 700; }
.ticker-track {
  display: flex;
  gap: 16px;
  align-items: baseline;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  width: 100%;
}
.ticker-track .ev {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}
.ticker-track .caret {
  width: 0.56em;
  height: 0.85em;
  background: var(--gold);
  flex: none;
  animation: blink 1.05s steps(1) infinite;
}
.ticker-track b { font-weight: 700; color: var(--gold); }
.ticker-track .sep { color: var(--text-faint); }
.ticker-track .good { color: var(--cyan); }
.ticker-track .bad { color: var(--red); }

/* ---------------------------------------------------------------- console */

.lede {
  font: 700 var(--t-notice)/1.28 Pixeloid, Sligoil, monospace;
  color: var(--gold);
  margin: 2px 0 18px;
  max-width: 24ch;
  letter-spacing: 0.01em;
  text-shadow: var(--bloom);
}

.label {
  font: 500 var(--t-micro)/1 Sligoil;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 12px;
}

.rule { border: 0; border-top: 1px solid var(--frame-dim); margin: 18px 0; }

/* the command list: a man page, and the site's whole navigation */
.console { display: flex; flex-direction: column; }
/* two columns of commands, so the console band stays short and the chart keeps the screen */
.cmds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 18px; align-content: start; }

.cmds button {
  display: grid;
  grid-template-columns: 9ch 1fr;
  gap: 16px;
  align-items: baseline;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  padding: 9px 22px;
  min-height: 48px;
  cursor: pointer;
  font: 400 var(--t-small)/1.4 Sligoil;
  color: var(--text-dim);
}

.cmds button .cmd {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cmds button:hover,
.cmds button:focus-visible { background: rgba(255, 204, 61, 0.07); color: var(--text); }
.cmds button:hover .cmd, .cmds button:focus-visible .cmd { color: var(--gold); }

.cmds button[aria-current="page"] { border-left-color: var(--gold); background: rgba(255, 204, 61, 0.05); }
.cmds button[aria-current="page"] .cmd { color: var(--gold); text-shadow: var(--bloom-soft); }

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

.panel { padding: 0; position: relative; height: clamp(360px, 44vh, 540px); }
.panel canvas { display: block; width: 100%; height: 100%; }
.panel.is-folded { display: none; }

.split { display: flex; flex-direction: column; }
.split canvas { flex: 1; min-height: 190px; width: 100%; display: block; }

.panel-empty {
  position: absolute;
  inset: auto auto 26px 26px;
  text-align: left;
  max-width: 46%;
  font: 500 var(--t-small)/1.5 Sligoil;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  pointer-events: none;
}

/* ---------------------------------------------------------------- identity */

.ident { display: flex; align-items: center; gap: 24px; padding-top: 26px; padding-bottom: 26px; }
.ident .seal {
  width: 112px;
  height: 112px;
  flex: none;
  border: 1px solid var(--frame);
  padding: 8px;
  object-fit: contain;
  background: rgba(6, 43, 79, 0.45);
}
.ident .name {
  font: 700 var(--t-ident)/1.08 Pixeloid, Sligoil, monospace;
  color: var(--gold);
  letter-spacing: 0.01em;
  text-shadow: var(--bloom);
}
.ident .tick {
  font: 500 var(--t-small)/1 Sligoil;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-top: 14px;
}

/* ------------------------------------------------- the record: the one window */

.record { padding: 0; display: flex; flex-direction: column; }

.record .win-strip {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--frame);
  font: 700 var(--t-micro)/1 Sligoil;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  flex: none;
  background: rgba(255, 204, 61, 0.07);
}

/* a button does not inherit its font: say it, or Chrome drops the fold control to 13 px */
.record .win-strip .ctl { margin-left: auto; display: flex; gap: 10px; }
.record .win-strip .ctl button {
  font: 700 18px/1 Sligoil;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px 8px;
  min-width: 34px;
}
.record .win-strip .ctl button:hover,
.record .win-strip .ctl button:focus-visible { color: var(--gold); }

.record .win-body { padding: 20px var(--pad) var(--pad); }
.record.is-folded .win-body { display: none; }

.mint {
  font: 500 var(--t-mint)/1.42 Sligoil;
  color: var(--gold-hot);
  word-break: break-all;
  overflow-wrap: anywhere;
  min-width: 0;
  user-select: all;
  margin: 0 0 18px;
  text-shadow: var(--bloom-soft);
}
.mint.is-empty { color: var(--text-faint); letter-spacing: 0.08em; text-shadow: none; }

.keys { display: flex; flex-wrap: wrap; gap: 10px; }

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--frame);
  background: rgba(6, 43, 79, 0.4);
  color: var(--text);
  font: 700 var(--t-micro)/1 Sligoil;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.08s;
}

.key:hover, .key:focus-visible { color: var(--gold); border-color: var(--gold); box-shadow: var(--bloom-soft); }
.key:active { transform: translateY(1px); }
.key[aria-disabled="true"], .key:disabled { color: var(--text-faint); border-color: var(--frame-dim); cursor: not-allowed; box-shadow: none; }
.key.is-primary { color: var(--gold); border-color: var(--gold); box-shadow: var(--bloom-soft); }
.key .mark { width: 17px; height: 17px; flex: none; }
.key[aria-disabled="true"] .mark { opacity: 0.35; }

/* ---------------------------------------------------------------- journal */

.journal { display: grid; grid-template-columns: 30px 1fr; gap: 18px; padding: var(--pad-y) var(--pad); }
.journal canvas { width: 30px; height: 100%; display: block; }
.journal .lines {
  font: 400 var(--t-micro)/1.5 Sligoil;
  color: var(--text-dim);
  overflow: hidden;
  min-width: 0;
}
.journal .lines div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journal .lines .hot { color: var(--gold); }
.journal .lines .good { color: var(--cyan); }
.journal .lines .bad { color: var(--red); }

/* ---------------------------------------------------------------- prose */

.prose {
  font: 400 var(--t-body)/1.75 Sligoil;
  color: var(--text);
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
  margin: 0;
}

.fine { font: 400 var(--t-micro)/1.6 Sligoil; color: var(--text-faint); text-align: justify; margin: 0; }

/* ---------------------------------------------------------------- data rows */

.rows { display: grid; gap: 0; margin: 0 calc(var(--pad) * -1); }
.row {
  display: grid;
  grid-template-columns: minmax(130px, 24%) 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--frame-dim);
  min-width: 0;
}
.row:last-child { border-bottom: 0; }
.row .k { font: 500 var(--t-micro)/1.3 Sligoil; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.row .v { font: 400 var(--t-small)/1.45 Sligoil; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.row .n { font: 700 var(--t-small)/1.3 Sligoil; color: var(--gold); white-space: nowrap; }
.row .n.good { color: var(--cyan); }
.row .n.bad { color: var(--red); }

.big {
  font: 700 var(--t-notice)/1 Pixeloid, Sligoil, monospace;
  color: var(--gold);
  text-shadow: var(--bloom);
}

/* ---------------------------------------------------------------- forms */

.field { display: grid; gap: 10px; margin-bottom: 18px; min-width: 0; }
.field > label { font: 500 var(--t-micro)/1 Sligoil; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.field input, .field select, .field textarea {
  font: 400 var(--t-small)/1.4 Sligoil;
  color: var(--gold-hot);
  background: rgba(2, 16, 31, 0.6);
  border: 1px solid var(--frame-dim);
  padding: 14px 18px;
  min-height: 50px;
  width: 100%;
  min-width: 0;
  border-radius: 0;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--gold); box-shadow: var(--bloom-soft); }
.field select { appearance: none; }
.field select option { background: #062b4f; color: var(--text); }
.field .note { font: 400 var(--t-micro)/1.45 Sligoil; color: var(--text-faint); }
.field .note.bad { color: var(--red); }
.field .note.good { color: var(--cyan); }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ---------------------------------------------------------------- how */

.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.step { border: 1px solid var(--frame); padding: 0; background: rgba(2, 16, 31, 0.46); }
.step img { display: block; width: 100%; height: auto; }
.step .cap { padding: 18px var(--pad) var(--pad); border-top: 1px solid var(--frame-dim); }
.step .cap b { display: block; font: 700 var(--t-small)/1.2 Sligoil; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.step .cap span { font: 400 var(--t-small)/1.55 Sligoil; color: var(--text); }

/* ---------------------------------------------------------------- CRT */

.crt-lines,
.crt-vig {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.crt-lines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 10, 22, 0.3) 3px,
    rgba(0, 10, 22, 0.3) 4px
  );
}

.crt-vig {
  background: radial-gradient(135% 115% at 50% 46%, rgba(0, 0, 0, 0) 50%, rgba(1, 8, 17, 0.72) 100%);
}

/* ---------------------------------------------------------------- state */

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 60;
  border: 1px solid var(--gold);
  background: #062b4f;
  color: var(--gold);
  padding: 16px 28px;
  font: 700 var(--t-micro)/1 Sligoil;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.18s;
  box-shadow: var(--bloom-soft);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.is-on { opacity: 1; }
.toast.is-bad { border-color: var(--red); color: var(--red); box-shadow: none; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

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

@media (max-width: 1420px) {
  :root { --t-ident: 42px; --t-notice: 28px; --t-prompt: 30px; --sheet-w: 1340px; }
  .band-three { grid-template-columns: 1fr 1.3fr; }
  .band-three > .journal { grid-column: 1 / -1; }
}

@media (max-width: 1040px) {
  :root { --t-body: 18px; --t-ident: 38px; --t-notice: 25px; --pad: 22px; }
  .band-two, .band-three { grid-template-columns: 1fr; }
  .band-three > .journal { grid-column: auto; }
  .steps { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root {
    --t-prompt: 23px;
    --t-notice: 20px;
    --t-ident: 30px;
    --t-mint: 19px;
    --pad: 22px;
    --pad-y: 16px;
    --strip-h: 42px;
    --t-strip: 16px;
  }
  .screen { margin: 7px; border-radius: 6px; }
  .sheet { padding: 12px; min-height: calc(100vh - 14px); }
  .strip { padding: 0 18px; gap: 10px; }
  .strip .ctl button, .record .win-strip .ctl button { font-size: 16px; padding: 10px 3px; min-width: 26px; }
  .record .win-strip { padding: 0 18px; }
  .prompt { flex-wrap: wrap; row-gap: 2px; }
  .prompt-hint { margin-left: 0; width: 100%; padding-top: 10px; white-space: normal; letter-spacing: 0.12em; font-size: var(--t-micro); }
  .ident { gap: 16px; }
  .ident .seal { width: 74px; height: 74px; }
  .cmds { grid-template-columns: 1fr; }
  .cmds button { grid-template-columns: 8ch 1fr; gap: 12px; padding: 9px 18px; }
  .row { grid-template-columns: 1fr auto; }
  .row .k { grid-column: 1 / -1; }
  .cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  :root { --t-prompt: 20px; --t-ident: 26px; --t-mint: 17px; }
  .cmds button { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .prompt .block { animation: none; }
  .ticker-track { transform: none; }
}
