/* ===========================================================================
   OneNess platform - one stylesheet for every page that is not the console.

   The console keeps its own look (web/style.css, web/studio.css, web/wallet.css)
   and is served unchanged; this file is the community shell around it.  Dark,
   matte, one accent colour per idea: cyan for the platform, pink for money,
   green for verified, amber for a refusal.
   =========================================================================== */
:root {
  --bg: #05070b;
  --bg-2: #080c12;
  --panel: #0b1119;
  --panel-2: #0e1621;
  --line: #1b2430;
  --line-hot: #2b3a4d;
  --ink: #e8eef6;
  --dim: #8b9aab;
  --dim-2: #5d6b7a;
  --cyan: #7ef9ff;
  --cyan-deep: #1fa9c9;
  --pink: #ff5ea8;
  --green: #33e0c0;
  --amber: #ffd166;
  --violet: #a45bff;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .55);
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* one soft grid so long pages read as a surface, not a scroll */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 520px at 78% -10%, rgba(126, 249, 255, .09), transparent 60%),
    radial-gradient(760px 420px at 8% 4%, rgba(255, 94, 168, .07), transparent 62%);
  z-index: 0;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .9rem; }
small, .small { font-size: .82rem; color: var(--dim); }
code, .mono { font-family: var(--mono); font-size: .88em; }

/* ---------------------------------------------------------------- chrome --- */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: rgba(5, 7, 11, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.top .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  letter-spacing: .22em;
  font-size: .82rem;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap;
}
.top .brand img { height: 30px; width: auto; display: block; }

.top nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.top nav::-webkit-scrollbar { display: none; }
.top nav a {
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--dim);
  font-size: .9rem;
  white-space: nowrap;
  border: 1px solid transparent;
}
.top nav a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }
.top nav a.on { color: var(--cyan); border-color: var(--line-hot); background: var(--panel); }

.who { display: flex; align-items: center; gap: 8px; }
.who img.avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-hot);
}
.who .tag {
  font-family: var(--mono); font-size: .74rem; color: var(--dim);
  max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --------------------------------------------------------------- buttons --- */
.btn {
  appearance: none;
  border: 1px solid var(--line-hot);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--cyan-deep); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--cyan), var(--green));
  color: #04121a;
  font-weight: 700;
}
.btn.hot {
  border-color: transparent;
  background: linear-gradient(120deg, var(--pink), var(--violet));
  color: #12060f;
  font-weight: 700;
}
.btn.ghost { background: transparent; }
.btn.tiny { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }

/* ------------------------------------------------------------------ bits --- */
.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
        padding: 0 clamp(12px, 3vw, 28px); }
.pad { padding: clamp(18px, 3vw, 34px) 0; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-hot); background: var(--panel-2);
  font-family: var(--mono); font-size: .72rem; color: var(--dim);
  letter-spacing: .04em;
}
.pill.ok { color: var(--green); border-color: rgba(51, 224, 192, .45); }
.pill.warn { color: var(--amber); border-color: rgba(255, 209, 102, .45); }
.pill.hot { color: var(--pink); border-color: rgba(255, 94, 168, .45); }
.pill.ai { color: var(--violet); border-color: rgba(164, 91, 255, .45); }
.muted { color: var(--dim); }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ----------------------------------------------------------------- forms --- */
label.field { display: grid; gap: 6px; font-size: .85rem; color: var(--dim); }
input[type=text], input[type=password], input[type=number], input[type=search],
textarea, select {
  width: 100%;
  background: #070b11;
  border: 1px solid var(--line-hot);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: .92rem;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--cyan-deep);
  box-shadow: 0 0 0 3px rgba(31, 169, 201, .16);
}

