/* KETNET: shared styles. Dark cryogenic-lab look: deep navy, neon cyan readout, violet for |0>. */
:root {
  --bg: #04060c;
  --bg2: #070b15;
  --card: #0a1020;
  --card2: #0d1428;
  --line: rgba(110, 190, 255, .11);
  --line2: rgba(110, 190, 255, .22);
  --ink: #e9f4ff;
  --mute: #8ea3bd;
  --faint: #53637b;
  --cy: #38e8ff;
  --cy2: #0fb8e0;
  --vi: #8f6bff;
  --lime: #b6ff4a;
  --amber: #ffbe4d;
  --red: #ff5a7a;
  --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --r: 14px;
  --wrap: 1180px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body::before { /* faint lab grid behind everything */
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; opacity: .35;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(56, 232, 255, .3); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.08; }
h1 { font-size: clamp(38px, 6.4vw, 78px); }
h2 { font-size: clamp(28px, 3.8vw, 46px); }
h3 { font-size: 19px; }
p { margin: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cy); }
.lede { color: var(--mute); font-size: 17px; max-width: 620px; }
.hint { color: var(--mute); font-size: 13px; margin-top: 8px; }
.muted { color: var(--mute); }
.addr { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---------- nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; transition: background .3s, border-color .3s, backdrop-filter .3s; border-bottom: 1px solid transparent; }
.nav.solid { background: rgba(4, 6, 12, .78); backdrop-filter: blur(14px); border-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; letter-spacing: .2em; font-size: 15px; }
.brand svg { width: 46px; height: 24px; flex: none; }
.nav-links { display: flex; gap: 22px; margin-left: 18px; font-size: 14px; color: var(--mute); }
.nav-links a:hover { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.ca-pill { display: none; align-items: center; gap: 8px; border: 1px solid var(--line2); background: rgba(56, 232, 255, .05); border-radius: 999px; padding: 6px 12px; font: 12px var(--mono); cursor: pointer; }
.ca-pill.on { display: inline-flex; }
.ca-pill b { color: var(--cy); font-weight: 600; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .02);
  border-radius: 10px; padding: 11px 18px; font-weight: 600; font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { border-color: rgba(56, 232, 255, .5); background: rgba(56, 232, 255, .06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn.pri { background: var(--cy); border-color: var(--cy); color: #031018; box-shadow: 0 0 0 0 rgba(56, 232, 255, .5), 0 8px 30px rgba(56, 232, 255, .22); }
.btn.pri:hover { background: #7ff1ff; box-shadow: 0 0 0 4px rgba(56, 232, 255, .15), 0 8px 34px rgba(56, 232, 255, .35); transform: translateY(-1px); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- sections */
.sec { padding: 120px 0; position: relative; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 48px; }
.sec-head h2 { margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.grid > * { min-width: 0; }
.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; position: relative; }
.card.glow:hover { border-color: rgba(56, 232, 255, .35); box-shadow: 0 0 0 1px rgba(56, 232, 255, .08), 0 18px 50px rgba(0, 0, 0, .45); }
.empty { text-align: center; color: var(--mute); padding: 46px 20px; }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 18px; margin-bottom: 6px; }

/* reveal on scroll */
.rv { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }
.rv.d1 { transition-delay: .08s; } .rv.d2 { transition-delay: .16s; } .rv.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- status dot */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); display: inline-block; animation: pulse 2s infinite; flex: none; }
.dot.off { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- bits matrix (16 x 16 readout) */
.bits { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.bits i { aspect-ratio: 1; border-radius: 2px; background: rgba(143, 107, 255, .16); border: 1px solid rgba(143, 107, 255, .14); }
.bits i.on { background: var(--cy); border-color: var(--cy); box-shadow: 0 0 8px rgba(56, 232, 255, .55); }
.bits i.nil { background: rgba(255, 255, 255, .03); border-color: var(--line); }
.bits.live i.nil { animation: flick 1.6s infinite; animation-delay: calc(var(--d) * 1ms); }
@keyframes flick { 0%, 100% { background: rgba(255, 255, 255, .03); } 50% { background: rgba(56, 232, 255, .25); } }

/* record lines (key / value) */
.rec { font-family: var(--mono); font-size: 12px; color: var(--mute); display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; margin-top: 14px; }
.rec b { color: var(--faint); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.rec span, .rec a { color: var(--ink); word-break: break-all; }
.rec a:hover { color: var(--cy); }

/* tags */
.tag { font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--mute); white-space: nowrap; }
.tag.live, .st.live { color: var(--lime); border-color: rgba(182, 255, 74, .4); background: rgba(182, 255, 74, .07); }
.tag.cy { color: var(--cy); border-color: rgba(56, 232, 255, .4); background: rgba(56, 232, 255, .06); }
.st { font: 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--mute); white-space: nowrap; }
.st.measuring, .st.running, .st.queued { color: var(--cy); border-color: rgba(56, 232, 255, .4); }
.st.measured, .st.launching, .st.paying { color: var(--vi); border-color: rgba(143, 107, 255, .5); }
.st.failed { color: var(--red); border-color: rgba(255, 90, 122, .4); }
.st.waiting { color: var(--amber); border-color: rgba(255, 190, 77, .4); }

/* meter */
.meter .row2 { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); }
.meter .row2 b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .05); overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--vi), var(--cy)); box-shadow: 0 0 12px rgba(56, 232, 255, .6); border-radius: 6px; transition: width .6s; }
.meter small { color: var(--faint); font: 11px var(--mono); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.chat:empty { display: none; }
.m { max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.m.u { align-self: flex-end; background: rgba(56, 232, 255, .1); border: 1px solid rgba(56, 232, 255, .25); }
.m.a { align-self: flex-start; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.m.a::before { content: 'agent'; display: block; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--cy); margin-bottom: 3px; }
.plan { font: 12px/1.7 var(--mono); color: var(--mute); border: 1px dashed rgba(56, 232, 255, .35); border-radius: 10px; padding: 9px 12px; background: rgba(56, 232, 255, .03); }
.plan b { color: var(--cy); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { border: 1px solid var(--line2); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 12px; color: var(--mute); cursor: pointer; transition: all .2s; }
.chip:hover { color: var(--ink); border-color: var(--cy); }
.lock { margin-top: 14px; font-size: 13px; color: var(--amber); border: 1px solid rgba(255, 190, 77, .25); background: rgba(255, 190, 77, .05); border-radius: 10px; padding: 10px 12px; }

/* forms */
.field label { display: block; font-size: 12px; color: var(--mute); margin-bottom: 6px; font-weight: 500; }
.field input, .field textarea, textarea.inp {
  width: 100%; background: rgba(0, 0, 0, .3); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 13px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.field textarea, textarea.inp { min-height: 84px; resize: vertical; }
.field input:focus, .field textarea:focus, textarea.inp:focus { border-color: var(--cy); box-shadow: 0 0 0 3px rgba(56, 232, 255, .12); }

/* modal (wallet) */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(2, 4, 9, .7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal .box { width: min(400px, 100%); background: var(--card2); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; }
.modal h3 { margin-bottom: 6px; }
.modal p { color: var(--mute); font-size: 14px; margin-bottom: 16px; }
.modal .wl { display: grid; gap: 8px; }
.modal .wl a, .modal .wl button { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; background: rgba(255, 255, 255, .02); cursor: pointer; text-align: left; }
.modal .wl img { width: 26px; height: 26px; border-radius: 6px; }
.modal .wl small { margin-left: auto; color: var(--faint); font-size: 12px; }
.modal .x { margin-top: 14px; width: 100%; background: none; border: 0; color: var(--mute); cursor: pointer; padding: 8px; }

/* copy button */
.cp { margin-left: auto; border: 1px solid var(--line2); background: none; border-radius: 6px; padding: 2px 7px; font: 11px var(--mono); color: var(--mute); cursor: pointer; }
.cp:hover { color: var(--ink); border-color: var(--cy); }

/* toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 120; background: var(--card2); border: 1px solid var(--line2); border-radius: 12px; padding: 11px 16px; font-size: 14px; transition: all .3s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: rgba(255, 90, 122, .5); }

/* ---------- footer */
.foot { border-top: 1px solid var(--line); padding: 48px 0 60px; margin-top: 40px; }
.foot .top { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot .links { display: flex; gap: 22px; color: var(--mute); font-size: 14px; }
.foot .links a:hover { color: var(--ink); }
.foot .disc { color: var(--faint); font-size: 13px; margin-top: 26px; max-width: 760px; }
.foot .wal { color: var(--faint); font: 12px var(--mono); margin-top: 10px; word-break: break-all; }
.foot .wal a, .foot .wal span { color: var(--mute); }

/* ---------- responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .sec { padding: 84px 0; }
  .sec-head { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .brand span { display: none; }
  .nav .wrap { gap: 10px; }
  .nav-right .btn.pri { display: none; }
  .ca-pill.on { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}
