/* ============================================================
   PROJECTPT — Northgate v2 benchmark archive
   CRT phosphor terminal aesthetic: strictly monochrome
   green-on-black, scanlines, phosphor glow, notched frames.
   ============================================================ */

:root {
  --phos: #00F48E;            /* primary phosphor green   */
  --phos-hi: #00FF3C;         /* high-intensity green     */
  --phos-dim: #0a5c3a;        /* dim green for borders    */
  --phos-fill: rgba(0,244,142,.07);
  --ink: #c8ffe4;             /* main text (phosphor-lit) */
  --ink-dim: #6fae8e;         /* secondary text           */
  --ink-faint: #3d6b53;       /* faint labels             */
  --bg: #000000;
  --bg-panel: #030805;
  /* status colors derived from CRT phosphor family */
  --st-clean: #00F48E;        /* green phosphor   */
  --st-warn: #FFB000;         /* amber phosphor   */
  --st-bad: #FF4D4D;          /* red alert        */
  --st-idle: #5f7a6b;         /* cold gray-green  */
  --mono: 'JetBrains Mono', 'Courier New', 'Liberation Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 24px;
  overflow-x: hidden;
}

::selection { background: var(--phos); color: #000; }

/* --- CRT scanline overlay -------------------------------- */
body::after {
  content: "";
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0, 0, 0, .22) 3px, rgba(0, 0, 0, .22) 4px
  );
  pointer-events: none;
  z-index: 9000;
  animation: scan-drift 9s linear infinite;
}
@keyframes scan-drift {
  from { background-position: 0 0; }
  to   { background-position: 0 48px; }
}

/* faint green vignette */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(0,244,142,.045), transparent 70%);
  pointer-events: none; z-index: 8999;
}

/* --- boot overlay ---------------------------------------- */
#boot {
  position: fixed; inset: 0; background: #000; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
#boot .boot-inner { width: min(560px, 86vw); }
#boot .bl { color: var(--phos); text-shadow: 0 0 6px rgba(0,244,142,.55); white-space: pre; }
#boot .cursor { display: inline-block; width: 9px; height: 16px; background: var(--phos); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- layout ---------------------------------------------- */
.wrap { display: flex; min-height: 100vh; }

aside#side {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 252px;
  border-right: 1px solid var(--phos-dim);
  background: rgba(0, 6, 3, .92);
  padding: 22px 0 30px;
  overflow-y: auto;
  z-index: 100;
}
#side .brand {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--phos-dim);
  margin-bottom: 14px;
}
#side .brand .logo {
  color: var(--phos-hi);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  text-shadow: 0 0 8px rgba(0,255,60,.6);
}
#side .brand .sub { color: var(--ink-faint); font-size: 11px; margin-top: 4px; letter-spacing: .06em; }

#side nav a {
  display: flex; gap: 10px;
  padding: 5px 20px;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: .04em;
  border-left: 2px solid transparent;
}
#side nav a .n { color: var(--ink-faint); }
#side nav a:hover { color: var(--phos); background: var(--phos-fill); }
#side nav a.active {
  color: var(--phos-hi);
  border-left-color: var(--phos);
  background: var(--phos-fill);
  text-shadow: 0 0 6px rgba(0,244,142,.5);
}
#side nav a.active .n { color: var(--phos); }

#side .side-foot {
  margin-top: 18px; padding: 14px 20px 0;
  border-top: 1px solid var(--phos-dim);
  color: var(--ink-faint); font-size: 10px; line-height: 18px;
}

main {
  margin-left: 252px;
  flex: 1;
  min-width: 0;
  padding: 0 0 140px;
}

section.page {
  display: none;
  padding: 46px 52px 20px;
  max-width: 1060px;
  animation: pg-in .45s ease both;
}
section.page.on { display: block; }
@keyframes pg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- typography ------------------------------------------ */
h1.pg {
  color: var(--phos);
  font-size: 17px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0,244,142,.55);
  margin-bottom: 6px;
}
h1.pg::before { content: "> "; color: var(--phos-hi); }
.pg-sub { color: var(--ink-faint); font-size: 12px; margin-bottom: 34px; }

