:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-2: #10131c;
  --panel: rgba(17, 21, 31, 0.76);
  --panel-strong: rgba(22, 27, 40, 0.92);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(232, 184, 109, 0.34);
  --text: #f1f4fb;
  --muted: #929bae;
  --faint: #606a7d;
  --gold: #e8b86d;
  --gold-2: #ffcf81;
  --blue: #7eb8ff;
  --green: #5fd49a;
  --red: #ff7b7b;
  --purple: #b994ff;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  --radius: 22px;
  --font: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -10%, rgba(232, 184, 109, 0.17), transparent 34rem),
    radial-gradient(circle at 0% 20%, rgba(126, 184, 255, 0.13), transparent 28rem),
    linear-gradient(135deg, var(--bg), #0c0f17 48%, #080a0f);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

body.dim {
  --panel: rgba(13, 16, 24, 0.86);
  --panel-strong: rgba(15, 18, 27, 0.95);
  --text: #dbe1ed;
  --muted: #7d879b;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.orb {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(84px);
  opacity: 0.42;
  pointer-events: none;
}

.orb-gold { width: 340px; height: 340px; right: -120px; top: 80px; background: rgba(232, 184, 109, 0.33); }
.orb-blue { width: 320px; height: 320px; left: -140px; top: 320px; background: rgba(126, 184, 255, 0.24); }
.orb-red { width: 240px; height: 240px; right: 20%; bottom: -130px; background: rgba(255, 123, 123, 0.14); }

.topbar,
.shell,
.footer,
.toast { position: relative; z-index: 1; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px clamp(18px, 4vw, 54px) 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
  min-width: max-content;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(232, 184, 109, 0.18), rgba(126, 184, 255, 0.08));
  color: var(--gold-2);
  box-shadow: 0 0 30px rgba(232, 184, 109, 0.14);
  font-size: 1.25rem;
}

.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

.nav {
  justify-self: center;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  border-radius: 999px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 0.86rem;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav a:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.topbar-meta {
  justify-self: end;
  display: flex;
  gap: 10px;
  align-items: center;
}

.clock,
.ghost-button,
.small-button,
.button {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.clock,
.ghost-button {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
}

button { cursor: pointer; }

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px clamp(18px, 4vw, 54px) 58px;
}

.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 24px;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

.hero h1 {
  max-width: 930px;
  margin-bottom: 16px;
  font-size: clamp(2.25rem, 5vw, 5.25rem);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

.lede {
  max-width: 74ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.button:hover,
.small-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.button.primary {
  background: linear-gradient(135deg, rgba(232,184,109,0.92), rgba(255,207,129,0.74));
  color: #13100a;
  border-color: transparent;
  font-weight: 800;
}

.button.subtle { color: var(--gold-2); }
.small-button.danger { color: var(--red); }

.hero-console {
  align-self: end;
  border: 1px solid rgba(126,184,255,0.19);
  background: rgba(4, 7, 12, 0.56);
  border-radius: 18px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.console-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.console-line:last-child { border-bottom: 0; }
.console-line span { color: var(--faint); }
.console-line strong { color: var(--text); text-align: right; }
.console-line .ok, .ok { color: var(--green); }
.console-line .warn, .warn { color: var(--gold); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 34px;
}

.metric-card { padding: 18px; }
.metric-label {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.metric-card strong { display: block; font-size: 1.35rem; line-height: 1.1; }
.metric-card small { display: block; color: var(--faint); margin-top: 9px; line-height: 1.4; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 36px 0 16px;
}
.section-head.compact { margin: 0 0 18px; align-items: start; }
.section-head h2 { margin: 0; font-size: clamp(1.45rem, 2vw, 2rem); letter-spacing: -0.04em; }
.section-actions { display: flex; gap: 10px; }

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}

.kanban-column {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,0.026);
  padding: 12px;
}

.kanban-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 5px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kanban-column em {
  font-style: normal;
  color: var(--gold);
  border: 1px solid rgba(232,184,109,0.24);
  border-radius: 999px;
  padding: 3px 8px;
}

.dropzone {
  min-height: 300px;
  display: grid;
  gap: 10px;
  align-content: start;
  border-radius: 14px;
  transition: background 0.16s ease;
}
.dropzone.drag-over { background: rgba(232,184,109,0.06); }

.kanban-card {
  border: 1px solid rgba(255,255,255,0.095);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  padding: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22);
}
.kanban-card.dragging { opacity: 0.55; }
.card-top,
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.tag {
  color: #120d04;
  background: var(--gold);
  border-radius: 999px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 800;
}
.card-delete {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.card-delete:hover { color: var(--red); }
.kanban-card h3 { margin: 12px 0 7px; font-size: 1rem; line-height: 1.22; }
.kanban-card p { margin-bottom: 14px; color: var(--muted); line-height: 1.45; font-size: 0.88rem; }
.card-meta { color: var(--faint); font-family: var(--mono); font-size: 0.7rem; }

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}
.project-panel,
.radar-panel,
.system-map,
.pipeline-panel,
.notes-panel { padding: 22px; }

.momentum-list { display: grid; gap: 15px; }
.momentum-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.85fr) 72px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}
.momentum-row span { color: var(--text); font-weight: 650; }
.momentum-row b { color: var(--gold); font-family: var(--mono); font-size: 0.74rem; text-align: right; }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--blue)); }

.radar { width: 100%; min-height: 290px; }
.radar line { stroke: rgba(255,255,255,0.12); }
.radar-grid { fill: transparent; stroke: rgba(255,255,255,0.13); }
.radar-grid.inner { stroke: rgba(255,255,255,0.08); }
.radar-shape { fill: url(#radarFill); stroke: var(--gold); stroke-width: 2; }
.radar circle { fill: var(--gold-2); }
.radar text { fill: var(--muted); font-family: var(--mono); font-size: 12px; text-anchor: middle; }

.system-map { margin-top: 16px; }
.map-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 12px;
}
.node {
  position: relative;
  min-height: 120px;
  padding: 16px;
  border-radius: 17px;
  border: 1px solid rgba(255,255,255,0.085);
  background: rgba(255,255,255,0.034);
}
.node::after {
  content: "";
  position: absolute;
  right: -13px;
  top: 50%;
  width: 13px;
  height: 1px;
  background: rgba(232,184,109,0.35);
}
.node:last-child::after { display: none; }
.node.core { border-color: var(--border-strong); background: rgba(232,184,109,0.08); }
.node strong { display: block; margin-bottom: 8px; }
.node span { display: block; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }

.pipeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.pipeline li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.028);
}
.pipeline li.active { border-color: var(--border-strong); }
.pipeline span {
  grid-row: span 2;
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 800;
}
.pipeline strong { display: block; }
.pipeline em { color: var(--muted); font-style: normal; line-height: 1.4; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
  color: var(--text);
  padding: 14px;
  font: 0.92rem/1.5 var(--font);
  outline: none;
}
textarea:focus { border-color: var(--border-strong); }
.notes-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 54px) 38px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.74rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: rgba(8,10,15,0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.8rem;
}

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; }
  .nav { justify-self: start; overflow-x: auto; max-width: 100%; }
  .topbar-meta { justify-self: start; }
  .hero,
  .two-col { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .node::after { display: none; }
}

@media (max-width: 680px) {
  .topbar { padding-top: 16px; }
  .nav { display: none; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 2.35rem; }
  .metrics-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  .momentum-row { grid-template-columns: 1fr; gap: 7px; }
  .momentum-row b { text-align: left; }
  .map-grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
}
