/* ==========================================================================
   DemokratikKongo — JVM Runtime Inspector
   A site that reads as a live process inspection, not a marketing page.
   World: instrument ground, graph-paper hairlines, one indigo accent plus a
   phosphor-green "live" status. No gradients, no glass, no cards.
   ========================================================================== */

:root {
  --bg: #0b0d12;
  --bg-2: #0d1016;
  --panel: #11141c;
  --panel-2: #161a24;
  --line: #232835;
  --line-strong: #2e3544;
  --text: #e7eaf2;
  --dim: #a7aebf;
  --muted: #7c8496;

  --c1: #7d7aff;         /* indigo — links, selection, brand (client accent) */
  --c2: #5a57e8;         /* indigo fill */
  --live: #34d17b;       /* attached / enabled / live */
  --warn: #f0b24a;
  --danger: #f3656d;

  --surface: rgba(255, 255, 255, 0.02);
  --border: var(--line);

  --font: "Familjen Grotesk", system-ui, -apple-system, sans-serif;
  --display: "Familjen Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --radius: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* instrument ground: faint graph-paper grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.22;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c1); }
code, kbd, pre { font-family: var(--mono); }

::selection { background: var(--c1); color: #0b0d12; }

.prompt { color: var(--live); }

* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 0; }

:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ nav */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 28px;
  background: rgba(11, 13, 18, 0.94);
  border-bottom: 1px solid var(--line);
}
.nav-left { display: flex; align-items: center; gap: 22px; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-flex;
  width: 24px; height: 16px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

/* ------------------------------------------------------------------ btn */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: -0.01em;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--c1); color: var(--text); }
.btn-primary {
  background: var(--c2);
  border-color: var(--c2);
  color: #fff;
}
.btn-primary:hover { background: var(--c1); border-color: var(--c1); color: #fff; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel); }
.btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); }

/* ----------------------------------------------------------------- hero */

.hero {
  padding: 128px 28px 72px;
  max-width: 1160px;
  margin: 0 auto;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 40px;
}
.status-bar .seg { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-bar .seg + .seg::before {
  content: "";
  width: 1px; height: 12px;
  background: var(--line-strong);
  margin-right: 18px;
}
.status-bar .live { color: var(--live); }
.status-bar .live .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }

.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(44px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero-title .ver {
  display: inline-block;
  margin-left: 14px;
  vertical-align: 0.4em;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}
.hero-lede {
  font-size: 17px;
  color: var(--dim);
  max-width: 52ch;
  margin-bottom: 28px;
}
.hero-lede strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.inspector {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
.inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.inspector-head .live { color: var(--live); text-transform: none; letter-spacing: 0; }
.inspector-grid { display: grid; grid-template-columns: 1fr 1fr; }

.proc-list, .module-stream { padding: 10px 0; }
.proc-list { border-right: 1px solid var(--line); }

.proc-item, .mod-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.proc-item .name { color: var(--text); }
.proc-item .state { margin-left: auto; color: var(--muted); }
.proc-item .state.ok { color: var(--live); }

.mod-row .idx { color: var(--muted); width: 20px; }
.mod-row .name { color: var(--text); }
.mod-row .state { margin-left: auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.mod-row .state.on { color: var(--live); }
.mod-row .state.off { color: var(--muted); }

/* the one authored motion: the module stream scans in, row by row */
@media (prefers-reduced-motion: no-preference) {
  .mod-row {
    opacity: 0;
    animation: scan-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(0.12s + var(--i, 0) * 0.07s);
  }
}
@keyframes scan-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

/* -------------------------------------------------------------- register */

.register {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 1160px;
  margin: 0 auto;
}
.reg-cell {
  padding: 20px 22px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reg-cell:first-child { border-left: 0; }
.reg-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.reg-value .unit { font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.reg-label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* -------------------------------------------------------------- section */

.section { padding: 88px 28px; }
.section-inner { max-width: 1160px; margin: 0 auto; }
.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.section-sub { color: var(--dim); font-size: 16px; max-width: 62ch; margin-bottom: 34px; }
.section-sub strong { color: var(--text); font-weight: 600; }

/* module index — a ruled region table, not cards */
.module-index {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.module-index-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 22px;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.module-index-row:first-child { border-top: 0; }
.module-index-row:hover { background: var(--surface); }
.module-index-row .region { font-family: var(--mono); font-size: 14px; color: var(--text); font-weight: 600; }
.module-index-row .items { font-size: 14.5px; color: var(--dim); }
.module-index-row .count { font-family: var(--mono); font-size: 13px; color: var(--c1); white-space: nowrap; }

/* --------------------------------------------------------------- runbook */

.runbook {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
.runbook-step {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.runbook-step:first-child { border-top: 0; }
.runbook-step code {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
}
.runbook-step .prompt { color: var(--live); }
.runbook-step .desc { font-size: 14px; color: var(--dim); }
.runbook-step .desc strong { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- notice */

.notice {
  border: 1px solid rgba(243, 101, 109, 0.4);
  border-radius: var(--radius);
  background: rgba(243, 101, 109, 0.05);
  padding: 18px 22px;
  max-width: 860px;
  margin: 0 auto;
}
.notice-title {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--danger);
  margin-bottom: 8px;
}
.notice p { font-size: 14.5px; color: var(--dim); }

/* ---------------------------------------------------------------- footer */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 22px 28px;
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.footer-inner a { color: var(--text); }
.footer-inner a:hover { color: var(--c1); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero-body { grid-template-columns: 1fr; }
  .inspector-grid { grid-template-columns: 1fr; }
  .proc-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .register { grid-template-columns: repeat(2, 1fr); }
  .reg-cell:nth-child(3) { border-left: 0; }
  .module-index-row { grid-template-columns: 1fr; gap: 4px; }
  .runbook-step { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 620px) {
  .nav { padding: 0 16px; }
  .nav-links { display: none; }
  .hero { padding-top: 100px; }
  .status-bar { gap: 10px; }
  .status-bar .seg + .seg::before { display: none; }
  .register { grid-template-columns: 1fr 1fr; }
}
