/* ============================================================
   ASCENSION COMMAND CENTER — Status HUD
   Materializes out of the void on "status update". On-brand FUI:
   OLED void, Aura ice-blue / Chi Chi violet, glow not shadow.
   ============================================================ */
:root {
  --hud-aura: #00b4ff;
  --hud-chi:  #c800ff;
  --hud-ok:   #34e5b0;
  --hud-txt:  #eaf2ff;
  --hud-txt2: #7e8aa0;
  --hud-txt3: #45506a;
  --hud-surface: rgba(8, 10, 16, 0.66);
  --hud-border:  rgba(255, 255, 255, 0.07);
  --f-hud:  "Rajdhani", "Inter", sans-serif;
  --f-mono: "IBM Plex Mono", monospace;
  --f-body: "Inter", sans-serif;
}

/* ---- container: two columns flanking the head ---- */
#hud {
  position: fixed; inset: 0; z-index: 8; pointer-events: none;
  display: grid;
  grid-template-columns: minmax(0, 360px) 1fr minmax(0, 360px);
  align-items: start; gap: 0;
  padding: 22px max(14px, env(safe-area-inset-right)) 120px max(14px, env(safe-area-inset-left));
}
.hud-col { display: flex; flex-direction: column; gap: 14px; max-height: 100%; }
.hud-col.right { grid-column: 3; }
.hud-col.left  { grid-column: 1; }

/* ---- panel ---- */
.panel {
  pointer-events: auto;
  background: var(--hud-surface);
  border: 1px solid var(--hud-border);
  border-radius: 6px;
  padding: 14px 16px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  opacity: 0; transform: translateY(8px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.2,1);
  transition-delay: var(--d, 0s);
}
.hud-col.left  .panel { transform: translateX(-26px); }
.hud-col.right .panel { transform: translateX(26px); }
body.hud-on .panel { opacity: 1; transform: none; }

.panel.aura { border-color: rgba(0,180,255,0.18); box-shadow: 0 0 38px rgba(0,180,255,0.06), inset 0 0 26px rgba(0,180,255,0.03); }
.panel.chi  { border-color: rgba(200,0,255,0.18); box-shadow: 0 0 38px rgba(200,0,255,0.06), inset 0 0 26px rgba(200,0,255,0.03); }

.p-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.p-title { font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--hud-txt); display: flex; align-items: center; gap: 8px; }
.p-title svg { width: 14px; height: 14px; opacity: 0.8; }
.p-tag { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--hud-txt3); }
.p-tag.ok { color: var(--hud-ok); }
.panel.aura .p-title svg { color: var(--hud-aura); }
.panel.chi  .p-title svg { color: var(--hud-chi); }

/* ---- progress list (projects) ---- */
.row { margin-bottom: 11px; }
.row:last-child { margin-bottom: 0; }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row-name { font-family: var(--f-hud); font-weight: 600; font-size: 12.5px; letter-spacing: 0.06em; color: var(--hud-txt); }
.row-sub { font-family: var(--f-body); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hud-txt3); margin-top: 1px; }
.row-pct { font-family: var(--f-mono); font-size: 11px; color: var(--hud-txt2); }
.bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.06); margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--hud-aura), var(--hud-chi));
  transition: width 1.1s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--d, 0s) + .2s); }
body.hud-on .bar > i { width: var(--w, 0%); }

/* ---- stat grid (live metrics footer, command status) ---- */
.kv { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kv:last-child { margin-bottom: 0; }
.kv svg { width: 14px; height: 14px; color: var(--hud-txt2); flex: none; }
.kv .k { font-family: var(--f-body); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hud-txt3); }
.kv .v { font-family: var(--f-mono); font-size: 13px; color: var(--hud-txt); margin-left: auto; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.stat { text-align: left; }
.stat .sv { font-family: var(--f-hud); font-weight: 700; font-size: 15px; color: var(--hud-txt); }
.stat .sk { font-family: var(--f-body); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hud-txt3); margin-top: 2px; }

/* ---- rings (system health) ---- */
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ring { text-align: center; }
.ring svg { width: 100%; height: auto; max-width: 56px; }
.ring .rt circle.track { stroke: rgba(255,255,255,0.07); }
.ring .rt circle.val { stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--d,0s) + .25s); }
.ring .rl { font-family: var(--f-body); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hud-txt3); margin-top: 4px; }
.ring .rv { font-family: var(--f-mono); font-size: 11px; fill: var(--hud-txt); }

/* ---- pipeline stepper ---- */
.pipe { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 6px; position: relative; }
.pipe::before { content: ""; position: absolute; top: 15px; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, var(--hud-aura), var(--hud-chi)); opacity: 0.4; }
.step { display: flex; flex-direction: column; align-items: center; gap: 7px; z-index: 1; flex: 1; }
.step .node { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: #06080d; border: 1px solid var(--hud-border); }
.step .node svg { width: 13px; height: 13px; color: var(--hud-txt2); }
.step .sl { font-family: var(--f-body); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hud-txt3); }
.step .sp { font-family: var(--f-mono); font-size: 10px; color: var(--hud-txt2); }

/* ---- task rows ---- */
.task { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,0.04); }
.task:first-of-type { border-top: none; }
.task .tn { font-family: var(--f-body); font-size: 11.5px; color: var(--hud-txt); flex: 1; }
.task .tp { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; gap: 5px; }
.task .tp::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.task .tp.high { color: #ff5d7d; } .task .tp.med { color: var(--hud-aura); } .task .tp.low { color: var(--hud-txt3); }
.task .te { font-family: var(--f-mono); font-size: 10px; color: var(--hud-txt3); width: 48px; text-align: right; }

/* ---- charts (svg) ---- */
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000; transition: stroke-dashoffset 1.6s ease; transition-delay: calc(var(--d,0s) + .3s); }
body.hud-on .chart .line { stroke-dashoffset: 0; }

/* radar */
.radar { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.radar .grid-c { fill: none; stroke: rgba(0,180,255,0.14); }
.radar .sweep { transform-origin: 50% 50%; animation: radar-spin 4s linear infinite; }
@keyframes radar-spin { to { transform: rotate(360deg); } }
.radar .blip { fill: var(--hud-chi); }

/* status dot */
.sdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--hud-ok);
  box-shadow: 0 0 8px var(--hud-ok); animation: hud-pulse 2.2s ease-in-out infinite; }
@keyframes hud-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ---- responsive: collapse to a single scroll overlay on small screens ---- */
@media (max-width: 1040px) {
  #hud { grid-template-columns: 1fr; padding: 16px 12px 130px; overflow-y: auto;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); -webkit-overflow-scrolling: touch; }
  #hud:not(.scrollable) { pointer-events: none; }
  body.hud-on #hud { pointer-events: auto; }
  .hud-col, .hud-col.left, .hud-col.right { grid-column: 1; max-height: none; }
  .hud-col.right { margin-top: 14px; }
  .hud-col.left .panel, .hud-col.right .panel { transform: translateY(10px); }
  body.hud-on .panel { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .bar > i, .ring .rt circle.val, .chart .line { transition: none !important; }
  .radar .sweep { animation: none; }
}