h2 {
  color: var(--phos);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 42px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--phos-dim);
  text-shadow: 0 0 7px rgba(0,244,142,.4);
}
h2::before { content: "## "; color: var(--ink-faint); }
h3 {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: .08em;
  margin: 26px 0 8px;
}
h3::before { content: "### "; color: var(--ink-faint); }

p { margin: 10px 0; color: var(--ink); }
p.dim, .dim { color: var(--ink-dim); }
p.faint, .faint { color: var(--ink-faint); font-size: 12px; }

a { color: var(--phos); text-decoration: none; border-bottom: 1px dotted var(--phos-dim); }
a:hover { color: var(--phos-hi); text-shadow: 0 0 6px rgba(0,244,142,.5); }

strong { color: var(--phos-hi); font-weight: 700; }
em { color: var(--ink); font-style: normal; background: var(--phos-fill); padding: 0 4px; }

ul, ol { margin: 10px 0 10px 22px; }
li { margin: 4px 0; color: var(--ink); }
li::marker { color: var(--phos); }

hr { border: 0; border-top: 1px solid var(--phos-dim); margin: 34px 0; }

code, .code {
  font-family: var(--mono);
  background: var(--phos-fill);
  color: var(--phos);
  padding: 1px 5px;
  font-size: 12px;
}
pre {
  background: var(--bg-panel);
  border: 1px solid var(--phos-dim);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 12px 0;
  font-size: 12px;
  line-height: 20px;
  color: var(--ink);
}
pre code { background: none; padding: 0; color: var(--ink); }

/* --- rule box (the standing rule) ------------------------- */
.rulebox {
  border: 1px solid var(--phos);
  background: var(--phos-fill);
  padding: 16px 18px;
  margin: 18px 0;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.rulebox .rb-tag {
  color: var(--phos-hi); font-size: 11px; letter-spacing: .2em;
  text-shadow: 0 0 8px rgba(0,255,60,.6); margin-bottom: 6px;
}
.rulebox p { color: var(--ink); }

/* --- tables ----------------------------------------------- */
table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 12px; }
th {
  text-align: left; color: var(--phos);
  border-bottom: 1px solid var(--phos);
  padding: 6px 10px; letter-spacing: .08em; font-weight: 700;
  white-space: nowrap;
}
td { border-bottom: 1px solid rgba(10,92,58,.5); padding: 6px 10px; vertical-align: top; color: var(--ink); }
tr:hover td { background: rgba(0,244,142,.04); }
td.mono, .mono { font-family: var(--mono); font-size: 12px; }

/* --- verdict badges --------------------------------------- */
.vd { display: inline-block; padding: 0 8px; font-size: 11px; letter-spacing: .1em; border: 1px solid; }
.vd.clean { color: var(--st-clean); border-color: var(--st-clean); background: rgba(0,244,142,.08); }
.vd.warn  { color: var(--st-warn);  border-color: var(--st-warn);  background: rgba(255,176,0,.08); }
.vd.bad   { color: var(--st-bad);   border-color: var(--st-bad);   background: rgba(255,77,77,.08); }
.vd.idle  { color: var(--st-idle);  border-color: var(--st-idle);  background: rgba(95,122,107,.08); }

