:root {
  --bg: #050805;
  --bg-2: #070c07;
  --panel: #0a110a;
  --ink: #d6e2d6;            /* prose */
  --ink-dim: #8fa38f;        /* secondary prose */
  --fg: #3ef573;             /* terminal green: terminal, links, controls */
  --dim: rgba(62, 245, 115, .58);
  --faint: rgba(62, 245, 115, .28);
  --line: rgba(62, 245, 115, .18);
  --flame: #ffaf32;
  --alert: #ff5940;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1080px;
  --measure: 62ch;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,.12) 2px 3px);
}
a { color: var(--fg); text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover, a:focus-visible { text-decoration-color: var(--fg); }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }
code, .mono, .mono-strong { font-family: var(--mono); }
.mono-strong { font-weight: 600; color: var(--fg); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 5;
  background: rgba(5, 8, 5, .86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 28px; height: 28px; }
.brand span { font-family: var(--mono); color: var(--flame); font-weight: 600; letter-spacing: 3px; font-size: 15px; }
.nav a.item { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); text-decoration: none; }
.nav a.item:hover, .nav a.item:focus-visible { color: var(--fg); }
.nav a.item.cta { color: var(--fg); border: 1px solid var(--faint); border-radius: 2px; padding: 6px 12px; }
.nav a.item.cta:hover { background: var(--fg); color: var(--bg); }
@media (max-width: 700px) { .nav a.item:not(.cta) { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.hero h1 {
  font-family: var(--mono); color: var(--ink); font-weight: 600;
  font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.5px; text-wrap: balance;
  margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--fg); }
.hero .lede { color: var(--ink-dim); font-size: 18px; max-width: 46ch; margin-bottom: 26px; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.motto {
  margin-top: 26px; font-family: var(--mono);
  color: var(--flame); font-weight: 600; letter-spacing: 3px; font-size: 12px;
  text-shadow: 0 0 16px rgba(255, 175, 50, .3);
}
@media (max-width: 860px) {
  .hero { padding: 44px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
}

/* the live terminal */
.term {
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  font-family: var(--mono); font-size: 14px; color: var(--fg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 60px -30px rgba(62, 245, 115, .25);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; color: var(--dim); font-size: 12px; border-bottom: 1px solid var(--line);
}
.term-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 8px var(--fg); }
.term-log { padding: 12px 14px 4px; min-height: 150px; }
.row { display: flex; gap: 8px; align-items: baseline; margin-bottom: 7px; padding: 1px 0; }
.row .time { color: var(--faint); font-size: 12px; flex-shrink: 0; }
.row .who  { color: var(--flame); font-weight: 600; flex-shrink: 0; }
.row .txt  { min-width: 0; overflow-wrap: anywhere; }
.row .st   { margin-left: auto; color: var(--dim); font-size: 10px; flex-shrink: 0; letter-spacing: 1px; }
.row.sys   { color: var(--dim); font-size: 12px; }
.row.burning { opacity: .25; transition: opacity .6s ease; }
.term-prompt { padding: 6px 14px 12px; font-weight: 600; }
.cursor { display: inline-block; width: 9px; height: 15px; background: var(--fg); vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- buttons ---------- */
.btn, button.btn {
  display: inline-block; font-family: var(--mono); font-weight: 600; font-size: 14px; letter-spacing: 1px;
  border: 1px solid var(--fg); border-radius: 2px; color: var(--fg); background: none;
  padding: 11px 18px; cursor: pointer; text-decoration: none; line-height: 1.2;
}
.btn:hover, .btn:focus-visible { background: var(--fg); color: var(--bg); }
.btn.flame { border-color: var(--flame); color: var(--flame); }
.btn.flame:hover, .btn.flame:focus-visible { background: var(--flame); color: var(--bg); }
.btn.quiet { border-color: var(--faint); color: var(--ink); }
.btn.quiet:hover { border-color: var(--fg); color: var(--fg); background: none; }

/* ---------- sections ---------- */
section.block { padding: 56px 0; border-top: 1px solid var(--line); }
section.block h2 {
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--dim);
  margin-bottom: 8px;
}
section.block .title {
  font-size: clamp(24px, 2.6vw, 30px); font-weight: 600; line-height: 1.2; letter-spacing: -0.3px;
  color: var(--ink); margin-bottom: 26px; max-width: 30ch; text-wrap: balance;
}
p { margin-bottom: 14px; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 24px; } section.block { padding: 40px 0; } }

/* three facts strip */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div { padding: 22px 24px 22px 0; }
.facts > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
.facts .k { font-family: var(--mono); color: var(--fg); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.facts .v { color: var(--ink-dim); font-size: 15px; }
@media (max-width: 700px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
}

/* who knows what */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); color: var(--dim); font-weight: 500; font-size: 12px; letter-spacing: 1px; }
td:first-child { font-family: var(--mono); color: var(--flame); font-weight: 600; width: 20%; white-space: nowrap; }
th:nth-child(2), td:nth-child(2) { width: 38%; }
td:last-child { color: var(--ink-dim); }

/* features */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; row-gap: 22px; }
.features > div { border-top: 1px solid var(--line); padding-top: 12px; }
.features dt { font-family: var(--mono); color: var(--fg); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.features dd { color: var(--ink-dim); font-size: 15px; }
@media (max-width: 700px) { .features { grid-template-columns: 1fr; row-gap: 16px; } }

/* desktop link */
.shot { margin: 0; }
.shot img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 4px; }
.shot figcaption { font-family: var(--mono); color: var(--dim); font-size: 12px; margin-top: 8px; }
.steps { margin: 0 0 18px; counter-reset: s; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 14px; margin-bottom: 12px; color: var(--ink); }
.steps li::before { content: counter(s); font-family: var(--mono); color: var(--flame); font-weight: 600; flex-shrink: 0; width: 1.4em; }