/* ------------------------------------------------------------------ hero --- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero img.banner {
  width: 100%; height: clamp(210px, 34vw, 420px); object-fit: cover;
  display: block; opacity: .92;
}
.hero .veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 11, .2) 0%,
              rgba(5, 7, 11, .84) 62%, var(--bg) 100%);
}
.hero .copy { position: absolute; inset: auto 0 0 0; padding: clamp(14px, 3vw, 30px);
              max-width: 1180px; margin: 0 auto; }
.hero .kicker {
  font-family: var(--mono); letter-spacing: .34em; font-size: .72rem;
  color: var(--cyan); text-transform: uppercase; margin-bottom: 8px;
}
.hero p.lead { max-width: 62ch; color: #c8d5e3; margin-bottom: 12px; }

/* ----------------------------------------------------------------- posts --- */
.post { display: grid; gap: 12px; }
.post .head { display: flex; gap: 10px; align-items: center; }
.post .head img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--line-hot); flex: none;
}
.post .head .name { font-weight: 600; }
.post .head .when { font-family: var(--mono); font-size: .72rem; color: var(--dim-2); }
.post .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post .media { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.post .media img, .post .media video {
  width: 100%; border-radius: 10px; border: 1px solid var(--line);
  background: #000; max-height: 420px; object-fit: cover;
}
.post .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.onion {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 94, 168, .5);
  background: linear-gradient(120deg, rgba(255, 94, 168, .16), rgba(164, 91, 255, .12));
  color: var(--ink); font: inherit; font-size: .84rem; cursor: pointer;
}
.onion:hover { border-color: var(--pink); transform: translateY(-1px); }
.onion img { width: 20px; height: 20px; object-fit: contain; }
.onion .count { font-family: var(--mono); color: var(--pink); }
.onion:disabled { opacity: .5; cursor: not-allowed; }

.comments { display: grid; gap: 10px; margin-top: 4px; }
.comment {
  border-left: 2px solid var(--line-hot); padding: 6px 0 6px 12px;
  display: grid; gap: 4px;
}
.comment .who-line { display: flex; gap: 8px; align-items: center; font-size: .85rem; }
.comment .who-line img { width: 22px; height: 22px; border-radius: 50%; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; }
.comment.reply { margin-left: 22px; border-left-color: var(--line); }
.comment.ai { border-left-color: var(--violet); }

/* ----------------------------------------------------------------- store --- */
.listing { display: grid; gap: 10px; }
.listing .shot {
  width: 100%; height: 150px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: #000;
}
.listing .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.price { font-family: var(--mono); color: var(--pink); }
.files { display: grid; gap: 6px; }
.file-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
  font-size: .86rem;
}

