/* AI-ASURA — CyberKalki. Mythic-cyber theme: crimson + saffron on deep charcoal.
   Deliberately distinct from a SOC dashboard: a vertical "ward ladder" you ascend. */
:root {
  --bg: #0b0a0d;
  --bg-2: #131117;
  --panel: #17141c;
  --panel-2: #1f1b26;
  --border: #2a2431;
  --border-2: #3a3145;
  --txt: #ece7f0;
  --txt-dim: #a094ad;
  --txt-faint: #6f6479;
  --crimson: #e0304a;      /* primary — CyberKalki */
  --rose: #ff5c72;
  --saffron: #f6a623;      /* accent / progress */
  --gold: #ffcf5c;
  --jade: #33c98f;         /* success / cleared */
  --violet: #a97bf0;       /* boss */
  --mono: "JetBrains Mono","Cascadia Code","SF Mono",Consolas,monospace;
  --sans: -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,sans-serif;
  --shadow: 0 10px 40px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html,body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(224,48,74,.10), transparent 60%),
    radial-gradient(900px 480px at 0% 110%, rgba(246,166,35,.06), transparent 55%),
    var(--bg);
  color: var(--txt); font-family: var(--sans); font-size: 15px; line-height: 1.55; min-height: 100vh;
}
a { color: var(--rose); text-decoration: none; }
h1,h2,h3 { font-weight: 680; margin: 0 0 .4em; letter-spacing: .2px; }
code,.mono { font-family: var(--mono); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
  background: rgba(11,10,13,.86); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 12px; }
.sigil { width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center;
  background: conic-gradient(from 210deg, var(--crimson), var(--saffron), var(--crimson));
  color: #1a0508; font-weight: 900; font-family: var(--mono); font-size: 17px; box-shadow: 0 0 18px rgba(224,48,74,.4); }
.brand .name { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.brand .org { font-size: 10.5px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: 2px; }
.navlinks { display: flex; gap: 6px; align-items: center; }
.navlinks a, .navlinks button { font-size: 13px; color: var(--txt-dim); padding: 7px 12px; border-radius: 8px;
  cursor: pointer; background: transparent; border: 1px solid transparent; font-weight: 600; font-family: inherit; }
.navlinks a:hover, .navlinks button:hover { background: var(--panel); color: var(--txt); }
.navlinks a.active { background: var(--panel-2); color: var(--txt); border-color: var(--border-2); }

.hero-stats { display: flex; gap: 18px; align-items: center; }
.hstat { text-align: right; }
.hstat .v { font-family: var(--mono); font-weight: 800; font-size: 16px; }
.hstat .v.gold { color: var(--gold); }
.hstat .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt-faint); }

/* Pills / tags */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; border: 1px solid var(--border-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); }
.pill.live { color: var(--jade); border-color: rgba(51,201,143,.4); } .pill.live .dot { background: var(--jade); }
.pill.warn { color: var(--saffron); border-color: rgba(246,166,35,.4); }
.tag { font-size: 10.5px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--txt-dim); font-weight: 700; }
.tag.pts { color: var(--gold); border-color: rgba(255,207,92,.35); }
.tag.Initiate { color: var(--jade); } .tag.Adept { color: var(--saffron); }
.tag.Master { color: var(--crimson); } .tag.Boss { color: var(--violet); border-color: rgba(169,123,240,.4); }

/* THE LADDER */
.page-title { font-size: 24px; margin: 26px 0 6px; }
.subtle { color: var(--txt-dim); margin-bottom: 22px; font-size: 14px; }
.ladder { position: relative; padding-left: 40px; }
.ladder::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(180deg, var(--crimson), var(--saffron)); opacity: .5; }
.rung { position: relative; margin-bottom: 16px; }
.rung .node { position: absolute; left: -33px; top: 20px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--border-2); }
.rung.cleared .node { background: var(--jade); border-color: var(--jade); box-shadow: 0 0 12px rgba(51,201,143,.5); }
.rung.available .node { border-color: var(--crimson); box-shadow: 0 0 10px rgba(224,48,74,.5); }
.ward-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; cursor: pointer; transition: .13s; }
.ward-card:hover { border-color: var(--border-2); transform: translateX(3px); box-shadow: var(--shadow); }
.ward-card.locked { opacity: .5; cursor: not-allowed; }
.ward-card.cleared { border-color: rgba(51,201,143,.4); }
.ward-card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ward-card .idx { font-family: var(--mono); font-size: 11px; color: var(--txt-faint); letter-spacing: 1px; }
.ward-card .nm { font-size: 17px; font-weight: 800; margin: 2px 0; }
.ward-card .sb { font-size: 13px; color: var(--txt-dim); }
.ward-card .meta { display: flex; gap: 7px; margin-top: 11px; flex-wrap: wrap; align-items: center; }
.status-chip { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.status-chip.cleared { color: var(--jade); } .status-chip.locked { color: var(--txt-faint); }
.status-chip.available { color: var(--crimson); }

/* Panels / cards */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1.5fr 1fr; align-items: start; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 15px 18px; }
.stat .k { font-size: 11px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: 1px; }
.stat .v { font-size: 28px; font-weight: 800; font-family: var(--mono); margin-top: 3px; }
.stat .v.crimson { color: var(--crimson); } .stat .v.gold { color: var(--gold); }

