/* Concern build access — the Hyperion device language on the web.
   Every colour, gradient, shadow, radius, spacing and motion value is a token from
   hyperion-tokens.css (generated from SoftwareSimulator/docs/hyperion/tokens.json). */

@font-face { font-family: "Archivo"; font-weight: 400; src: url(fonts/Archivo-Regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; font-weight: 600; src: url(fonts/Archivo-SemiBold.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Archivo"; font-weight: 800; src: url(fonts/Archivo-Black.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; src: url(fonts/IBMPlexMono-Regular.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; src: url(fonts/IBMPlexMono-Medium.woff2) format("woff2"); font-display: swap; }

* { box-sizing: border-box; }
html { background: var(--color-void-700); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-6) var(--space-4);
  background: var(--color-void-700); color: var(--color-ink-700);
  font-family: var(--font-display); font-size: var(--size-body); line-height: var(--leading-normal);
}

/* ── Bone shell: the device body ─────────────────────────────────────────── */
.device {
  width: 100%; max-width: 420px;
  padding: var(--pad-pad-page) var(--pad-pad-console) var(--pad-pad-console);
  background: var(--gradient-shell-face);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shell);
  display: flex; flex-direction: column; gap: var(--space-6);
}
.device > * { min-width: 0; }

/* ── Engraved ink: one recipe, two substrates (body = flat, key = raised) ── */
.engraved {
  color: var(--color-ink-600);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
}
.title {
  margin: 0; font-weight: var(--weight-black); font-size: var(--size-h2);
  letter-spacing: var(--tracking-wide); line-height: var(--leading-tight);
}
.legend { margin: 0; font-size: var(--size-label); letter-spacing: var(--tracking-wide); }
.fine {
  margin: 0; font-size: var(--size-micro); text-transform: none; letter-spacing: 0;
  font-weight: var(--weight-regular); color: var(--color-ink-500); line-height: var(--leading-snug);
}
.face { display: flex; flex-direction: column; gap: var(--space-1); }

/* ── Phosphor glass: the recessed screen, only changeable data sits on it ── */
.glass {
  background: var(--gradient-screen-face);
  box-shadow: var(--shadow-screen-recess);
  border: 1px solid var(--line-onscreen);
  border-radius: var(--radius-sm);
  --vfd-on: var(--color-vfd-on); --vfd-off: var(--color-vfd-off); --vfd-glow: var(--color-vfd-glow);
}
/* The dots take their pitch from the tokens (--vfd-dot, the game's VFD_DOT): no page
   sizes a dot. A screen's padding is the game's VFD_SCREEN_PAD. */
.strip { display: flex; flex-direction: column; gap: var(--space-2); }
.strip .glass { padding: var(--vfd-screen-pad-y) var(--vfd-screen-pad-x); display: flex; justify-content: flex-start; overflow: hidden; }

/* ── Plastic key face: everything you press springs in ───────────────────── */
.key {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--pad-pad-key) var(--space-5);
  background: var(--gradient-key-face);
  box-shadow: var(--shadow-key);
  border: 0; border-radius: var(--radius-md);
  text-decoration: none; cursor: pointer; user-select: none;
  font: inherit; color: inherit; width: 100%;
  transition: transform var(--dur-press) var(--ease-key), box-shadow var(--dur-press) var(--ease-key);
}
.key .engraved { font-size: var(--size-caption); letter-spacing: var(--tracking-wide); }
/* THE SINK IS THE WALL (owner 2026-09-19): a raised key stands one
   wall-thickness (the 3px bottom lip) proud of its base, so pressing it
   travels exactly that and the cap lands ON the base. It used to travel a
   separate 2px against a 3px lip, so the cap and its own face disagreed. */
.key:active, .key.pressed { transform: translateY(3px); box-shadow: var(--shadow-key-flush); }
.key:focus-visible { outline: 2px solid var(--color-teal-500); outline-offset: 2px; }
.key.small { width: auto; padding: var(--space-2) var(--space-4); align-self: flex-end; }
.key.small .engraved { font-size: var(--size-label); }
.key.dead { cursor: default; }
.key.dead:active { transform: none; box-shadow: var(--shadow-key); }
.key.dead .engraved { color: var(--color-ink-500); }

/* DisplayKey: a key bezel wrapping a small glass pane that shows the build's size */
.keys { display: flex; flex-direction: column; gap: var(--pad-gap-keys); }
.key.display { justify-content: space-between; min-width: 0; }
.key.display .engraved { flex: 1; text-align: left; }
.key.display .pane { padding: var(--vfd-screen-pad-y) var(--vfd-screen-pad-x); box-shadow: var(--shadow-screen-recess-sm); flex: none; }
/* The suggested key is the same part as a list row, on a taller keycap. Its label and
   its pane keep the row's dimensions so all four glasses stand in ONE column (the
   glasses form the grid) — a bigger label here pushed the pane past the key's own
   right padding, because the label's word width cannot shrink. */
.key.display.primary { padding-block: calc(var(--pad-pad-key) + var(--space-3)); }
.strip .key.display.primary { margin-top: var(--space-1); }
.strip .fine { margin-top: var(--space-1); }

.foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.foot .fine { flex: 1; }

vfd-text { display: block; }

/* ── The admin panel ─────────────────────────────────────────────────────────
   The same materials, one module per job. Nothing here re-mocks a surface: the
   registry is paper, counts are glass, actions are keys. */
.device.wide { max-width: 720px; }

