/* monopole.systems — cyberpunk NOC dashboard
   Palette:
   #080818 terminal black (bg), #101028 panel dark, #00FF80 neon green,
   #00E0FF neon cyan, #FF3040 neon red, #FFB020 neon amber, #A0B0A0 phosphor text
*/

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

html, body {
    background: #080818;
    color: #A0B0A0;
    font-family: 'IBM Plex Mono', 'Menlo', monospace;
    font-size: clamp(12px, 0.8vw, 14px);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    position: relative;
    padding: 0;
}

/* ---------- Circuit-board background ---------- */
.circuit-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0,255,128,0.05), transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(0,224,255,0.05), transparent 60%);
    z-index: 0;
    pointer-events: none;
}

/* subtle scanline */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,255,128,0.02) 0px,
        rgba(0,255,128,0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* ---------- Top bar ---------- */
.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(0,255,128,0.18);
    background: rgba(8,8,24,0.85);
    backdrop-filter: blur(2px);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 32px);
    color: #00FF80;
    text-shadow: 0 0 8px rgba(0,255,128,0.45);
}

.brand .prompt { color: #00E0FF; }

.logotype {
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.brand .caret {
    display: inline-block;
    color: #00FF80;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.topbar-meta {
    display: flex;
    gap: 22px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #A0B0A0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-label { color: rgba(160,176,160,0.55); }

/* ---------- Dashboard grid ---------- */
.dashboard {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: 4px;
    padding: 4px;
    width: 100%;
}

.panel {
    position: relative;
    background: #101028;
    border: 1px solid rgba(0,255,128,0.30);
    box-shadow: inset 0 0 8px rgba(0,255,128,0.05);
    display: flex;
    flex-direction: column;
    min-height: 150px;
    opacity: 0;
    transform: translateY(6px);
    animation: panelIn 0.4s ease-out forwards;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(0,255,128,0.04) 0%,
        transparent 40%,
        transparent 60%,
        rgba(0,224,255,0.03) 100%
    );
}

@keyframes panelIn {
    to { opacity: 1; transform: translateY(0); }
}

/* stagger panel materialization (40ms each) */
.panel-health     { animation-delay: 0.04s; }
.panel-mission    { animation-delay: 0.08s; grid-column: span 2; grid-row: span 2; }
.panel-network    { animation-delay: 0.12s; grid-row: span 2; }
.panel-procs      { animation-delay: 0.16s; grid-column: span 2; }
.panel-throughput { animation-delay: 0.20s; grid-column: span 2; }
.panel-alerts     { animation-delay: 0.24s; grid-column: span 2; }
.panel-terminal   { animation-delay: 0.28s; grid-column: span 2; }
.panel-cap        { animation-delay: 0.32s; grid-column: span 4; }
.panel-footer     { animation-delay: 0.36s; grid-column: span 4; min-height: 38px; }

/* panel head */
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0,255,128,0.18);
    background: linear-gradient(180deg, rgba(0,255,128,0.06), transparent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.panel-title { color: #00FF80; }

.panel-tag {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid currentColor;
    border-radius: 1px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.tag-green { color: #00FF80; }
.tag-cyan  { color: #00E0FF; }
.tag-amber { color: #FFB020; }
.tag-red   { color: #FF3040; animation: pulseRed 2s ease-in-out infinite; }

@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 rgba(255,48,64,0); }
    50%      { box-shadow: 0 0 6px rgba(255,48,64,0.6); }
}

.panel-body {
    flex: 1;
    padding: 12px;
    overflow: hidden;
    font-family: 'IBM Plex Mono', monospace;
}

/* ---------- Status dots ---------- */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    animation: pulse 2s ease-in-out infinite;
}

.dot-green { background: #00FF80; box-shadow: 0 0 6px #00FF80; }
.dot-amber { background: #FFB020; box-shadow: 0 0 6px #FFB020; }
.dot-red   { background: #FF3040; box-shadow: 0 0 6px #FF3040; }
.dot-cyan  { background: #00E0FF; box-shadow: 0 0 6px #00E0FF; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(0.85); }
}

/* ---------- Health metric bars ---------- */
.metric-row {
    display: grid;
    grid-template-columns: 90px 1fr 60px;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

.metric-label {
    color: rgba(160,176,160,0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bar {
    position: relative;
    height: 6px;
    background: rgba(0,255,128,0.08);
    border: 1px solid rgba(0,255,128,0.18);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: var(--c, #00FF80);
    box-shadow: 0 0 8px var(--c, #00FF80);
    transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.metric-val {
    text-align: right;
    color: #00FF80;
    font-variant-numeric: tabular-nums;
}

/* ---------- Mission panel ---------- */
.mono-body p, .mono-body li {
    color: #A0B0A0;
    margin: 4px 0;
    font-size: 13px;
}

.mono-body .lede {
    color: #00FF80;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(0,255,128,0.3);
}

.bullets {
    list-style: none;
    margin-top: 10px;
    padding-left: 0;
}

.bullets li {
    color: #00E0FF;
    padding: 2px 0;
}

/* typewriter target start state */
[data-typewriter] {
    visibility: hidden;
}

[data-typewriter].tw-active,
[data-typewriter].tw-done {
    visibility: visible;
}

/* ---------- Network map ---------- */
.net-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

.netmap {
    flex: 1;
    width: 100%;
    height: auto;
    font-family: 'Fira Code', monospace;
    font-size: 9px;
}

.netmap .node rect {
    fill: #080818;
    stroke: #00FF80;
    stroke-width: 1;
    filter: drop-shadow(0 0 3px rgba(0,255,128,0.4));
}

.netmap .node-core rect {
    stroke: #00E0FF;
    filter: drop-shadow(0 0 4px rgba(0,224,255,0.55));
}

.netmap .node text {
    fill: #A0B0A0;
    text-anchor: middle;
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.05em;
}

.netmap .node-core text { fill: #00E0FF; }

.netmap .stream {
    stroke: #00E0FF;
    stroke-dasharray: 4 8;
    opacity: 0.85;
    animation: dataFlow 2s linear infinite;
}

.netmap .s2 { stroke: #00FF80; animation-duration: 2.4s; }
.netmap .s3 { animation-duration: 1.8s; }
.netmap .s4 { stroke: #FFB020; animation-duration: 2.6s; }
.netmap .s5 { animation-duration: 2.2s; }
.netmap .s6 { stroke: #00FF80; animation-duration: 2.0s; }
.netmap .s7 { animation-duration: 2.8s; }

@keyframes dataFlow {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -24; }
}

.net-legend {
    display: flex;
    gap: 14px;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: rgba(160,176,160,0.7);
    text-transform: uppercase;
}

/* ---------- Process table ---------- */
.proc-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

.proc-table th, .proc-table td {
    padding: 4px 6px;
    text-align: left;
    border-bottom: 1px dashed rgba(0,255,128,0.10);
}

.proc-table th {
    color: rgba(0,255,128,0.7);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 400;
    font-size: 10px;
}

.proc-table td { color: #A0B0A0; font-variant-numeric: tabular-nums; }
.proc-table tbody tr:hover { background: rgba(0,255,128,0.05); }

/* ---------- Throughput sparkline ---------- */
.spark {
    width: 100%;
    height: 100px;
    display: block;
}

.thru-readout {
    display: flex;
    gap: 18px;
    margin-top: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #A0B0A0;
}

.thru-readout .kv-key {
    color: rgba(0,255,128,0.7);
    text-transform: uppercase;
    margin-right: 4px;
}

#rx-val { color: #00FF80; }
#tx-val { color: #00E0FF; }
#peak-val { color: #FFB020; }

/* ---------- Alerts ---------- */
.alert-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    max-height: 100%;
    overflow: hidden;
}

.alert-list li {
    padding: 3px 0;
    border-bottom: 1px dashed rgba(0,255,128,0.1);
    display: grid;
    grid-template-columns: 70px 60px 1fr;
    gap: 8px;
    color: #A0B0A0;
    animation: alertIn 0.35s ease-out;
}

.alert-list li .ts   { color: rgba(160,176,160,0.55); }
.alert-list li .lvl-INFO  { color: #00E0FF; }
.alert-list li .lvl-WARN  { color: #FFB020; }
.alert-list li .lvl-CRIT  { color: #FF3040; text-shadow: 0 0 4px rgba(255,48,64,0.5); }
.alert-list li .lvl-OK    { color: #00FF80; }

@keyframes alertIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---------- Terminal panel ---------- */
.term-body {
    background: #050510;
    border: 1px solid rgba(0,255,128,0.15);
    margin: 6px;
    padding: 8px 10px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #A0B0A0;
    overflow: hidden;
}

.term-line {
    margin: 1px 0;
    white-space: pre-wrap;
}

.term-line .prompt {
    color: #00FF80;
    margin-right: 6px;
}

.term-line .cmd { color: #00E0FF; }
.term-line.term-out { color: #A0B0A0; padding-left: 6px; }
.term-line .ok   { color: #00FF80; }
.term-line .warn { color: #FFB020; }
.term-line .err  { color: #FF3040; }

.caret-block {
    display: inline-block;
    color: #00FF80;
    margin-left: 1px;
    animation: blink 0.8s step-end infinite;
    font-size: 12px;
}

/* ---------- Capability matrix ---------- */
.cap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 4px;
}

.cap {
    border: 1px solid rgba(0,255,128,0.18);
    background: rgba(0,255,128,0.03);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

.cap-key {
    color: rgba(0,255,128,0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cap-val { color: #A0B0A0; }
.cap-val.ok   { color: #00FF80; }
.cap-val.warn { color: #FFB020; }
.cap-val.err  { color: #FF3040; }

/* ---------- Footer status bar ---------- */
.footer-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #A0B0A0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.foot-item { display: inline-flex; align-items: center; gap: 4px; }
.foot-item.right { margin-left: auto; color: rgba(160,176,160,0.55); text-transform: none; letter-spacing: 0.04em; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .dashboard { grid-template-columns: repeat(2, 1fr); }
    .panel-mission, .panel-network, .panel-procs,
    .panel-throughput, .panel-alerts, .panel-terminal,
    .panel-cap, .panel-footer { grid-column: span 2; grid-row: auto; }
}

@media (max-width: 640px) {
    .dashboard { grid-template-columns: 1fr; }
    .panel-mission, .panel-network, .panel-procs,
    .panel-throughput, .panel-alerts, .panel-terminal,
    .panel-cap, .panel-footer { grid-column: span 1; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .topbar-meta { gap: 12px; flex-wrap: wrap; }
}