/* access */
.price-card { border: 1px solid var(--line); border-radius: 4px; background: var(--panel); padding: 28px; }
.price { font-family: var(--mono); display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.price .num { color: var(--flame); font-size: 40px; font-weight: 600; line-height: 1; }
.price .per { color: var(--dim); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 12px; }
.status { font-family: var(--mono); color: var(--dim); font-size: 13px; min-height: 1.4em; }
.fine { color: var(--ink-dim); font-size: 14px; }

/* get the app */
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.apps > div { border: 1px solid var(--line); border-radius: 4px; padding: 24px; }
.apps h3 { font-family: var(--mono); color: var(--fg); font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.apps p { color: var(--ink-dim); font-size: 15px; }
.apps .btn { margin-top: 14px; }
@media (max-width: 700px) { .apps { grid-template-columns: 1fr; } }

/* footer */
footer { border-top: 1px solid var(--line); padding: 26px 0 48px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; font-family: var(--mono); font-size: 12px; color: var(--dim); }
footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--fg); }
footer .spacer { flex: 1; }

/* ---------- inner pages (privacy, terms, android, success) ---------- */
main.legal { padding: 48px 0 64px; }
main.legal .wrap { max-width: 760px; }
.masthead { margin-bottom: 28px; }
.masthead h1 { font-family: var(--mono); color: var(--ink); font-size: 30px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.15; margin-bottom: 6px; }
.masthead .flame { display: none; }
.tagline { color: var(--ink-dim); font-size: 16px; }
.legal h2 { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--dim); margin: 30px 0 10px; }
.legal ul { margin-left: 20px; }
.legal li { margin-bottom: 8px; color: var(--ink-dim); }
.legal li b { color: var(--ink); font-weight: 500; }
.legal footer { margin-top: 48px; padding-inline: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 20px; margin-bottom: 20px; }
.code-display { font-family: var(--mono); font-size: 20px; letter-spacing: 2px; padding: 20px; margin: 16px 0; border: 1px dashed var(--fg); text-align: center; user-select: all; color: var(--fg); }
.code-display.ready { cursor: pointer; }
.code-display.ready:active { background: rgba(64,255,115,.08); }
.hint { color: var(--dim); font-size: 13px; text-align: center; margin: -8px 0 12px; }
.code-display.gone { font-size: 15px; letter-spacing: 0; color: var(--dim); border-color: var(--dim); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--dim); text-decoration: underline; cursor: pointer; }
.linkbtn:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.warn { color: var(--alert); font-size: 14px; }

