:root {
  color-scheme: dark;
  --bg: #050706;
  --box: #090d0b;
  --inset: #040605;
  --line: #1b2722;
  --line-hi: #2c4037;
  --fg: #b8c5be;
  --bright: #e8f0eb;
  --dim: #5d6d65;
  --accent: #6ef2a5;
  --accent-dim: #25553d;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", "DejaVu Sans Mono",
          Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  font: 400 0.95rem/1.65 var(--mono);
}

::selection { background: var(--accent); color: var(--bg); }

.top, .grid {
  width: calc(100% - 5rem);
  max-width: 77rem;
  margin: 0 auto;
}

p { margin: 0 0 1rem; }

/* header */
.top { padding-top: 4rem; padding-bottom: 3.25rem; }

h1 {
  margin: 0;
  color: var(--bright);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 22px rgba(110, 242, 165, 0.12);
}
h1::before { content: "$ "; color: var(--accent); font-weight: 400; }
h1::after {
  content: "_";
  margin-left: 0.06em;
  color: var(--accent);
  font-weight: 400;
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* layout: PGP on the left, everything else stacked on the right */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 2.25rem;
  align-items: stretch;
  padding-bottom: 4rem;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.stack .signal { flex: 1; }
.pgp { display: flex; flex-direction: column; }
.pgp textarea { flex: 1 0 auto; }

/* boxes: a 1px frame with the title cut into the top edge */
.box {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 2.1rem 1.9rem 1.75rem;
  background: var(--box);
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.box:hover, .box:focus-within { border-color: var(--line-hi); }
.box > :last-child { margin-bottom: 0; }

h2 {
  position: absolute;
  top: 0;
  left: 1.25rem;
  margin: 0;
  padding: 0 0.6rem;
  transform: translateY(-50%);
  background: linear-gradient(var(--bg) 50%, var(--box) 50%);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
h2::before { content: "[ "; color: var(--dim); font-weight: 400; }
h2::after { content: " ]"; color: var(--dim); font-weight: 400; }

.label {
  display: block;
  margin: 0 0 0.4rem;
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fpr {
  margin: 0 0 1.6rem;
  color: var(--bright);
  font-size: 1.02rem;
  letter-spacing: 0.05em;
  word-spacing: 0.1em;
}
.fpr span { display: inline-block; white-space: nowrap; margin-right: 1.5ch; }
.box > .fpr:last-child { margin-bottom: 0; }

.addr { margin-bottom: 0.6rem; font-size: 1.15rem; }
.note { color: var(--dim); font-size: 0.82rem; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
a:hover, a:focus-visible {
  border-bottom-color: var(--accent);
  background: rgba(110, 242, 165, 0.07);
}
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.actions { margin: 1.1rem 0 0; }
a.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
a.btn:hover, a.btn:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

textarea, .copy {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.95rem 1.1rem;
  background: var(--inset);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 0;
  font: 400 0.8rem/1.55 var(--mono);
  caret-color: var(--accent);
}
textarea {
  height: 25.5rem;
  min-height: 12rem;
  resize: vertical;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}
textarea:focus, .copy:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

/* signal */
.signal-body {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}
.qr {
  display: block;
  flex: none;
  width: 148px;
  height: 148px;
}
.signal-link { flex: 1 1 13rem; min-width: 0; }
.signal-link .actions { margin: 0 0 1.25rem; }

/* 404 */
.lost { flex: 1; }
.lost .note { margin: 0 0 1.5rem; font-size: 0.95rem; }

@media (max-width: 62rem) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 36rem) {
  .top, .grid { width: calc(100% - 2rem); }
  .grid { padding-bottom: 2.5rem; }
  .top { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .grid, .stack { gap: 2rem; }
  .box { padding: 1.9rem 1.15rem 1.4rem; }
  h2 { left: 0.75rem; }
  .fpr { font-size: 0.92rem; letter-spacing: 0; }
  .addr { font-size: 1.05rem; }
  textarea { height: 22rem; font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  h1::after { animation: none; }
  a, .box { transition: none; }
}