/* Buttons / inputs */
button,.btn { font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; background: var(--panel-2);
  color: var(--txt); border: 1px solid var(--border-2); border-radius: 9px; padding: 9px 16px; transition: .12s; }
button:hover,.btn:hover { border-color: var(--crimson); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--crimson), #b81e34); color: #fff; border: none; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; } .btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-danger { color: var(--crimson); border-color: rgba(224,48,74,.45); }
input,textarea,select { font-family: inherit; font-size: 14px; background: var(--bg-2); color: var(--txt);
  border: 1px solid var(--border-2); border-radius: 9px; padding: 10px 12px; width: 100%; }
input:focus,textarea:focus { outline: none; border-color: var(--crimson); }
label { font-size: 12px; color: var(--txt-dim); font-weight: 700; display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .spread { justify-content: space-between; }

/* Console / chat */
.console { display: flex; flex-direction: column; height: 460px; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 13px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.msg.you { align-self: flex-end; background: linear-gradient(135deg,#3a1520,#2c1019); border: 1px solid #56202f; }
.msg.ai { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.msg.leak { border-color: var(--jade); box-shadow: 0 0 0 1px rgba(51,201,143,.3); }
.composer { display: flex; gap: 8px; margin-top: 12px; } .composer textarea { resize: none; height: 46px; }

/* Trace */
.trace { font-family: var(--mono); font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.trace .ev { padding: 7px 10px; border-radius: 7px; border-left: 3px solid var(--border-2); background: var(--bg-2); }
.trace .ev .k { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt-faint); }
.trace .ev.trust-user { border-left-color: var(--saffron); }
.trace .ev.trust-tool { border-left-color: var(--rose); }
.trace .ev.trust-untrusted { border-left-color: var(--crimson); background: rgba(224,48,74,.06); }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--txt-dim); margin-bottom: 8px; flex-wrap: wrap; }
.legend span::before { content: "●"; margin-right: 4px; }

/* meter (crescendo) */
.meter { height: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.meter > div { height: 100%; background: linear-gradient(90deg, var(--crimson), var(--saffron)); transition: width .3s; }

/* boss graph */
.graph { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.gnode { width: 200px; text-align: center; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border-2);
  background: var(--panel); font-weight: 700; font-size: 13px; transition: .2s; }
.gnode .r { font-size: 9.5px; color: var(--txt-faint); text-transform: uppercase; letter-spacing: 1px; }
.gnode.unknown { opacity: .5; }
.gnode.discovered { border-color: var(--saffron); color: var(--saffron); }
.gnode.compromised { border-color: var(--crimson); color: var(--crimson); background: rgba(224,48,74,.08); box-shadow: 0 0 12px rgba(224,48,74,.25); }
.gedge { color: var(--txt-faint); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th,td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-faint); }
.rank { font-family: var(--mono); font-weight: 800; } .r1 { color: var(--gold); } .r2 { color: #cfd6e0; } .r3 { color: #d59b6b; }

.hint-box { border-left: 3px solid var(--saffron); background: rgba(246,166,35,.07); padding: 11px 14px; border-radius: 0 8px 8px 0; margin-bottom: 8px; font-size: 13.5px; }
.filecode { background: #0b0910; border: 1px solid var(--border); border-radius: 8px; padding: 13px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; color: #cbb; overflow-x: auto; }
.muted { color: var(--txt-dim); } .faint { color: var(--txt-faint); } .center { text-align: center; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .hidden { display: none !important; }

/* onboarding */
.onboard { min-height: 82vh; display: grid; place-items: center; padding: 20px; }
.onboard .card { width: 100%; max-width: 440px; }
.onboard .big { font-size: 34px; font-weight: 900; letter-spacing: .5px;
  background: linear-gradient(120deg, var(--crimson), var(--saffron)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.onboard .tag2 { color: var(--txt-dim); margin-bottom: 22px; }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.toast { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2);
  box-shadow: var(--shadow); font-size: 13.5px; max-width: 340px; animation: sl .2s; }
.toast.ok { border-color: var(--jade); } .toast.err { border-color: var(--crimson); }
.toast.blood { border-color: var(--gold); background: linear-gradient(135deg,#2a2210,var(--panel-2)); }
@keyframes sl { from { transform: translateX(18px); opacity: 0; } }

@media (max-width: 800px) { .cols-2 { grid-template-columns: 1fr; } .hero-stats { display: none; } }