/* success page: the access key as a QR of pyrochat://redeem/<CODE>, drawn in-page (no network).
   dark modules on a white tile so a phone camera reads it against the black page */
.qr { display: none; flex-direction: column; align-items: center; margin: 4px 0 14px; }
.qr:not([hidden]) { display: flex; }
.qr .tile { position: relative; z-index: 1; /* above the body::after scanlines: a clean tile for the camera */
  background: #fff; padding: 12px; border-radius: 4px; width: 224px; height: 224px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.qr .tile svg { display: block; width: 200px; height: 200px; }
.qr figcaption { font-family: var(--mono); color: var(--dim); font-size: 13px; text-align: center; margin-top: 10px; }
/* [ OPEN IN PYROCHAT ]: only where the app can be installed — phones (coarse pointer) or narrow screens */
.openrow { display: none; text-align: center; margin: 0 0 16px; }
@media (pointer: coarse), (max-width: 700px) { .openrow:not([hidden]) { display: block; } }
.openrow .btn { width: 100%; max-width: 360px; text-align: center; }
pre.hash {
  font-family: var(--mono); border: 1px solid var(--line); background: var(--panel); padding: 10px 12px; margin: 6px 0 14px;
  font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--dim);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .row.burning { transition: none; }
}

/* phone screenshots */
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.shots figure { margin: 0; }
.shots img { width: 100%; height: auto; display: block; border-radius: 22px; border: 1px solid var(--line); background: #000; }
.shots figcaption { font-family: var(--mono); color: var(--dim); font-size: 12px; margin-top: 10px; }
@media (max-width: 900px) { .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* who-knows-what table: stacked rows on phones */
@media (max-width: 700px) {
  table thead { display: none; }
  table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  table td { display: block; border: 0; padding: 2px 0; width: auto !important; white-space: normal !important; }
  table td:first-child { margin-bottom: 4px; }
  table td:nth-child(2)::before, table td:last-child::before {
    font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--dim); display: block; margin-top: 6px;
  }
  table td:nth-child(2)::before { content: "knows"; }
  table td:last-child::before { content: "can never know"; }
}
main.legal footer { display: flex; flex-wrap: wrap; gap: 20px; font-family: var(--mono); font-size: 12px; color: var(--dim); }
main.legal footer a { color: var(--dim); text-decoration: none; }
main.legal footer a:hover { color: var(--fg); }

/* ---------- pay.html: crypto checkout inside the site (NOWPayments stays behind /api/crypto) ---------- */
.pay .masthead h1 { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: 2px; color: var(--fg); }
.pay .plan { font-family: var(--mono); font-size: 15px; color: var(--ink-dim); min-height: 1.6em; }
.pay .plan b { color: var(--flame); font-weight: 600; }
.pay .label { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--dim); margin: 0 0 6px; }
/* the coin picker: `coin:` + a combobox field, the selected coin beside it, a dropdown of ≤ 8 rows.
   Logos are small and sit on the phosphor palette as they are (no tinting): 20 px in rows, 28 px beside the field */
.picker { position: relative; }
.pickrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.pickrow .label { margin: 0; font-size: 14px; color: var(--fg); }
.search {
  flex: 1 1 200px; min-width: 0; font-family: var(--mono); font-size: 16px; padding: 10px 12px; margin: 0;
  background: var(--bg); color: var(--fg); border: 1px solid var(--faint); border-radius: 2px; -webkit-appearance: none; appearance: none;
}
.search::placeholder { color: var(--dim); }
.search:focus { border-color: var(--fg); outline: none; }
.search:disabled { opacity: .5; }
/* phones: `coin:` and the selected coin share the first line, the field takes the whole second one
   (the placeholder needs ~26 characters of 16 px mono — more than a field next to the label can give) */
