:root{
  --bg:#0d0f0e;
  --surface:#161a18;
  --surface-2:#1d2220;
  --border:#262b28;
  --text:#f3f1ea;
  --text-muted:#8b948d;
  --text-faint:#5b625d;
  --teal:#0f6e56;
  --teal-bright:#7fd9ab;
  --amber:#d9a15c;
  --dusk:#8fa3d9;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:'JetBrains Mono',monospace;
  -webkit-font-smoothing:antialiased;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}
a{color:inherit;text-decoration:none;}

/* ---------- welcome modal ---------- */
#welcome{
  display:none;
  position:fixed;inset:0;z-index:100;
  background:rgba(8,10,9,0.94);
  align-items:center;justify-content:center;
  padding:24px;
}
#welcome .card{
  max-width:440px;width:100%;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  padding:32px 28px;
  text-align:center;
}
#welcome .lock{width:44px;height:44px;margin:0 auto 18px;}
#welcome p{line-height:1.7;font-size:14px;margin:0 0 14px;color:var(--text);}
#welcome p.ar{direction:rtl;font-size:15px;color:#cfd3cd;margin-bottom:24px;}
#welcome button{
  font-family:inherit;font-size:13px;letter-spacing:.03em;
  padding:10px 22px;border-radius:8px;
  background:var(--surface-2);border:1px solid var(--border);
  color:var(--text-faint);cursor:not-allowed;
  transition:background .2s,color .2s,border-color .2s;
}
#welcome button.ready{
  background:rgba(15,110,86,0.18);
  border-color:var(--teal);
  color:var(--teal-bright);
  cursor:pointer;
}

/* ---------- nav ---------- */
header{
  display:flex;align-items:center;justify-content:space-between;
  padding:22px 5vw;
  border-bottom:1px solid var(--border);
}
header nav{display:flex;gap:26px;align-items:center;font-size:13px;color:var(--text-muted);}
header nav a:hover{color:var(--text);}
header nav a.active{color:var(--teal-bright);}
header .enter{
  background:var(--text);color:var(--bg);
  padding:9px 18px;border-radius:8px;
  font-size:13px;font-weight:600;
}
header .enter:hover{background:var(--teal-bright);}