/* Intake: a form of typed fields and the key that sends them. */
.intake { display: flex; flex-direction: column; gap: var(--space-2); }

/* The typed field: the game's VfdInput, "VFD on a button" (vfd-input.js). A key one
   frame wide (VFD_FRAME) around a glass; it stays pressed in while you type, and the
   text is VFD dots. The input underneath is invisible once the dots are up; without
   the script it shows as plain phosphor text. */
.key.field {
  padding: var(--vfd-frame); cursor: text;
  -webkit-user-select: auto; user-select: auto;   /* iOS will not type into a no-select key */
}
.key.field:focus-within { transform: translateY(3px); box-shadow: var(--shadow-key-flush); }
.key.field .pane { display: block; flex: 1; min-width: 0; position: relative; padding: var(--vfd-screen-pad-y) var(--vfd-screen-pad-x); }
.key.field input {
  display: block; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: transparent;
  -webkit-user-select: text; user-select: text;
  color: var(--color-phosphor-teal); caret-color: var(--color-phosphor-teal);
  font-family: var(--font-mono); font-size: var(--size-body-lg);   /* 16px or more: iOS does not zoom */
}
.key.field input::placeholder { color: var(--color-phosphor-dim); opacity: 1; }
.key.field vfd-text { position: absolute; left: var(--vfd-screen-pad-x); top: var(--vfd-screen-pad-y); pointer-events: none; }
.key.field .caret { position: absolute; left: 0; top: 0; pointer-events: none; }
.dotted input { color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; }
.dotted input::placeholder { color: transparent; }
.dotted input::selection { background: color-mix(in srgb, var(--color-teal-500) 25%, transparent); }
/* Autofill paints its own field: keep it clear, and tell the script it filled. */
.dotted input:-webkit-autofill { -webkit-text-fill-color: transparent; transition: background-color 600000s 0s; animation-name: vfd-autofill; }
@keyframes vfd-autofill { from {} to {} }

/* Paper-under-plastic: a tractor-feed sheet, sprocket holes down both edges, and the
   ledger's greenbar banding so the print system and the app agree with each other. */
.registry {
  list-style: none; margin: 0; padding: var(--space-2) 28px;
  position: relative;
  background: var(--color-paper-100); color: var(--color-ink-700);
  border-radius: var(--radius-xs); box-shadow: var(--shadow-card);
  font-family: var(--font-mono); font-size: var(--size-caption);
  overflow: hidden;
}
.registry::before, .registry::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 16px; pointer-events: none;
  background-image: radial-gradient(circle at 8px 8px,
                    var(--color-paper-300) 2.5px, transparent 3px);
  background-size: 16px 20px;
}
.registry::before { left: 0; }
.registry::after { right: 0; }
.registry > li {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-1);
}
.registry > li:nth-child(even) { background: rgba(52, 196, 184, 0.07); }
/* The address on its own line with its annotation beneath: a register line, and the
   only way a long address stops being broken across three lines. */
.registry .entry { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.registry .who { overflow-wrap: break-word; }
.registry .stamp { color: var(--color-ink-500); font-size: var(--size-micro); }
.registry .pane { flex: none; padding: var(--vfd-screen-pad-y) var(--vfd-screen-pad-x); box-shadow: var(--shadow-screen-recess-sm); }
.record.gone .who { color: var(--color-ink-500); text-decoration: line-through; }
.record.gone .stamp { color: var(--color-ink-500); }
.rowkeys { display: flex; gap: var(--space-2); flex: none; }
.rowkeys form { margin: 0; }
.log > li { gap: var(--space-4); }
.log .when { flex: none; color: var(--color-ink-500); }
.log .who { flex: 1; min-width: 0; overflow-wrap: break-word; }
.log .what { flex: none; }

.key.red { background: var(--gradient-key-face-red); }
.key.red .engraved { color: var(--color-paper-100); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.alert { color: var(--color-red-600); }

/* ── /join, the sign-up page ─────────────────────────────────────────────────
   The phone choice is a pair of LATCHING keys: the chosen one stays down, the way
   .pressed holds any key down. The radio itself is hidden; the key is its label. */
/* The form holds whole strips, so it spaces them as the device does. */
.intake.signup { gap: var(--space-6); }
.keys.pair { flex-direction: row; }
.keys.pair .key { flex: 1; }
.key.latch { position: relative; }
.key.latch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.key.latch:has(input:checked) { transform: translateY(3px); box-shadow: var(--shadow-key-flush); }
.key.latch:has(input:focus-visible) { outline: 2px solid var(--color-teal-500); outline-offset: 2px; }
/* Each hint speaks for one phone; with neither picked, both show. */
.intake:has(input[value="ios"]:checked) .hint[data-for="android"],
.intake:has(input[value="android"]:checked) .hint[data-for="ios"] { display: none; }
/* Turnstile shows only when it needs a click (data-appearance="interaction-only"); the rest
   of the time its box is empty, and its half-gap margins cancel the strip gap it adds. */
.cf-turnstile { margin-block: calc(-1 * var(--space-6) / 2); }
.steps {
  margin: 0; padding-left: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-1);
  font-size: var(--size-caption); color: var(--color-ink-700); line-height: var(--leading-snug);
}

@media (max-width: 560px) {
  .registry > li { flex-wrap: wrap; }
  .registry .entry { flex-basis: 100%; }
  .log > li { gap: var(--space-2); }
  .log .who { flex: 1 1 100%; order: 3; }
}