/* ------------------------------------------------------------- hackathon --- */
.chal { display: grid; gap: 12px; }
.chal .art {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.chal .art img { width: 92px; height: 92px; border-radius: 16px; border: 1px solid var(--line); }
.chal .steps { margin: 0; padding-left: 18px; color: #c8d5e3; }
.chal .steps li { margin: 5px 0; }
.vault-box {
  display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.vault-box .k { font-family: var(--mono); font-size: .72rem; color: var(--dim-2);
                text-transform: uppercase; letter-spacing: .1em; }
.vault-box .v { font-family: var(--mono); font-size: .95rem; overflow-wrap: anywhere; }
table.board { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.board th, table.board td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.board th { font-family: var(--mono); font-size: .74rem; color: var(--dim-2);
                 text-transform: uppercase; letter-spacing: .08em; }

/* ------------------------------------------------------- dialogs/toasts --- */
dialog.sheet {
  border: 1px solid var(--line-hot); border-radius: 16px; padding: 0;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  color: var(--ink); width: min(460px, 94vw); box-shadow: var(--shadow);
}
dialog.sheet::backdrop { background: rgba(2, 4, 7, .72); backdrop-filter: blur(3px); }
dialog.sheet .inner { padding: 20px; display: grid; gap: 12px; }
dialog.sheet .tabs { display: flex; gap: 6px; }
dialog.sheet .tabs button {
  flex: 1; padding: 8px; border-radius: 9px; border: 1px solid var(--line-hot);
  background: transparent; color: var(--dim); font: inherit; cursor: pointer;
}
dialog.sheet .tabs button.on { color: var(--cyan); border-color: var(--cyan-deep); }

#toasts {
  position: fixed; right: 14px; bottom: 14px; z-index: 90;
  display: grid; gap: 8px; max-width: min(360px, 90vw);
}
.toast {
  padding: 10px 13px; border-radius: 10px; font-size: .88rem;
  border: 1px solid var(--line-hot); background: rgba(11, 17, 25, .96);
  box-shadow: var(--shadow);
}
.toast.bad { border-color: rgba(255, 94, 168, .6); }
.toast.good { border-color: rgba(51, 224, 192, .6); }

/* ---------------------------------------------------------- clip window --- */
#clip {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  width: min(360px, 88vw); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line-hot); background: #000; box-shadow: var(--shadow);
  display: none;
}
#clip.on { display: block; }
#clip video { width: 100%; display: block; }
#clip .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--cyan);
  background: linear-gradient(transparent, rgba(0, 0, 0, .82));
}

/* ---------------------------------------------------- floating assistant --- */
#ai-bubble {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: 58px; height: 58px; border-radius: 50%; padding: 0;
  border: 1px solid var(--line-hot); background: #0a1017; cursor: pointer;
  box-shadow: var(--shadow); overflow: hidden;
}
#ai-bubble img { width: 100%; height: 100%; object-fit: cover; }
#ai-bubble::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(126, 249, 255, .35);
}
#ai-panel {
  position: fixed; right: 18px; bottom: 86px; z-index: 71;
  width: min(400px, 94vw); height: min(540px, 76vh);
  display: none; grid-template-rows: auto 1fr auto;
  border: 1px solid var(--line-hot); border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #0b1119, #060a0f);
  box-shadow: var(--shadow);
}
#ai-panel.on { display: grid; }
#ai-panel header {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); background: rgba(10, 16, 23, .9);
}
#ai-panel header img { width: 28px; height: 28px; border-radius: 50%; }
#ai-panel header .t { font-family: var(--mono); font-size: .78rem; letter-spacing: .16em; }
#ai-panel header .x {
  margin-left: auto; background: none; border: 0; color: var(--dim);
  font-size: 1.1rem; cursor: pointer;
}
#ai-log { overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
#ai-log .m { padding: 9px 12px; border-radius: 12px; font-size: .9rem; max-width: 92%;
             white-space: pre-wrap; overflow-wrap: anywhere; }
#ai-log .m.ai { background: #0d1722; border: 1px solid var(--line); }
#ai-log .m.me { background: rgba(126, 249, 255, .12); border: 1px solid rgba(126, 249, 255, .3);
                justify-self: end; }
#ai-log .m.sys { background: none; border: 1px dashed var(--line-hot); color: var(--dim);
                 font-family: var(--mono); font-size: .76rem; }
#ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
#ai-form input { flex: 1; }
#ai-note { padding: 0 12px 8px; font-family: var(--mono); font-size: .68rem; color: var(--dim-2); }

/* --------------------------------------------------------------- layout --- */
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.footer {
  border-top: 1px solid var(--line); margin-top: 30px; padding: 22px 0 60px;
  color: var(--dim-2); font-size: .82rem;
}
.footer .row { gap: 18px; }
.steps-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { display: grid; gap: 2px; }
.stat .n { font-family: var(--mono); font-size: 1.35rem; color: var(--cyan); }
.stat .l { font-size: .74rem; color: var(--dim-2); text-transform: uppercase;
           letter-spacing: .1em; }
.empty {
  border: 1px dashed var(--line-hot); border-radius: 12px; padding: 22px;
  text-align: center; color: var(--dim);
}
.warnbox {
  border: 1px solid rgba(255, 209, 102, .45); background: rgba(255, 209, 102, .07);
  border-radius: 10px; padding: 10px 12px; font-size: .86rem; color: #ffe6ad;
}
.hide { display: none !important; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .top nav { order: 3; width: 100%; }
  .hero .copy { position: static; padding: 16px; }
  .hero img.banner { height: 200px; }
  .who .tag { display: none; }
  #ai-panel { height: 72vh; bottom: 84px; }
}
