/* afterglow -- shared styling for the landing page and the run page.

   The page kind sits on <html> (.landing / .run), never on <body>: jb.js owns
   the body classes .log, .done and .fail and replaces them wholesale, so a
   page-kind class on <body> would not survive the first state change. */

:root {
  --bg: #060c18;
  --panel: #0a1428;
  --sunk: #0d1a30;
  --line: #1a2d4a;

  --fg: #c8d8f0;
  --bright: #e0eeff;
  --dim: #6888aa;
  --faint: #3a526a;

  --ok: #64b5f6;
  --bad: #ef9a9a;
  --warn: #ffe082;

  --brand-grad: linear-gradient(135deg, #0d47a1 0%, #0288d1 60%, #4fc3f7 100%);

  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: Consolas, "DejaVu Sans Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--sans);
}

/* --- the bar at the top of both pages ----------------------------------- */

#brand {
  padding: 9px 10px;
  border-bottom: 1px solid #1a3a6a;
  background: var(--brand-grad);
  text-align: center;
}

#brand b {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  vertical-align: middle;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.byline {
  position: fixed;
  bottom: 9px;
  left: 11px;
  z-index: 9;
  margin: 0;
  color: var(--faint);
  font: 11px/1 var(--mono);
  letter-spacing: 0.06em;
}

/* --- landing page ------------------------------------------------------- */

.shell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 34px;
  min-height: calc(100vh - 38px);
  padding: 28px 20px 46px;
}

.meme {
  width: 200px;
  max-width: 40vw;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #0288d1;
  box-shadow: 0 0 24px #0288d155;
}

.panel {
  width: 300px;
}

.lede {
  margin: 0 0 1.6em;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* The note sits on the same line as the supported versions and must read as
   a note, not as a third supported one -- dimmer, and never broken apart. */
.lede .soon {
  opacity: 0.62;
  white-space: nowrap;
}

.pick {
  margin: 0;
}

.opt {
  display: block;
  margin-bottom: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  cursor: pointer;
}

.opt:hover {
  border-color: #2a4a7a;
}

.opt input {
  margin: 0 9px 0 0;
  vertical-align: middle;
}

.opt span {
  vertical-align: middle;
}

/* The autostart switch is a different kind of choice from the payload
   radios, so it sits apart from them rather than looking like a third one. */
.opt-auto {
  margin-top: 16px;
  border-style: dashed;
  background: none;
  color: var(--dim);
  font-size: 14px;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 0.8em 1.4em;
  border: 1px solid #1a4a8a;
  border-radius: 5px;
  background: linear-gradient(135deg, #0d2a5c 0%, #0a3a7a 100%);
  color: var(--ok);
  font: 700 15px/1 var(--sans);
  letter-spacing: 0.1em;
  cursor: pointer;
}

.btn:hover,
.btn:focus {
  border-color: var(--ok);
  background: linear-gradient(135deg, #0d47a1 0%, #0288d1 100%);
  outline: none;
}

.count {
  margin: 12px 0 0;
  min-height: 1.2em;
  color: var(--ok);
  font: 12px/1.2 var(--mono);
  letter-spacing: 0.05em;
}

/* --- run page ----------------------------------------------------------- */

/* Running: a spinner under the bar. jb.js switches the body to .done, .fail
   or .log. */
#spin {
  position: fixed;
  top: calc(50% + 20px);
  left: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 4px solid var(--line);
  border-top-color: var(--ok);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#msg {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: none;
  text-align: center;
  font-size: 16px;
  letter-spacing: 0.5px;
}

#wrap {
  padding: 0;
}

#state,
#out {
  display: none;
}

body.done #spin,
body.fail #spin {
  display: none;
}

body.fail #msg {
  display: block;
}

body.done #msg {
  display: block;
  color: var(--ok);
  font-weight: 700;
  letter-spacing: 2px;
}

/* ?log=1 -- the full step log. The column is laid out with flex rather than
   by subtracting the header height from 100vh: the log then keeps filling
   the page whatever the strip above it ends up being. */
body.log {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

body.log #spin,
body.log #msg {
  display: none;
}

body.log #wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 14px 18px 30px;
}

body.log #state {
  display: block;
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

body.log #out {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--sunk);
  font: 12px/1.45 var(--mono);
  white-space: pre-wrap;
}

/* The live heap readout sits in the flow under the bar. Nothing on this page
   scrolls the document itself -- the log has its own scroll box -- so it
   stays in view without being positioned over the wordmark. */
#ramBox {
  overflow: hidden;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--sunk);
  color: var(--ok);
  font: 11px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The retry notice, raised by jb.js when the chain throws or stalls. */
.notice {
  margin: 1em 0;
  padding: 0.7em 1em;
  border: 2px solid #e66;
  background: #2a1414;
  color: #f99;
  font: 700 20px/1.4 var(--sans);
}

.ok {
  color: var(--ok);
}

.bad {
  color: var(--bad);
}

.warn {
  color: var(--warn);
}

code {
  color: #9fb3d0;
}
