:root {
  --bg0: #070907;
  --bg1: #0c120e;
  --green: #8eff5a;
  --green-dim: #5cb83a;
  --green-dark: #163516;
  --amber: #ffb000;
  --cream: #f3e6c4;
  --cream-dark: #c9b58a;
  --ink: #1a140c;
  --plastic: #161616;
  --plastic-hi: #2c2c2c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg0);
  color: #d7e6d0;
  font-family: "IBM Plex Mono", "Space Mono", monospace;
}

/* Scanline + grid backdrop */
.stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, #132016 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 80% 80%, #10180f 0%, transparent 50%),
    var(--bg0);
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(80, 160, 80, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 160, 80, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.08) 0,
    rgba(0, 0, 0, 0.08) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.content {
  position: relative;
  z-index: 1;
/* Site header */
.site-header {
  text-align: center;
  padding: 22px 24px 4px;
}
.kicker {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  letter-spacing: 0.38em;
  color: var(--green-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}
h1.title {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 64px;
  letter-spacing: 0.18em;
  color: var(--green);
  text-shadow:
    0 0 18px rgba(142, 255, 90, 0.45),
    0 0 40px rgba(142, 255, 90, 0.15);
  line-height: 1;
}
.tagline {
  margin-top: 10px;
  font-size: 15px;
  color: #a8bba8;
  letter-spacing: 0.04em;
}
.ticker {
  margin: 16px auto 0;
  display: inline-flex;
  gap: 22px;
  padding: 6px 16px;
  border: 1px solid #1e2a1e;
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #7d9278;
  text-transform: uppercase;
}
.ticker b { color: var(--green); font-weight: 600; }

/* Layout */
.layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 48px;
  padding: 22px 48px 18px;
}

/* Pager device */
.terminal {
  width: 460px;
  flex: 0 0 460px;
}
.pager {
  background:
    linear-gradient(180deg, #2a2a2a 0%, #141414 18%, #0e0e0e 100%);
  border-radius: 28px 28px 18px 18px;
  padding: 16px 18px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -8px 16px rgba(0,0,0,0.55),
    0 18px 0 #050505,
    0 28px 40px rgba(0,0,0,0.55);
  position: relative;
}
.pager::before {
  /* side bevel */
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 22px 22px 12px 12px;
  border: 1px solid rgba(255,255,255,0.04);
  pointer-events: none;
}
.pager-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 10px;
}
.brand {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #8a8a8a;
}
.model {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #555;
  font-family: "IBM Plex Mono", monospace;
}
.led-wrap { display: flex; align-items: center; gap: 6px; }
.led {
  width: 9px; height: 9px; border-radius: 50%;
  background: #1a3a10;
  box-shadow: inset 0 1px 2px #000;
}
.led.on {
  background: #7CFF4C;
  box-shadow: 0 0 8px #7CFF4C, 0 0 14px rgba(124,255,76,0.6);
}
.led-label { font-size: 8px; letter-spacing: 0.14em; color: #666; }

.lcd-bezel {
  background: linear-gradient(180deg, #0a0a0a, #2a2a2a);
  border-radius: 8px;
  padding: 10px 10px 12px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.9),
    0 1px 0 rgba(255,255,255,0.08);
}
.lcd {
  position: relative;
  background:
    linear-gradient(180deg, #1a3d1a 0%, #0c240c 40%, #0a1c0a 100%);
  border-radius: 4px;
  min-height: 120px;
  padding: 8px 14px 10px;
  overflow: hidden;
  box-shadow:
    inset 0 0 24px rgba(80, 255, 80, 0.12),
    inset 0 6px 14px rgba(0,0,0,0.45);
}
.lcd::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.18) 0px,
      rgba(0,0,0,0.18) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(180deg, rgba(255,255,255,0.07), transparent 40%);
}
.lcd-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "VT323", monospace;
  font-size: 20px;
  color: var(--green);
  text-shadow: 0 0 6px rgba(142,255,90,0.6);
  opacity: 0.85;
  letter-spacing: 0.08em;
}
.signal { letter-spacing: 0.02em; }
.lcd-digits {
  font-family: "VT323", monospace;
  font-size: 54px;
  line-height: 1;
  color: var(--green);
  text-shadow: 0 0 10px rgba(142,255,90,0.7), 0 0 24px rgba(142,255,90,0.25);
  letter-spacing: 0.04em;
  margin-top: 6px;
  text-align: center;
}
.lcd-digits.sent {
  font-size: 54px;
  letter-spacing: 0.12em;
}
.lcd-digits.alert {
  font-size: 46px;
  letter-spacing: 0.1em;
}
.lcd-caption {
  font-family: "VT323", monospace;
  font-size: 22px;
  color: var(--green);
  opacity: 0.75;
  text-align: center;
  letter-spacing: 0.16em;
  margin-top: 2px;
  text-shadow: 0 0 6px rgba(142,255,90,0.4);
}
.grill {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
  margin-bottom: 2px;
}
.grill span {
  width: 28px; height: 4px; border-radius: 2px;
  background: #0a0a0a;
  box-shadow: inset 0 1px 1px #000, 0 1px 0 rgba(255,255,255,0.06);
}