@media (max-width: 520px) {
  .selected { order: 1; }
  .search { order: 2; flex-basis: 100%; }
}
.selected {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
  font-family: var(--mono); font-size: 14px; line-height: 1.45; color: var(--ink-dim); min-height: 28px;
}
.selected:empty { display: none; }
.selected .txt, .opt .txt { min-width: 0; overflow-wrap: anywhere; }
.selected .name, .opt .name { white-space: nowrap; }          /* wrap between the parts, never inside a name */
.selected .code, .opt .code { color: var(--fg); font-weight: 600; letter-spacing: 1px; }
.selected .name, .opt .name { color: var(--ink); }
.selected .net, .opt .net { color: var(--dim); }
.logo { display: inline-block; flex-shrink: 0; border-radius: 50%; vertical-align: middle; }
.selected .logo { width: 28px; height: 28px; }
.opt .logo { width: 20px; height: 20px; }
/* the placeholder glyph when a coin has no logo (or it failed to load): same footprint as the image */
.logo.ph { display: inline-flex; align-items: center; justify-content: center; color: var(--dim); font-size: 20px; line-height: 1; border-radius: 0; }
.opt .logo.ph { font-size: 15px; }
.listbox {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 3;
  background: var(--panel); border: 1px solid var(--fg); border-radius: 2px; padding: 4px; max-height: 60vh; overflow-y: auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 18px 40px -16px rgba(62, 245, 115, .3);
}
.listbox[hidden] { display: none; }
button.opt {
  font: inherit; font-family: var(--mono); font-size: 14px; line-height: 1.45; display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 8px 10px; background: none; border: 0; border-radius: 2px; color: var(--ink-dim); cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
button.opt .logo { margin-top: 0; }                            /* 20 px logo on a 20 px first line */
button.opt.active, button.opt:hover { background: rgba(62, 245, 115, .1); color: var(--ink); }
button.opt[aria-selected="true"] .code::after { content: " ✓"; color: var(--dim); font-weight: 400; }
.nomatch { font-family: var(--mono); color: var(--dim); font-size: 13px; margin: 10px 0 0; }
.payrow { margin: 18px 0 0; text-align: center; }
/* while the dropdown is open it overlays the pay row: hide what it half-covers (a short list would show the button's bottom edge) */
#step1.listopen .payrow, #step1.listopen .status { visibility: hidden; }
.payrow .btn { width: 100%; max-width: 360px; text-align: center; }
.payrow .btn:disabled { opacity: .45; cursor: default; background: none; color: var(--fg); }
.pay .status { text-align: center; color: var(--fg); font-size: 14px; margin: 14px 0 0; }
.pay .status:empty { margin: 0; min-height: 0; }
.pay .status.alert { color: var(--alert); }
.code-display.amount { font-size: 26px; letter-spacing: 0; padding: 18px 16px; margin: 0 0 8px; overflow-wrap: anywhere; }
.code-display.addr { font-size: 14px; letter-spacing: 0; padding: 14px 16px; margin: 0 0 16px; word-break: break-all; line-height: 1.5; }
.pay .unit { font-family: var(--mono); font-size: 13px; color: var(--dim); text-align: center; margin: 0 0 18px; }
.pay .hint { margin: -8px 0 14px; }
.memo { font-family: var(--mono); font-size: 14px; text-align: center; line-height: 1.7; margin: 0 0 14px; }
.memo .tapcopy { font-weight: 600; letter-spacing: 1px; border-bottom: 1px dashed var(--alert); cursor: pointer; padding: 0 2px; user-select: all; }
.countdown { font-family: var(--mono); color: var(--flame); font-weight: 600; font-size: 15px; letter-spacing: 1px; text-align: center; margin: 0 0 4px; }
.pay #status { margin: 10px 0 0; }
.againrow { text-align: center; margin: 14px 0 0; }
.againrow .btn { width: 100%; max-width: 360px; text-align: center; }
.pay .fine { margin-top: 16px; }
