:root {
  --bg: #000;
  --fg: #e8e8e8;
  --dim: #6f6f6f;
  --line: #2a2a2a;
  --hi: #fff;
  --warn: #d9b45a;
  --ok: #8fd6a0;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 14px/1.7 var(--mono); -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
  background-attachment: fixed;
}
body::before { content: ""; position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 0%, transparent 0%, #000 75%); opacity: .9; pointer-events: none; z-index: 0; }
#hex { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .16; z-index: 0; pointer-events: none; }
.scan { position: fixed; inset: 0; pointer-events: none; z-index: 5; background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px); }
a { color: var(--hi); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: normal; color: var(--hi); border-bottom: 1px solid var(--hi); }
.dim { color: var(--dim); }
.ok { color: var(--ok); } .warn { color: var(--warn); }

.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.85); backdrop-filter: blur(6px);
  font-size: 12px;
}
.bar-l { color: var(--dim); white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hi); margin-right: 6px; animation: blink 1.4s steps(2) infinite; }
.bar nav { display: flex; gap: 16px; margin-left: auto; }
.bar nav a { color: var(--dim); }
.bar nav a:hover { color: var(--hi); text-decoration: none; }

main { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }

.hero { padding: 40px 0 24px; }
.boot { margin: 0 0 28px; min-height: 8.5em; color: var(--dim); font-size: 12px; white-space: pre-wrap; }
.boot b { color: var(--fg); font-weight: 400; }
.hero-grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: center; }
.keyhole img { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 14px; filter: contrast(1.1); }
.addr-label { margin: 0; color: var(--dim); font-size: 12px; }
h1 { margin: 4px 0 8px; font-size: clamp(40px, 9vw, 84px); line-height: 1; letter-spacing: .04em; font-weight: 700; color: var(--hi); position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden; opacity: .7; }
.glitch::before { animation: g1 3.2s infinite steps(1); color: #bbb; }
.glitch::after { animation: g2 2.6s infinite steps(1); color: #777; }
.tag { font-size: 17px; margin: 0 0 22px; }
.ca { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.ca-k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; }
.ca-v { all: unset; cursor: pointer; font: inherit; font-size: 13px; padding: 9px 12px; border: 1px dashed #444; border-radius: 8px; word-break: break-all; }
.ca-v:hover, .ca-v:focus-visible { border-color: var(--hi); color: var(--hi); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; padding: 10px 16px; border: 1px solid var(--hi); border-radius: 8px; background: var(--hi); color: #000; font-weight: 500; }
.btn:hover { background: #000; color: var(--hi); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--hi); border-color: #555; }
.btn.ghost:hover { border-color: var(--hi); }
.btn.sm { padding: 4px 12px; font-size: 12px; }

.box { border: 1px solid #cfcfcf; border-radius: 14px; margin: 28px 0; background: rgba(0,0,0,.82); overflow: hidden; }
.box-h { padding: 10px 16px; font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--line); }
.box-b { padding: 20px 16px; margin: 0; }
.prose p { margin: 0 0 14px; font-size: 16px; max-width: 64ch; }
.prose.small p { font-size: 13.5px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--hi); }
.code { font: inherit; font-size: 13.5px; overflow-x: auto; color: var(--fg); }
.code .k { color: var(--dim); } .code .s { color: var(--hi); }

.flow { display: grid; grid-template-columns: 1fr auto 1.3fr auto 1fr; gap: 0; align-items: center; }
.cell { border: 1px solid #8a8a8a; border-radius: 12px; min-height: 170px; padding: 10px 12px; font-size: 12px; }
.cell.lit { border-color: var(--hi); box-shadow: 0 0 24px rgba(255,255,255,.08); }
.cell-h { color: var(--dim); margin-bottom: 10px; }
.cell-b { line-height: 1.9; letter-spacing: .04em; word-break: break-word; }
.arrow { position: relative; min-width: 120px; padding: 0 8px; font-size: 10.5px; color: var(--dim); line-height: 1.5; text-align: left; }
.arrow span { display: block; padding: 0 6px 34px; }
.arrow::after { content: ""; position: absolute; left: 0; right: 6px; top: 62%; border-top: 1px solid var(--fg); }
.arrow::before { content: ""; position: absolute; right: 0; top: calc(62% - 4px); border: 4.5px solid transparent; border-left: 7px solid var(--fg); }
.note { color: var(--dim); font-size: 12.5px; margin: 18px 0 0; max-width: 78ch; }

.kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv td { padding: 8px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.kv tr:last-child td { border-bottom: 0; }
.kv td:first-child { color: var(--dim); width: 130px; }

.term { min-height: 260px; max-height: 420px; overflow-y: auto; font-size: 13px; cursor: text; }
#out div { white-space: pre-wrap; word-break: break-word; }
#out .cmd { color: var(--hi); }
#f { display: flex; gap: 8px; align-items: baseline; }
#f label { color: var(--dim); white-space: nowrap; }
#in { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--hi); font: inherit; caret-color: var(--hi); }

footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 24px 16px 40px; text-align: center; font-size: 12px; }
.links { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
[data-off] { opacity: .35; pointer-events: none; }

@keyframes blink { 50% { opacity: .2; } }
@keyframes g1 { 0%,91%,100% { clip-path: inset(0 0 100% 0); transform: none; } 92% { clip-path: inset(12% 0 60% 0); transform: translate(-3px,0); } 95% { clip-path: inset(62% 0 10% 0); transform: translate(3px,0); } }
@keyframes g2 { 0%,86%,100% { clip-path: inset(0 0 100% 0); transform: none; } 87% { clip-path: inset(40% 0 38% 0); transform: translate(4px,0); } 90% { clip-path: inset(80% 0 4% 0); transform: translate(-2px,0); } }

@media (max-width: 760px) {
  .bar nav { display: none; } .bar .btn { margin-left: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .keyhole { max-width: 200px; }
  .flow { grid-template-columns: 1fr; }
  .cell { min-height: 0; }
  .arrow { min-width: 0; padding: 10px 0 10px 28px; }
  .arrow span { padding: 0; }
  .arrow::after { left: 12px; right: auto; top: 0; bottom: 6px; border-top: 0; border-left: 1px solid var(--fg); }
  .arrow::before { right: auto; left: 7.5px; top: auto; bottom: 0; border: 4.5px solid transparent; border-top: 7px solid var(--fg); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } html { scroll-behavior: auto; } }

/* overflow guards for narrow screens */
.flow > *, .hero-grid > * { min-width: 0; }
.boot { overflow-wrap: anywhere; }