/* Keypad housing */
.keypad-housing {
  margin-top: 16px;
  background:
    linear-gradient(180deg, #222 0%, #141414 30%, #101010 100%);
  border-radius: 18px;
  padding: 18px 22px 20px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 14px 0 #050505,
    0 22px 32px rgba(0,0,0,0.5);
}
.keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}
.key {
  height: 56px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #3c3c3c 0%, #232323 55%, #1a1a1a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -3px 4px rgba(0,0,0,0.5),
    0 5px 0 #080808,
    0 7px 10px rgba(0,0,0,0.4);
  color: #f0f0f0;
  font-family: "Orbitron", sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.key.star, .key.hash { color: #bbb; font-size: 26px; }
.key.active {
  background: linear-gradient(180deg, #2a2a2a, #151515);
  box-shadow:
    inset 0 3px 6px rgba(0,0,0,0.7),
    0 2px 0 #080808;
  transform: translateY(3px);
  color: var(--green);
}
.page-btn {
  margin-top: 16px;
  width: 100%;
  height: 62px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ff6a58 0%, #e1221c 45%, #a50d0d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -4px 6px rgba(0,0,0,0.3),
    0 6px 0 #5a0707,
    0 10px 16px rgba(180, 0, 0, 0.35);
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.28em;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-btn.sent {
  background: linear-gradient(180deg, #6adf4a 0%, #2e9a22 50%, #176814 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 6px 0 #0b3a0a,
    0 10px 16px rgba(40, 140, 20, 0.3);
  letter-spacing: 0.2em;
}
.page-btn.locked {
  background: linear-gradient(180deg, #555, #2a2a2a);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 5px 0 #111;
  color: #999;
  letter-spacing: 0.12em;
  font-size: 16px;
}

.quick-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}
.chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--green);
  border: 1px solid #2a4a2a;
  background: rgba(20, 40, 20, 0.6);
  border-radius: 999px;
  padding: 4px 10px;
}
.chip b { color: #c8ffb0; }

.captcha {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0e120e;
  border: 1px solid #2a332a;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #c5d0c5;
}
.box {
  width: 18px; height: 18px;
  border: 2px solid #4a5a4a;
  border-radius: 3px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a7a2a;
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 18px;
}
.captcha .brand-mini {
  margin-left: auto;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #6a7a6a;
  text-align: right;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Cheat sheet */
.card-wrap {
  width: 320px;
  flex: 0 0 320px;
  padding-top: 8px;
}
.cheatsheet {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(140, 110, 60, 0.08) 28px
    ),
    linear-gradient(180deg, #f7edd4, #ead9b0);
  color: var(--ink);
  border-radius: 4px;
  padding: 0 0 16px;
  transform: rotate(1.2deg);
  box-shadow:
    0 1px 0 #fff8e6 inset,
    0 18px 28px rgba(0,0,0,0.45),
    0 0 0 1px #cbb88a;
  position: relative;
}
.cheatsheet::before {
  /* tape */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 86px;
  height: 22px;
  background: rgba(232, 220, 170, 0.7);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.sheet-banner {
  background: #b42318;
  color: #fff8e0;
  text-align: center;
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
  padding: 10px 8px 8px;
  text-transform: uppercase;
}
.sheet-sub {
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6a5130;
  padding: 8px 12px 4px;
}
.codes { padding: 4px 16px 0; }
.code-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed #c9b58a;
  font-size: 14px;
}
.code-row .num {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #8b1510;
}
.code-row .meaning {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: #2a2114;
  text-align: right;
}
.sheet-foot {
  text-align: center;
  font-size: 10px;
  color: #6a5130;
  letter-spacing: 0.08em;
  margin-top: 12px;
  padding: 0 16px;
  line-height: 1.4;
}

.notes {
  margin-top: 22px;
  transform: rotate(-0.4deg);
  font-size: 11px;
  line-height: 1.55;
  color: #8a9a88;
  padding: 0 8px;
}
.notes li { margin: 0 0 6px 16px; }

.site-footer {
  text-align: center;
  padding: 2px 24px 18px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #6a7a68;
}
.site-footer span { color: #8eaa88; }


/* ===== Live page additions ===== */
html, body { min-height: 100%; }
body { overflow-x: hidden; }
.stage { min-height: 100vh; padding: 12px 0 24px; }
.content { max-width: 1100px; margin: 0 auto; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.key { width: 100%; user-select: none; transition: transform 60ms ease, box-shadow 60ms ease; }
.key:active, .key.active {
  background: linear-gradient(180deg, #2a2a2a, #151515);
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.7), 0 2px 0 #080808;
  transform: translateY(3px);
  color: var(--green);
}
.key small {
  position: absolute; bottom: 4px; left: 0; right: 0;
  font-family: "IBM Plex Mono", monospace; font-size: 8px; font-weight: 400;
  letter-spacing: 0.14em; color: #777;
}
.key:focus-visible, .page-btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.page-btn { transition: transform 60ms ease; }
.page-btn:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 2px 0 #5a0707; }
.page-btn:disabled { cursor: not-allowed; }
.page-btn.sending { filter: brightness(0.85); letter-spacing: 0.16em; }
button.chip { cursor: pointer; }
button.chip:hover { background: rgba(40, 80, 40, 0.7); }
.code-row { cursor: pointer; }
.code-row:hover .num { text-decoration: underline; }
.lcd-digits { min-height: 54px; white-space: nowrap; overflow: hidden; }
.lcd-digits.empty { opacity: 0.35; }
.lcd-digits.long { font-size: 40px; }
.lcd-digits .cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lcd.flash { animation: lcdflash 0.25s steps(1) 6; }
@keyframes lcdflash { 50% { filter: brightness(1.8); } }
.led.blink { animation: blink 0.4s steps(1) infinite; }
.led.red { background: #ff4b3a; box-shadow: 0 0 8px #ff4b3a, 0 0 14px rgba(255,75,58,0.6); }
.counter { font-family: "VT323", monospace; font-size: 18px; color: var(--green); opacity: 0.6; text-align: right; margin-top: -2px; }
.bot-check { margin-top: 14px; min-height: 0; display: flex; justify-content: center; }
.bot-check:empty { display: none; }
.status-line { margin-top: 12px; text-align: center; font-size: 11px; letter-spacing: 0.08em; color: #7d9278; min-height: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 900px) {
  .layout { flex-direction: column; align-items: center; gap: 36px; padding: 18px 14px; }
  .terminal { width: 100%; max-width: 440px; flex: none; }
  .card-wrap { width: 100%; max-width: 360px; flex: none; }
  h1.title { font-size: 44px; letter-spacing: 0.14em; }
  .ticker { gap: 12px; font-size: 10px; flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 420px) {
  .stage { padding-top: 4px; }
  .site-header { padding: 16px 12px 0; }
  .kicker { font-size: 9px; letter-spacing: 0.24em; }
  h1.title { font-size: 36px; }
  .tagline { font-size: 12px; }
  .pager { padding: 12px 12px 10px; }
  .lcd { min-height: 104px; padding: 6px 10px 8px; }
  .lcd-status { font-size: 16px; }
  .lcd-digits { font-size: 40px; min-height: 40px; }
  .lcd-digits.long, .lcd-digits.alert, .lcd-digits.sent { font-size: 32px; }
  .lcd-caption { font-size: 17px; }
  .keypad-housing { padding: 14px 14px 16px; }
  .keys { gap: 10px 12px; }
  .key { height: 50px; }
  .page-btn { height: 56px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .lcd.flash, .led.blink, .lcd-digits .cursor { animation: none; }
}