/* --- run cards -------------------------------------------- */
.runcard {
  border: 1px solid var(--phos-dim);
  background: var(--bg-panel);
  margin: 16px 0;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.runcard .rc-head {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline;
  padding: 10px 16px;
  border-bottom: 1px solid var(--phos-dim);
  background: var(--phos-fill);
}
.runcard .rc-head .t { color: var(--phos-hi); font-weight: 700; letter-spacing: .06em; }
.runcard .rc-head .m { color: var(--ink-faint); font-size: 11px; }
.runcard .rc-body { padding: 12px 16px; }
.runcard .rc-body p { margin: 6px 0; }

/* --- stage chain ------------------------------------------ */
.chain { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 12px 0; }
.chain .st {
  border: 1px solid var(--phos-dim);
  padding: 2px 9px; font-size: 11px; color: var(--ink-dim);
  background: var(--bg-panel); white-space: nowrap;
}
.chain .st.done { color: #000; background: var(--phos); border-color: var(--phos); font-weight: 700; }
.chain .st.skip { color: var(--st-warn); border-color: var(--st-warn); text-decoration: line-through; }
.chain .arr { color: var(--phos); }

/* --- timebar ---------------------------------------------- */
.tbar { margin: 8px 0; }
.tbar .tb-track { height: 10px; background: rgba(10,92,58,.35); position: relative; }
.tbar .tb-fill { height: 100%; background: var(--phos); box-shadow: 0 0 8px rgba(0,244,142,.6); }
.tbar .tb-lab { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-faint); margin-top: 3px; }

/* --- incident entries ------------------------------------- */
.inc { border-left: 2px solid var(--phos-dim); padding: 8px 0 8px 16px; margin: 18px 0; }
.inc.crit { border-left-color: var(--st-bad); }
.inc .inc-t { color: var(--ink); }
.inc.crit .inc-t { color: var(--st-bad); }
.inc .inc-n { color: var(--ink-faint); font-size: 11px; letter-spacing: .1em; }

/* --- file entries ----------------------------------------- */
.file {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  border: 1px solid var(--phos-dim); background: var(--bg-panel);
  padding: 8px 14px; margin: 8px 0;
}
.file .fn { color: var(--phos); min-width: 260px; }
.file .fd { color: var(--ink-dim); font-size: 12px; flex: 1; min-width: 200px; }
.file .fs { color: var(--ink-faint); font-size: 11px; }
.btn {
  display: inline-block; border: 1px solid var(--phos); color: var(--phos);
  padding: 2px 12px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  background: transparent; cursor: pointer; font-family: var(--mono);
  text-decoration: none;
}
.btn:hover { background: var(--phos); color: #000; text-shadow: none; }
.btn.ghost { border-color: var(--phos-dim); color: var(--ink-dim); }
.btn.ghost:hover { border-color: var(--phos); color: var(--phos); background: var(--phos-fill); }

/* --- file viewer modal ------------------------------------ */
#viewer {
  display: none; position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,.88);
  padding: 4vh 5vw;
}
#viewer .vw-box {
  border: 1px solid var(--phos); background: #010603;
  height: 100%; display: flex; flex-direction: column;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}
#viewer .vw-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--phos-dim);
  background: var(--phos-fill);
}
#viewer .vw-head .t { color: var(--phos-hi); }
#viewer pre {
  flex: 1; overflow: auto; margin: 0; border: 0; padding: 16px;
  counter-reset: ln;
}
#viewer pre .vl { display: block; }
#viewer pre .vl::before {
  counter-increment: ln; content: counter(ln);
  display: inline-block; width: 44px; margin-right: 14px;
  color: var(--ink-faint); text-align: right; user-select: none;
}

/* --- secrets tables --------------------------------------- */
.secrets td.v { color: var(--st-warn); font-family: var(--mono); }
.sec-toggle { margin: 8px 0 4px; }
.secrets.masked td.v { color: transparent; text-shadow: 0 0 10px rgba(200,255,228,.8); user-select: none; }

/* --- kv grid ---------------------------------------------- */
.kv { display: grid; grid-template-columns: 210px 1fr; gap: 2px 18px; margin: 12px 0; font-size: 12px; }
.kv .k { color: var(--ink-faint); }
.kv .val { color: var(--ink); }

/* --- model tabs -------------------------------------------- */
.mtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.mtabs button {
  border: 1px solid var(--phos-dim); background: transparent; color: var(--ink-dim);
  font-family: var(--mono); font-size: 12px; padding: 4px 14px; cursor: pointer; letter-spacing: .06em;
}
.mtabs button.on { border-color: var(--phos); color: var(--phos-hi); background: var(--phos-fill); text-shadow: 0 0 6px rgba(0,244,142,.5); }
.mpane { display: none; margin-top: 18px; }
.mpane.on { display: block; animation: pg-in .35s ease both; }

/* --- responsive -------------------------------------------- */
@media (max-width: 900px) {
  aside#side { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--phos-dim); }
  .wrap { flex-direction: column; }
  main { margin-left: 0; }
  section.page { padding: 30px 20px 20px; }
}