/* ---------- hero ---------- */
.hero{position:relative;padding:72px 5vw 40px;max-width:900px;}
.eyebrow{font-size:11px;letter-spacing:.12em;color:var(--teal-bright);margin-bottom:20px;}
h1.display{
  font-family:'Fraunces',serif;font-style:italic;font-weight:600;
  font-size:clamp(30px,5vw,44px);line-height:1.14;margin:0 0 20px;
}
.lede{font-size:13.5px;line-height:1.75;color:var(--text-muted);max-width:480px;margin:0 0 28px;}
.cta-row{display:flex;gap:12px;flex-wrap:wrap;}
.btn-primary{background:var(--teal);color:#eafff2;padding:12px 22px;border-radius:9px;font-size:13px;font-weight:600;display:inline-flex;align-items:center;gap:8px;}
.btn-primary:hover{background:var(--teal-bright);color:#06231a;}
.btn-secondary{border:1px solid var(--border);color:var(--text-muted);padding:12px 20px;border-radius:9px;font-size:13px;cursor:pointer;}
.btn-secondary:hover{color:var(--text);border-color:var(--text-faint);}

/* ---------- spaces grid (home) ---------- */
.spaces{padding:10px 5vw 90px;display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.space-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:24px 22px;display:block;}
.space-card h3{font-size:15px;font-style:italic;font-weight:700;margin:0 0 6px;font-family:'Fraunces',serif;}
.space-card .sub{font-size:11.5px;color:var(--text-faint);margin:0 0 12px;}
.space-card p{font-size:12.5px;line-height:1.6;color:var(--text-muted);margin:0 0 16px;}
.space-card .go{font-size:12px;font-weight:600;}
.space-card.ideas .go{color:var(--amber);}
.space-card.report .go{color:var(--teal-bright);}
.space-card.free .go{color:var(--dusk);}

/* ---------- generic page hero (subpages) ---------- */
.page-hero{padding:48px 5vw 8px;max-width:600px;}

/* ---------- composer ---------- */
.composer{margin:0 5vw 24px;max-width:600px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:16px;}
.composer textarea, .composer input{
  width:100%;background:transparent;border:none;color:var(--text);
  font-family:'JetBrains Mono',monospace;font-size:13px;resize:none;outline:none;
}
.composer-footer{display:flex;justify-content:space-between;align-items:center;margin-top:10px;}
.tag{font-size:11px;padding:6px 12px;border-radius:7px;border:1px solid var(--border);color:var(--text-muted);cursor:pointer;}
.tag.active{background:rgba(217,161,92,0.15);color:var(--amber);border-color:rgba(217,161,92,0.3);}
.pill-btn{padding:8px 18px;border-radius:8px;font-size:12px;font-weight:600;border:none;cursor:pointer;}

/* ---------- feed items ---------- */
.feed{padding:0 5vw 60px;max-width:600px;display:flex;flex-direction:column;gap:10px;}
.feed-item{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:14px 16px;display:flex;justify-content:space-between;align-items:flex-start;gap:14px;}
.feed-item p.body{color:var(--text);font-size:13px;margin:0 0 5px;}
.feed-item p.byline{color:var(--text-faint);font-size:11px;margin:0;}
.vote{text-align:center;flex-shrink:0;}
.vote .arrow{color:var(--teal-bright);font-size:14px;cursor:pointer;}
.vote .count{color:var(--text-muted);font-size:11px;}

/* ---------- confirmation state ---------- */
.confirm{margin:0 5vw 60px;max-width:520px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:22px;display:none;}
.confirm p{color:var(--text-muted);font-size:13px;line-height:1.6;margin:0;}
.confirm p.title{color:var(--text);font-size:14px;font-weight:600;margin:0 0 8px;}

footer{margin-top:auto;padding:40px 5vw 36px;border-top:1px solid var(--border);font-size:12px;color:var(--text-faint);}

/* ---------- how-it-works modal ---------- */
#howModal{position:fixed;inset:0;z-index:90;background:rgba(8,10,9,0.94);display:none;align-items:center;justify-content:center;padding:24px;}
#howModal .card{max-width:460px;width:100%;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:28px 26px;}
#howModal .card p.title{color:var(--text);font-size:15px;font-weight:600;margin:0 0 14px;}
#howModal .card p.body{color:var(--text-muted);font-size:12.5px;line-height:1.7;margin:0 0 12px;}
#howModal .close{display:inline-block;margin-top:6px;color:var(--teal-bright);font-size:12px;cursor:pointer;text-decoration:underline;}

/* ---------- chat widget ---------- */
#chatBubble{
  position:fixed;bottom:22px;right:22px;z-index:80;
  width:52px;height:52px;border-radius:50%;
  background:var(--text);color:var(--bg);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:20px;
}
#chatBubble .dot{position:absolute;top:2px;right:2px;width:11px;height:11px;border-radius:50%;border:2px solid var(--bg);}
#chatBubble .dot.online{background:var(--teal-bright);}
#chatBubble .dot.offline{background:var(--text-faint);}
#chatPanel{
  position:fixed;bottom:84px;right:22px;z-index:80;
  width:310px;background:var(--surface);border:1px solid var(--border);border-radius:14px;
  overflow:hidden;display:none;
}
#chatPanel .head{padding:14px 16px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;}
#chatPanel .head p.t{color:var(--text);font-size:12.5px;font-weight:600;margin:0;}
#chatPanel .head p.s{color:var(--text-faint);font-size:10.5px;margin:2px 0 0;}
#chatPanel .status{display:flex;align-items:center;gap:5px;font-size:10px;}
#chatPanel .status .dot{width:6px;height:6px;border-radius:50%;display:inline-block;}
#chatPanel .body{padding:14px 16px;display:flex;flex-direction:column;gap:10px;min-height:160px;max-height:260px;overflow-y:auto;}
#chatPanel .msg{max-width:80%;padding:8px 11px;border-radius:10px;font-size:12px;}
#chatPanel .msg.staff{align-self:flex-start;background:var(--surface-2);border-radius:10px 10px 10px 2px;color:var(--text);}
#chatPanel .msg.me{align-self:flex-end;background:var(--teal);border-radius:10px 10px 2px 10px;color:#eafff2;}
#chatPanel .foot{padding:10px 12px;border-top:1px solid var(--border);display:flex;gap:8px;}
#chatPanel .foot input{flex:1;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:8px 10px;color:var(--text);font-family:'JetBrains Mono',monospace;font-size:11.5px;outline:none;}
#chatPanel .foot .send{background:var(--text);color:var(--bg);padding:8px 12px;border-radius:8px;font-size:11px;font-weight:600;border:none;cursor:pointer;}
#chatOffline{padding:24px 20px;text-align:center;}
#chatOffline p{color:var(--text-muted);font-size:12px;line-height:1.7;margin:0 0 14px;}
#chatOffline .hours{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:12px 14px;display:inline-block;text-align:left;}
#chatOffline .hours p.d1{color:var(--text);font-size:12px;margin:0 0 4px;}
#chatOffline .hours p.d2{color:var(--text-faint);font-size:11px;margin:0;}
#chatOffline .redirect{color:var(--text-faint);font-size:11px;margin:14px 0 0;}
#chatOffline .redirect a{color:var(--teal-bright);}

@media(max-width:860px){
  header nav a{display:none;}
  header nav a.enter{display:inline-block;}
  .spaces{grid-template-columns:1fr;}
}
